/**
 * Valzo Common Styles
 * ===================
 * Shared CSS for all pages - header, footer, bottom nav, toast, breadcrumb, sidebar
 * 
 * Usage: <link rel="stylesheet" href="/static/common.css">
 */

/* Prevent horizontal scroll globally */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* ===========================
   CSS Variables (Color Palette)
   Soft Dark Mode: Deep grays, not pure black
   Soft Light Mode: Off-white, not pure white
   =========================== */

/* Light Theme (Default) - Soft off-white */
:root {
    /* Background Colors - Soft off-white, reduces eye strain */
    --bg-dark: #F8F8F6;
    --bg-primary: #F8F8F6;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F5F5F3;
    
    /* Primary - Trust & Premium (Navy) */
    --primary: #1E3A5F;
    --primary-light: #2D5A8A;
    --primary-dark: #0F1E33;
    
    /* Luxury (Gold) - High contrast in both modes */
    --accent-gold: #B8962E;
    --accent-gold-light: #D4AF37;
    --accent-gold-dark: #8B7022;
    
    /* Savings (Green) - High contrast for "Verified" badges */
    --accent-green: #059669;
    --accent-green-light: #10B981;
    --accent-green-dark: #047857;
    
    /* Action (Orange) - High contrast for "Grab Deal" buttons */
    --accent-action: #EA580C;
    --accent-action-hover: #C2410C;
    
    /* Legacy compatibility */
    --accent-fire: #EA580C;
    --accent-teal: #1E3A5F;
    --accent-purple: #4F46E5;
    
    /* Text Colors - Good contrast on light backgrounds */
    --text-primary: #1F2937;
    --text-secondary: #4B5563;
    --text-muted: #6B7280;
    
    /* Border */
    --border-subtle: rgba(0,0,0,0.08);
    
    /* Gradients */
    --gradient-fire: linear-gradient(135deg, #EA580C 0%, #F97316 100%);
    --gradient-gold: linear-gradient(135deg, #B8962E 0%, #D4AF37 100%);
    --gradient-primary: linear-gradient(135deg, #1E3A5F 0%, #2D5A8A 100%);
    --gradient-bank: linear-gradient(135deg, #1E3A5F 0%, #D4AF37 100%);
}

/* Dark Theme - Soft deep gray, reduces eye fatigue */
[data-theme="dark"],
[data-theme="dark"] html {
    /* Background Colors - Deep gray, NOT pure black */
    --bg-dark: #1E1E2E;
    --bg-primary: #1E1E2E;
    --bg-card: #2A2A3C;
    --bg-card-hover: #343448;
    
    /* Text Colors - Soft off-white, NOT pure white */
    --text-primary: #E8E8EC;
    --text-secondary: #A0A0B0;
    --text-muted: #7A7A8C;
    
    /* Border */
    --border-subtle: rgba(255,255,255,0.10);
    
    /* Action Colors - Vibrant for visibility */
    --accent-action: #F97316;
    --accent-action-hover: #FB923C;
    
    /* Green for Verified badges - stays vibrant */
    --accent-green: #10B981;
    --accent-green-light: #34D399;
    --accent-green-dark: #059669;
    
    /* Gold - stays vibrant */
    --accent-gold: #D4AF37;
    --accent-gold-light: #E8C860;
    --accent-gold-dark: #B8962E;
    
    /* Purple */
    --accent-purple: #6366F1;
}

/* ===========================
   Base Styles
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
}

/* ===========================
   Header Styles
   =========================== */
/* IMPORTANT: Use high specificity to prevent page-level CSS overrides */
/* Page-level CSS should NOT override header positioning - it breaks sticky functionality */
/* CRITICAL: Include .site-header selector for shop page compatibility */
body header.site-header,
body .site-header,
body header,
header.site-header,
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    padding: 15px 0;
    position: sticky !important; /* Prevent page-level overrides */
    top: 0;
    z-index: 1000;
}

header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    text-decoration: none;
}

.logo-image {
    height: 60px;
    max-height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
    background: transparent !important;
    transition: transform 0.3s ease, filter 0.3s ease;
    /* Zoom into the V - scale up the actual content */
    transform: scale(1.4);
    transform-origin: center center;
    /* Golden glow effect */
    filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.4)) 
            drop-shadow(0 0 16px rgba(30, 58, 95, 0.3))
            brightness(1.08);
}

