/* ===== 2025 MODERN HEADER DESIGN ===== */
/* External CSS for better caching and performance */
/* Version: 4.1.0 - Design System 2.0 Alignment + Bug Fixes */
/*
 * Changelog v4.1.0 - BUG FIXES:
 * - ADDED: Fallback values to all var() calls for graceful degradation
 * - FIXED: Stacking context isolation to prevent z-index conflicts with backdrop-filter
 * - OPTIMIZED: Transitions to only animate transform/opacity where possible
 * - ADDED: isolation: isolate to header for explicit stacking context management
 *
 * Changelog v4.0.0 - DESIGN SYSTEM 2.0 REFACTOR:
 * - REMOVED: Duplicate :root color variables (now uses main.css --sys-color-*)
 * - Z-INDEX: Replaced arbitrary values (1100-1103) with design system scale (--sys-z-*)
 * - SPACING: Replaced px/rem values with --sys-space-* tokens (8px grid)
 * - RADIUS: Replaced px values with --sys-radius-* tokens
 * - TYPOGRAPHY: Replaced inline fonts with --sys-font-* tokens
 * - TRANSITIONS: Replaced "all" with specific properties (transform, background-color, color)
 * - ADDED: WordPress admin bar handling (.admin-bar #site-header)
 * - ENHANCED: Safe area support with max() for iPhone notch
 * - ADDED: Mobile edge cases (landscape orientation, <350px screens)
 *
 * Previous changelog entries preserved below...
 *
 * Changelog v3.1.1:
 * - CONTRAST FIX: Enhanced logo visibility when mobile menu is open
 * - Added solid white header background when menu is open
 * - Added stronger shadow to header for separation from backdrop
 * - Added drop shadow to logo image for better visibility
 * - Added subtle text shadow to logo name for readability
 *
 * Changelog v3.1.0:
 * - ROOT CAUSE FIX: Changed hamburger HTML from <span> to <i> elements
 * - REASON: app.css has global rule "header span::before" and "header span::after" that adds pseudo-elements
 * - RESULT: Using <i> elements bypasses this rule entirely - no more interference
 * - CLEANUP: Removed most !important overrides as they're no longer needed
 * - SIMPLIFIED: CSS is now cleaner and more maintainable
 *
 * Changelog v3.0.1:
 * - SPACING FIX: Increased gap from 3px to 6px in .mobile-menu-toggle (prevents hamburger/menu label overlap)
 * - PADDING FIX: Adjusted button padding from "6px 4px 4px" to "8px 4px 6px" for better visual balance
 * - MARGIN FIX: Removed margin-top from .menu-label (gap property now handles all spacing)
 * - OVERRIDE FIX: Updated media query override to use margin-top: 0 instead of 1px
 *
 * Changelog v3.0.0 - BREAKING CHANGES (fundamental architectural fixes):
 * - HAMBURGER REBUILD: Switched from position:absolute to pure flexbox (justify-content: space-between)
 * - REMOVED: gap property from .hamburger-icon (conflicts with absolute positioning)
 * - ANIMATION FIX: Switch to absolute positioning ONLY when active (X state)
 * - VIEWPORT FIX: Changed from width:100vw to left:0 + right:0 (avoids scrollbar width issues)
 * - REMOVED: All max-width:100vw constraints that caused scrollbar conflicts
 * - SIMPLIFIED: Removed defensive overflow/width measures that were fighting symptoms
 * - CORE ISSUE: 100vw includes scrollbar width, causing horizontal overflow on pages with vertical scrollbars
 */

/* ========================================
   DESIGN SYSTEM 2.0 REFERENCE
   ========================================
   This file relies on design tokens from main.css:
   - Colors: --sys-color-primary, --sys-color-ink-base, --sys-color-surface-*
   - Spacing: --sys-space-1 through --sys-space-16 (8px grid)
   - Z-Index: --sys-z-sticky (200), --sys-z-fixed (300), --sys-z-overlay (400)
   - Radius: --sys-radius-sm (4px) through --sys-radius-full (9999px)
   - Typography: --sys-font-display (Montserrat), --sys-font-body (Lato)
   - Transitions: --sys-transition-fast (150ms), --sys-transition-base (300ms)
   ======================================== */

