/* ========================
   Customer Dashboard Modern (Reference Match)
   ======================== */

/* General Layout */
body {
    background-color: #f6f9fc;
    /* Very light cool grey */
    font-family: 'Segoe UI', sans-serif;
}

.wrap {
    max-width: 85% !important;
    /* Wide layout */
    width: 85% !important;
    margin: 20px auto !important;
    padding: 0 !important;
}

/* Navbar Modernization - ORANGE THEME */
.topbar {
    background: #f37021 !important;
    /* Orange Background */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    padding: 20px 30px !important;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.topbar .center {
    background: #fff;
    /* White background for search */
    border-radius: 50px;
    height: 48px;
    padding: 0 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-grow: 1;
    max-width: 1400px;
    /* Wider search bar area */
    margin: 0 40px;
}

.topbar .brand {
    color: #fff !important;
    /* White Brand Text */
    font-size: 26px !important;
    /* Slightly Larger */
    margin-right: 0;
    font-weight: 800 !important;
    white-space: nowrap;
}

.search {
    flex-grow: 1;
    display: flex;
    padding: 0 !important;
    /* Override style.css padding */
    border: none !important;
    /* Override style.css border */
    margin: 0 !important;
    background: transparent !important;
    height: 100%;
    align-items: center;
}

.search input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #333 !important;
    font-weight: 700;
    width: 100%;
    outline: none;
    padding: 0 !important;
    height: 100%;
    font-size: 16px;
}

.topbar .right a {
    color: #fff !important;
    /* White menu links */
    font-weight: 600 !important;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.2s;
    opacity: 0.95;
}

.topbar .right a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

/* Banner Improvement */
.banner-area {
    margin-top: 20px !important;
    border-radius: 12px !important;
    /* Reduced radius specifically for wide banner look */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    max-width: 85% !important;
    width: 85% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    height: 480px !important;
    /* Fixed height for consistent look */
    position: relative;
}

/* Category Modern - Simple Chips/Capsules */
.category-area {
    gap: 15px !important;
    /* Tighter gap for chips */
    padding: 20px 0 !important;
    justify-content: center;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
}

.cat-pill {
    background: #fff !important;
    /* White background by default */
    padding: 10px 24px !important;
    border-radius: 50px !important;
    /* Capsule shape */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05) !important;
    border: 1px solid #eee !important;
    width: auto !important;
    flex-direction: row !important;
    /* Horizontal layout */
    gap: 10px;
    align-items: center;
    color: #555 !important;
    transition: all 0.2s;
    text-decoration: none !important;
}

.cat-pill:hover {
    background: #fff8f0 !important;
    border-color: #f37021 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(243, 112, 33, 0.15) !important;
}

.cat-pill.active {
    background: #f37021 !important;
    color: #fff !important;
    border-color: #f37021 !important;
    box-shadow: 0 4px 10px rgba(243, 112, 33, 0.3) !important;
}

.cat-pill .cat-icon {
    width: auto !important;
    height: auto !important;
    font-size: 20px !important;
    margin-bottom: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit !important;
    /* Inherit from parent (grey or white) */
    transition: none;
    border: none !important;
    outline: none !important;
}

.cat-pill .cat-icon i {
    border: none !important;
    outline: none !important;
}

/* Specific Icon Colors (Inactive) */
/* Emojis handled natively */
a[href="dashboard_customer.php"] .cat-icon i,
a[href="?cat="] .cat-icon i {
    color: #f37021 !important;
}

/* All Orange */

/* Active State - Force White Text/Icon if needed */
.cat-pill.active .cat-icon i {
    color: #fff !important;
}

/* For Emojis, we can't easily change color to white on active without filters, 
   but user likes the "sticker" look, so we leave them as is or maybe add brightness/contrast if needed.
   Let's just leave them natural as requested. */


.cat-pill.active .cat-icon,
.cat-pill:hover .cat-icon {
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
}

.cat-pill span {
    font-weight: 600;
    font-size: 15px;
}

.cat-pill.active span {
    color: #fff !important;
}

/* Product Grid & Cards - Reformatted */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    /* Strictly 5 Columns */
    gap: 15px !important;
    /* Small gap for larger cards */
    padding-bottom: 50px !important;
    width: 100% !important;
    margin: 0 auto !important;
    /* Ensure centered if width < 100% */
    justify-content: center !important;
    /* Force center alignment of columns */
    box-sizing: border-box !important;
    /* Ensure padding doesn't affect width */
}