.logo:hover .logo-image {
    transform: scale(1.45);
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.6)) 
            drop-shadow(0 0 24px rgba(30, 58, 95, 0.4))
            brightness(1.1);
}

/* Dark theme logo - enhanced glow */
[data-theme="dark"] .logo-image {
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5)) 
            drop-shadow(0 0 20px rgba(30, 58, 95, 0.4))
            brightness(1.1);
}

[data-theme="dark"] .logo:hover .logo-image {
    transform: scale(1.45);
    filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.7)) 
            drop-shadow(0 0 28px rgba(30, 58, 95, 0.5))
            brightness(1.15);
}

/* Mobile logo adjustments */
@media (max-width: 768px) {
    .logo-image {
        height: 50px;
        max-height: 50px;
        transform: scale(1.3);
        filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.3)) 
                drop-shadow(0 0 12px rgba(30, 58, 95, 0.2))
                brightness(1.05);
    }
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #D4AF37 0%, #F4D03F 50%, #D4AF37 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-action);
}

/* Mobile header adjustments */
@media (max-width: 768px) {
    header .container {
        padding: 0 16px;
    }
    
    .header-actions {
        display: none;
    }
    
    .header-theme-toggle {
        display: flex;
    }
}

/* ===========================
   Breadcrumb Styles
   =========================== */
.breadcrumb {
    padding: 15px 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumb a {
    color: var(--accent-action);
    text-decoration: none;
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--text-muted);
}

.breadcrumb .separator {
    opacity: 0.5;
}

/* ===========================
   Footer Styles
   =========================== */
footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    padding: 30px 0;
    text-align: center;
    margin-top: 60px;
}

footer .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.footer-links a {
    color: var(--accent-action);
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.social-links a {
    color: var(--accent-action);
    text-decoration: none;
    font-size: 0.9rem;
}

.affiliate-notice {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 0 20px;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    margin-top: 10px;
}

/* Footer mobile adjustment for bottom nav */
@media (max-width: 768px) {
    footer {
        padding-bottom: 80px;
    }
}

/* ===========================
   Bottom Navigation (Mobile)
   =========================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border-subtle);
    padding: 8px 0;
    z-index: 10005; /* Highest - above everything including sticky banners and modals */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
        justify-content: space-around;
        height: 60px; /* Fixed height to prevent overlap */
        /* Ensure bottom nav is always on top */
        position: fixed !important;
        z-index: 10005 !important;
    }
    
    body {
        padding-bottom: 70px; /* Space for bottom nav */
    }
    
    /* Ensure main content doesn't overlap bottom nav */
    main {
        padding-bottom: 20px;
    }
    
    /* Ensure sticky banner doesn't cover bottom nav but is fully visible */
    #valzo-mobile-sticky,
    .mobile-sticky-cta {
        z-index: 10000 !important; /* Visible above nav area, but nav (10005) still on top */
        bottom: 60px !important; /* Position above bottom nav (60px height) */
        /* Ensure banner is fully visible, not cut off */
        min-height: 60px !important;
        height: auto !important;
        max-height: none !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        /* Ensure banner content is not clipped */
        padding: 12px 16px !important;
    }
    
    /* Ensure bottom nav is always on top */
    #bottomNav {
        z-index: 10005 !important;
        position: fixed !important;
        bottom: 0 !important;
        height: 60px !important;
        /* Ensure nav doesn't overlap banner visually */
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
        background: var(--bg-card) !important;
    }
    
    /* Ensure sticky banner is fully visible - prevent clipping */
    #valzo-mobile-sticky {
        /* Force full visibility */
        clip-path: none !important;
        -webkit-clip-path: none !important;
        transform: translateZ(0); /* Force GPU acceleration for better rendering */
        /* Ensure banner is above nav visually */
        z-index: 10000 !important;
        bottom: 60px !important; /* Position above nav (60px height) */
        /* Ensure banner content is fully visible */
        padding: 12px 16px !important;
        min-height: 60px !important;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.65rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: var(--accent-action);
}

