/* ============================================================
   CapeTown5 — Design System
   Ink & Gold · Mobile-first · App-shell
   ============================================================ */

/* ── Tokens ───────────────────────────────────────────────── */
:root {
    /* Surfaces */
    --bg:            #FFFFFF;
    --bg-soft:       #F7F7F9;
    --surface:       #FFFFFF;
    --surface-2:     #F2F2F5;
    --overlay:       rgba(14, 14, 17, .55);

    /* Text */
    --ink:           #0E0E11;
    --ink-2:         #3A3A44;
    --muted:         #71717F;
    --faint:         #A1A1AE;
    --on-ink:        #FFFFFF;

    /* Lines */
    --line:          #E8E8EE;
    --line-strong:   #D7D7E0;

    /* Brand */
    --gold:          #E7B94D;
    --on-gold:       #0E0E11;   /* accent ke upar text — Brand.php se override hota hai */
    --gold-deep:     #A97A15;
    --gold-soft:     #FDF5E2;
    --money:         #0F9D75;
    --money-soft:    #E6F7F1;
    --danger:        #DC3A3A;
    --danger-soft:   #FDECEC;
    --info:          #2C6FE8;
    --info-soft:     #EAF1FE;
    --warn:          #C67A00;
    --warn-soft:     #FFF6E5;

    /* Radii */
    --r-xs: 6px;
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-full: 999px;

    /* Shadows */
    --sh-1: 0 1px 2px rgba(14,14,17,.05);
    --sh-2: 0 4px 14px rgba(14,14,17,.07);
    --sh-3: 0 12px 32px rgba(14,14,17,.11);
    --sh-gold: 0 8px 24px rgba(231,185,77,.35);

    /* Motion */
    --ease: cubic-bezier(.22,.68,.28,1);
    --fast: .16s var(--ease);
    --base: .26s var(--ease);
    --slow: .42s var(--ease);

    /* Layout */
    --nav-h: 60px;
    --bottom-h: 64px;
    --max-w: 1280px;
    --gutter: 16px;

    /* Fonts */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Outfit', var(--font);
    --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
}

[data-theme="dark"] {
    --bg:            #0B0B0D;
    --bg-soft:       #101013;
    --surface:       #141419;
    --surface-2:     #1C1C23;
    --overlay:       rgba(0,0,0,.7);

    --ink:           #F4F4F7;
    --ink-2:         #D2D2DC;
    --muted:         #9494A2;
    --faint:         #6C6C7A;
    --on-ink:        #0E0E11;

    --line:          #26262E;
    --line-strong:   #33333D;

    --gold:          #E7B94D;
    --on-gold:       #0E0E11;
    --gold-deep:     #E7B94D;
    --gold-soft:     #2A2314;
    --money:         #35D3A3;
    --money-soft:    #10281F;
    --danger:        #FF6B6B;
    --danger-soft:   #2A1414;
    --info:          #6FA5FF;
    --info-soft:     #131E30;
    --warn:          #E7B94D;
    --warn-soft:     #2A2314;

    --sh-1: 0 1px 2px rgba(0,0,0,.4);
    --sh-2: 0 4px 14px rgba(0,0,0,.5);
    --sh-3: 0 12px 32px rgba(0,0,0,.6);
    color-scheme: dark;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 12px);
    overflow-x: clip;
    overscroll-behavior-y: none;
}

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
    max-width: 100%;
    padding-bottom: env(safe-area-inset-bottom);
    transition: background var(--base), color var(--base);
}

body.has-bottom-nav { padding-bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }
body.no-scroll { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; width: 100%; }

h1,h2,h3,h4,h5 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
h1 { font-size: clamp(26px, 5vw, 40px); }
h2 { font-size: clamp(20px, 3.6vw, 28px); }
h3 { font-size: clamp(17px, 2.6vw, 21px); }

::selection { background: var(--gold); color: var(--on-gold); }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Layout ───────────────────────────────────────────────── */
.wrap { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }
.wrap-sm { max-width: 720px; }
.wrap-md { max-width: 960px; }

