/* Scroll-Craft & Impeccable Polish for /menu */
::selection { background: rgba(27, 86, 148, 0.16); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.price-pill, .flash-cd, .group-count, .stat-box b { font-variant-numeric: tabular-nums; }

/* Hairline document progress bar */
#sc-readbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 60;
    pointer-events: none;
    background: linear-gradient(90deg, var(--accent) 0%, #38bdf8 55%, var(--butter) 100%);
    transform-origin: 0 50%;
    transform: scaleX(var(--sc-doc, 0));
    will-change: transform;
}

/* Dimensional Hero Layers + Pointer Spotlight */
.hero { position: relative; }
.hero-left {
    transform: translate3d(0, calc((var(--sc-p, 0) - 0.18) * 14px), 0);
    will-change: transform;
}
.hero-stage {
    position: relative;
    border-color: rgba(16, 56, 96, 0.4);
    box-shadow: 0 28px 56px -28px rgba(10, 34, 62, 0.58), 0 4px 12px -4px rgba(10, 34, 62, 0.25);
    transform: translate3d(0, calc((var(--sc-p, 0) - 0.18) * -22px), 0);
    will-change: transform;
}
.hero-stage-glow {
    position: absolute;
    inset: -20%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(380px circle at calc(var(--sc-mx, 0.65) * 100%) calc(var(--sc-my, 0.42) * 100%), rgba(255, 227, 110, 0.24), transparent 65%),
        radial-gradient(460px circle at 18% 12%, rgba(96, 165, 250, 0.22), transparent 60%);
    transform: translate3d(0, calc((var(--sc-p, 0) - 0.2) * -32px), 0);
    transition: opacity .35s var(--ease);
}

/* Refined Hero Orbs: soft layered depth instead of hard offset borders */
.hero-orb {
    border: 1.5px solid rgba(22, 15, 10, 0.16);
    box-shadow: 0 18px 30px -18px rgba(8, 24, 44, 0.68), 0 3px 0 rgba(22, 15, 10, 0.14);
    transition: transform .35s var(--spring), box-shadow .3s var(--ease), border-color .25s ease;
}
.hero-orb:nth-child(2) {
    transform: translate3d(0, calc(-10px + (var(--sc-p, 0) * -10px)), 0);
}
.hero-orb:hover {
    transform: translate3d(0, -6px, 0);
    box-shadow: 0 24px 36px -18px rgba(8, 24, 44, 0.78), 0 4px 0 rgba(22, 15, 10, 0.16);
}
.hero-orb:nth-child(2):hover {
    transform: translate3d(0, calc(-15px + (var(--sc-p, 0) * -10px)), 0);
}
.hero-orb-cta { display: none; }

/* Single Flash Sale Spotlight fills the hero stage cleanly */
.hero-badges.is-flash-only.cnt-1 {
    display: flex;
    justify-content: center;
    padding: 16px 4px 12px;
}
.hero-badges.is-flash-only.cnt-1 .hero-orb {
    width: min(100%, 410px);
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    text-align: left;
    padding: 12px;
    border-radius: 22px;
    background: linear-gradient(135deg, #FFFFFF 0%, #FFFBEB 100%);
    border-color: rgba(245, 158, 11, 0.55);
}
.hero-badges.is-flash-only.cnt-1 .hero-orb img {
    width: 136px;
    height: 118px;
    aspect-ratio: auto;
    border-radius: 15px;
    border: 1px solid rgba(22, 15, 10, 0.1);
}
.hero-badges.is-flash-only.cnt-1 .hero-orb-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}
.hero-badges.is-flash-only.cnt-1 .hero-orb-name {
    margin-top: 0;
    font-family: var(--f-display);
    font-size: 17px;
    line-height: 1.2;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.hero-badges.is-flash-only.cnt-1 .hero-orb-price {
    margin-top: 2px;
    font-size: 12.5px;
    padding: 4px 11px;
}
.hero-badges.is-flash-only.cnt-1 .hero-orb-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 800;
    color: var(--accent);
}
.hero-badges.is-flash-only.cnt-1 .hero-orb-flash {
    top: -10px;
    left: 16px;
    transform: none;
}

/* Scroll-reactive Ticker Ribbon */
.ticker-scroll-shift {
    transform: translate3d(calc((var(--sc-p, 0.5) - 0.5) * -180px), 0, 0);
    will-change: transform;
}
@keyframes scTickerMarquee {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}
.ticker-wrap .ticker-track {
    animation: scTickerMarquee 32s linear infinite !important;
}
.ticker-wrap .ticker:hover .ticker-track {
    animation-play-state: paused !important;
}

/* Best Seller Horizontal Scroll Progress Track */
.best-progress {
    height: 4px;
    width: min(220px, 100%);
    background: rgba(22, 15, 10, 0.09);
    border-radius: 99px;
    margin-top: 10px;
    overflow: hidden;
}
.best-progress span {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--accent), #0ea5e9);
    border-radius: 99px;
    transform-origin: 0 50%;
    transform: scaleX(0.28);
    transition: transform .18s ease-out;
}