.bottom-nav-item .nav-icon {
    font-size: 1.3rem;
}

.nav-item-wrapper {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: 0;
    right: 5px;
    background: var(--accent-action);
    color: white;
    font-size: 0.6rem;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
}

/* ===========================
   Toast Notification
   =========================== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--accent-green);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10004; /* Above sticky banner, below bottom nav */
    pointer-events: none;
}

/* Social proof toast container positioning on mobile */
@media (max-width: 768px) {
    #valzo-toast-container {
        bottom: 220px !important; /* Above floating help (140px) + margin (80px) */
        left: 16px !important;
        right: 16px !important;
        max-width: calc(100vw - 32px) !important;
        z-index: 10004 !important; /* Above sticky banner (9999), below drawer (10003) */
        transition: bottom 0.3s ease, z-index 0.3s ease;
    }
    
    /* When drawer is open, move toast higher */
    .categories-sheet.open ~ * #valzo-toast-container,
    .wishlist-panel.open ~ * #valzo-toast-container,
    body:has(.categories-sheet.open) #valzo-toast-container,
    body:has(.wishlist-panel.open) #valzo-toast-container {
        bottom: 470px !important; /* Above drawer (max-height ~40vh = ~250px) + margin */
        z-index: 10001 !important; /* Below drawer (10003) */
    }
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    background: #EF4444;
}

.toast.warning {
    background: #F59E0B;
}

/* ===========================
   Container
   =========================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    /* Global mobile spacing reduction to combat scroll fatigue */
    section {
        padding-top: 32px !important;
        padding-bottom: 32px !important;
    }
    
    /* Reduce vertical gaps between sections */
    main > section + section {
        margin-top: 0;
    }
    
    /* Compact headings */
    h1, h2, h3 {
        margin-top: 0;
        margin-bottom: 16px;
    }
    
    h1 {
        font-size: 1.8rem !important;
    }
    
    h2 {
        font-size: 1.4rem !important;
    }
    
    h3 {
        font-size: 1.2rem !important;
    }
    
    /* Reduce padding in cards and containers */
    .card, .card-item, .pillar-card, .product-card, .deal-card {
        padding: 16px !important;
    }
    
    /* Reduce gaps in grids */
    .deals-grid, .grid {
        gap: 12px !important;
    }
    
    /* Compact list items */
    ul, ol {
        padding-left: 20px;
    }
    
    li {
        margin-bottom: 8px;
    }
    
    /* Reduce paragraph spacing */
    p {
        margin-bottom: 12px;
    }
}

/* ===========================
   Page Header (for static pages)
   =========================== */
.page-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-subtle);
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--accent-action), var(--accent-gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
}

/* ===========================
   Content Section (for static pages)
   =========================== */
.content-section {
    margin-bottom: 40px;
}

.content-section h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--accent-action);
}

.content-section p {
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.content-section ul {
    margin-left: 30px;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.content-section li {
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .content-section h2 {
        font-size: 1.4rem;
    }
}

/* ===========================
   Highlight Box
   =========================== */
.highlight-box {
    background: var(--bg-card);
    border-left: 4px solid var(--accent-action);
    padding: 20px;
    margin: 30px 0;
    border-radius: 8px;
}

.highlight-box p {
    margin: 0;
    color: var(--text-primary);
}

/* ===========================
   Back Link Button
   =========================== */
.back-link {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 24px;
    background: var(--accent-action);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.back-link:hover {
    opacity: 0.9;
}

/* ===========================
   Theme Toggle (Mobile Header)
   =========================== */
.header-theme-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 8px;
}

@media (max-width: 768px) {
    .header-theme-toggle {
        display: flex;
    }
}

/* ===========================
   Mobile Navigation Drawers
   =========================== */

/* Overlay */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 10002; /* Below drawers (10003), above bottom nav (10005) */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    visibility: hidden;
}

.overlay.open {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

/* Categories Bottom Sheet (More Drawer) */
.categories-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 16px;
    border-radius: 24px 24px 0 0;
    z-index: 10006; /* Above overlay (10002), drawers (10003), and bottom nav (10005) */
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 30px rgba(0,0,0,0.3);
    max-height: 40vh;
    overflow-y: auto;
    /* Ensure hidden by default */
    visibility: hidden;
    opacity: 0;
}

/* Mobile: Add padding to account for bottom nav so settings are visible */
@media (max-width: 768px) {
    .categories-sheet {
        padding-bottom: 80px; /* Add space above bottom nav (60px) + margin (20px) so settings are visible */
        max-height: 70vh; /* Increased height to show settings section */
    }
}

/* Remove hidden attribute when opening */
.categories-sheet:not([hidden]) {
    visibility: visible;
}

.categories-sheet.open {
    bottom: 0;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

/* Ensure drawer is hidden when hidden attribute is present (unless .open class) */
.categories-sheet[hidden]:not(.open) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.categories-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-subtle);
    border-radius: 2px;
    margin: 0 auto 12px;
}

