/* =========================================
   1. SITE HEADER
   ========================================= */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky; top: 0; z-index: 1000;
    width: 100%; padding-bottom: 10px;
    transition: transform 0.3s ease-in-out;
}
.site-header.scroll-down { transform: translateY(-100%); }

.header-inner {
    max-width: 1200px; margin: 0 auto; padding: 10px 15px 0;
}

.header-top-row {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px;
}

.menu-toggle {
    background: none; border: none; font-size: 2rem;
    color: var(--dark); cursor: pointer; padding: 0; display: flex; align-items: center;
}

.logo-container {
    text-decoration: none; display: flex; flex-direction: column;
    align-items: flex-start; line-height: 1;
}
.logo-text {
    font-size: 1.5rem; font-weight: 800; color: var(--dark); letter-spacing: -0.5px;
}
.logo-slogan {
    font-size: 0.65rem; color: #6B7280; text-transform: uppercase;
    letter-spacing: 1px; margin-top: 3px; font-weight: 600;
}

.header-actions { display: flex; gap: 15px; align-items: center; }

.icon-link {
    color: var(--dark); position: relative; display: flex;
    align-items: center; text-decoration: none;
}
.icon-link i { font-size: 1.8rem; }

/* CART BADGE (Restored) */
.cart-badge {
    position: absolute; top: -5px; right: -8px;
    background: #EF4444; color: white;
    font-size: 0.7rem; font-weight: bold;
    height: 18px; width: 18px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid white;
}

/* SEARCH BAR */
.header-search-row { width: 100%; }
.search-form {
    display: flex; width: 100%; border: 1px solid #D1D5DB;
    border-radius: 4px; overflow: hidden; height: 40px;
}
.search-input {
    flex: 1; border: none; padding: 0 15px; font-size: 1rem;
    outline: none; color: var(--dark);
}
.search-btn {
    background: #EF4444; color: white; border: none; width: 50px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; cursor: pointer; transition: background 0.2s;
}
.search-btn:hover { background: #DC2626; }

@media (min-width: 769px) {
    .header-inner { display: flex; align-items: center; gap: 30px; padding-bottom: 10px; }
    .header-top-row { margin-bottom: 0; flex-grow: 0; }
    .header-search-row { flex-grow: 1; max-width: 600px; }
    .menu-toggle { display: none; }
}

/* =========================================
   2. MOBILE DRAWER
   ========================================= */
.mobile-drawer {
    position: fixed; top: 0; left: -300px; width: 280px; height: 100%;
    background: white; z-index: 2001; transition: left 0.3s ease-in-out;
    padding: 1.5rem; box-shadow: 2px 0 10px rgba(0,0,0,0.1); overflow-y: auto;
}
.mobile-drawer.open { left: 0; }
.drawer-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid #F3F4F6;
}
.drawer-header h3 { font-size: 1.2rem; margin: 0; color: var(--dark); }
.close-drawer-btn {
    background: none; border: none; font-size: 1.5rem; color: #9CA3AF; cursor: pointer; padding: 5px;
}
.drawer-section { margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid #F3F4F6; }
.drawer-label {
    display: block; font-size: 0.75rem; text-transform: uppercase;
    color: #9CA3AF; margin-bottom: 0.8rem; font-weight: 600;
}
.drawer-link {
    display: flex; align-items: center; gap: 12px; padding: 10px 0;
    color: var(--dark); text-decoration: none; font-size: 0.95rem; transition: color 0.2s;
}
.drawer-link i { font-size: 1.2rem; color: var(--primary); }
.drawer-link:hover { color: var(--primary); }
.drawer-cta {
    display: flex; align-items: center; justify-content: center;
    gap: 8px; width: 100%; text-align: center; padding: 12px; font-weight: 600;
}

/* =========================================
   3. MOBILE BOTTOM NAVIGATION
   ========================================= */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; background: var(--white);
    display: flex; justify-content: space-around; padding: 0.8rem 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05); z-index: 990;
    border-top: 1px solid #f3f4f6; transition: transform 0.3s ease-in-out;
}
.bottom-nav.scroll-down { transform: translateY(100%); }
@media (min-width: 769px) { .bottom-nav { display: none; } }
.nav-item {
    display: flex; flex-direction: column; align-items: center;
    font-size: 0.75rem; color: #6B7280; text-decoration: none; transition: color 0.2s;
}
.nav-item.active { color: var(--primary); font-weight: 500; }
.nav-item i { font-size: 1.4rem; margin-bottom: 4px; }