.section { padding-block: clamp(28px, 5vw, 56px); }
.section-tight { padding-block: clamp(20px, 3vw, 32px); }

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.center { display: flex; align-items: center; justify-content: center; }
.wrap-flex { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* Flex/grid children default to min-width:auto (= min-content), which lets a
   long word, a wide image or a chip row push the page wider than the screen.
   Every layout row here is meant to shrink instead. */
.row > *, .between > *, .center > *, .stack > *, .grid > *,
.wrap > *, main > * { min-width: 0; }
.row, .between, .center, .stack, .grid { min-width: 0; }

/* Page-level grid/flex layouts — inke column bhi content ke hisaab se
   phail sakte hain, isliye har ek ko explicitly shrink karne diya hai. */
.shop-layout > *, .pd-layout > *, .cart-layout > *, .acct-layout > *,
.footer-grid > *, .stat-grid > *, .spec-grid > *, .share-grid > *,
.rs-actions > *, .rating-summary > * { min-width: 0; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .g-4 { grid-template-columns: repeat(2, 1fr); } .g-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .g-4, .g-3, .g-2 { grid-template-columns: repeat(2, 1fr); } }

.hide-mobile { display: initial; }
.only-mobile { display: none; }
@media (max-width: 860px) {
    .hide-mobile { display: none !important; }
    .only-mobile { display: initial; }
}

/* Text utils */
.t-center { text-align: center; }
.t-right  { text-align: right; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.gold  { color: var(--gold-deep); }
.money { color: var(--money); }
.danger{ color: var(--danger); }
.xs { font-size: 11px; } .sm { font-size: 13px; } .lg { font-size: 17px; } .xl { font-size: 20px; }
.bold { font-weight: 600; } .bolder { font-weight: 700; }
.display { font-family: var(--font-display); }
.upper { text-transform: uppercase; letter-spacing: .06em; }
.nowrap { white-space: nowrap; }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.divider { height: 1px; background: var(--line); border: 0; }
.spacer { height: 24px; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    --btn-bg: var(--ink);
    --btn-fg: var(--on-ink);
    --btn-bd: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--r-full);
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1.5px solid var(--btn-bd);
    cursor: pointer;
    white-space: nowrap;
    transition: transform var(--fast), box-shadow var(--fast), background var(--fast), opacity var(--fast);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.btn:hover  { transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(0) scale(.985); box-shadow: none; }
.btn:disabled, .btn.is-loading { opacity: .55; pointer-events: none; }

.btn-gold    { --btn-bg: var(--gold); --btn-fg: var(--on-gold); }
.btn-gold:hover { box-shadow: var(--sh-gold); }
.btn-money   { --btn-bg: var(--money); --btn-fg: #fff; }
.btn-danger  { --btn-bg: var(--danger); --btn-fg: #fff; }
.btn-ghost   { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line-strong); }
.btn-ghost:hover { --btn-bg: var(--surface-2); }
.btn-soft    { --btn-bg: var(--surface-2); --btn-fg: var(--ink); }
.btn-plain   { --btn-bg: transparent; --btn-fg: var(--ink); padding-inline: 8px; }
.btn-plain:hover { box-shadow: none; text-decoration: underline; }

.btn-sm  { padding: 8px 14px; font-size: 13px; }
.btn-xs  { padding: 6px 11px; font-size: 12px; }
.btn-lg  { padding: 15px 26px; font-size: 15px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 10px; width: 40px; height: 40px; border-radius: var(--r-full); }
.btn-round { border-radius: var(--r-full); }

.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
    content: ''; position: absolute; width: 16px; height: 16px;
    border: 2px solid currentColor; border-top-color: transparent;
    border-radius: 50%; animation: spin .6s linear infinite;
    color: var(--btn-fg);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Chips & badges ───────────────────────────────────────── */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; font-size: 12.5px; font-weight: 500;
    border-radius: var(--r-full);
    background: var(--surface-2); color: var(--ink-2);
    border: 1px solid transparent;
    transition: all var(--fast); cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--line-strong); }
.chip.active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chip-gold { background: var(--gold-soft); color: var(--gold-deep); }
.chip-money{ background: var(--money-soft); color: var(--money); }

.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; font-size: 11px; font-weight: 600;
    border-radius: var(--r-xs); letter-spacing: .02em;
    background: var(--surface-2); color: var(--ink-2);
}
.badge-gold  { background: var(--gold-soft);  color: var(--gold-deep); }
.badge-money { background: var(--money-soft); color: var(--money); }
.badge-danger{ background: var(--danger-soft);color: var(--danger); }
.badge-info  { background: var(--info-soft);  color: var(--info); }
.badge-warn  { background: var(--warn-soft);  color: var(--warn); }
.badge-ink   { background: var(--ink); color: var(--on-ink); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    overflow: hidden;
}
.card-pad { padding: 16px; }
.card-hover { transition: border-color var(--base), transform var(--base), box-shadow var(--base); }
.card-hover:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--sh-2); }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    padding: 20px;
}