.categories-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    margin-bottom: 16px;
}

.categories-sheet h3 {
    margin: 0;
    text-align: center;
    font-size: 1rem;
    color: var(--text-primary);
    flex: 1;
}

.sheet-close-btn {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.sheet-section {
    margin-bottom: 20px;
}

.sheet-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.categories-row {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-subtle) transparent;
}

.categories-row::-webkit-scrollbar {
    height: 4px;
}

.categories-row::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 2px;
}

.category-card-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    width: 70px;
    height: 70px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    text-decoration: none;
    color: var(--text-primary);
}

.category-card-compact:active {
    transform: scale(0.95);
    background: var(--bg-card-hover);
}

.category-card-compact.active {
    border-color: var(--accent-gold);
    background: var(--bg-card-hover);
}

.category-card-compact-icon {
    font-size: 20px;
    margin-bottom: 4px;
    line-height: 1;
    display: block;
}

.category-card-compact-label {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    color: var(--text-primary);
    line-height: 1.2;
    word-break: break-word;
    display: block;
}

.quick-links-row {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--border-subtle) transparent;
}

.quick-links-row::-webkit-scrollbar {
    height: 4px;
}

.quick-links-row::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 2px;
}

.quick-link-card-compact {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    width: 80px;
    height: 70px;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    text-decoration: none;
    color: var(--text-primary);
}

.quick-link-card-compact:active {
    transform: scale(0.95);
    background: var(--bg-card-hover);
}

.quick-link-card-compact-icon {
    font-size: 20px;
    margin-bottom: 4px;
    line-height: 1;
    display: block;
}

.quick-link-card-compact-label {
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    color: var(--text-primary);
    line-height: 1.2;
    word-break: break-word;
    max-height: 2.4em;
    overflow: hidden;
    display: block;
}

.quick-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.quick-link-item:hover {
    border-color: var(--accent-gold);
    background: var(--bg-card-hover);
}

.settings-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-subtle);
}

.settings-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}

.settings-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-subtle);
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-gold);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Wishlist Panel */
.wishlist-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-card);
    z-index: 10003; /* Highest - above overlay (10002), bottom nav (10005) */
    transition: right 0.3s ease, visibility 0.3s ease, opacity 0.3s ease;
    display: none;
    flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
    visibility: hidden;
    opacity: 0;
}

/* Ensure panel is hidden when hidden attribute is present */
.wishlist-panel[hidden] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    right: -400px !important;
}

@media (max-width: 768px) {
    .wishlist-panel {
        width: 80vw;
        max-width: 80vw;
    }
}

/* Tablet-specific: Ensure panel is hidden */
@media (min-width: 769px) and (max-width: 1024px) {
    .wishlist-panel {
        right: -400px;
        display: none;
        visibility: hidden;
        opacity: 0;
    }
}

.wishlist-panel.open {
    right: 0;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure panel is hidden when hidden attribute is present (unless .open class) */
.wishlist-panel[hidden]:not(.open) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    right: -400px !important;
}

.wishlist-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wishlist-header h2 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-primary);
}

.wishlist-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.wishlist-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.wishlist-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.wishlist-empty p {
    margin: 8px 0;
    color: var(--text-secondary);
}

.wishlist-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
    transition: all 0.2s ease;
}