/* Footer Modernization */
.main-footer {
    background: #fff;
    padding: 60px 0 0 0;
    margin-top: 50px;
    border-top: 1px solid #eee;
}

.footer-content {
    max-width: 85% !important;
    width: 85% !important;
    margin: 0 auto;
    padding: 0 0 40px 0;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.info-card {
    background: #FFF8E1;
    /* Light yellow background */
    padding: 30px;
    border-radius: 12px;
    margin-top: 30px;
    border: 1px solid #FFE082;
    width: 100%;
    /* Full width */
}

.info-header {
    color: #8D6E63;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
}

.info-grid {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.info-block {
    flex: 1;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #FFE082;
}

.info-block h4 {
    color: #f37021;
    margin-bottom: 15px;
    font-size: 18px;
}

.info-block ul {
    list-style: none;
    padding: 0;
}

.info-block ul li {
    margin-bottom: 10px;
    color: #555;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-card {
    background: #fff;
    border-radius: 16px !important;
    /* overflow: hidden !important; REMOVED to allow button */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0 !important;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1) !important;
}

.card-image {
    width: 100%;
    /* Force full width */
    aspect-ratio: 1 / 1;
    /* Square aspect ratio */
    position: relative !important;
    /* Fix for absolute button positioning */
    background: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* Reduced padding for larger image */
    overflow: visible !important;
    /* Ensure button isn't clipped */
    z-index: 10;
    border-radius: 16px 16px 0 0;
    /* Add radius here since parent overflow is gone */
}

/* Card Image - Balanced Frame */
.img-frame {
    width: 100%;
    height: 100%;
    background: #f9f9f9;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    align-items: center;
    justify-content: center;
    padding: 2px !important;
}

.img-frame img {
    height: 100% !important;
    width: 100% !important;
    object-fit: contain !important;
    mix-blend-mode: multiply;
    padding: 0;
}

.no-image {
    color: #aaa;
    font-weight: 600;
    font-size: 20px;
}

/* Add Button - Balanced Size */
/* Add Button - Balanced Size */
.btn-add-floating {
    background: #ffffff !important;
    color: #f37021 !important;
    border: none !important;
    position: absolute;
    bottom: 10px !important;
    /* Inside image area */
    right: 15px !important;
    width: 42px !important;
    /* Balanced Button */
    height: 42px !important;
    border-radius: 10px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-add-floating:hover {
    background: #f37021 !important;
    color: #ffffff !important;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(243, 112, 33, 0.4) !important;
}

.card-info {
    padding: 25px 15px 15px 15px !important;
    position: relative;
    z-index: 5;
    background: #fff;
    border-radius: 0 0 16px 16px;
}

.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 10px;
}

.product-name {
    font-size: 19px !important;
    /* Larger font */
    font-weight: 700 !important;
    color: #333 !important;
    margin: 0 !important;
    line-height: 1.2;

    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Standard property for compatibility */
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    /* Take available width */
}

.product-price {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #f37021 !important;
    white-space: nowrap;
    /* Prevent wrapping */
    margin-top: 2px;
    /* Align visually with text */
}

.product-meta {
    margin-top: 8px !important;
    padding-top: 0 !important;
    border-top: none !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-rating {
    font-size: 13px !important;
    /* Larger Scaling */
    color: #999;
    display: flex;
    align-items: center;
    /* Vertical Center */
    width: 100%;
    line-height: 1;
    /* Fix vertical align */
}

.product-rating i {
    font-size: 12px !important;
    /* Match text */
    margin-right: 4px;
    /* Space between star and number */
    margin-top: -2px;
    /* Slight optical adjustment */
}

.store-name {
    margin-left: auto;
    font-size: 13px !important;
    /* Larger Scaling */
    color: #999;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.store-name i {
    font-size: 12px;
    margin-right: 4px;
}

/* Headers */
h2,
h3 {
    color: #333 !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px;
    margin-bottom: 25px !important;
    font-size: 24px !important;
    /* Make h3 same size as h2 explicitly */
}

/* Category Modern - Simple Chips/Capsules */
.category-area {
    gap: 20px !important;
    /* Slightly more gap for larger buttons */
    padding: 25px 0 !important;
    justify-content: center;
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
}

.cat-pill {
    background: #fff !important;
    padding: 12px 35px !important;
    /* Larger Padding */
    border-radius: 50px !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08) !important;
    /* Slightly stronger shadow */
    border: 1px solid #eee !important;
    width: auto !important;
    flex-direction: row !important;
    gap: 15px;
    /* Larger gap between icon and text */
    align-items: center;
    color: #555 !important;
    transition: all 0.2s;
    text-decoration: none !important;
}

.cat-pill .cat-icon {
    width: auto !important;
    height: auto !important;
    font-size: 26px !important;
    /* Larger Icon */
    margin-bottom: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit !important;
    transition: none;
    border: none !important;
    outline: none !important;
}

.cat-pill span {
    font-weight: 700;
    /* Bolder text */
    font-size: 18px;
    /* Larger Text */
}

/* Make sure container doesn't get messed up */
.image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Simple Footer */
.simple-footer {
    text-align: center;
    padding: 30px 0 10px 0;
    /* Adjusted padding */
    background: transparent;
    color: #888;
    font-size: 14px;
    margin-top: 20px;
    border-top: 1px solid #eee;
    /* Restore border for separation inside main footer */
    width: 100%;
}

/* Navbar Profile Alignment Fixes */
.topbar .right {
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    /* Reduced space between profile and logout */
}

/* User Profile Link - Common Styles */
.user-profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white !important;
    transition: opacity 0.3s;
    margin-right: 0 !important;
    /* Managed by parent gap */
}