/* =========================================
   4. PRODUCT CARD (PERFECT MERGE)
   ========================================= */

/* The Card Container */
.product-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    /* User's Original Soft Shadow */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 170px;
    border: 1px solid #F3F4F6;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--primary); /* Gold border on hover */
}

/* --- IMAGE AREA (The Fix) --- */
.card-image-wrapper {
    position: relative;
    width: 100%;
    height: 250px; /* FIXED HEIGHT: Ensures uniform cards */
    overflow: hidden;
    background-color: white;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;    /* COVERS the box (No whitespace) */
    object-position: top; /* Focuses on top of image */
    display: block;
    padding: 0;           /* Clean edges */
    transition: transform 0.3s;
}

.product-card:hover .card-img { transform: scale(1.05); }

/* --- BADGES (Restored Your Red Circle) --- */
.card-badge {
    position: absolute;
    top: 10px; left: 10px;
    background: #DC2626; /* Deep Red */
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* If you also use the new tags, this stacks them safely */
.product-tags {
    position: absolute; top: 10px; left: 10px; z-index: 3;
    display: flex; flex-direction: column; gap: 6px;
}

/* --- WISHLIST (Restored Your Style) --- */
.card-wishlist-btn {
    position: absolute;
    bottom: 10px; left: 10px; /* Original Bottom-Left position */
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px; 
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 2;
    color: #374151;
    transition: all 0.2s;
}
.card-wishlist-btn:hover { border-color: #DC2626; color: #DC2626; }

/* --- DETAILS AREA --- */
.card-details {
    padding: 15px;
    text-align: center; /* Center align like your original */
    display: flex; flex-direction: column; flex: 1;
}

/* Title: Restored Line Clamping */
.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limits to 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em; /* Keeps alignment perfect */
}
.card-title a { text-decoration: none; color: inherit; }

/* REVIEWS (Restored Colors) */
.card-reviews {
    display: flex; justify-content: center; align-items: center;
    gap: 2px; margin-bottom: 8px; font-size: 0.8rem;
}
.star-filled { color: #F59E0B; /* Cheetah Gold */ }
.star-empty { color: #1F2937; opacity: 0.4; }
.review-count { color: #9CA3AF; font-size: 0.75rem; margin-left: 4px; }

/* PRICING (Restored Colors) */
.card-price-block { margin-bottom: 12px; }

.old-price {
    font-size: 0.85rem; text-decoration: line-through;
    color: #9CA3AF; display: block; margin-bottom: 2px;
}

.current-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: #F59E0B; /* Cheetah Gold */
    display: block;
}

/* ADD TO CART BUTTON (Restored Yellow Pill) */
.btn-add-cart {
    background: #FEF3C7; /* Pale Yellow */
    color: #D97706;      /* Dark Orange */
    border: none;
    width: 100%;
    padding: 10px 0;
    border-radius: 30px; /* Pill Shape */
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: auto;
}
.btn-add-cart:hover {
    background: var(--primary); color: white; transform: scale(1.02);
}

/* =========================================
   5. AI WIDGET
   ========================================= */
.ai-fab {
    position: fixed; bottom: 80px; right: 20px;
    width: 56px; height: 56px; background: var(--dark); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    cursor: pointer; z-index: 999; border: 2px solid var(--primary);
    text-decoration: none; transition: transform 0.3s ease-in-out;
}
.ai-fab.scroll-down { transform: translateY(150px) scale(0); }
.ai-fab:hover { transform: scale(1.1); }

/* =========================================
   6. FOOTER
   ========================================= */
.site-footer {
    background: #111827; color: white; padding-top: 4rem; padding-bottom: 6rem; margin-top: 4rem;
}
.footer-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem; max-width: 1200px; margin: 0 auto; padding: 0 1rem;
}
.footer-title {
    margin-bottom: 1.5rem; color: var(--primary);
    font-size: 1.1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
}
.footer-link {
    display: block; margin-bottom: 0.8rem; color: #9CA3AF; text-decoration: none; transition: color 0.2s;
}
.footer-link:hover { color: white; }
.footer-bottom {
    border-top: 1px solid #374151; margin-top: 3rem; padding-top: 2rem;
    text-align: center; color: #6B7280; font-size: 0.9rem;
}

/* =========================================
   7. BREADCRUMBS
   ========================================= */
.breadcrumb-wrapper { padding: 1.5rem 0 1rem 0; margin-bottom: 1rem; }
.breadcrumb-header {
    font-size: 2.2rem; font-weight: 800; color: #1F2937;
    margin: 0 0 0.2rem 0; line-height: 1.1; letter-spacing: -0.5px; text-transform: capitalize;
}
.breadcrumb-nav { display: flex; align-items: center; }
.breadcrumb-list {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem;
    padding: 0; margin: 0; list-style: none; font-size: 0.9rem; color: #6B7280;
}
.breadcrumb-list a { color: #6B7280; text-decoration: none; transition: color 0.2s; }
.breadcrumb-list a:hover { color: #F59E0B; }
.breadcrumb-list .separator { font-size: 0.75rem; color: #9CA3AF; display: flex; align-items: center; }
.breadcrumb-list .active { color: #6B7280; pointer-events: none; }
@media (max-width: 768px) {
    .breadcrumb-header { font-size: 1.8rem; }
    .breadcrumb-wrapper { padding: 1rem 0; }
}
/* ======================================================
   DESKTOP UPGRADE COMPONENTS (Add to bottom of components.css)
   ====================================================== */

/* 1. NEW DESKTOP SEARCH (Default: Hidden on Mobile) */
.header-search-desktop {
    display: none; /* Hidden by default */
    flex: 1;
    max-width: 600px;
    margin: 0 2rem;
}

/* 2. NEW DESKTOP NAV BAR (Default: Hidden on Mobile) */
.header-nav-bar {
    display: none; /* Hidden by default */
    gap: 25px;
    padding-top: 15px;
    border-top: 1px solid #F3F4F6;
    margin-top: 10px;
    width: 100%;
}

.nav-link-desktop {
    text-decoration: none;
    color: #374151;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex; 
    align-items: center; 
    gap: 6px;
    transition: color 0.2s;
}

.nav-link-desktop:hover, .nav-link-desktop.active {
    color: #EF4444; /* Your Brand Red/Primary */
}

/* WhatsApp Specific Style */
.nav-link-desktop.special-link {
    color: #16a34a; /* WhatsApp Green */
    margin-left: 0; /* Pushes it to the far right */
margin-right: 20px;
}

/* 3. NEW DESKTOP TEXT LABELS (e.g. "My Cart") */
.desktop-text-action {
    display: none; /* Hidden on mobile */
    flex-direction: column;
    line-height: 1.2;
    margin-left: 8px;
    font-size: 0.85rem;
    color: #374151;
    text-align: left;
}
.desktop-text-action small {
    font-size: 0.7rem;
    color: #6B7280;
}

/* ======================================================
   THE SWITCH: DESKTOP LOGIC (Min-Width: 769px)
   ====================================================== */
@media (min-width: 769px) {
    
    /* A. LAYOUT FIXES */
    .header-inner {
        display: flex;
        flex-direction: column; /* Stacks Top Row and Nav Row */
        padding-bottom: 0;
    }

    .header-top-row {
        width: 100%;
        margin-bottom: 0;
    }

    /* B. HIDE MOBILE ELEMENTS */
    .menu-toggle { display: none !important; }
    .bottom-nav { display: none !important; } /* REMOVES BOTTOM NAV ON PC */

    /* C. SHOW DESKTOP ELEMENTS */
    .header-search-desktop { display: block; }
    .header-nav-bar.desktop-only { display: flex; }
    .desktop-text-action { display: flex; }
}
/* ======================================================
   MASSIVE DESKTOP LAYOUT & CENTERING
   ====================================================== */

@media (min-width: 769px) {

    /* 1. MAKE HEADER FULL WIDTH */
    .site-header .header-inner {
        max-width: 96% !important; /* Covers almost whole screen */
        width: 96% !important;
        margin: 0 auto;
    }

    /* 2. CENTER THE NAV BUTTONS */
    .header-nav-bar {
        justify-content: center; /* Centers the items */
        padding-left: 0;
        padding-right: 0;
        position: relative; /* Needed for absolute positioning if strictly needed */
    }

    /* OPTIONAL: If you want WhatsApp to stay on the far right while others center:
       Uncomment the lines below. Otherwise, WhatsApp will sit next to Account in the center. */
    /* .nav-link-desktop.special-link {
        position: absolute;
        right: 0;
    } 
    */

    /* 3. MAKE MAIN CONTENT FULL WIDTH */
    main.container {
        max-width: 96% !important; /* Matches header width */
        width: 96% !important;
        margin: 0 auto;
    }
    
    /* 4. EXPAND PRODUCT GRID TO FILL NEW SPACE */
    .product-grid {
        justify-content: flex-start; /* Aligns items to start */
    }
}
/* ======================================================
   ACCOUNT DROPDOWN (DESKTOP)
   ====================================================== */

.account-dropdown-wrapper {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

/* The Dropdown Box (Hidden by Default) */
.account-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0; /* Aligns to right edge of icon */
    width: 220px;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-radius: 8px;
    padding: 10px 0;
    z-index: 1100;
    border: 1px solid #f3f4f6;
    margin-top: 10px; /* Small gap */
}

/* Show on Hover (Desktop Only) */
@media (min-width: 769px) {
    .account-dropdown-wrapper:hover .account-dropdown-menu {
        display: block;
    }
    
    /* Invisible bridge to prevent menu closing when moving mouse down */
    .account-dropdown-wrapper::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: 10px; 
    }
}

/* Dropdown Content Styles */
.dropdown-header {
    padding: 10px 15px;
    border-bottom: 1px solid #f3f4f6;
    text-align: center;
}

.btn-login-small {
    background: var(--primary); /* Gold/Yellow */
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    display: block;
    transition: background 0.2s;
}
.btn-login-small:hover { background: #d97706; }

.dropdown-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dropdown-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    text-decoration: none;
    color: #374151;
    font-size: 0.9rem;
    transition: background 0.1s;
}

.dropdown-list li a:hover {
    background: #f9fafb;
    color: var(--primary);
}

.dropdown-list li a i {
    font-size: 1.1rem;
    color: #9CA3AF;
}
.dropdown-list li a:hover i {
    color: var(--primary);
}

.dropdown-list .divider {
    height: 1px;
    background: #f3f4f6;
    margin: 5px 0;
}
.partner-link {
    font-size: 0.85rem;
    color: #374151; /* neutral */
    display: flex;
    align-items: center;
    gap: 4px;
}

.partner-link:hover {
    color: #111827;
}

.partner-start {
    text-decoration: underline;
    font-weight: 600;
}

.partner-invite {
    margin: 2.5rem 0;
}

.partner-card {
    background: #F8FAFC;
    border: 1px dashed #CBD5E1;
    border-radius: 14px;
    padding: 1.5rem;
}

.partner-text h3 {
    margin: 0 0 6px;
    font-size: 1.1rem;
    color: #0F172A;
}

.partner-text p {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 10px;
}

.partner-link {
    font-size: 0.9rem;
    color: #1D4ED8;
    text-decoration: none;
}

.partner-link span {
    text-decoration: underline;
    font-weight: 600;
}
/* Custom Profile Avatar in Header - LARGER SIZE */
.custom-avatar {
    width: 40px;       /* Increased from 28px */
    height: 40px;      /* Increased from 28px */
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px; /* More space between image and text */
    border: 2px solid #f1f1f1; /* Slightly thicker border */
    display: block;
}

/* Ensure text stays perfectly centered next to the larger image */
.account-dropdown-wrapper .icon-link {
    display: flex;
    align-items: center;
    gap: 0; /* We use margin-right on the avatar instead */
}

/* Adjust text size slightly if needed */
.desktop-text-action small {
    font-size: 0.75rem; /* Ensure "Hello," is readable */
    display: block;
    margin-bottom: -2px; /* Pull text closer together */
}

/* ============================================================
   FIX: HEADER ALIGNMENT (Logo Left, Search Middle, Icons Right)
   ============================================================ */

/* 1. PARENT CONTAINER: Establish the Flex Row */
.header-top-row {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Aligns items starting from the left */
    gap: 15px;
    position: relative;
    width: 100%;
}

/* 2. LOGO: Release it from the center trap */
.logo-container {
    /* These !importants override the global.css mobile centering */
    position: static !important; 
    left: auto !important;
    transform: none !important;
    
    /* Formatting */
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Aligns "CLOZET" and slogan to the left */
    margin-right: 15px;      /* Buffer space after logo */
    z-index: 20;
}

/* 3. DESKTOP SEARCH: Make it fill the middle space */
.header-search-desktop {
    flex-grow: 1; /* This makes the search bar stretch to fill empty space */
    max-width: 600px; /* Prevents it from getting too wide */
    margin: 0 20px;   /* Space on sides */
}

/* 4. ICONS (Account/Cart): Push to the far right */
.header-actions {
    /* 'margin-left: auto' acts like a spring, pushing this block to the right edge */
    margin-left: auto !important; 
    
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0; /* Prevents icons from squishing */
}

/* --- MOBILE SPECIFIC TWEAKS --- */
@media (max-width: 768px) {
    .header-top-row {
        gap: 10px;
    }
    
    /* On mobile, we still want the "Spring" effect to push cart to right */
    .header-actions {
        margin-left: auto;
    }
    
    /* Ensure slogan doesn't break layout */
    .logo-slogan {
        display: none; /* Optional: Hide slogan on tiny screens to save space */
    }
}
/* =========================================
   MOBILE ONLY: CENTERED LOGO + SLOGAN
   ========================================= */
@media (max-width: 768px) {
    
    /* 1. Set the Stage */
    .header-top-row {
        position: relative; /* Needed for absolute centering */
        justify-content: space-between; /* Pushes Menu Left, Cart Right */
    }

    /* 2. Center the Logo Container */
    .logo-container {
        /* Take it out of the flex flow to center it perfectly */
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        
        /* Center text inside */
        align-items: center !important; 
        text-align: center !important;
        width: auto !important;
        margin: 0 !important;
        z-index: 10;
    }

    /* 3. Bring Back the Slogan */
    .logo-slogan {
        display: block !important; /* Force it to show */
        font-size: 0.65rem; /* Readable size */
        margin-top: 2px;
        white-space: nowrap; /* Prevent wrapping */
    }

    /* 4. Ensure Actions stay on Right */
    .header-actions {
        margin-left: auto !important; /* Pushes to far right */
        z-index: 20; /* Above logo if screen is tiny */
    }

    /* 5. Ensure Menu Button stays on Left */
    .menu-toggle {
        z-index: 20;
    }
}

/* ADD THIS TO css/components.css */

/* Mobile Footer Badges */
.nav-item .cart-badge {
    position: absolute;
    top: -5px;
    right: -8px;
    width: 16px;      /* Slightly smaller for mobile footer */
    height: 16px;
    font-size: 0.6rem;
    border: 1px solid white; /* White border makes it pop against icons */
    z-index: 10;
    
    /* Ensure it works even if global styles miss it */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #EF4444; /* Default Red */
    color: white;
    font-weight: bold;
}