.wishlist-item:hover {
    border-color: var(--accent-gold);
}

.wishlist-item-link {
    display: flex;
    gap: 12px;
    flex: 1;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.wishlist-item-link:hover {
    opacity: 1;
}

.wishlist-item-link:hover .wishlist-item-title {
    color: var(--accent-gold);
}

.wishlist-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.wishlist-item-content {
    flex: 1;
    min-width: 0;
}

.wishlist-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wishlist-item-price {
    font-size: 0.85rem;
    color: var(--accent-action);
    font-weight: 600;
}

.wishlist-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.wishlist-item-remove:hover {
    color: var(--accent-action);
}

/* Mobile-specific drawer adjustments */
@media (max-width: 768px) {
    .categories-sheet {
        max-height: 50vh;
    }
    
    .wishlist-panel {
        width: 85vw;
        max-width: 85vw;
    }
}

/* Desktop: Hide drawers */
@media (min-width: 769px) {
    .categories-sheet,
    .wishlist-panel {
        display: none !important;
        visibility: hidden !important;
    }
}

/* ============================================= */
/* SALE BANNER BUTTONS - Standardized           */
/* ============================================= */

/* Sale Banner Actions Container - Ensures horizontal alignment */
.sale-banner-actions {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap; /* Prevent wrapping to ensure horizontal alignment */
}

/* Sale Banner Buttons - Standardized styling */
.sale-banner-btn {
    padding: 12px 24px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sale-banner-btn-primary {
    background: #1E3A5F;
    color: white;
}

.sale-banner-btn-primary:hover {
    background: #2D5A8A;
    transform: translateY(-2px);
}

.sale-banner-btn-secondary {
    background: rgba(30, 58, 95, 0.1);
    color: #1E3A5F;
    border: 2px solid #1E3A5F;
}

.sale-banner-btn-secondary:hover {
    background: rgba(30, 58, 95, 0.2);
    border-color: #2D5A8A;
}

/* Mobile: Ensure buttons stay horizontal but can stack if needed */
@media (max-width: 768px) {
    .sale-banner-actions {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .sale-banner-btn {
        padding: 10px 18px;
        font-size: 0.85rem;
        flex: 1 1 auto;
        min-width: fit-content;
    }
}

/* Ensure buttons don't wrap on larger mobile screens */
@media (min-width: 481px) and (max-width: 768px) {
    .sale-banner-actions {
        flex-wrap: nowrap;
    }
}

/* ===========================
   SIDEBAR COMPONENT (Reusable)
   =========================== */

/* Two-Column Layout Wrapper */
.page-with-sidebar {
    display: flex;
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.page-main-content {
    flex: 1;
    min-width: 0; /* Prevents flex item from overflowing */
}

.page-main-content .container {
    max-width: 100%;
}

@media (min-width: 1201px) {
    .page-main-content .container {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Sidebar Container */
.homepage-sidebar {
    width: 320px;
    min-width: 320px; /* Ensure minimum width to prevent chopping */
    flex-shrink: 0;
    box-sizing: border-box;
}

/* Hide sidebar completely on mobile */
@media (max-width: 1200px) {
    .page-with-sidebar {
        flex-direction: column;
    }
    
    .homepage-sidebar {
        display: none !important; /* Completely hidden on mobile */
    }
}

/* Sidebar Sticky Positioning (Desktop Only) */
@media (min-width: 1201px) {
    .homepage-sidebar {
        position: sticky;
        top: 100px; /* Below header */
        align-self: flex-start;
        max-height: calc(100vh - 120px);
        overflow-y: hidden;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
    }
}

/* Sidebar Content Sections */
.sidebar-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 100%;
    overflow: visible; /* Changed from hidden to visible to prevent chopping */
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Sidebar Email Form */
.sidebar-email-form .email-capture-form {
    margin-bottom: 0;
    max-width: 100%;
    padding: 0;
    box-shadow: none;
    width: 100%;
    box-sizing: border-box;
}

.sidebar-email-form .email-capture-title {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.sidebar-email-form .email-capture-description {
    font-size: 0.75rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.sidebar-email-form .email-privacy-note {
    font-size: 0.65rem;
    margin-top: 6px;
    line-height: 1.3;
}

.sidebar-email-form .email-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.sidebar-email-form .email-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.sidebar-email-form .email-submit-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    font-size: 0.85rem;
}

@media (min-width: 1400px) {
    .sidebar-email-form .email-form-group {
        flex-direction: row;
    }
    
    .sidebar-email-form .email-submit-btn {
        width: auto;
        flex-shrink: 0;
    }
}

/* Sidebar Compact Cards */
.sidebar-card-item {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.sidebar-card-item:hover {
    border-color: #1E3A5F;
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.1);
}

.sidebar-card-item:last-child {
    margin-bottom: 0;
}

.sidebar-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.sidebar-card-rank {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-card-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.15;
}

.sidebar-card-rating {
    font-size: 0.7rem;
    color: #F59E0B;
    margin-bottom: 3px;
}

.sidebar-card-details {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.25;
}

.sidebar-card-apply {
    display: inline-block;
    width: 100%;
    padding: 5px 10px;
    background: linear-gradient(135deg, #1E3A5F 0%, #2D5A8A 100%);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.sidebar-card-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

/* Sidebar Quick Links */
.sidebar-quick-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-quick-links li {
    margin-bottom: 4px;
    width: 100%;
    min-width: 0; /* Allow list item to shrink */
    overflow: visible; /* Don't clip content */
}

.sidebar-quick-links li:last-child {
    margin-bottom: 0;
}

.sidebar-quick-links a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    min-width: 0; /* Allow flex item to shrink */
    width: 100%;
    box-sizing: border-box;
    overflow: visible; /* Prevent text from being clipped */
    white-space: normal; /* Allow text to wrap if needed */
    word-wrap: break-word; /* Break long words if necessary */
}

.sidebar-quick-links a:hover {
    background: var(--bg-card-hover);
    color: var(--accent-action);
}

.sidebar-quick-links .link-icon {
    font-size: 1rem;
    width: 18px;
    min-width: 18px; /* Prevent icon from shrinking */
    text-align: center;
    flex-shrink: 0;
    display: inline-block;
    flex-grow: 0; /* Don't let icon grow */
}

/* ===========================
   Utility Classes
   =========================== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.py-20 { padding-top: 20px; padding-bottom: 20px; }

/* ===========================
   EMAIL CAPTURE FORM
   =========================== */

.email-capture-form {
    max-width: 500px;
    margin: 32px auto;
    padding: 24px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.email-capture-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.email-capture-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.email-signup-form {
    margin-top: 16px;
}

.email-form-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.email-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.email-input:focus {
    outline: none;
    border-color: var(--accent-action);
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.1);
}

.email-submit-btn {
    padding: 12px 24px;
    background: var(--accent-action);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.email-submit-btn:hover:not(:disabled) {
    background: var(--accent-action-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

.email-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.email-privacy-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 12px;
    margin-bottom: 0;
}

.email-message {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.email-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--accent-green);
}

.email-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #EF4444;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .email-capture-form {
        max-width: 100%;
        margin: 24px auto;
        padding: 20px 16px;
        border-radius: 8px;
    }
    
    .email-capture-title {
        font-size: 1.2rem;
        margin-bottom: 6px;
    }
    
    .email-capture-description {
        font-size: 0.9rem;
        margin-bottom: 16px;
    }
    
    /* Stack form elements vertically on mobile */
    .email-form-group {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 12px;
    }
    
    /* Full-width input on mobile */
    .email-input {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px; /* Prevents iOS auto-zoom */
        min-height: 48px; /* Optimal touch target */
        border-radius: 8px;
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Full-width button on mobile */
    .email-submit-btn {
        width: 100%;
        padding: 14px 24px;
        font-size: 1rem;
        min-height: 48px; /* Optimal touch target */
        border-radius: 8px;
    }
    
    .email-privacy-note {
        font-size: 0.7rem;
        margin-top: 12px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .email-capture-form {
        padding: 16px 12px;
    }
    
    .email-capture-title {
        font-size: 1.1rem;
    }
    
    .email-input,
    .email-submit-btn {
        font-size: 0.9rem;
        padding: 12px 14px;
    }
}

