/* ============================================================
   MINIJAYA GEMS — SHARED STYLES
   Extracted byte-for-byte from the final index.html
   Loaded on every page: index, product-detail, inventory,
   wishlist, collection, settings, and future pages.
   ============================================================ */

/* ============ CSS VARIABLES ============ */
:root {
    --gold: #c6a87b;
    --gold-bright: #d4b98c;
    --dark: #07070a;
    --glass: rgba(255, 255, 255, 0.03);
    --white: #f1ede8;
    --bg-color: #07070a;
    --text-color: #f1ede8;
    --sidebar-bg: rgba(7, 7, 10, 0.94);
    --sidebar-hover: rgba(7, 7, 10, 0.98);
    --card-bg: #0d0d12;
    --border-color: rgba(198, 168, 123, 0.1);
    --nav-link-color: #aaa;
    --input-bg: #1a1a20;
    --mobile-nav-bg: rgba(7, 7, 10, 0.96);
    --ease-out: cubic-bezier(0.165, 0.85, 0.45, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --s-dur: 0.55s;                              /* search open/close duration */
    --s-ease: cubic-bezier(0.22, 1, 0.36, 1);    /* easeOutQuint: fast start, long soft landing */
}

body.light-theme {
    --bg-color: #fcfaf7;
    --text-color: #1a1a1a;
    --sidebar-bg: rgba(255, 255, 255, 0.94);
    --sidebar-hover: rgba(255, 255, 255, 0.98);
    --card-bg: #ffffff;
    --border-color: rgba(0, 0, 0, 0.1);
    --nav-link-color: #444;
    --input-bg: #f0f0f0;
    --glass: rgba(0, 0, 0, 0.03);
    --mobile-nav-bg: rgba(252, 250, 247, 0.98);
}

/* ============ GLOBAL RESET ============ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html { max-width: 100vw; overflow-x: clip; }
body { max-width: 100vw; overflow-x: clip; }
/* Stop a swipe inside a drawer/dropdown from rubber-banding the page behind
   it on iOS Safari — a very common source of "janky scroll" complaints.
   This must live on <html>, not <body>: because <html> above already has an
   explicit overflow-x, <html> — not <body> — is the element that actually
   scrolls the page (per the CSS overflow-propagation spec). Setting
   overscroll-behavior-y on <body> instead, while it's a non-propagating
   nested scroll box, made some Chromium builds lose track of which element
   should receive wheel input at all — killing scroll everywhere except
   paths (like the sidebar) that happened to chain through a different
   element. */
html { overscroll-behavior-y: none; }

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    padding-left: 50px;
    transition: padding-left 0.4s var(--ease-out), background 0.6s ease, color 0.6s ease;
}

a, button, [role="button"], label { touch-action: manipulation; }

/* ============ SCROLL PROGRESS ============ */
.scroll-progress {
    position: fixed; top: 0; left: 50px; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-bright) 100%);
    transform-origin: 0 50%; transform: scaleX(0);
    z-index: 3000; pointer-events: none;
}

/* ============ MOUSE GLOW & DUST ============ */
#cursor-glow {
    position: fixed; top: 0; left: 0; width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(198,168,123,0.06) 0%, transparent 70%);
    border-radius: 50%; pointer-events: none; z-index: 1;
    transform: translate(-50%, -50%);
    will-change: transform;
}
.dust span {
    position: absolute; background: var(--gold); border-radius: 50%;
    pointer-events: none;
}