/* ========================================
   GLOBAL FONT SETTINGS
   ======================================== */
html {
    margin-top: 0 !important;
    overflow-x: hidden;
    box-sizing: border-box;
}

body {
    font-family: var(--sys-font-body, 'Lato', -apple-system, BlinkMacSystemFont, sans-serif) !important;
    color: var(--sys-color-ink-base, #2B2823);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    line-height: var(--sys-line-height-normal, 1.5);
    box-sizing: border-box;
}

/* Prevent page width expansion and scrolling when mobile menu opens */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    overscroll-behavior: contain;  /* Prevent scroll chaining and iOS bounce */
}

/* Enhance header and logo visibility when mobile menu is open */
body.menu-open #site-header {
    background: var(--sys-color-surface-0, #FFFFFF);  /* Solid white background for better contrast */
    box-shadow: var(--sys-shadow-lg, 0 10px 25px rgba(43, 40, 35, 0.12));  /* Stronger shadow to separate from backdrop */
}

body.menu-open .logo {
    position: relative;
    z-index: calc(var(--sys-z-overlay, 400) + 3);  /* Ensure logo stays above everything */
}

body.menu-open .logo img {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));  /* Enhanced shadow for better visibility */
}

body.menu-open .logo-name {
    text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);  /* Subtle text shadow for better readability */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--sys-font-display, 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif) !important;
    font-weight: 700;
    color: var(--sys-color-ink-base, #2B2823);
    line-height: var(--sys-line-height-tight, 1.1);
}

/* ========================================
   HEADER CONTAINER
   ======================================== */
#site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    box-shadow: var(--sys-shadow-sm, 0 1px 2px rgba(43, 40, 35, 0.05));
    position: sticky;
    top: 0;
    left: 0;
    right: 0;  /* Use left + right instead of width */
    z-index: var(--sys-z-sticky, 200);
    padding: 0;
    border-bottom: 1px solid var(--sys-color-surface-2, #F4F3F0);
    /* Use transform for better performance - avoid animating background-color */
    transition:
        transform 300ms ease,
        box-shadow 300ms ease;
    overflow-x: clip;
    box-sizing: border-box;
    /* Explicit stacking context to prevent z-index conflicts with backdrop-filter */
    isolation: isolate;
}

/* WordPress admin bar compatibility */
.admin-bar #site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar #site-header {
        top: 46px;
    }
}

#site-header.scrolled {
    box-shadow: var(--sys-shadow-md, 0 4px 12px rgba(43, 40, 35, 0.08));
    background: rgba(255, 255, 255, 0.98);
}

/* Safe area support for iPhone notch/Dynamic Island */
@supports (padding: max(0px)) {
    #site-header {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }

    .content-container {
        padding-left: max(var(--sys-space-6, 2rem), env(safe-area-inset-left));
        padding-right: max(var(--sys-space-6, 2rem), env(safe-area-inset-right));
    }
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sys-space-4, 1rem) var(--sys-space-6, 2rem);
    width: 100%;
    box-sizing: border-box;
    position: relative;
    min-width: 0;  /* Allow flexbox to shrink properly */
}

/* ========================================
   LOGO
   ======================================== */
.logo {
    display: flex;
    align-items: center;
    gap: var(--sys-space-3, 0.75rem);
    text-decoration: none;
    /* Only animate transform for performance - use opacity for background effect */
    transition: transform 300ms ease;
    flex-shrink: 0;
    z-index: calc(var(--sys-z-sticky, 200) + 1);
    padding: var(--sys-space-2, 0.5rem);
    margin: calc(var(--sys-space-2, 0.5rem) * -1);
    border-radius: var(--sys-radius-lg, 12px);
}

.logo:hover {
    background: var(--sys-color-primary-tint-05, rgba(183, 120, 13, 0.05));
}

.logo:active {
    transform: translateY(0);
}

.logo img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    transition: filter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.logo:hover img {
    filter: drop-shadow(0 4px 8px rgba(183, 120, 13, 0.2));
}

