:root {
    --bg-primary: #FAFAF9;
    --bg-secondary: #FFFDF5;
    --gold-primary: #CA8A04;
    --text-primary: #0C0A09;
    --text-secondary: #44403C;
    --text-muted: #78716C;
    --glass-blur: 24px;
    --glass-opacity: 0.85;
    --nav-bg: rgba(250, 250, 249, 0.9);
    --border-color: rgba(12, 10, 9, 0.08);
    --card-bg: rgba(255, 255, 255, 0.85);
}

.dark-theme {
    --bg-primary: #0C0A09;
    --bg-secondary: #1C1917;
    --text-primary: #FAFAF9;
    --text-secondary: #D6D3D1;
    --text-muted: #A8A29E;
    --glass-opacity: 0.4;
    --nav-bg: rgba(12, 10, 9, 0.94);
    --border-color: rgba(250, 250, 249, 0.1);
    --card-bg: rgba(28, 25, 23, 0.4);
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary);
    background-color: var(--bg-primary);
    transition: background-color 0.4s ease, color 0.4s ease;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background-color: inherit;
    transition: background-color 0.4s ease;
    will-change: transform;
    pointer-events: none;
}

/* Glass Foundations */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.05);
    transition: background 0.4s ease, border 0.4s ease, filter 0.4s ease;
    transform: translateZ(0);
    will-change: transform;
}

.glass-nav {
    background: var(--nav-bg);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    transition: background 0.4s ease;
    transform: translateZ(0);
    will-change: transform;
}

/* UI Focus & Polish */
.focus-ring {
    transition: outline 0.2s ease, box-shadow 0.2s ease;
}

.focus-ring:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--gold-primary);
}

html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
}

@media (max-width: 1024px) {
    .hide-desktop-mobile {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    /* Global scrollable category bar */
    .cat-scroll {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .cat-scroll::-webkit-scrollbar {
        display: none;
    }

    .cat-scroll .flex {
        flex-wrap: nowrap !important;
    }

    /* Mobile Performance: Disable heavy CSS filters during scroll */
    .glass-card, .glass-nav, .mobile-menu-overlay, .cart-overlay, .checkout-drawer, .blur-bg {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background-color: var(--bg-primary) !important;
    }
    
    body::before {
        display: none !important;
        will-change: auto;
    }
    
    * {
        /* Reduce repaint cost on scrolling elements */
        -webkit-overflow-scrolling: touch;
    }
}