.user-profile-link:hover {
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9) !important;
}

.nav-profile-img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.nav-username {
    font-weight: 600;
    font-size: 18px;
    /* Significantly Larger */
    color: white;
}

/* Logout Button Adjustment if needed */
.btn-logout {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none !important;
    font-size: 18px;
    /* Match username */
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.btn-logout:hover {
    color: #fff !important;
}

/* =========================================
   RESPONSIVE STYLES (Mobile First Fixes)
   ========================================= */

@media (max-width: 991px) {
    .wrap {
        width: 95% !important;
        max-width: 95% !important;
    }

    /* Checkout Layout */
    .checkout-container {
        grid-template-columns: 1fr !important;
        /* Stack vertically */
    }

    .order-summary {
        position: static;
        /* Remove sticky on mobile */
        margin-top: 20px;
    }
}

@media (max-width: 768px) {

    /* Navbar */
    .topbar {
        padding: 15px !important;
        flex-direction: column;
        gap: 15px;
    }

    .topbar .right {
        width: 100%;
        justify-content: space-between;
        /* Spread profile and logout */
        margin-top: 10px;
    }

    /* Adjust Checkout Form */
    .form-row {
        flex-direction: column;
        gap: 15px;
    }

    .payment-methods {
        grid-template-columns: 1fr;
        /* Stack payment options */
    }

    /* Dashboard Product Grid Fix - 2 Columns */
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding-bottom: 30px !important;
    }

    /* Adjust Product Cards for 2-column mobile */
    .product-card {
        border-radius: 12px !important;
    }

    .card-info {
        padding: 10px !important;
    }

    .product-name {
        font-size: 14px !important;
        margin-bottom: 4px !important;
        height: 34px;
        /* Limit height roughly */
    }

    .product-price {
        font-size: 15px !important;
    }

    .store-name {
        display: none;
        /* Hide store name on mobile to save space */
    }

    .btn-add-floating {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
    }

    /* Category Pills on Mobile */
    .cat-pill {
        padding: 8px 16px !important;
        gap: 8px;
    }

    .cat-pill span {
        font-size: 14px !important;
    }

    .cat-pill .cat-icon {
        font-size: 20px !important;
    }

    .category-area {
        gap: 10px !important;
        padding: 15px 0 !important;
    }

    /* Fonts */
    h2 {
        font-size: 20px !important;
        margin-bottom: 15px !important;
    }

    h3 {
        font-size: 18px !important;
    }

    /* Banner on Mobile */
    .banner-area {
        height: 180px !important;
        /* Smaller banner height */
        margin-top: 15px !important;
    }
}