/* ── Forms ────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.label {
    display: block; margin-bottom: 7px;
    font-size: 13px; font-weight: 500; color: var(--ink-2);
}
.label .req { color: var(--danger); }

.input, .select, .textarea {
    width: 100%;
    padding: 13px 15px;
    font-size: 15px;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    transition: border-color var(--fast), box-shadow var(--fast), background var(--fast);
    appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--ink);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 9%, transparent);
}
.input.error, .select.error, .textarea.error { border-color: var(--danger); }
.textarea { min-height: 110px; resize: vertical; line-height: 1.6; }

.select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2371717F' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-left: 42px; }
.input-group .ig-icon {
    position: absolute; left: 14px; color: var(--faint);
    display: flex; pointer-events: none;
}
.input-group .ig-suffix { position: absolute; right: 12px; }

.help { margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.err  { margin-top: 6px; font-size: 12.5px; color: var(--danger); }

.check {
    display: flex; align-items: flex-start; gap: 10px;
    cursor: pointer; font-size: 14px; user-select: none;
}
.check input[type=checkbox], .check input[type=radio] {
    width: 19px; height: 19px; flex: none; margin-top: 1px;
    accent-color: var(--ink); cursor: pointer;
}

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
    position: absolute; inset: 0; cursor: pointer;
    background: var(--line-strong); border-radius: var(--r-full);
    transition: background var(--base);
}
.switch span::before {
    content: ''; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
    background: #fff; border-radius: 50%; transition: transform var(--base);
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.switch input:checked + span { background: var(--money); }
.switch input:checked + span::before { transform: translateX(20px); }

/* Segmented control */
.segment {
    display: inline-flex; padding: 3px; gap: 2px;
    background: var(--surface-2); border-radius: var(--r-full);
}
.segment button {
    padding: 8px 16px; font-size: 13px; font-weight: 500;
    border-radius: var(--r-full); color: var(--muted);
    transition: all var(--fast);
}
.segment button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); font-weight: 600; }

/* ── Header ───────────────────────────────────────────────── */
.header {
    position: sticky; top: 0; z-index: 100;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--line);
    /* Own compositing layer + transform-only animation — repainting a blurred
       bar on every scroll frame is what made it shiver. */
    transform: translate3d(0, 0, 0);
    will-change: transform;
    backface-visibility: hidden;
    transition: transform .22s var(--ease), box-shadow var(--base);
}
.header.hidden { transform: translate3d(0, -100%, 0); }
/* Mid-gesture the bar must not chase the finger — only settle after it stops. */
.header.no-anim { transition: none; }
.header.scrolled { box-shadow: var(--sh-1); }

.header-inner {
    height: var(--nav-h);
    display: flex; align-items: center; gap: 14px;
}

.logo {
    display: flex; align-items: center; gap: 9px;
    font-family: var(--font-display);
    font-size: 20px; font-weight: 700; letter-spacing: -.03em;
    flex: none;
}
.logo img { height: 30px; width: auto; }
.logo .mark {
    width: 32px; height: 32px; border-radius: 9px;
    background: var(--ink); color: var(--gold);
    display: grid; place-items: center;
    font-size: 15px; font-weight: 700; letter-spacing: 0;
}
.logo .five { color: var(--gold-deep); }

.nav-links { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.nav-links a {
    padding: 9px 13px; font-size: 14px; font-weight: 500;
    color: var(--ink-2); border-radius: var(--r-sm);
    transition: all var(--fast); position: relative;
}
.nav-links a:hover { background: var(--surface-2); color: var(--ink); }
.nav-links a.active { color: var(--ink); font-weight: 600; }
.nav-links a.active::after {
    content: ''; position: absolute; left: 13px; right: 13px; bottom: 3px;
    height: 2px; background: var(--gold); border-radius: 2px;
}

.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }

.icon-btn {
    position: relative;
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: var(--r-full);
    color: var(--ink-2);
    transition: background var(--fast), color var(--fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .count {
    position: absolute; top: 2px; right: 2px;
    min-width: 17px; height: 17px; padding: 0 4px;
    display: grid; place-items: center;
    font-size: 10px; font-weight: 700; line-height: 1;
    background: var(--gold); color: var(--on-gold);
    border-radius: var(--r-full);
    border: 2px solid var(--bg);
}
.icon-btn .count:empty, .icon-btn .count[data-count="0"] { display: none; }

/* Search bar in header */
.header-search {
    flex: 1; max-width: 460px; position: relative;
}
.header-search input {
    width: 100%; height: 40px;
    padding: 0 40px 0 40px;
    font-size: 14px;
    background: var(--surface-2);
    border: 1.5px solid transparent;
    border-radius: var(--r-full);
    transition: all var(--fast);
}
.header-search input:focus {
    outline: none; background: var(--surface);
    border-color: var(--line-strong); box-shadow: var(--sh-2);
}
.header-search .s-icon { position: absolute; left: 14px; top: 11px; color: var(--faint); }

/* Search suggestions dropdown */
.suggest {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--r-md); box-shadow: var(--sh-3);
    overflow: hidden; max-height: 70vh; overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: all var(--fast); z-index: 120;
}
.suggest.open { opacity: 1; visibility: visible; transform: translateY(0); }
.suggest-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; transition: background var(--fast);
}
.suggest-item:hover, .suggest-item.hl { background: var(--surface-2); }
.suggest-item img { width: 40px; height: 50px; object-fit: cover; border-radius: var(--r-xs); flex: none; }
.suggest-head { padding: 10px 14px 6px; font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }

/* ── Bottom nav (mobile app shell) ────────────────────────── */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
    display: none;
    /* Always parked at the bottom — never hidden, never animated on scroll. */
    transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    width: 100%; max-width: 100vw;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 860px) { .bottom-nav { display: block; } }

.bottom-nav ul { display: flex; height: var(--bottom-h); align-items: center; }
.bottom-nav li { flex: 1; }
.bottom-nav a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 8px 0; font-size: 10.5px; font-weight: 500;
    color: var(--muted); position: relative;
    transition: color var(--fast);
}
.bottom-nav a.active { color: var(--ink); font-weight: 600; }
.bottom-nav a.active svg { stroke-width: 2.3; }
.bottom-nav a .count {
    position: absolute; top: 3px; left: 50%; margin-left: 5px;
    min-width: 16px; height: 16px; padding: 0 4px;
    display: grid; place-items: center;
    font-size: 9.5px; font-weight: 700;
    background: var(--gold); color: var(--on-gold); border-radius: var(--r-full);
}
.bottom-nav .fab-item a {
    margin-top: -22px;
}
.bottom-nav .fab {
    width: 46px; height: 46px; border-radius: 15px;
    background: linear-gradient(135deg, var(--gold), #D89F2A);
    color: var(--on-gold); display: grid; place-items: center;
    box-shadow: var(--sh-gold);
    transition: transform var(--fast);
}
.bottom-nav .fab-item a:active .fab { transform: scale(.92); }

/* ── Drawer / sheets ──────────────────────────────────────── */
.backdrop {
    position: fixed; inset: 0; z-index: 200;
    background: var(--overlay);
    backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden; transition: all var(--base);
}
.backdrop.open { opacity: 1; visibility: visible; }

.drawer {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 201;
    width: min(320px, 84vw);
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform var(--base);
    display: flex; flex-direction: column;
    overflow-y: auto;
}
.drawer.right { left: auto; right: 0; transform: translateX(100%); width: min(420px, 92vw); }
.drawer.open { transform: translateX(0); }

.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 201;
    background: var(--bg);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    transform: translateY(100%);
    transition: transform var(--base);
    max-height: 88vh; display: flex; flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -8px 40px rgba(0,0,0,.2);
}
.sheet.open { transform: translateY(0); }
.sheet-handle {
    width: 40px; height: 4px; border-radius: 4px;
    background: var(--line-strong); margin: 10px auto 4px; flex: none;
}
.sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 18px 14px; border-bottom: 1px solid var(--line); flex: none;
}
.sheet-body { padding: 18px; overflow-y: auto; }
.sheet-foot { padding: 14px 18px; border-top: 1px solid var(--line); flex: none; background: var(--surface); }