/* Single Flash Sale card fills row cleanly */
.flash-row:has(.flash-card:only-child) {
    grid-template-columns: minmax(0, 1fr);
}

/* Sticky Menu Explorer Dock (Desktop) & Scroll-Spy Category Highlight */
.toolbar.is-sticky-ready {
    position: sticky;
    top: 76px;
    z-index: 25;
    background: rgba(255, 255, 255, 0.97);
    border: 1.5px solid rgba(22, 15, 10, 0.08);
    border-radius: 22px;
    padding: 12px 14px;
    margin-bottom: 22px;
    transition: box-shadow .22s ease, border-color .22s ease;
}
.toolbar.is-stuck {
    border-color: rgba(22, 15, 10, 0.14);
    box-shadow: 0 18px 34px -22px rgba(22, 15, 10, 0.35);
}
.cats .cat.is-spy:not(.on) {
    border-color: var(--accent);
    color: var(--accent);
    background: #EFF6FF;
}

/* Staggered Once-Only Scroll Reveal (already accessible if JS delayed) */
.sc-ready [data-sc-in] {
    opacity: 0;
    transform: translate3d(0, 18px, 0);
    transition: opacity .52s cubic-bezier(0.16, 1, 0.3, 1), transform .58s cubic-bezier(0.16, 1, 0.3, 1);
}
.sc-ready [data-sc-in].is-in {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Delivery Closing Finale Depth */
.deliv .blob {
    transform: translate3d(calc((var(--sc-p, 0.5) - 0.5) * -36px), calc((var(--sc-p, 0.5) - 0.5) * 24px), 0) scale(calc(0.92 + var(--sc-p, 0.5) * 0.16));
    will-change: transform;
}

/* Mobile-specific art direction */
@media (max-width: 640px) {
    .hero-left { transform: none; }
    .hero-stage { transform: none; min-height: 296px; }
    .hero-badges.is-flash-only.cnt-1 .hero-orb {
        grid-template-columns: 104px minmax(0, 1fr);
        gap: 11px;
        padding: 10px;
    }
    .hero-badges.is-flash-only.cnt-1 .hero-orb img {
        width: 104px;
        height: 96px;
    }
    .hero-badges.is-flash-only.cnt-1 .hero-orb-name { font-size: 15px; }
    .toolbar.is-sticky-ready { position: static; border-radius: 18px; padding: 10px 12px; }
    .best-progress { width: 140px; }
}

/* Reduced Motion Respect */
@media (prefers-reduced-motion: reduce) {
    #sc-readbar { display: none; }
    .hero-left, .hero-stage, .hero-stage-glow, .hero-orb, .hero-orb:nth-child(2), .ticker-scroll-shift, .deliv .blob {
        transform: none !important;
        transition: none !important;
    }
    .ticker-wrap .ticker-track { animation: none !important; }
    .sc-ready [data-sc-in] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