.logo-name {
    /* !important needed to override app.css conflicting styles */
    font-family: var(--sys-font-display, 'Montserrat', sans-serif) !important;
    font-size: var(--sys-font-size-h5, 1.25rem) !important;
    font-weight: 800 !important;
    color: var(--sys-color-ink-base, #2B2823) !important;
    margin: 0 !important;
    margin-left: 0 !important;
    letter-spacing: -0.03em !important;
    white-space: nowrap !important;
    display: block !important;
    text-transform: none !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ========================================
   MOBILE MENU TOGGLE - WITH VISUAL LABEL
   ======================================== */
.mobile-menu-toggle {
    display: none;
    position: relative;
    width: 54px;
    height: 54px;
    background: rgba(43, 40, 35, 0.04);
    border: 1px solid rgba(43, 40, 35, 0.1);
    border-radius: var(--sys-radius-lg, 12px);
    cursor: pointer;
    padding: var(--sys-space-2, 0.5rem) var(--sys-space-1, 0.25rem);
    z-index: calc(var(--sys-z-sticky, 200) + 1);
    /* Avoid animating background-color for performance */
    transition: opacity 300ms ease;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--sys-space-2, 0.5rem);
    touch-action: manipulation;  /* Eliminates 300ms tap delay on mobile */
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.mobile-menu-toggle:hover {
    background: var(--sys-color-primary-tint-10, rgba(183, 120, 13, 0.1));
    border-color: var(--sys-color-primary-tint-20, rgba(183, 120, 13, 0.2));
}

.mobile-menu-toggle:focus-visible {
    outline: 3px solid var(--sys-color-primary, #B7780D);
    outline-offset: var(--sys-space-1, 0.25rem);
    box-shadow: 0 0 0 4px var(--sys-color-primary-tint-20, rgba(183, 120, 13, 0.2)),
                0 0 0 7px var(--sys-color-primary, #B7780D);
    border-color: var(--sys-color-primary, #B7780D);
}

/* Hamburger icon wrapper - PURE FLEXBOX, NO ABSOLUTE POSITIONING */
.hamburger-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    position: relative;
}

/* Menu label below hamburger */
.menu-label {
    display: block;
    font-family: var(--sys-font-display, 'Montserrat', sans-serif);
    font-size: var(--sys-font-size-caption, 0.75rem);
    font-weight: 700;
    color: var(--sys-color-ink-base, #2B2823);
    margin-top: 0;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1;
    /* Avoid animating color for performance */
    transition: opacity 300ms ease;
}

.mobile-menu-toggle:hover .menu-label {
    color: var(--sys-color-primary, #B7780D);
}

.mobile-menu-toggle.is-active .menu-label {
    color: var(--sys-color-primary, #B7780D);
}

/* Hamburger lines - PURE FLEXBOX, let space-between handle spacing */
.hamburger-line {
    width: 20px;
    height: 2px;
    background: var(--sys-color-ink-base, #2B2823);
    border-radius: var(--sys-radius-sm, 4px);
    /* Only animate transform and opacity for performance */
    transition:
        transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: center;
    flex-shrink: 0;
    display: block;
}

/* No individual positioning needed - flexbox handles it */

/* Hamburger Animation - Adapted for flexbox layout */
.mobile-menu-toggle.is-active {
    background: var(--sys-color-primary-tint-10, rgba(183, 120, 13, 0.1));
    border-color: var(--sys-color-primary-tint-20, rgba(183, 120, 13, 0.2));
}

.mobile-menu-toggle.is-active .hamburger-line {
    background: var(--sys-color-primary, #B7780D);
}

/* Switch to absolute positioning only when animating to X */
.mobile-menu-toggle.is-active .hamburger-icon {
    position: relative;
}

.mobile-menu-toggle.is-active .hamburger-icon .hamburger-line {
    position: absolute;
    left: 50%;
    top: 50%;
}

.mobile-menu-toggle.is-active .hamburger-icon .hamburger-line:nth-child(1) {
    transform: translate(-50%, -50%) rotate(45deg);
}

.mobile-menu-toggle.is-active .hamburger-icon .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translate(-50%, -50%) translateX(-24px);
}

.mobile-menu-toggle.is-active .hamburger-icon .hamburger-line:nth-child(3) {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* ========================================
   NAVIGATION - HERITAGE PALETTE
   ======================================== */
.main-navigation {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--sys-space-2, 0.5rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    position: relative;
}

.nav-link {
    font-family: var(--sys-font-display, 'Montserrat', sans-serif) !important;
    font-size: var(--sys-font-size-small, 0.875rem);
    font-weight: 600;
    color: var(--sys-color-ink-base, #2B2823);
    text-decoration: none;
    padding: var(--sys-space-3, 0.75rem) var(--sys-space-4, 1rem);
    display: flex;
    align-items: center;
    gap: var(--sys-space-2, 0.5rem);
    /* Only animate transform for performance */
    transition: transform 300ms ease;
    position: relative;
    border-radius: var(--sys-radius-md, 8px);
    letter-spacing: -0.01em;
    touch-action: manipulation;  /* Eliminates 300ms tap delay */
}

/* Enhanced focus indicators for WCAG 2.2 compliance */
.nav-link:focus-visible {
    outline: 2px solid var(--sys-color-primary, #B7780D);
    outline-offset: 2px;
    background: var(--sys-color-primary-tint-10, rgba(183, 120, 13, 0.1));
}

/* Ensure visited links maintain the same color as unvisited links */
.nav-link:visited {
    color: var(--sys-color-ink-base, #2B2823);
}

/* Ensure visited current page links maintain accent color */
.nav-link.current-page:visited {
    color: var(--sys-color-primary, #B7780D);
}

.nav-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--sys-color-primary-tint-10, rgba(183, 120, 13, 0.1));
    border-radius: var(--sys-radius-md, 8px);
    opacity: 0;
    /* Animate opacity for performance */
    transition: opacity 300ms ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 3px;
    background: var(--sys-color-primary, #B7780D);
    border-radius: var(--sys-radius-sm, 4px);
    /* Transform is a safe animation property */
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-link:hover {
    color: var(--sys-color-primary, #B7780D);
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link:hover::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-link:active {
    transform: translateY(0);
}

/* Current Page Highlighting */
.nav-link.current-page {
    color: var(--sys-color-primary, #B7780D);
    font-weight: 700;
}

.nav-link.current-page::after {
    transform: translateX(-50%) scaleX(1);
}

.nav-link.current-page::before {
    opacity: 1;
}

/* ========================================
   CART - HERITAGE PALETTE
   ======================================== */
.cart-item {
    margin-left: var(--sys-space-3, 0.75rem);
}

.cart-link {
    background: rgba(43, 40, 35, 0.04);
    border: 1px solid rgba(43, 40, 35, 0.12);
    padding: var(--sys-space-3, 0.75rem) var(--sys-space-4, 1rem);
    position: relative;
    overflow: hidden;
    font-family: var(--sys-font-body, 'Lato', sans-serif) !important;
    color: var(--sys-color-ink-base, #2B2823);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--sys-space-2, 0.5rem);
    border-radius: var(--sys-radius-md, 8px);
    /* Optimize: Only animate safe properties */
    transition:
        color 300ms ease,
        border-color 300ms ease,
        box-shadow 300ms ease;
    touch-action: manipulation;  /* Eliminates 300ms tap delay */
}

.cart-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--sys-color-primary, #B7780D);
    opacity: 0;
    transition: opacity 300ms ease;
}

.cart-link:hover::before {
    opacity: 1;
}

.cart-link > * {
    position: relative;
    z-index: var(--sys-z-base, 1);
}

.cart-link:hover {
    color: var(--sys-color-surface-0, #FFFFFF);
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(183, 120, 13, 0.3),
                0 8px 32px rgba(183, 120, 13, 0.15);
}

.cart-link:active {
    transform: translateY(0);
}

.cart-link:hover::after {
    display: none;
}

.cart-icon {
    position: relative;
    display: inline-flex;
    font-size: 1.0625rem;
}

.cart-badge {
    position: absolute;
    top: -7px;
    right: -9px;
    background: var(--sys-color-primary, #B7780D);
    color: var(--sys-color-surface-0, #FFFFFF);
    font-size: var(--sys-font-size-caption, 0.75rem);
    font-weight: 700;
    padding: 2px 5px;
    border-radius: var(--sys-radius-md, 8px);
    min-width: 16px;
    text-align: center;
    box-shadow: var(--sys-shadow-sm, 0 1px 2px rgba(43, 40, 35, 0.05));
    /* Optimize: Only animate safe properties */
    transition:
        background-color 300ms ease,
        color 300ms ease;
}

.cart-link:hover .cart-badge {
    background: var(--sys-color-surface-0, #FFFFFF);
    color: var(--sys-color-ink-base, #2B2823);
}

.cart-total {
    font-weight: 700;
    font-size: var(--sys-font-size-small, 0.875rem);
    letter-spacing: -0.01em;
}

/* ========================================
   MOBILE MENU BACKDROP
   ======================================== */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, var(--sys-color-primary-tint-10, rgba(183, 120, 13, 0.1)) 0%, rgba(43, 40, 35, 0.85) 100%);
    z-index: var(--sys-z-overlay, 400);
    opacity: 0;
    transition: opacity 300ms ease;
}

.mobile-menu-backdrop.is-active {
    display: block;
    opacity: 1;
}

/* ========================================
   RESPONSIVE - MOBILE FIRST
   ======================================== */
@media (max-width: 1200px) {
    .nav-link {
        font-size: var(--sys-font-size-small, 0.875rem);
        padding: var(--sys-space-3, 0.75rem);
    }
}

@media (max-width: 1024px) {
    /* Prevent horizontal overflow when mobile menu is open */
    body.menu-open {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 360px;
        max-width: 85vw;
        background: rgba(43, 40, 35, 0.95);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        box-shadow: var(--sys-shadow-xl, 0 20px 50px rgba(43, 40, 35, 0.15));
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        transform: translateX(100%);
        transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
        z-index: calc(var(--sys-z-overlay, 400) + 1);
        overflow-y: auto;
        overscroll-behavior: contain;  /* Prevent scroll chaining */
        -webkit-overflow-scrolling: touch;  /* Smooth scrolling on iOS */
        will-change: transform;
        padding: var(--sys-space-16, 4rem) 0 var(--sys-space-8, 2rem);
    }

    .main-navigation.is-active {
        transform: translateX(0);
    }

    .nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: var(--sys-space-1, 0.25rem);
        width: 100%;
        padding: 0 var(--sys-space-4, 1rem);
    }

    .nav-item {
        width: 100%;
    }

    .nav-link {
        width: 100%;
        padding: var(--sys-space-4, 1rem) var(--sys-space-5, 1.25rem);
        font-size: var(--sys-font-size-body, 1rem);
        justify-content: flex-start;
        border-radius: var(--sys-radius-lg, 12px);
        font-weight: 600;
        color: var(--sys-color-surface-0, #FFFFFF) !important;
    }

    /* Ensure visited links maintain white color on mobile */
    .nav-link:visited {
        color: var(--sys-color-surface-0, #FFFFFF);
    }

    /* Enhanced focus indicators for mobile navigation */
    .nav-link:focus-visible {
        outline: 3px solid var(--sys-color-primary, #B7780D);
        outline-offset: -3px;
        background: var(--sys-color-primary-tint-20, rgba(183, 120, 13, 0.2));
    }

    .nav-link::before {
        border-radius: var(--sys-radius-lg, 12px);
        background: var(--sys-color-primary-tint-10, rgba(183, 120, 13, 0.1));
    }

    .nav-link::after {
        left: var(--sys-space-5, 1.25rem);
        transform: translateX(0) scaleX(0);
        transform-origin: left;
        bottom: 50%;
        margin-bottom: -1.5px;
        width: 4px;
        height: 24px;
        border-radius: var(--sys-radius-sm, 4px);
        background: var(--sys-color-primary, #B7780D);
    }

    .nav-link:hover::after {
        transform: translateX(0) scaleX(1);
    }

    .nav-link:hover {
        background-color: var(--sys-color-primary-tint-10, rgba(183, 120, 13, 0.1));
        padding-left: var(--sys-space-6, 1.5rem);
        transform: translateY(0);
        color: var(--sys-color-surface-0, #FFFFFF) !important;
    }

    .nav-link.current-page {
        color: var(--sys-color-primary, #B7780D) !important;
    }

    .cart-item {
        margin-left: 0;
        margin-top: var(--sys-space-5, 1.25rem);
        padding: var(--sys-space-5, 1.25rem) 0 var(--sys-space-2, 0.5rem);
        border-top: 2px solid rgba(255, 255, 255, 0.1);
    }

    .cart-link {
        background: var(--sys-color-primary, #B7780D);
        color: var(--sys-color-surface-0, #FFFFFF);
        border: none;
        margin: 0 var(--sys-space-2, 0.5rem);
        justify-content: center;
        border-radius: var(--sys-radius-xl, 16px);
        padding: var(--sys-space-4, 1rem) var(--sys-space-5, 1.25rem);
        box-shadow: 0 4px 16px rgba(183, 120, 13, 0.3),
                    0 1px 4px rgba(0, 0, 0, 0.1);
    }

    .cart-link::before {
        display: none;
    }

    .cart-link:hover {
        box-shadow: 0 8px 24px rgba(183, 120, 13, 0.4),
                    0 4px 12px rgba(0, 0, 0, 0.15);
        padding-left: var(--sys-space-5, 1.25rem);
        background: var(--sys-color-primary-light, #C98D28);
    }

    .cart-badge {
        background: var(--sys-color-surface-0, #FFFFFF);
        color: var(--sys-color-ink-base, #2B2823);
    }
}

/* iPad Pro optimization */
@media (min-width: 1025px) and (max-width: 1366px) {
    .content-container {
        padding: var(--sys-space-4, 1rem) var(--sys-space-5, 1.25rem);
    }

    .nav-link {
        padding: var(--sys-space-3, 0.75rem);
        font-size: var(--sys-font-size-small, 0.875rem);
    }

    .cart-link {
        padding: var(--sys-space-2, 0.5rem) var(--sys-space-3, 0.75rem);
    }
}

/* Fix for <900px width - brand name visibility and hamburger alignment */
@media (max-width: 900px) {
    /* Force proper flexbox behavior on content container */
    #site-header .content-container,
    header#site-header .content-container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        padding: var(--sys-space-3, 0.75rem) var(--sys-space-5, 1.25rem);
        position: relative !important;
    }

    /* Override app.css .logo container styles with maximum specificity */
    #site-header .content-container .logo,
    header#site-header .content-container a.logo,
    header .content-container .logo {
        display: flex !important;
        align-items: center !important;
        width: auto !important; /* Override app.css width: 50% */
        max-width: none !important;
        flex-shrink: 0 !important;
        padding-left: 0 !important; /* Override app.css padding-left: 25px */
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: auto !important;
        justify-content: flex-start !important;
        gap: var(--sys-space-3, 0.75rem) !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }

    /* Override app.css .logo img negative margin with maximum specificity */
    #site-header .content-container .logo img,
    header#site-header .content-container a.logo img,
    header .content-container .logo img,
    .logo img {
        width: 42px !important;
        height: 42px !important;
        margin: 0 !important; /* Override app.css margin-left: -20px */
        margin-left: 0 !important;
        margin-right: 0 !important;
        flex-shrink: 0 !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }

    /* Override app.css conflicting .logo .logo-name styles with maximum specificity */
    #site-header .content-container .logo .logo-name,
    header#site-header .content-container a.logo span.logo-name,
    header .content-container .logo .logo-name,
    .logo .logo-name,
    .logo-name,
    span.logo-name {
        font-family: var(--sys-font-display, 'Montserrat', sans-serif) !important;
        font-size: var(--sys-font-size-h5, 1.25rem) !important;
        font-weight: 800 !important;
        color: var(--sys-color-ink-base, #2B2823) !important;
        display: inline-block !important;
        visibility: visible !important;
        opacity: 1 !important;
        text-transform: none !important;
        letter-spacing: -0.03em !important;
        margin: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        bottom: auto !important;
        transform: none !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* Ensure mobile menu toggle button is properly positioned with maximum specificity */
    #site-header .content-container .mobile-menu-toggle,
    header#site-header .content-container button.mobile-menu-toggle,
    header .content-container .mobile-menu-toggle,
    .mobile-menu-toggle,
    button.mobile-menu-toggle {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
        margin-left: auto !important;
        position: relative !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }

    /* Hamburger lines now use <i> elements which are not affected by app.css "header span" rules */

    /* Explicitly prevent hamburger styles from applying to logo-name span */
    #site-header .logo .logo-name,
    header#site-header .logo span.logo-name,
    header .logo .logo-name,
    a.logo span.logo-name,
    .logo > span.logo-name {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background-color: transparent !important;
        /* Prevent app.css header span pseudo-elements from affecting logo-name */
    }

    /* CRITICAL: Explicitly prevent hamburger styles from applying to menu-label span */
    #site-header .mobile-menu-toggle .menu-label,
    header#site-header .mobile-menu-toggle span.menu-label,
    header .mobile-menu-toggle .menu-label,
    button.mobile-menu-toggle span.menu-label,
    .mobile-menu-toggle > span.menu-label,
    span.menu-label {
        position: static !important;  /* Not absolute like hamburger lines */
        width: auto !important;  /* Not 20px */
        height: auto !important;  /* Not 2px */
        background-color: transparent !important;  /* Not var(--sys-color-ink-base) */
        top: auto !important;  /* No positioning */
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin: 0 !important;  /* Reset app.css margins */
        margin-top: 0 !important;  /* No extra margin, gap handles spacing */
        transform: none !important;  /* No transform */
        display: block !important;  /* Block display, not hidden */
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Remove pseudo-elements from logo-name span that app.css adds to header span */
    #site-header .logo .logo-name::before,
    #site-header .logo .logo-name::after,
    header#site-header .logo span.logo-name::before,
    header#site-header .logo span.logo-name::after,
    header .logo .logo-name::before,
    header .logo .logo-name::after,
    a.logo span.logo-name::before,
    a.logo span.logo-name::after,
    .logo > span.logo-name::before,
    .logo > span.logo-name::after {
        content: none !important;
        display: none !important;
    }

    /* Remove pseudo-elements from menu-label span that app.css adds to header span */
    #site-header .mobile-menu-toggle .menu-label::before,
    #site-header .mobile-menu-toggle .menu-label::after,
    header#site-header .mobile-menu-toggle span.menu-label::before,
    header#site-header .mobile-menu-toggle span.menu-label::after,
    header .mobile-menu-toggle .menu-label::before,
    header .mobile-menu-toggle .menu-label::after,
    button.mobile-menu-toggle span.menu-label::before,
    button.mobile-menu-toggle span.menu-label::after,
    .mobile-menu-toggle > span.menu-label::before,
    .mobile-menu-toggle > span.menu-label::after,
    span.menu-label::before,
    span.menu-label::after {
        content: none !important;
        display: none !important;
    }

    /* No positioning needed - flexbox handles hamburger line spacing */

    .main-navigation {
        width: 320px;
    }
}

@media (max-width: 768px) {
    .content-container {
        padding: var(--sys-space-3, 0.75rem) var(--sys-space-4, 1rem);
    }

    .logo-name {
        font-size: var(--sys-font-size-h5, 1.25rem) !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Landscape mobile optimization - prevents nav from covering screen */
@media (max-width: 768px) and (orientation: landscape) {
    #site-header {
        padding: var(--sys-space-2, 0.5rem) var(--sys-space-4, 1rem);
    }

    .main-navigation {
        height: 70vh;
        max-height: 70vh;
        overflow-y: auto;
    }
}

@media (max-width: 480px) {
    .content-container {
        padding: var(--sys-space-3, 0.75rem) var(--sys-space-4, 1rem);
    }

    .logo {
        gap: var(--sys-space-2, 0.5rem);
    }

    .logo img {
        width: 38px;
        height: 38px;
    }

    .logo-name {
        font-size: var(--sys-font-size-body, 1rem) !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .main-navigation {
        width: 100%;
        max-width: 100vw;
        border-left: none;
    }
}

@media (max-width: 360px) {
    .logo-name {
        font-size: var(--sys-font-size-body, 1rem) !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* Extra small screens (<350px) - ensure readability */
@media (max-width: 350px) {
    .logo img {
        width: 36px;
        height: 36px;
    }

    .logo-name {
        font-size: 1rem !important;
    }

    .mobile-menu-toggle {
        width: 48px;
        height: 48px;
    }

    .content-container {
        padding: var(--sys-space-2, 0.5rem) var(--sys-space-3, 0.75rem);
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    #site-header,
    .main-navigation {
        backdrop-filter: none;
        background: var(--sys-color-surface-0, #FFFFFF);
    }

    .mobile-menu-backdrop {
        background: rgba(43, 40, 35, 0.85);
    }
}