@media (min-width: 861px) {
    .sheet {
        left: 50%; right: auto; bottom: auto; top: 50%;
        width: min(520px, 92vw);
        transform: translate(-50%, -46%) scale(.97);
        border-radius: var(--r-lg);
        opacity: 0; visibility: hidden;
    }
    .sheet.open { transform: translate(-50%, -50%) scale(1); opacity: 1; visibility: visible; }
    .sheet-handle { display: none; }
}

/* ── Product card ─────────────────────────────────────────── */
.p-card { position: relative; display: block; }
.p-media {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface-2);
}
.p-media img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform var(--slow), opacity var(--base);
}
.p-card:hover .p-media img { transform: scale(1.045); }
.p-media .hover-img {
    position: absolute; inset: 0; opacity: 0;
}
.p-card:hover .hover-img { opacity: 1; }

.p-tags { position: absolute; top: 9px; left: 9px; display: flex; flex-direction: column; gap: 5px; z-index: 2; }
.p-tag {
    padding: 4px 8px; font-size: 10.5px; font-weight: 700;
    border-radius: var(--r-xs); letter-spacing: .03em;
    background: var(--ink); color: var(--on-ink);
    text-transform: uppercase;
}
.p-tag.off  { background: var(--danger); color: #fff; }
.p-tag.new  { background: var(--gold); color: var(--on-gold); }
.p-tag.hot  { background: #FF5A1F; color: #fff; }

.p-wish {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(8px);
    color: var(--ink-2);
    transition: all var(--fast);
}
.p-wish:hover { transform: scale(1.1); }
.p-wish.active { color: var(--danger); }
.p-wish.active svg { fill: currentColor; }

.p-earn {
    position: absolute; bottom: 8px; left: 8px; right: 8px; z-index: 2;
    padding: 6px 10px; border-radius: var(--r-sm);
    background: color-mix(in srgb, var(--money) 92%, transparent);
    color: #fff; font-size: 11.5px; font-weight: 600;
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    opacity: 0; transform: translateY(6px);
    transition: all var(--base);
}
.p-card:hover .p-earn, .touch .p-earn { opacity: 1; transform: translateY(0); }

.p-info { padding: 10px 2px 4px; }
.p-brand { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
.p-name  { font-size: 13.5px; font-weight: 500; margin: 2px 0 6px; line-height: 1.35; }
.p-price { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.p-price .now  { font-size: 15px; font-weight: 700; font-family: var(--font-display); }
.p-price .was  { font-size: 12.5px; color: var(--faint); text-decoration: line-through; }
.p-price .off  { font-size: 12px; font-weight: 700; color: var(--money); }

.p-rating {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 6px; margin-top: 6px;
    font-size: 11.5px; font-weight: 600;
    background: var(--money-soft); color: var(--money);
    border-radius: var(--r-xs);
}
.p-sizes { display: flex; gap: 4px; margin-top: 7px; flex-wrap: wrap; }
.p-sizes span {
    font-size: 10.5px; padding: 2px 6px; border-radius: 4px;
    border: 1px solid var(--line); color: var(--muted);
}

.p-oos {
    position: absolute; inset: 0; z-index: 3;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    display: grid; place-items: center;
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
    color: var(--ink);
}

/* Product grid */
.p-grid { display: grid; gap: 18px 14px; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
@media (max-width: 480px) { .p-grid { gap: 16px 10px; grid-template-columns: repeat(2, 1fr); } }

/* Horizontal scroll rail */
.rail {
    display: flex; gap: 14px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; -ms-overflow-style: none;
    padding-bottom: 4px;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: 0 0 auto; width: 165px; scroll-snap-align: start; }
@media (min-width: 861px) { .rail > * { width: 200px; } }

.rail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.rail-head h2 { margin: 0; }
.rail-head .sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }

/* ── Skeletons ────────────────────────────────────────────── */
.skel {
    background: linear-gradient(90deg, var(--surface-2) 25%, color-mix(in srgb, var(--surface-2) 55%, var(--bg)) 37%, var(--surface-2) 63%);
    background-size: 400% 100%;
    animation: shimmer 1.3s ease-in-out infinite;
    border-radius: var(--r-sm);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.skel-card { aspect-ratio: 3/4; border-radius: var(--r-md); }
.skel-line { height: 12px; margin-top: 8px; }
.skel-line.w60 { width: 60%; } .skel-line.w40 { width: 40%; }

/* ── Alerts / toasts ──────────────────────────────────────── */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 13px 15px; border-radius: var(--r-sm);
    font-size: 14px; border: 1px solid transparent;
}
.alert-success { background: var(--money-soft);  color: var(--money);  border-color: color-mix(in srgb, var(--money) 25%, transparent); }
.alert-error   { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.alert-info    { background: var(--info-soft);   color: var(--info);   border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.alert-warning { background: var(--warn-soft);   color: var(--warn);   border-color: color-mix(in srgb, var(--warn) 25%, transparent); }

.toast-host {
    position: fixed; z-index: 300;
    bottom: calc(var(--bottom-h) + 16px); left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; gap: 8px; align-items: center;
    pointer-events: none; width: min(420px, calc(100vw - 32px));
}
@media (min-width: 861px) { .toast-host { bottom: 24px; left: auto; right: 24px; transform: none; align-items: flex-end; } }

.toast {
    display: flex; align-items: center; gap: 10px;
    padding: 13px 18px; border-radius: var(--r-full);
    background: var(--ink); color: var(--on-ink);
    font-size: 14px; font-weight: 500;
    box-shadow: var(--sh-3);
    animation: toastIn .3s var(--ease);
    pointer-events: auto; max-width: 100%;
}
.toast.out { animation: toastOut .25s var(--ease) forwards; }
.toast.success { background: var(--money); color: #fff; }
.toast.error   { background: var(--danger); color: #fff; }
@keyframes toastIn  { from { opacity: 0; transform: translateY(16px) scale(.94); } }
@keyframes toastOut { to   { opacity: 0; transform: translateY(10px) scale(.96); } }

/* ── Empty state ──────────────────────────────────────────── */
.empty { text-align: center; padding: 56px 20px; }
.empty .ico {
    width: 76px; height: 76px; margin: 0 auto 18px;
    border-radius: 50%; display: grid; place-items: center;
    background: var(--surface-2); color: var(--faint);
}
.empty h3 { margin-bottom: 6px; }
.empty p { color: var(--muted); margin-bottom: 20px; font-size: 14px; }

/* ── Breadcrumb ───────────────────────────────────────────── */
.crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; padding-block: 14px; }
.crumb a:hover { color: var(--ink); }
.crumb .sep { color: var(--faint); }

/* ── Pagination ───────────────────────────────────────────── */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 32px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 38px; height: 38px; padding: 0 12px;
    display: grid; place-items: center;
    font-size: 13.5px; font-weight: 500;
    border: 1px solid var(--line); border-radius: var(--r-sm);
    transition: all var(--fast);
}
.pager a:hover { border-color: var(--ink); }
.pager .active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 600; }
.pager .gap { border: 0; }

/* ── Footer ───────────────────────────────────────────────── */
.footer {
    background: var(--bg-soft);
    border-top: 1px solid var(--line);
    margin-top: 48px;
    padding-top: 44px;
}
.footer-grid {
    display: grid; gap: 32px;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    padding-bottom: 36px;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.footer h4 {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .08em; color: var(--faint); margin-bottom: 14px;
    font-family: var(--font);
}
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links a { font-size: 14px; color: var(--ink-2); transition: color var(--fast); }
.footer-links a:hover { color: var(--gold-deep); }

.socials { display: flex; gap: 8px; margin-top: 16px; }
.socials a {
    width: 38px; height: 38px; border-radius: var(--r-full);
    display: grid; place-items: center;
    border: 1px solid var(--line); color: var(--ink-2);
    transition: all var(--fast);
}
.socials a:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); transform: translateY(-2px); }

.footer-bottom {
    border-top: 1px solid var(--line);
    padding-block: 18px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
    font-size: 12.5px; color: var(--muted);
}
.made-by {
    display: inline-flex; align-items: center; gap: 5px;
    font-weight: 500; transition: color var(--fast);
}
.made-by:hover { color: var(--gold-deep); }
.made-by .heart { color: var(--danger); animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 0%,100% { transform: scale(1); } 15% { transform: scale(1.22); } 30% { transform: scale(1); } 45% { transform: scale(1.15); } }

/* ── Misc helpers ─────────────────────────────────────────── */
.sticky-bar {
    position: sticky; bottom: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 12px var(--gutter);
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
body.has-bottom-nav .sticky-bar { bottom: calc(var(--bottom-h) + env(safe-area-inset-bottom)); }

.ratio { position: relative; overflow: hidden; }
.ratio > img, .ratio > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ── Image loading skeleton ───────────────────────────────── */
/*
 * Shimmer sirf tab chalta hai jab box ke andar koi image abhi load ho rahi ho.
 * `.is-loading` app.js lagata hai aur load hote hi hata deta hai — isliye
 * bina image wale boxes (jaise CTA cards) kabhi nahi chamakte.
 */
.ratio, .p-media { background-color: var(--surface-2); }

.is-loading {
    background-image: linear-gradient(
        100deg,
        transparent 20%,
        color-mix(in srgb, var(--gold) 14%, transparent) 42%,
        transparent 64%
    );
    background-size: 220% 100%;
    animation: img-shimmer 1.4s var(--ease) infinite;
}
@keyframes img-shimmer {
    from { background-position: 130% 0; }
    to   { background-position: -30% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .is-loading { animation: none; background-image: none; }
}

.scroll-x {
    display: flex; gap: 8px; padding-bottom: 2px;
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    /* Flex/grid items get min-width:auto = min-content. A row of chips then
       forces the whole page wider than the screen. Pin it to zero. */
    min-width: 0; max-width: 100%;
}
.scroll-x::-webkit-scrollbar { display: none; }
.scroll-x > * { flex: none; }

.fade-in { animation: fadeIn .4s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

.pulse-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--money); position: relative;
}
.pulse-dot::after {
    content: ''; position: absolute; inset: 0; border-radius: 50%;
    background: var(--money); animation: pulseRing 1.8s ease-out infinite;
}
@keyframes pulseRing { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3); opacity: 0; } }

.hr-text {
    display: flex; align-items: center; gap: 14px;
    color: var(--faint); font-size: 12.5px; margin-block: 20px;
}
.hr-text::before, .hr-text::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Progress bar */
.progress { height: 6px; background: var(--surface-2); border-radius: var(--r-full); overflow: hidden; }
.progress > i {
    display: block; height: 100%; border-radius: var(--r-full);
    background: linear-gradient(90deg, var(--gold), #D89F2A);
    transition: width .6s var(--ease);
}

/* Sticky page title bar for inner pages */
.page-head {
    display: flex; align-items: center; gap: 12px;
    padding-block: 18px 14px;
}
.page-head h1 { font-size: clamp(21px, 4vw, 28px); }
.back-btn {
    width: 38px; height: 38px; border-radius: var(--r-full);
    display: grid; place-items: center; flex: none;
    border: 1px solid var(--line); transition: all var(--fast);
}
.back-btn:hover { background: var(--surface-2); }

/* Utility spacing */
.mt-4{margin-top:4px}.mt-8{margin-top:8px}.mt-12{margin-top:12px}.mt-16{margin-top:16px}.mt-20{margin-top:20px}.mt-24{margin-top:24px}.mt-32{margin-top:32px}
.mb-4{margin-bottom:4px}.mb-8{margin-bottom:8px}.mb-12{margin-bottom:12px}.mb-16{margin-bottom:16px}.mb-20{margin-bottom:20px}.mb-24{margin-bottom:24px}
.p-0{padding:0}.p-12{padding:12px}.p-16{padding:16px}.p-20{padding:20px}
.w-100{width:100%}
.rel{position:relative}
.hidden{display:none !important}