/* ============ DESKTOP SIDEBAR ============ */
.sidebar {
    position: fixed; left: 0; top: 0; height: 100vh; width: 50px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color); z-index: 2000;
    transition: width 0.4s var(--ease-out), background 0.6s ease;
    display: flex; flex-direction: column; overflow: hidden;
}
.sidebar::before { content: ''; display: block; min-height: 56px; flex-shrink: 0; width: 100%; }
.sidebar:hover { width: 240px; background: var(--sidebar-hover); border-right-color: var(--gold); }
.side-item { display: flex; align-items: center; height: 50px; border-radius: 8px; text-decoration: none; color: #888; transition: 0.3s; margin: 4px 6px; cursor: pointer; position: relative; }
.side-icon { min-width: 40px; display: flex; justify-content: center; font-size: 1rem; }
.side-label { font-size: 0.85rem; opacity: 0; transition: 0.3s; white-space: nowrap; }
.sidebar:hover .side-label { opacity: 1; }
.side-item:hover, .side-item.active { background: rgba(198,168,123,0.1); color: var(--gold); }
.sidebar-divider { height: 1px; background: var(--border-color); margin: 15px 10px; }
.side-badge { position: absolute; top: 4px; right: 8px; background: var(--gold); color: #000; font-size: 0.5rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: none; align-items: center; justify-content: center; padding: 0 3px; line-height: 1; z-index: 2; }
.side-badge.visible { display: flex; }
.sidebar:hover .side-badge { right: 12px; }
.sidebar-profile { margin-top: auto; margin-bottom: 20px; padding: 12px 6px; display: none; align-items: center; cursor: pointer; transition: all 0.3s ease; gap: 12px; width: 100%; }
.sidebar-profile.visible { display: flex; }
.profile-circle { min-width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(198,168,123,0.3); overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--glass); flex-shrink: 0; }
.profile-circle img { width: 100%; height: 100%; object-fit: cover; }
.profile-info { opacity: 0; white-space: nowrap; transition: opacity 0.3s ease; display: flex; flex-direction: column; justify-content: center; flex: 1; overflow: hidden; }
.sidebar:hover .profile-info { opacity: 1; }
.profile-name { font-size: 0.85rem; font-weight: 500; color: var(--text-color); overflow: hidden; text-overflow: ellipsis; }
.profile-plan { font-size: 0.7rem; color: var(--gold); opacity: 0.8; }
.profile-chevron { opacity: 0; color: #555; transition: 0.3s; flex-shrink: 0; }
.sidebar:hover .profile-chevron { opacity: 1; }

/* ============ TOP NAVIGATION ============ */
nav { position: fixed; top: 0; right: 0; left: 50px; z-index: 1000; padding: 0 5%; height: 56px; display: flex; align-items: center; justify-content: space-between; transition: background 0.6s ease, border-color 0.6s ease; }
nav.scrolled { background: var(--bg-color); border-bottom: 1px solid var(--border-color); }
.logo { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; text-decoration: none; color: var(--text-color); font-weight: 600; letter-spacing: 2px; flex-shrink: 0; }
.nav-links { display: flex; gap: 32px; list-style: none; align-items: center; }
.nav-links a { color: var(--nav-link-color); text-decoration: none; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; position: relative; transition: 0.3s; cursor: pointer; white-space: nowrap; }
.nav-links a::after { content: ''; position: absolute; bottom: -8px; left: 50%; width: 0; height: 1px; background: var(--gold); transition: 0.4s; transform: translateX(-50%); }
.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after { width: 100%; }
#google-login-wrapper { position: relative; display: inline-block; }
#google-login-target { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0.01; overflow: hidden; z-index: 2; cursor: pointer; }
#google-login-container { position: relative; z-index: 1; }

/* ============ DESKTOP NAV SEARCH ============ */
/* Pure CSS. JS only toggles .expanded on .nav-search-wrapper; opening and closing are both transitions. */
.nav-search-wrapper {
    --search-w: clamp(190px, 22vw, 280px);
    --trigger-w: 116px;
    position: relative;
    margin: 0 18px 0 auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    z-index: 5;
}
.nav-search-trigger { display: flex; align-items: center; justify-content: center; gap: 7px; width: var(--trigger-w); background: none; border: 1px solid var(--border-color); border-radius: 50px; color: var(--nav-link-color); font-family: 'Inter', sans-serif; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; padding: 0; height: 32px; cursor: pointer; white-space: nowrap;
    transition: color 0.3s, border-color 0.3s, opacity 0.2s ease 0.3s; }           /* on close: fades back in late */
.nav-search-trigger i { font-size: 0.7rem; color: var(--gold); }
.nav-search-trigger:hover { color: var(--gold); border-color: rgba(198,168,123,0.4); }
.nav-search-wrapper.expanded .nav-search-trigger { opacity: 0; pointer-events: none;
    transition: color 0.3s, border-color 0.3s, opacity 0.12s ease 0s; }            /* on open: fades out immediately */
.nav-search-expand {
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: calc(var(--trigger-w) + 8px);   /* starts exactly the size of the Search button */
    padding: 4px;                          /* room for the focus ring */
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
    transition: width var(--s-dur) cubic-bezier(0.65, 0, 0.35, 1), opacity 0.2s ease 0.35s;   /* close */
}
.nav-search-wrapper.expanded .nav-search-expand {
    width: calc(var(--search-w) + 8px);
    opacity: 1;
    pointer-events: auto;
    transition: width var(--s-dur) var(--s-ease), opacity 0.12s ease 0s;                      /* open */
}
.nav-search-input-row {
    display: flex; align-items: center; gap: 10px;
    width: 100%; min-width: 0; overflow: hidden;
    background: var(--card-bg);
    border: 1px solid rgba(198,168,123,0.5);
    border-radius: 50px;
    padding: 0 14px; height: 32px;
    box-shadow: 0 0 0 3px rgba(198,168,123,0.07);
    white-space: nowrap;
}
.nav-search-input-row .search-icon { color: var(--gold); font-size: 0.75rem; flex-shrink: 0; }
#gemSearchInput { flex: 1; background: none; border: none; outline: none; color: var(--text-color); font-family: 'Inter', sans-serif; font-size: 0.75rem; letter-spacing: 0.5px; min-width: 0; }
#gemSearchInput::placeholder { color: #555; font-size: 0.7rem; letter-spacing: 1px; text-transform: uppercase; }
.search-clear-btn { background: none; border: none; color: #555; cursor: pointer; padding: 4px; font-size: 0.7rem; transition: color 0.2s; display: none; flex-shrink: 0; }
.search-clear-btn:hover { color: var(--gold); }
.search-clear-btn.visible { display: block; }
.search-dropdown { position: absolute; top: calc(100% + 8px); right: 0; left: auto; min-width: 280px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.4); opacity: 0; visibility: hidden; transform: translateY(-8px); pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s; max-height: 420px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; z-index: 2100; }
.search-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: all; }
.search-dropdown::-webkit-scrollbar { width: 4px; }
.search-dropdown::-webkit-scrollbar-track { background: transparent; }
.search-dropdown::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.search-result-item { display: flex; align-items: center; gap: 14px; padding: 12px 18px; cursor: pointer; transition: background 0.2s; text-decoration: none; color: var(--text-color); border-bottom: 1px solid var(--border-color); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item:focus { background: rgba(198,168,123,0.06); outline: none; }
.search-result-img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border-color); flex-shrink: 0; background: var(--input-bg); }
.search-result-info { flex: 1; min-width: 0; }
.search-result-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta { font-size: 0.68rem; color: var(--gold); letter-spacing: 1px; text-transform: uppercase; margin-top: 2px; opacity: 0.8; }
.search-result-price { font-size: 0.78rem; color: var(--gold); font-weight: 500; flex-shrink: 0; }
.search-state-msg { padding: 24px 18px; text-align: center; font-size: 0.78rem; color: #555; letter-spacing: 1px; }
.search-state-msg i { display: block; font-size: 1.4rem; color: var(--gold); margin-bottom: 8px; opacity: 0.5; }
.search-loading { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 20px; color: #555; font-size: 0.78rem; letter-spacing: 1px; }
@keyframes searchSpin { to { transform: rotate(360deg); } }
.search-spinner { width: 14px; height: 14px; border: 2px solid var(--border-color); border-top-color: var(--gold); border-radius: 50%; animation: searchSpin 0.7s linear infinite; }
.search-highlight { color: var(--gold); font-weight: 600; }

/* ============ MOBILE TOP BAR ============ */
.mobile-top-bar { display: none; position: fixed; top: 0; left: 0; right: 0; z-index: 1000; padding: max(14px, env(safe-area-inset-top)) 4% 10px; background: transparent; align-items: center; gap: 0; --so: 0; transition: background 0.4s ease, border-bottom 0.4s ease; }
.mobile-top-bar.scrolled { background: var(--mobile-nav-bg); border-bottom: 1px solid var(--border-color); }
.mobile-logo { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; text-decoration: none; color: var(--text-color); font-weight: 600; letter-spacing: 2px; flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; margin-right: auto; opacity: calc(1 - var(--so, 0) * 1.6); transition: opacity 0.3s ease; }
.mobile-auth-btn { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 2px; color: var(--gold); border: 1px solid rgba(198,168,123,0.4); padding: 6px 12px; border-radius: 20px; cursor: pointer; background: none; font-family: 'Inter', sans-serif; position: relative; overflow: hidden; white-space: nowrap; flex-shrink: 0; }
#mobile-google-target { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0.01; overflow: hidden; z-index: 2; cursor: pointer; }
.mobile-search-bar { display: none; position: relative; align-items: center; z-index: 1;
    flex-grow: 0; flex-shrink: 0; flex-basis: calc(34px + (100% - 34px) * var(--so, 0));   /* 34px icon  ->  full bar */
    transition: flex-basis var(--s-dur) var(--s-ease); }
.mobile-search-input-row {
    display: flex; align-items: center;
    background: var(--card-bg); border: 1px solid var(--border-color);
    border-radius: 50px; height: 34px; width: 100%;
    overflow: hidden; cursor: pointer; transform-origin: right center;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.mobile-search-bar.expanded .mobile-search-input-row {
    cursor: default;
    border-color: rgba(198,168,123,0.5); box-shadow: 0 0 0 3px rgba(198,168,123,0.07);
}
.mobile-search-input-row .search-icon {
    width: 32px; min-width: 32px; height: 100%;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    color: var(--gold); font-size: 0.78rem; pointer-events: none;
}
#gemSearchInputMobile {
    flex: 1; min-width: 0; width: 0; padding-right: 4px;
    background: none; border: none; outline: none; color: var(--text-color);
    font-family: 'Inter', sans-serif; font-size: 16px;
    letter-spacing: 0.5px; opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.mobile-search-bar.expanded #gemSearchInputMobile { opacity: 1; pointer-events: auto; transition: opacity 0.25s ease 0.2s; }
#gemSearchInputMobile::placeholder { color: #555; font-size: 0.68rem; letter-spacing: 1px; text-transform: uppercase; }
.mobile-search-clear-btn { background: none; border: none; color: #555; cursor: pointer; padding: 4px; font-size: 0.7rem; display: none; flex-shrink: 0; opacity: 0; pointer-events: none; transition: color 0.2s; }
.mobile-search-clear-btn:hover { color: var(--gold); }
.mobile-search-clear-btn.visible { display: block; }
.mobile-search-bar.expanded .mobile-search-clear-btn.visible { opacity: 1; pointer-events: auto; }
.mobile-search-dropdown { position: absolute; top: calc(100% + 6px); right: 0; min-width: 260px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.4); opacity: 0; visibility: hidden; transform: translateY(-8px); pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s; max-height: 360px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; z-index: 200; }
.mobile-search-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: all; }
.mobile-search-dropdown::-webkit-scrollbar { width: 4px; }
.mobile-search-dropdown::-webkit-scrollbar-track { background: transparent; }
.mobile-search-dropdown::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.mobile-search-inner { position: relative; display: flex; justify-content: flex-end; width: 100%; }

/* ============ MOBILE SEARCH EXPANSION (pure CSS) ============ */
/* --so is 0 (closed) or 1 (open) on the top bar. The search bar's width, the logo/login shrink
   and fade all derive from it, so ONE class change animates opening AND collapsing back to the icon.
   Nothing is positioned absolutely, so nothing jumps and nothing is pushed off-screen:
   the search bar grows and the flex layout squeezes logo + login to zero width. */
.mobile-top-bar.search-open { --so: 1; }
.mobile-top-bar:has(.mobile-search-bar.expanded) { --so: 1; }
#mobile-auth-area { flex: 0 1 auto; min-width: 0; overflow: hidden;
    margin-left: calc(8px * (1 - var(--so, 0))); opacity: calc(1 - var(--so, 0) * 1.6);
    transition: margin-left var(--s-dur) var(--s-ease), opacity 0.3s ease; }
.mobile-search-bar.expanded .mobile-search-dropdown { left: 0; right: 0; min-width: 0; }

/* ============ MOBILE BOTTOM NAV ============ */
.mobile-bottom-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000; background: var(--mobile-nav-bg); border-top: 1px solid var(--border-color); padding: 8px 0 max(8px, env(safe-area-inset-bottom)); }
.mobile-nav-items { display: flex; align-items: center; justify-content: space-around; }
.mobile-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 4px; cursor: pointer; color: #777; text-decoration: none; transition: color 0.2s; border: none; background: none; font-family: 'Inter', sans-serif; flex: 1; position: relative; }
.mobile-nav-item i { font-size: 1.1rem; }
.mobile-nav-item span { font-size: 0.55rem; letter-spacing: 1px; text-transform: uppercase; }
.mobile-nav-item.active, .mobile-nav-item:hover { color: var(--gold); }
.mobile-nav-badge { position: absolute; top: 0; right: calc(50% - 12px); background: var(--gold); color: #000; font-size: 0.45rem; font-weight: 700; min-width: 14px; height: 14px; border-radius: 7px; display: none; align-items: center; justify-content: center; padding: 0 3px; line-height: 1; }
.mobile-nav-badge.visible { display: flex; }

/* ============ FLOATING CART (MOBILE) ============ */
.floating-cart {
    position: fixed;
    bottom: 84px; right: 16px;
    width: 52px; height: 52px;
    border-radius: 50%;
    background: var(--gold);
    color: #000;
    display: none;
    align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 2500;
    box-shadow: 0 10px 30px rgba(198,168,123,0.4);
    font-size: 1.1rem;
    transition: transform 0.25s;
}
.floating-cart:active { transform: scale(0.92); }
.floating-cart-badge {
    position: absolute;
    top: -4px; right: -4px;
    background: #07070a;
    color: var(--gold);
    font-size: 0.6rem;
    font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9px;
    display: none;
    align-items: center; justify-content: center;
    padding: 0 4px;
    border: 1px solid var(--gold);
}
.floating-cart-badge.visible { display: flex; }

/* ============ SETTINGS MODAL ============ */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 3000; display: none; align-items: flex-end; justify-content: center; opacity: 0; }
.modal-overlay.open { display: flex; opacity: 1; }
.settings-card { background: var(--card-bg); border: 1px solid var(--border-color); width: 100%; max-width: 450px; border-radius: 20px 20px 0 0; padding: 30px; padding-bottom: max(30px, env(safe-area-inset-bottom)); color: var(--text-color); }
@media (min-width: 769px) { .modal-overlay { align-items: center; } .settings-card { border-radius: 20px; } }
.settings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.settings-title { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; color: var(--gold); }
.close-settings { color: #555; cursor: pointer; transition: 0.3s; font-size: 1.2rem; padding: 4px; }
.close-settings:hover { color: var(--gold); }
.setting-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--border-color); gap: 16px; }
.setting-info { flex: 1; min-width: 0; }
.setting-info h4 { font-size: 0.9rem; font-weight: 500; }
.setting-info p { font-size: 0.7rem; color: #666; margin-top: 2px; }
select.setting-input { background: var(--input-bg); border: 1px solid var(--border-color); color: var(--text-color); padding: 8px 10px; border-radius: 5px; outline: none; font-size: 0.8rem; flex-shrink: 0; -webkit-appearance: none; appearance: none; }
.theme-switch { position: relative; display: inline-block; width: 46px; height: 22px; flex-shrink: 0; }
.theme-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background-color: #333; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: var(--gold); transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--gold); }
input:checked + .slider:before { transform: translateX(24px); background-color: #fff; }

/* ============ CART DRAWER & TOAST ============ */
.toast-container { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 9000; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.toast { background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-color); padding: 12px 22px; border-radius: 30px; font-size: 0.78rem; letter-spacing: 0.5px; box-shadow: 0 10px 40px rgba(0,0,0,0.4); display: flex; align-items: center; gap: 10px; pointer-events: none; white-space: nowrap; }
.toast i { color: var(--gold); font-size: 0.85rem; }
.toast.toast-remove i { color: #e05555; }
.toast.toast-warn i { color: #f0a500; }
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.78); z-index: 4000; opacity: 0; pointer-events: none; }
.cart-overlay.open { opacity: 1; pointer-events: all; }
.cart-drawer {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(400px, 92vw);
    background: var(--bg-color);
    border-left: 1px solid var(--border-color);
    z-index: 4001;
    display: flex;
    flex-direction: column;
    visibility: hidden;          /* GSAP animates x; .open only flips visibility */
    will-change: transform;
}
.cart-drawer.open { visibility: visible; }
.cart-drawer-header { padding: 24px 20px 18px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.cart-drawer-title { font-family: 'Cormorant Garamond'; font-size: 1.4rem; color: var(--gold); }
.cart-close-btn { background: none; border: none; color: #666; font-size: 1.1rem; cursor: pointer; transition: 0.2s; padding: 4px; }
.cart-close-btn:hover { color: var(--gold); }
.cart-items-list { flex: 1; overflow-y: auto; padding: 16px 20px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.cart-items-list::-webkit-scrollbar { width: 4px; }
.cart-items-list::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 16px; color: #555; text-align: center; }
.cart-empty i { font-size: 2.5rem; color: var(--gold); opacity: 0.3; }
.cart-empty p { font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; }
.cart-item-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-color); }
.cart-item-row:last-child { border-bottom: none; }
.cart-item-img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border-color); flex-shrink: 0; background: var(--card-bg); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 0.75rem; color: var(--gold); margin-top: 3px; }
.cart-item-remove { background: none; border: none; color: #555; cursor: pointer; font-size: 0.85rem; transition: 0.2s; padding: 6px; flex-shrink: 0; }
.cart-item-remove:hover { color: #e05555; }
.cart-drawer-footer { padding: 18px 20px; border-top: 1px solid var(--border-color); flex-shrink: 0; display: none; }
.cart-drawer-footer.has-items { display: block; }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.cart-total-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px; color: #777; }
.cart-total-value { font-size: 1rem; font-weight: 600; color: var(--gold); }
.cart-checkout-btn { width: 100%; padding: 14px; background: var(--gold); color: #000; border: none; border-radius: 8px; font-weight: 700; font-size: 0.85rem; cursor: pointer; transition: 0.3s; font-family: 'Inter', sans-serif; letter-spacing: 1px; text-transform: uppercase; }
.cart-checkout-btn:hover { background: var(--gold-bright); transform: translateY(-1px); }

/* ============ FOOTER ============ */
.footer-section { background: transparent; border-top: 1px solid var(--border-color); padding: 4rem 6% 2rem; }
.footer-container { display: grid; grid-template-columns: 1fr; gap: 40px; max-width: 1400px; margin: 0 auto; }
@media (min-width: 600px) { .footer-container { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .footer-container { grid-template-columns: 2fr 1fr 1fr; } }
.footer-title { font-family: 'Cormorant Garamond', serif; color: var(--gold); font-size: 1.1rem; margin-bottom: 1.5rem; text-transform: uppercase; letter-spacing: 2px; }
.footer-desc { font-size: 0.75rem; line-height: 1.8; color: #777; max-width: 300px; }
.footer-links { list-style: none; color: #888; font-size: 0.8rem; }
.footer-links li { margin-bottom: 12px; transition: 0.3s; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.footer-links li:hover { color: var(--gold); }
.footer-links i { color: var(--gold); font-size: 0.9rem; width: 18px; text-align: center; flex-shrink: 0; }
.social-links { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.social-icon { width: 35px; height: 35px; border-radius: 50%; border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; color: #888; transition: 0.4s; text-decoration: none; font-size: 0.9rem; }
.social-icon:hover { border-color: var(--gold); color: var(--gold); background: rgba(198,168,123,0.05); transform: translateY(-3px); }
.footer-bottom { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 10px; font-size: 0.65rem; color: #555; letter-spacing: 2px; text-align: center; }
@media (min-width: 600px) { .footer-bottom { flex-direction: row; justify-content: space-between; text-align: left; } }

/* ============ SCROLL TO TOP ============ */
.scroll-top-btn { position: fixed; bottom: 90px; right: 24px; width: 44px; height: 44px; border-radius: 50%; background: var(--card-bg); border: 1px solid var(--border-color); color: var(--gold); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1500; opacity: 0; transform: translateY(16px); pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,0.3); font-size: 0.9rem; transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s, background 0.3s; }
.scroll-top-btn.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
.scroll-top-btn:hover { border-color: var(--gold); background: rgba(198,168,123,0.1); }
@media (max-width: 768px) { .scroll-top-btn { bottom: 86px; right: 76px; } }

/* ============ MOBILE PROFILE DRAWER ============ */
.mobile-profile-drawer { position: fixed; inset: 0; z-index: 3500; display: none; align-items: flex-end; justify-content: center; background: rgba(0,0,0,0.85); opacity: 0; }
.mobile-profile-drawer.active { display: flex; opacity: 1; }
.mobile-profile-sheet { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px 20px 0 0; width: 100%; padding: 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.mobile-profile-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.mobile-profile-avatar { width: 52px; height: 52px; border-radius: 50%; overflow: hidden; border: 1px solid rgba(198,168,123,0.4); flex-shrink: 0; }
.mobile-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.mobile-profile-name { font-size: 1rem; font-weight: 500; }
.mobile-profile-plan { font-size: 0.7rem; color: var(--gold); margin-top: 2px; }
.mobile-profile-actions { display: flex; flex-direction: column; gap: 12px; }
.mobile-profile-action-btn { width: 100%; padding: 14px; border-radius: 10px; font-family: 'Inter', sans-serif; font-size: 0.85rem; cursor: pointer; transition: 0.2s; border: none; }
.mobile-profile-action-btn.logout { background: rgba(255,80,80,0.1); color: #ff5050; border: 1px solid rgba(255,80,80,0.2); }
.mobile-profile-action-btn.cancel { background: var(--glass); color: #777; border: 1px solid var(--border-color); }
.mobile-profile-action-btn:active { opacity: 0.7; }

/* ============ BACK BUTTON ============ */
/* Reusable. Markup: <button class="back-btn" data-back aria-label="Go back"><i class="fas fa-arrow-left"></i></button>
   Add .has-label for an icon + text pill, .is-fixed to float it (top-left under the nav on desktop,
   bottom-left above the bottom nav on mobile). */
.back-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; min-width: 32px; padding: 0; border-radius: 50px; flex-shrink: 0; cursor: pointer; text-decoration: none; white-space: nowrap;
    background: var(--glass); border: 1px solid var(--border-color); color: var(--nav-link-color);
    font-family: 'Inter', sans-serif; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 2px;
    transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, transform 0.2s ease; }
.back-btn i { color: var(--gold); font-size: 0.7rem; transition: transform 0.3s var(--ease-out); }
.back-btn:hover { color: var(--gold); border-color: rgba(198,168,123,0.4); }
.back-btn:hover i { transform: translateX(-2px); }
.back-btn:active { transform: scale(0.94); }
.back-btn:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }
.back-btn.has-label { padding: 0 14px; }
.back-btn.is-fixed { position: fixed; top: 68px; left: 66px; z-index: 900; }
@media (max-width: 768px) {
    .back-btn.is-fixed { top: auto; left: 16px; bottom: 90px; width: 44px; height: 44px; z-index: 1500; background: var(--card-bg); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
    .back-btn.is-fixed.has-label { width: auto; }
}

/* ============ RESPONSIVE OVERRIDES ============ */
@media (max-width: 768px) {
    body { padding-left: 0; padding-bottom: 70px; }
    .sidebar { display: none; }
    nav { display: none; }
    .mobile-top-bar { display: flex; }
    .mobile-bottom-nav { display: block; }
    .mobile-search-bar { display: flex; }
    .floating-cart { display: flex; }
    #cursor-glow { display: none; }
    .scroll-progress { left: 0; }
}
@media (min-width: 769px) {
    .mobile-top-bar { display: none !important; }
    .mobile-bottom-nav { display: none !important; }
    .mobile-search-bar { display: none !important; }
    .floating-cart { display: none !important; }
}
@media (max-width: 768px) { .modal-overlay { align-items: flex-end; } }

/* ============ GLOBAL OVERFLOW GUARD (MOBILE) ============ */
@media (max-width: 768px) {
    #cursor-glow { display: none !important; }
    .dust { display: none !important; }
    .scroll-progress { left: 0 !important; }
    .toast-container { bottom: 90px; }
}

/* ============ DUST (fixed layer so particles are visible) ============ */
.dust { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.dust span { bottom: -10px; }
@keyframes floatDust { from { transform: translateY(0); opacity: 0; } 20% { opacity: .35; } to { transform: translateY(-110vh); opacity: 0; } }

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