/* =====================================================================
   ABIDIN SEUK — drink store
   Taro-milk background, brown-sugar ink, cups drawn in pure CSS.
   Every animation here is CSS. There is no JavaScript on the site.
   ===================================================================== */

:root {
    /* Colors taken from the ABIDIN SEUK logo */
    --brand-green: #1f5f33;
    --brand-lime: #a8d53b;
    --brand-orange: #ffb627;
    --brand-cream: #f5fbea;

    --bg: #eef4e2;          /* soft sage */
    --surface: #ffffff;
    --ink: #1f5f33;         /* logo green */
    --muted: #5b7562;
    --accent: #c06d00;      /* deep orange, readable on light backgrounds */
    --leaf: #5e9a1e;        /* focus rings and highlights */
    --straw: #ffb627;       /* logo orange */
    --pearl: #2b1710;       /* tapioca pearl */
    --line: #d3e0c0;
    --on-ink: #ffffff;
    --tint-base: #ffffff;
    --input-bg: #ffffff;
    --counter: var(--ink);
    --error-bg: #fbe4e1;
    --error-text: #8a1f12;
    --footer-bg: var(--brand-green);
    --footer-ink: var(--brand-cream);
    --footer-muted: #bcd79b;
    --shadow: 0 28px 50px -28px rgba(31, 95, 51, 0.55);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Latin letters use the first font; Khmer letters fall through to the Khmer font */
    --display: "Bagel Fat One", "Koulen", "Arial Rounded MT Bold", system-ui, sans-serif;
    --body: "Figtree", "Kantumruy Pro", system-ui, -apple-system, sans-serif;
}

/* Dark theme: deep tea-leaf green with cream text. Python sets data-theme on <html>. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0e2216;
    --surface: #163322;
    --ink: #f1f8e4;
    --muted: #a9c2a3;
    --accent: #ffb627;
    --leaf: #a8d53b;
    --line: #2a4a33;
    --on-ink: #0e2216;
    --tint-base: #163322;
    --input-bg: #102a1a;
    --counter: #2f6b3c;
    --error-bg: #4a211c;
    --error-text: #ffb8ab;
    --footer-bg: var(--brand-green);
    --shadow: 0 28px 50px -24px rgba(0, 0, 0, 0.75);
}

/* Smooth fade between pages, and cups that fly from the menu to the drink page */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.3s; }
::view-transition-group(*) { animation-duration: 0.5s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--body);
    font-size: 1rem;
    line-height: 1.55;
    overflow-x: clip;
    transition: background 0.3s, color 0.3s;
}

main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px 80px;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.1; }
h1, h2 { font-family: var(--display); font-weight: 400; }
a { color: inherit; }
small { font-weight: 400; color: var(--muted); }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--leaf); outline-offset: 3px; }

/* ---------- header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
}

.topbar {
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
}

.logo {
    font-family: var(--display);
    font-size: 1.55rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 9px;
}

.logo-badge {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    transition: rotate 0.6s var(--spring), scale 0.6s var(--spring);
}



.topbar nav { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; font-weight: 700; }
.topbar nav > a { text-decoration: none; position: relative; }

.topbar nav > a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -4px;
    height: 2px;
    background: currentColor;
    scale: 0 1;
    transition: scale 0.25s;
}

.topbar nav > a:hover::after { scale: 1 1; }

.count {
    display: inline-block;
    min-width: 24px;
    padding: 0 7px;
    border-radius: 12px;
    background: var(--ink);
    color: var(--on-ink);
    text-align: center;
    font-size: 0.85rem;
}

.count.bump { animation: bump 0.6s 0.3s var(--spring); }

/* ---------- cart icon button ---------- */
.topbar nav > a.cart-link::after,
.topbar nav > a.account-link::after { display: none; }   /* no underline on the icon */

.cart-link,
.account-link {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--line);
    color: var(--ink);
    transition: background 0.2s, color 0.2s, border-color 0.2s, scale 0.3s var(--spring);
}

.cart-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cart-link:hover,
.account-link:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--on-ink);
}

.cart-link:hover .cart-icon { animation: cart-roll 0.6s var(--spring); }
.cart-link:active,
.account-link:active { scale: 0.92; }

@keyframes cart-roll {
    30% { rotate: -12deg; translate: -2px 0; }
    65% { rotate: 8deg; translate: 2px 0; }
}

/* ---------- "fly to cart" ----------
   After "Add to cart", the next page shows the drink tossed from where the
   preview cup was (lower left) in an arc up to the cart icon, then it drops in.
   Two animations make the curve: the outer box moves sideways (fly-x) while
   the cup moves up with an overshoot (fly-y). Pure CSS. */
.fly-cup {
    position: absolute;
    left: 50%;
    top: -14px;
    z-index: 5;
    translate: -50% 0;
    pointer-events: none;
    animation:
        fly-x 1.1s cubic-bezier(0.25, 0.1, 0.25, 1) both,
        into-cart 0.45s 1.15s ease-in forwards;
}

.fly-cup .cup {
    font-size: 4.5px;
    animation: fly-y 1.1s cubic-bezier(0.3, 1.5, 0.55, 1) both;
}

@keyframes fly-x {
    from { translate: calc(-50% - var(--fly-dx, 34vw)) 0; }
}

@keyframes fly-y {
    from { translate: 0 var(--fly-dy, 48vh); scale: 5; rotate: -30deg; }
    60% { scale: 1.6; }
}

@keyframes into-cart {
    to { translate: -50% 16px; scale: 0.3; opacity: 0; }
}

/* the cart catches the cup, then the number bounces */
.cart-link.has-fly { animation: cart-catch 0.5s 1.15s var(--spring); }
.cart-link.has-fly .count.bump { animation-delay: 1.4s; }

@keyframes cart-catch {
    40% { scale: 1.22; rotate: -10deg; background: var(--brand-orange); border-color: var(--brand-orange); color: var(--brand-green); }
}

/* on phones the cart icon is on the left, and the cup comes from below */
@media (max-width: 860px) {
    .fly-cup { --fly-dx: 27vw; --fly-dy: 70vh; }
}

/* ---------- back to top ---------- */
@property --scrolled {
    syntax: "<percentage>";
    inherits: false;
    initial-value: 0%;
}

.to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 45;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--brand-cream);
    /* inner green button + outer lime ring that fills as you scroll */
    background:
        radial-gradient(closest-side, var(--brand-green) 86%, transparent 87%),
        conic-gradient(var(--brand-lime) var(--scrolled), rgba(168, 213, 59, 0.25) 0);
    box-shadow: var(--shadow);
    transition: scale 0.3s var(--spring);
}

.to-top svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: translate 0.3s var(--spring);
}

.to-top:hover { scale: 1.08; }
.to-top:hover svg { translate: 0 -3px; }
.to-top:active { scale: 0.92; }

/* Browsers that can link animations to scrolling: hide it at the top,
   show it after 300px, and fill the ring as you go down the page. */
@supports (animation-timeline: scroll()) {
    .to-top {
        animation:
            to-top-show linear both,
            to-top-ring linear both;
        animation-timeline: scroll(root), scroll(root);
        animation-range: 150px 350px, normal;
    }

    @keyframes to-top-show {
        from { opacity: 0; visibility: hidden; translate: 0 24px; }
        to { opacity: 1; visibility: visible; translate: 0 0; }
    }

    @keyframes to-top-ring {
        from { --scrolled: 0%; }
        to { --scrolled: 100%; }
    }
}

/* keep it clear of the sticky "Add to cart" bar on phones */
@media (max-width: 520px) {
    .to-top { right: 16px; bottom: 16px; width: 48px; height: 48px; }
    .page-drink .to-top { bottom: 104px; }
}

/* ---------- "Add to cart" button: little cart rolls forward on hover ---------- */
.btn-add { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }

.btn-cart {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: translate 0.4s var(--spring), rotate 0.4s var(--spring);
}

.btn-add:hover .btn-cart { translate: 4px 0; rotate: -8deg; }
.btn-add:active .btn-cart { translate: 14px -4px; rotate: -18deg; }

.cart-link .count {
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    line-height: 22px;
    font-size: 0.75rem;
    font-weight: 800;
    background: var(--brand-orange);
    color: var(--brand-green);
    box-shadow: 0 0 0 2px var(--bg);
}

@keyframes bump {
    40% { scale: 1.6; background: var(--accent); }
}

/* ---------- language & theme switches ---------- */
.switch {
    display: flex;
    padding: 3px;
    border-radius: 999px;
    border: 2px solid var(--line);
    font-size: 0.85rem;
}

.switch a {
    padding: 4px 11px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.switch a:hover { color: var(--ink); }
.switch a.on { background: var(--ink); color: var(--on-ink); }

/* ---------- toast (after "Add to cart") ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 60;
    width: max-content;
    max-width: calc(100% - 32px);
    margin: 0;
    padding: 14px 22px 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--on-ink);
    font-weight: 700;
    box-shadow: var(--shadow);
    translate: -50% 0;
    animation: toast 4.5s forwards;
}

.toast-pearl {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--accent);
    animation: drop-in 0.6s 0.2s var(--spring) both;
}

@keyframes toast {
    0% { translate: -50% 140%; opacity: 0; }
    8%, 86% { translate: -50% 0; opacity: 1; }
    100% { translate: -50% 30%; opacity: 0; visibility: hidden; }
}

@keyframes drop-in {
    from { translate: 0 -24px; opacity: 0; }
}

/* ---------- buttons ---------- */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 999px;
    background: var(--ink);
    color: var(--on-ink);
    font: 700 1rem var(--body);
    text-decoration: none;
    cursor: var(--cursor-click, pointer);
    transition: background 0.2s, translate 0.25s var(--spring), box-shadow 0.25s;
}

.btn:hover {
    translate: 0 -3px;
    box-shadow: var(--shadow);
}

.btn:active { translate: 0 1px; }
.btn-wide { width: 100%; }

/* =====================================================================
   THE CUP (pure CSS)
   ===================================================================== */
/* --level = how much empty space is at the top of the cup (animated on "sip") */
@property --level {
    syntax: "<percentage>";
    inherits: true;
    initial-value: 12%;
}

.cup {
    --pearl-r: 0.3em;
    position: relative;
    width: 5em;
    height: 7em;
    margin-top: 3em;          /* room for the straw */
    flex-shrink: 0;
}

.cup-sm { font-size: 9px; }
.cup-md { font-size: 16px; }
.cup-lg { font-size: 22px; }
.cup-xl { font-size: 30px; }
.cup-xxl { font-size: 42px; }

.cup .straw {
    position: absolute;
    left: 55%;
    bottom: 35%;
    width: 0.6em;
    height: 7.5em;
    border-radius: 0.3em;
    background: var(--straw);
    transform: rotate(10deg);
    transform-origin: bottom center;
}

.cup .glass {
    position: absolute;
    inset: 0;
    clip-path: polygon(0 0, 100% 0, 87% 100%, 13% 100%);
    transition: filter 0.4s;
    background:
        radial-gradient(circle, var(--pearl) 0 var(--pearl-r), transparent calc(var(--pearl-r) + 0.03em))
            0 100% / 0.75em 0.7em repeat-x,
        radial-gradient(circle, var(--pearl) 0 var(--pearl-r), transparent calc(var(--pearl-r) + 0.03em))
            0.37em calc(100% - 0.6em) / 0.75em 0.7em repeat-x,
        radial-gradient(circle, var(--pearl) 0 var(--pearl-r), transparent calc(var(--pearl-r) + 0.03em))
            0.15em calc(100% - 1.2em) / 0.75em 0.7em repeat-x,
        var(--stripes, linear-gradient(transparent, transparent)) 0 100% / 100% calc(100% - var(--level)) no-repeat,
        linear-gradient(to bottom, rgba(255, 255, 255, 0.6) 0 var(--level), var(--tea) var(--level));
}

.cup .glass::before {           /* sealed lid */
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 0.35em;
    z-index: 3;
    background: rgba(255, 255, 255, 0.95);
}

.cup .glass::after {            /* shine */
    content: "";
    position: absolute;
    top: 18%;
    left: 16%;
    width: 0.35em;
    height: 55%;
    z-index: 3;
    border-radius: 1em;
    background: rgba(255, 255, 255, 0.35);
}

.cup.stripes {
    --stripes: repeating-linear-gradient(
        165deg, transparent 0 0.9em, rgba(122, 58, 24, 0.55) 0.9em 1.25em);
}

/* ---------- cup extras (only on the drink builder) ---------- */
.glass > span { position: absolute; }
.glass > span > i { position: absolute; display: block; }

.foam {
    left: 0; right: 0;
    top: 0.84em;
    height: 1.35em;
    z-index: 2;
    background:
        radial-gradient(circle at 50% 0, transparent 0.35em, #fff3df 0.37em) 0 100% / 0.9em 0.45em repeat-x,
        linear-gradient(#fff9ef, #fff3df);
    background-clip: padding-box;
    scale: 1 0;
    transform-origin: top;
    transition: scale 0.5s var(--spring);
}

.ice { inset: 0; }
.ice i {
    width: 1.2em; height: 1.2em;
    border-radius: 0.22em;
    background: rgba(255, 255, 255, 0.42);
    border: 0.07em solid rgba(255, 255, 255, 0.85);
    box-shadow: inset -0.15em -0.15em 0 rgba(255, 255, 255, 0.35);
}
.ice i:nth-child(1) { left: 0.55em; top: 1.15em; rotate: 12deg; }
.ice i:nth-child(2) { left: 2.6em;  top: 1.0em;  rotate: -9deg; transition-delay: 0.07s; }
.ice i:nth-child(3) { left: 1.45em; top: 2.15em; rotate: 22deg; transition-delay: 0.14s; }
.ice i:nth-child(4) { left: 3.05em; top: 2.35em; rotate: -16deg; transition-delay: 0.21s; }

.jelly { inset: 0; }
.jelly i {
    width: 0.6em; height: 0.6em;
    border-radius: 0.12em;
    background: rgba(255, 255, 255, 0.72);
    border: 0.05em solid #fff;
}
.jelly i:nth-child(1) { left: 0.95em; top: 3.4em; rotate: 15deg; }
.jelly i:nth-child(2) { left: 2.2em;  top: 3.95em; rotate: -20deg; transition-delay: 0.05s; }
.jelly i:nth-child(3) { left: 3.3em;  top: 3.3em; rotate: 30deg;  transition-delay: 0.1s; }
.jelly i:nth-child(4) { left: 1.6em;  top: 4.55em; rotate: -8deg; transition-delay: 0.15s; }
.jelly i:nth-child(5) { left: 2.95em; top: 4.7em; rotate: 40deg;  transition-delay: 0.2s; }

.popping { inset: 0; }
.popping i {
    width: 0.5em; height: 0.5em;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff 0 0.08em, var(--pop, #ff7b8a) 0.1em);
}
.popping i:nth-child(1) { left: 1.0em; top: 3.0em; }
.popping i:nth-child(2) { left: 2.05em; top: 4.25em; --pop: #ffc94d; transition-delay: 0.05s; }
.popping i:nth-child(3) { left: 3.2em; top: 3.75em; --pop: #6fd1a0; transition-delay: 0.1s; }
.popping i:nth-child(4) { left: 1.4em; top: 4.95em; --pop: #ffc94d; transition-delay: 0.15s; }
.popping i:nth-child(5) { left: 2.7em; top: 3.2em; transition-delay: 0.2s; }
.popping i:nth-child(6) { left: 3.4em; top: 4.6em; --pop: #6fd1a0; transition-delay: 0.25s; }

.pudding {
    left: 0; right: 0;
    bottom: 1.9em;
    height: 0.95em;
    background: linear-gradient(#d99a3b 0 0.12em, #f5cf72 0.12em, #f0bf55);
    transition: bottom 0.4s;
}

.more-pearls {
    left: 0; right: 0;
    bottom: 1.82em;
    height: 0.7em;
    background: radial-gradient(circle, var(--pearl) 0 0.3em, transparent 0.33em) 0.2em 0 / 0.75em 0.7em repeat-x;
}

/* hidden until chosen: things drop into the cup */
.ice i, .jelly i, .popping i, .pudding, .more-pearls {
    opacity: 0;
    translate: 0 -3em;
    transition: opacity 0.25s, translate 0.6s var(--spring);
}

/* ---------- the live preview: CSS :has() reads the form ---------- */
.builder:has([name="ice"][value="Less ice"]:checked) .ice i:nth-child(-n+2),
.builder:has([name="ice"][value="Normal ice"]:checked) .ice i,
.builder:has([value="coconut"]:checked) .jelly i,
.builder:has([value="popping"]:checked) .popping i,
.builder:has([value="pudding"]:checked) .pudding,
.builder:has([value="pearls"]:checked) .more-pearls {
    opacity: 1;
    translate: 0 0;
}

.builder:has([value="foam"]:checked) .foam { scale: 1 1; }
.builder:has([value="pearls"]:checked) .pudding { bottom: 2.5em; }

.builder:has([name="sugar"][value="0%"]:checked) .stage .glass { filter: saturate(0.5) brightness(1.1); }
.builder:has([name="sugar"][value="25%"]:checked) .stage .glass { filter: saturate(0.75) brightness(1.05); }
.builder:has([name="sugar"][value="75%"]:checked) .stage .glass { filter: saturate(1.2) brightness(0.97); }
.builder:has([name="sugar"][value="100%"]:checked) .stage .glass { filter: saturate(1.45) brightness(0.93); }

.stage .cup { transition: font-size 0.5s var(--spring); }
.builder:has([name="size"][value="large"]:checked) .stage .cup { font-size: 36px; }

/* =====================================================================
   HERO — three slides that rotate by themselves (18 s loop)
   ===================================================================== */
.hero {
    position: relative;
    height: clamp(560px, 80vh, 700px);
    margin: 0 calc(50% - 50vw) 0;
    overflow: hidden;
}

.slide {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    align-items: center;
    gap: 24px;
    padding: 0 max(20px, calc(50vw - 540px));
    background:
        radial-gradient(circle at 72% 58%, color-mix(in srgb, var(--tea) 70%, var(--bg)) 0, transparent 42%),
        linear-gradient(160deg, color-mix(in srgb, var(--tea) 22%, var(--bg)), color-mix(in srgb, var(--tea) 45%, var(--bg)));
    opacity: 0;
    visibility: hidden;
    animation: slide 18s var(--delay) infinite;
}

@keyframes slide {
    0% { opacity: 0; visibility: visible; }
    3%, 30% { opacity: 1; }
    34%, 100% { opacity: 0; visibility: hidden; }
}

.slide-text, .slide-art, .bigword { animation-delay: var(--delay); animation-iteration-count: infinite; animation-duration: 18s; }

.slide-text { position: relative; z-index: 2; animation-name: text-in; }

@keyframes text-in {
    0% { translate: 0 40px; opacity: 0; }
    3% { translate: 0 40px; opacity: 0; }
    9%, 100% { translate: 0 0; opacity: 1; }
}

.slide h2 {
    font-size: clamp(2.5rem, 5.6vw, 4.6rem);
    line-height: 0.98;
    max-width: 10ch;
}

.slide-text p {
    font-size: 1.15rem;
    max-width: 34ch;
    margin: 18px 0 28px;
    color: color-mix(in srgb, var(--ink) 75%, transparent);
}

.slide-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.slide-price { font-family: var(--display); font-size: 1.7rem; color: var(--accent); }

.bigword {
    position: absolute;
    right: 2vw;
    bottom: 58px;                    /* sits on top of the waves, bottom edge dips into them */
    z-index: 0;
    font-family: var(--display);
    font-size: clamp(5rem, 12vw, 11rem);
    line-height: 1;
    white-space: nowrap;
    color: color-mix(in srgb, var(--tea) 45%, var(--ink));
    opacity: 0.17;
    pointer-events: none;
    animation-name: word-drift;
    animation-timing-function: linear;
}

@keyframes word-drift {
    from { translate: 4% 0; }
    to { translate: -6% 0; }
}

.slide-art {
    position: relative;
    z-index: 1;
    height: 100%;
    display: grid;
    place-items: center;
    animation-name: art-in;
    animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes art-in {
    0% { translate: 80px 30px; rotate: 10deg; opacity: 0; }
    2% { translate: 80px 30px; rotate: 10deg; opacity: 0; }
    10%, 100% { translate: 0 0; rotate: 0deg; opacity: 1; }
}

.bob { position: relative; z-index: 1; animation: bob 4s ease-in-out infinite; }

@keyframes bob {
    50% { translate: 0 -16px; rotate: -2deg; }
}

.plate {
    position: absolute;
    bottom: 13%;
    width: 280px;
    height: 34px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(43, 23, 16, 0.28), transparent);
    animation: plate 4s ease-in-out infinite;
}

@keyframes plate {
    50% { scale: 0.82; opacity: 0.6; }
}

/* things floating around the cup */
.floaters { position: absolute; inset: 6% 0; z-index: 0; }

.floaters i {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: calc(26px * var(--s));
    height: calc(26px * var(--s));
    animation: drift var(--t) ease-in-out var(--wait) infinite;
}

@keyframes drift {
    50% { translate: 10px -28px; rotate: 30deg; }
}

.float-pearls .floaters i {
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #8a5640, var(--pearl) 60%);
}

.float-cubes .floaters i {
    border-radius: 6px;
    background: color-mix(in srgb, var(--tea) 80%, white);
    box-shadow: inset -4px -4px 0 rgba(0, 0, 0, 0.08);
}

.float-leaves .floaters i {
    width: calc(34px * var(--s));
    border-radius: 0 100% 0 100%;
    background: linear-gradient(135deg, #8dbb5a, #4f8a35);
}

.hero-dots {
    position: absolute;
    left: max(20px, calc(50vw - 540px));
    bottom: 104px;
    z-index: 5;
    display: flex;
    gap: 8px;
}

.hero-dots span {
    width: 44px;
    height: 5px;
    border-radius: 5px;
    background: color-mix(in srgb, var(--ink) 18%, transparent);
    overflow: hidden;
}

.hero-dots span::after {
    content: "";
    display: block;
    height: 100%;
    background: var(--ink);
    transform-origin: left;
    scale: 0 1;
    animation: dot 18s linear var(--delay) infinite;
}

@keyframes dot {
    0% { scale: 0 1; }
    33.3% { scale: 1 1; }
    33.4%, 100% { scale: 0 1; }
}


/* =====================================================================
   CATEGORY BAND
   ===================================================================== */
.categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0 calc(50% - 50vw);
}

.cat {
    position: relative;
    height: 230px;
    padding: 28px max(20px, 3vw);
    display: flex;
    overflow: hidden;
    text-decoration: none;
    background: color-mix(in srgb, var(--tea) 55%, var(--bg));
    transition: background 0.3s;
}

.cat:hover { background: color-mix(in srgb, var(--tea) 75%, var(--bg)); }

.cat-text { position: relative; z-index: 1; max-width: 55%; }
.cat-text strong { display: block; font-family: var(--display); font-weight: 400; font-size: 1.8rem; line-height: 1.1; }
.cat-text small { display: block; margin-top: 6px; color: color-mix(in srgb, var(--ink) 75%, transparent); font-size: 0.92rem; }

.cat-cup {
    position: absolute;
    right: 8%;
    bottom: 0;
    translate: 0 24%;
    rotate: 6deg;
    transition: translate 0.5s var(--spring), rotate 0.5s var(--spring);
}

.cat:hover .cat-cup { translate: 0 4%; rotate: -4deg; }

/* =====================================================================
   STEPS
   ===================================================================== */
.steps { padding: 88px 0 24px; }
.steps h2 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 32px; max-width: 16ch; }

.steps ol {
    list-style: none;
    counter-reset: step;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.steps li {
    counter-increment: step;
    position: relative;
    padding: 76px 24px 26px;
    border-radius: 28px;
    background: var(--surface);
}

.steps li::before {
    content: counter(step);
    position: absolute;
    top: 18px;
    left: 24px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #8a5640, var(--pearl) 62%);
    color: #f6ece3;
    font-family: var(--display);
    font-size: 1.3rem;
}

.steps li:not(:last-child)::after {      /* little straw linking the steps */
    content: "";
    position: absolute;
    top: 39px;
    left: 82px;
    right: -12px;
    height: 4px;
    border-radius: 4px;
    background: repeating-linear-gradient(90deg, var(--line) 0 8px, transparent 8px 14px);
}

.steps strong { display: block; font-size: 1.2rem; margin-bottom: 6px; }
.steps li span { color: var(--muted); }

/* =====================================================================
   MENU
   ===================================================================== */
.menu { padding-top: 64px; }

.menu-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 24px;
}

.menu-head h2 { font-size: clamp(2.2rem, 5vw, 3.2rem); }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; }

.tabs a {
    padding: 8px 18px;
    border-radius: 999px;
    border: 2px solid var(--ink);
    text-decoration: none;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
}

.tabs a.on, .tabs a:hover { background: var(--ink); color: var(--on-ink); }

.drinks {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 22px;
}

.drink {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: 28px;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.35s var(--spring), box-shadow 0.35s;
}

.drink:hover, .drink:focus-visible {
    transform: translateY(-8px);
    box-shadow: var(--shadow);
}

.drink-art {
    position: relative;
    display: flex;
    justify-content: center;
    padding: 6px 0 22px;
    background:
        radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--tea) 55%, var(--tint-base)) 0 28%, transparent 60%),
        color-mix(in srgb, var(--tea) 26%, var(--tint-base));
}

.drink-art .cup { transition: transform 0.45s var(--spring); }
.drink:hover .drink-art .cup { transform: translateY(-10px) rotate(-6deg); }

.drink-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.drink h3 { font-size: 1.2rem; }
.drink p { margin: 6px 0 16px; color: var(--muted); font-size: 0.95rem; flex: 1; }

.drink-foot { display: flex; align-items: center; justify-content: space-between; }
.drink .price { font-family: var(--display); font-size: 1.35rem; color: var(--accent); }

.drink .go {
    padding: 7px 14px;
    border-radius: 999px;
    border: 2px solid var(--line);
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.25s, color 0.25s, border-color 0.25s;
}

.drink:hover .go { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

/* reveal on scroll (pure CSS, Chrome/Edge/Safari 26+; others just show it) */
@supports (animation-timeline: view()) {
    .reveal {
        animation: reveal linear both;
        animation-timeline: view();
        animation-range: entry 0% entry 70%;
    }

    @keyframes reveal {
        from { opacity: 0; translate: 0 48px; scale: 0.96; }
    }
}

/* =====================================================================
   DRINK BUILDER
   ===================================================================== */
.back {
    display: inline-block;
    margin: 8px 0 18px;
    font-weight: 700;
    text-underline-offset: 4px;
}

.builder {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 32px;
    align-items: start;
}

.builder-art {
    position: sticky;
    top: 92px;
    border-radius: 36px;
    padding: 12px 0 28px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 62%, color-mix(in srgb, var(--tea) 60%, var(--tint-base)) 0 30%, transparent 62%),
        color-mix(in srgb, var(--tea) 30%, var(--tint-base));
}

.stage {
    position: relative;
    height: 470px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 40px;
}

.stage .plate { bottom: 26px; width: 240px; animation: none; }
.stage-note { margin: 0; color: var(--muted); font-weight: 500; }

.builder-form {
    background: var(--surface);
    border-radius: 32px;
    padding: 34px;
}

.tag {
    display: inline-block;
    margin: 0 0 10px;
    padding: 4px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tea) 35%, var(--tint-base));
    font-weight: 700;
    font-size: 0.85rem;
}

.builder-form h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
.lead { color: var(--muted); margin: 10px 0 4px; max-width: 48ch; }
.base-price { font-weight: 700; color: var(--accent); margin: 0 0 6px; }

fieldset { border: none; padding: 0; margin: 24px 0 0; }
legend { font-weight: 800; margin-bottom: 10px; padding: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.chip span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 2px solid var(--line);
    background: var(--surface);
    cursor: var(--cursor-click, pointer);
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s, color 0.2s, scale 0.3s var(--spring);
}

.chip span:hover { border-color: var(--leaf); }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.chip input:checked + span small { color: color-mix(in srgb, var(--on-ink) 75%, transparent); }
.chip input:active + span { scale: 0.94; }
.chip input:focus-visible + span { outline: 3px solid var(--leaf); outline-offset: 2px; }

.chip .dot { width: 12px; height: 12px; border-radius: 50%; }
.topping-pearls .dot { background: var(--pearl); box-shadow: 0 0 0 1px #8a5640; }
.topping-coconut .dot { background: #fff; box-shadow: 0 0 0 1px var(--line); border-radius: 3px; }
.topping-pudding .dot { background: #f0bf55; border-radius: 3px; }
.topping-popping .dot { background: radial-gradient(circle at 35% 30%, #fff 0 1px, #ff7b8a 2px); }
.topping-foam .dot { background: #fff3df; box-shadow: 0 0 0 1px #e8d3b5; }

.add-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 2px dashed var(--line);
}

.btn-grow { flex: 1; min-width: 180px; padding: 16px 28px; font-size: 1.05rem; }

.qty { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }

input[type="text"], input[type="tel"], input[type="number"], input[type="email"], input[type="password"], textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--line);
    border-radius: 14px;
    font: 500 1rem var(--body);
    color: var(--ink);
    background: var(--input-bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.qty input { width: 96px; }

input:focus, textarea:focus {
    outline: none;
    border-color: var(--leaf);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--leaf) 22%, transparent);
}

/* =====================================================================
   CART
   ===================================================================== */
.cart { padding-top: 12px; }
.cart h1 { font-size: clamp(2.2rem, 5vw, 3rem); margin-bottom: 22px; }

.empty {
    background: var(--surface);
    border-radius: 28px;
    padding: 48px 24px;
    text-align: center;
}

.empty p { font-size: 1.1rem; margin-top: 0; }

.cart-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 24px;
    align-items: start;
}

.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.line {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    padding: 4px 20px 16px;
    background: var(--surface);
    border-radius: 22px;
    animation: drop-in 0.5s var(--spring) both;
}

.line:nth-child(2) { animation-delay: 0.06s; }
.line:nth-child(3) { animation-delay: 0.12s; }
.line:nth-child(n+4) { animation-delay: 0.18s; }

.line-info { flex: 1; padding-bottom: 2px; }
.line-info h3 { font-size: 1.1rem; }
.line-info p { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; }
.line-info .unit { color: var(--ink); }

.line-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.stepper {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid var(--line);
    border-radius: 999px;
    padding: 2px;
}

.stepper button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--bg);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ink);
    cursor: var(--cursor-click, pointer);
    transition: background 0.2s, color 0.2s, scale 0.2s var(--spring);
}

.stepper button:hover { background: var(--ink); color: var(--on-ink); scale: 1.1; }
.stepper span { min-width: 18px; text-align: center; font-weight: 700; }

.link {
    border: none;
    background: none;
    padding: 0;
    color: var(--muted);
    text-decoration: underline;
    font: 500 0.9rem var(--body);
    cursor: var(--cursor-click, pointer);
}

.link:hover { color: var(--accent); }

.checkout {
    background: var(--surface);
    border-radius: 28px;
    padding: 28px;
    display: grid;
    gap: 14px;
    position: sticky;
    top: 92px;
}

.checkout h2 { font-size: 1.9rem; }
.checkout > label { display: grid; gap: 6px; font-weight: 700; }
.checkout fieldset { margin: 4px 0 0; }

.errors {
    margin: 0;
    padding: 12px 16px 12px 34px;
    border-radius: 14px;
    background: var(--error-bg);
    color: var(--error-text);
    font-weight: 500;
    animation: shake 0.45s;
}

@keyframes shake {
    20%, 60% { translate: -6px 0; }
    40%, 80% { translate: 6px 0; }
}

.totals { margin: 6px 0 0; border-top: 2px dashed var(--line); padding-top: 12px; }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals dt, .totals dd { margin: 0; }
.totals .grand { font-weight: 800; font-size: 1.25rem; }

/* =====================================================================
   ORDER DONE
   ===================================================================== */
.done {
    position: relative;
    max-width: 640px;
    margin: 16px auto 0;
    text-align: center;
    background: var(--surface);
    border-radius: 36px;
    padding: 12px 32px 38px;
    animation: drop-in 0.6s var(--spring) both;
}

.done-cups { display: flex; justify-content: center; gap: 4px; margin-bottom: 18px; }
.done-cups .cup:first-child { animation: cheers-left 1.2s 0.4s var(--spring) both; }
.done-cups .cup:nth-child(2) { animation: cheers-right 1.2s 0.4s var(--spring) both; }

@keyframes cheers-left { 40% { rotate: 14deg; translate: 10px 0; } }
@keyframes cheers-right { 40% { rotate: -14deg; translate: -10px 0; } }

.done h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); }
.order-no { font-size: 1.2rem; margin: 14px 0 4px; }
.order-no strong { font-family: var(--display); font-weight: 400; font-size: 1.9rem; color: var(--accent); }

.receipt {
    list-style: none;
    padding: 16px 0 0;
    margin: 20px 0 28px;
    border-top: 2px dashed var(--line);
    text-align: left;
}

.receipt li { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; }
.receipt .grand { font-weight: 800; font-size: 1.2rem; border-top: 2px dashed var(--line); margin-top: 8px; padding-top: 10px; }

/* pearls falling once to celebrate */
.rain { position: fixed; inset: 0; z-index: 55; pointer-events: none; overflow: hidden; }

.rain i {
    position: absolute;
    top: -30px;
    left: var(--x);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #8a5640, var(--pearl) 60%);
    animation: rain var(--t) var(--wait) ease-in forwards;
}

@keyframes rain {
    to { translate: 0 110vh; rotate: 360deg; }
}

/* =====================================================================
   FOOTER — topped with a row of pearls
   ===================================================================== */
.site-footer {
    position: relative;
    margin-top: 40px;
    padding: 64px 20px 28px;
    background: var(--footer-bg);
    color: var(--footer-ink);
}

.site-footer::before {
    content: "";
    position: absolute;
    left: 0; right: 0;
    top: -13px;
    height: 26px;
    background: radial-gradient(circle at 50% 50%, var(--footer-bg) 0 12px, transparent 12.5px) 0 0 / 30px 26px repeat-x;
}

.footer-inner {
    max-width: 1080px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
    gap: 32px;
}

.footer-brand p { color: var(--footer-muted); max-width: 30ch; }
.footer-logo { display: block; width: min(260px, 100%); margin-bottom: 14px; }
.footer-logo img { display: block; width: 100%; height: auto; transition: scale 0.5s var(--spring); }
.footer-logo:hover img { scale: 1.04; }
.site-footer h4 { font-size: 1rem; margin-bottom: 10px; }
.site-footer p, .site-footer ul { margin: 0; color: var(--footer-muted); }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 6px; }
.site-footer ul a { text-decoration: none; }
.site-footer ul a:hover { color: var(--footer-ink); text-decoration: underline; }

.copy {
    max-width: 1080px;
    margin: 40px auto 0 !important;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.88rem;
}

/* =====================================================================
   BRAND EFFECTS — "Fresh in every layer"
   ===================================================================== */

/* ---------- 1. flowing waves at the bottom of the hero ---------- */
.hero-waves {
    position: absolute;
    left: 0; right: 0;
    bottom: -1px;
    height: 92px;
    z-index: 4;
    pointer-events: none;
}

.wave {
    --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 80' preserveAspectRatio='none'%3E%3Cpath d='M0 40C100 8 200 8 300 40S500 72 600 40V80H0Z'/%3E%3C/svg%3E");
    position: absolute;
    left: 0; right: 0;
    bottom: 0;
    -webkit-mask: var(--wave) 0 0 / var(--w) 100% repeat-x;
    mask: var(--wave) 0 0 / var(--w) 100% repeat-x;
    animation: wave-flow var(--speed) linear infinite;
}

.wave-orange { --w: 720px; --speed: 16s; height: 92px; background: var(--brand-orange); }
.wave-lime   { --w: 560px; --speed: 11s; height: 68px; background: var(--brand-lime); animation-direction: reverse; }
.wave-green  { --w: 640px; --speed: 8s;  height: 44px; background: var(--brand-green); }

@keyframes wave-flow {
    to { -webkit-mask-position: var(--w) 0; mask-position: var(--w) 0; }
}

/* ---------- 2. moving ribbon ---------- */
.ribbon {
    margin: 0 calc(50% - 50vw);
    padding: 10px 0 20px;
    overflow: hidden;
    background: var(--brand-green);
    color: var(--brand-cream);
}

.ribbon-track {
    display: flex;
    width: max-content;
    animation: ribbon 45s linear infinite;
}

@media (hover: hover) {
    .ribbon:hover .ribbon-track { animation-play-state: paused; }
}

.ribbon-item {
    display: flex;
    align-items: center;
    gap: 28px;
    padding-right: 28px;
    font-family: var(--display);
    font-size: 1.55rem;
    line-height: 1.5;
    white-space: nowrap;
}

.ribbon-item::after {                 /* a lime pearl between names */
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #d9f08f, var(--brand-lime) 60%);
}

.ribbon-item.slogan { color: var(--brand-orange); }

@keyframes ribbon {
    to { translate: -50% 0; }
}

/* ---------- 3. liquid buttons: orange fills up from the bottom ---------- */
.btn {
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.btn::before {
    content: "";
    position: absolute;
    left: -15%;
    right: -15%;
    top: -35%;
    bottom: 0;
    z-index: -1;
    border-radius: 45% 45% 0 0 / 35% 35% 0 0;
    background: var(--brand-orange);
    translate: 0 102%;
    transition: translate 0.5s cubic-bezier(0.3, 0.8, 0.3, 1);
}

.btn:hover { color: var(--brand-green); }
.btn:hover::before { translate: 0 0; }

/* ---------- 4. menu cards: the drink gets sipped, and a shine sweeps across ---------- */
.drink { position: relative; }

.drink:hover .drink-art .cup { animation: sip 1.8s 0.15s ease-in-out; }
.drink:hover .drink-art .straw { animation: straw-sip 1.8s 0.15s ease-in-out; }

@keyframes sip {
    45%, 60% { --level: 36%; }
}

@keyframes straw-sip {
    40%, 60% { translate: 0 0.45em; }
}

.drink::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.45) 50%, transparent 62%);
    translate: -110% 0;
}

.drink:hover::after { translate: 110% 0; transition: translate 0.9s ease; }

/* ---------- 5. stickers ("Best seller", "New") ---------- */
.sticker {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 76px;
    height: 76px;
    padding: 10px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-orange);
    color: var(--brand-green);
    font-weight: 800;
    font-size: 0.78rem;
    line-height: 1.1;
    text-align: center;
    rotate: 12deg;
    box-shadow: 0 8px 18px -8px rgba(31, 95, 51, 0.6);
    transition: rotate 0.5s var(--spring), scale 0.5s var(--spring);
}

.sticker::before {                    /* dashed ring that slowly turns */
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    border: 1.5px dashed rgba(31, 95, 51, 0.55);
    animation: spin 14s linear infinite;
}

.sticker-new { background: var(--brand-lime); }
.drink:hover .sticker { rotate: -8deg; scale: 1.1; }

@keyframes spin {
    to { rotate: 360deg; }
}

/* ---------- 6. scroll progress bar under the header ---------- */
@supports (animation-timeline: scroll()) {
    .site-header::after {
        content: "";
        position: absolute;
        left: 0; right: 0;
        bottom: 0;
        height: 3px;
        background: linear-gradient(90deg, var(--brand-lime), var(--brand-orange));
        transform-origin: left;
        animation: progress linear both;
        animation-timeline: scroll(root);
    }

    @keyframes progress {
        from { scale: 0 1; }
        to { scale: 1 1; }
    }
}

/* ---------- 7. wavy underline under section headings ---------- */
.menu-head h2::after,
.steps h2::after {
    content: "";
    display: block;
    width: 110px;
    height: 12px;
    margin-top: 10px;
    background: var(--brand-lime);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12'%3E%3Cpath d='M0 6Q6 0 12 6T24 6' fill='none' stroke='black' stroke-width='3.2'/%3E%3C/svg%3E") 0 0 / 24px 12px repeat-x;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12'%3E%3Cpath d='M0 6Q6 0 12 6T24 6' fill='none' stroke='black' stroke-width='3.2'/%3E%3C/svg%3E") 0 0 / 24px 12px repeat-x;
}

/* ---------- phones & tablets (no mouse): hover effects play by themselves ---------- */
@media (hover: none) {
    /* each menu card takes a sip in turn, every few seconds */
    .drink .drink-art .cup { animation: sip-loop 6s ease-in-out calc(var(--i, 0) * 0.8s) infinite; }
    .drink .drink-art .straw { animation: straw-loop 6s ease-in-out calc(var(--i, 0) * 0.8s) infinite; }
    .drink::after { animation: shine-loop 6s ease-in-out calc(var(--i, 0) * 0.8s) infinite; }
    .sticker { animation: sticker-wiggle 3s ease-in-out infinite; }
    .cat-cup { animation: cat-bob 3.5s ease-in-out infinite alternate; }
    .cat:nth-child(2) .cat-cup { animation-delay: -1.2s; }
    .cat:nth-child(3) .cat-cup { animation-delay: -2.4s; }

    /* a tap fills the button, like hovering does with a mouse */
    .btn:active::before { translate: 0 0; transition-duration: 0.25s; }
    .btn:active { color: var(--brand-green); }
}

@keyframes sip-loop {
    0%, 20% { --level: 12%; }
    32%, 42% { --level: 36%; }
    56%, 100% { --level: 12%; }
}

@keyframes straw-loop {
    0%, 18%, 58%, 100% { translate: 0 0; }
    30%, 44% { translate: 0 0.45em; }
}

@keyframes shine-loop {
    0%, 60% { translate: -110% 0; }
    80%, 100% { translate: 110% 0; }
}

@keyframes sticker-wiggle {
    0%, 100% { rotate: 12deg; scale: 1; }
    50% { rotate: -8deg; scale: 1.08; }
}

@keyframes cat-bob {
    from { translate: 0 24%; rotate: 6deg; }
    to { translate: 0 8%; rotate: -3deg; }
}

:lang(km) .sticker { font-size: 0.7rem; line-height: 1.45; }
:lang(km) .ribbon-item { line-height: 1.7; }

@media (max-width: 860px) {
    .hero-waves { height: 70px; }
    .wave-orange { height: 70px; }
    .wave-lime { height: 52px; }
    .wave-green { height: 34px; }
    .hero-dots { bottom: 84px; }
    .ribbon-item { font-size: 1.2rem; gap: 20px; padding-right: 20px; }
}

/* =====================================================================
   LOADING ANIMATION (first visit) — a cup fills in three layers,
   pearls drop in, then the green screen lifts away. Total: about 2.4 s.
   ===================================================================== */
.intro {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: var(--brand-green);
    color: var(--brand-cream);
    pointer-events: none;          /* never blocks clicks */
    animation: intro-leave 0.65s 1.85s cubic-bezier(0.7, 0, 0.3, 1) forwards;
}

.intro::after {                     /* row of pearls along the bottom edge */
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: -13px;
    height: 26px;
    background: radial-gradient(circle at 50% 50%, var(--brand-green) 0 12px, transparent 12.5px) 0 0 / 30px 26px repeat-x;
}

@keyframes intro-leave {
    to { translate: 0 calc(-100% - 30px); visibility: hidden; }
}

.intro-inner {
    display: grid;
    justify-items: center;
    animation: intro-pop 0.5s var(--spring) both;
}

@keyframes intro-pop {
    from { scale: 0.6; opacity: 0; }
}

.intro-cup {
    position: relative;
    isolation: isolate;            /* keeps the straw tucked behind the cup */
    width: 120px;
    height: 160px;
    margin-top: 60px;
}

.intro-glass {
    position: absolute;
    inset: 0;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 86% 100%, 14% 100%);
    background: rgba(245, 251, 234, 0.14);
}

.intro-glass::before {              /* lid */
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 8px;
    z-index: 3;
    background: var(--brand-cream);
}

.intro .layer {
    position: absolute;
    left: 0; right: 0;
    bottom: 0;
    transform-origin: bottom;
    scale: 1 0;
    animation: fill 0.45s cubic-bezier(0.3, 0.7, 0.4, 1) forwards;
}

.layer-orange { height: 38%; background: var(--brand-orange); animation-delay: 0.25s !important; }
.layer-lime   { height: 70%; background: var(--brand-lime);   animation-delay: 0.6s !important; z-index: -1; }
.layer-cream  { height: 90%; background: var(--brand-cream);  animation-delay: 0.95s !important; z-index: -2; }

@keyframes fill {
    to { scale: 1 1; }
}

/* gentle wave on top of each layer */
.intro .layer::before {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    top: -7px;
    height: 14px;
    border-radius: 50%;
    background: inherit;
    animation: slosh 0.9s ease-in-out infinite alternate;
}

@keyframes slosh {
    from { rotate: -4deg; }
    to { rotate: 4deg; }
}

/* pearls drop to the bottom */
.intro-glass i {
    position: absolute;
    bottom: 6px;
    z-index: 2;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #8a5640, var(--pearl) 60%);
    translate: 0 -200px;
    animation: pearl-drop 0.55s cubic-bezier(0.5, 0, 0.75, 1.35) forwards;
}

.intro-glass i:nth-child(4) { left: 26px; animation-delay: 0.35s; }
.intro-glass i:nth-child(5) { left: 46px; animation-delay: 0.5s; }
.intro-glass i:nth-child(6) { left: 66px; animation-delay: 0.42s; }
.intro-glass i:nth-child(7) { left: 36px; bottom: 22px; animation-delay: 0.62s; }
.intro-glass i:nth-child(8) { left: 56px; bottom: 22px; animation-delay: 0.7s; }

@keyframes pearl-drop {
    to { translate: 0 0; }
}

.intro-straw {
    position: absolute;
    left: 62%;
    bottom: 45%;
    z-index: -1;
    width: 12px;
    height: 150px;
    border-radius: 6px;
    background: repeating-linear-gradient(180deg, var(--brand-orange) 0 14px, var(--brand-cream) 14px 22px);
    transform-origin: bottom;
    rotate: 12deg;
    translate: 0 -80px;
    opacity: 0;
    animation: straw-in 0.45s 1.25s var(--spring) forwards;
}

@keyframes straw-in {
    to { translate: 0 0; opacity: 1; }
}

.intro-name {
    margin: 26px 0 0;
    font-family: var(--display);
    font-size: 2.2rem;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: var(--brand-lime);
}

.intro-slogan {
    margin: 4px 0 0;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--brand-cream);
    opacity: 0;
    translate: 0 12px;
    animation: slogan-in 0.5s 1.1s ease-out forwards;
}

@keyframes slogan-in {
    to { opacity: 1; translate: 0 0; }
}

/* =====================================================================
   ACCOUNTS — sign in / sign up / account / my orders
   ===================================================================== */
.account-link.signed-in {
    background: var(--brand-lime);
    border-color: var(--brand-lime);
    color: var(--brand-green);
}

.account-link .initial { font-weight: 800; font-size: 1.05rem; line-height: 1; }

.btn-ghost {
    background: transparent;
    color: var(--ink);
    box-shadow: inset 0 0 0 2px var(--line);
}

.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn[disabled]::before { display: none; }

.muted { color: var(--muted); margin: 4px 0 0; }

.notice {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--brand-orange) 22%, var(--surface));
    font-weight: 500;
}

.notice-ok { background: color-mix(in srgb, var(--brand-lime) 30%, var(--surface)); }

/* ---------- sign in / sign up ---------- */
.auth {
    display: grid;
    grid-template-columns: 1fr 1.05fr;
    margin: 16px auto 0;
    max-width: 960px;
    border-radius: 36px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: drop-in 0.55s var(--spring) both;
}

.auth-art {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 40px 24px 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 85%, rgba(168, 213, 59, 0.35) 0 30%, transparent 60%),
        var(--brand-green);
    color: var(--brand-cream);
    text-align: center;
}

.auth-badge {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    box-shadow: 0 0 0 6px rgba(245, 251, 234, 0.12);
    animation: bob 4s ease-in-out infinite;
}

.auth-slogan {
    margin: 0;
    font-family: var(--display);
    font-size: 1.7rem;
    line-height: 1.25;
    color: var(--brand-lime);
}

.auth-cups { display: flex; align-items: flex-end; gap: 6px; margin-bottom: -18px; }
.auth-cups .cup { animation: bob 4s ease-in-out infinite; }
.auth-cups .cup:nth-child(1) { animation-delay: -1.3s; }
.auth-cups .cup:nth-child(3) { animation-delay: -2.6s; }

.auth-card { padding: 44px 40px 36px; }
.auth-card h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
.auth-intro { color: var(--muted); margin: 10px 0 22px; max-width: 40ch; }

.auth-form { display: grid; gap: 14px; }
.auth-form label { display: grid; gap: 6px; font-weight: 700; }
.auth-form small { font-weight: 500; }

.auth-forgot { justify-self: end; margin-top: -4px; font-weight: 600; font-size: 0.92rem; color: var(--muted); }
.auth-forgot:hover { color: var(--accent); }

.auth-switch { margin: 22px 0 0; text-align: center; color: var(--muted); }
.auth-switch a { font-weight: 800; color: var(--ink); }

/* ---------- password box with show/hide eye ---------- */
.auth-form .pw-label, .pw-field .pw-label { font-weight: 700; }
.auth-form .pw-label { margin-bottom: -8px; }
.pw-field { display: grid; gap: 6px; }

.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 54px; }
.pw-wrap input::-ms-reveal { display: none; }       /* Edge's own eye: we have ours */

.pw-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 40px;
    height: 40px;
    translate: 0 -50%;
    display: grid;
    place-items: center;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--muted);
    cursor: var(--cursor-click, pointer);
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.pw-toggle[hidden] { display: none; }
.pw-toggle:hover { background: color-mix(in srgb, var(--brand-lime) 22%, transparent); color: var(--ink); }
.pw-toggle:active svg { scale: 0.88; }

.pw-toggle svg {
    grid-area: 1 / 1;
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: opacity 0.2s, scale 0.25s var(--spring);
}

/* hidden password -> eye with a slash ("tap to show"); visible -> open eye */
.pw-toggle .eye-open { opacity: 0; scale: 0.6; }
.pw-toggle[aria-pressed="true"] .eye-open { opacity: 1; scale: 1; }
.pw-toggle[aria-pressed="true"] .eye-closed { opacity: 0; scale: 0.6; }
.pw-toggle[aria-pressed="true"] { color: var(--ink); }

.eye-closed .slash { stroke-dasharray: 23; stroke-dashoffset: 0; transition: stroke-dashoffset 0.3s; }
.pw-toggle[aria-pressed="true"] .eye-closed .slash { stroke-dashoffset: 23; }

/* ---------- cart: sign-in box instead of the checkout form ---------- */
.login-box p { margin: 0; color: var(--muted); }
.login-box .btn-ghost { margin-top: -4px; }

/* ---------- my account ---------- */
.account { max-width: 960px; margin: 16px auto 0; }

.account-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 20px;
    margin-bottom: 24px;
}

.account-head h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }

.avatar {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-lime);
    color: var(--brand-green);
    font-family: var(--display);
    font-size: 2rem;
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand-lime) 30%, transparent);
}

.account-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }

.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

.panel {
    display: grid;
    gap: 14px;
    padding: 28px;
    border-radius: 28px;
    background: var(--surface);
}

.panel h2 { font-size: 1.6rem; }
.panel label { display: grid; gap: 6px; font-weight: 700; }
.panel .btn { justify-self: start; }

/* ---------- my orders ---------- */
.history { max-width: 860px; margin: 0 auto; }
.history h1 { font-size: clamp(2.2rem, 5vw, 3rem); margin-bottom: 22px; }

.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }

.order-card {
    display: flex;
    gap: 20px;
    padding: 6px 24px 22px;
    border-radius: 26px;
    background: var(--surface);
    animation: drop-in 0.5s var(--spring) both;
}

.order-card:nth-child(2) { animation-delay: 0.06s; }
.order-card:nth-child(n+3) { animation-delay: 0.12s; }

.order-cups { display: flex; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.order-body { flex: 1; padding-top: 18px; }
.order-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.order-top h2 { font-size: 1.35rem; }

.pill {
    padding: 4px 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-lime) 35%, var(--surface));
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.order-lines { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 2px dashed var(--line); display: grid; gap: 4px; }
.order-lines li { display: flex; justify-content: space-between; gap: 16px; }
.order-total { display: flex; justify-content: space-between; margin: 10px 0 0; padding-top: 10px; border-top: 2px dashed var(--line); font-size: 1.15rem; }

.done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

@media (max-width: 760px) {
    .auth { grid-template-columns: 1fr; }
    .auth-art { flex-direction: row; justify-content: center; padding: 20px 20px 0; }
    .auth-slogan { display: none; }
    .auth-badge { width: 64px; height: 64px; align-self: center; margin-bottom: 18px; }
    .auth-cups .cup-lg { font-size: 16px; }
    .auth-cups .cup-md { font-size: 12px; }
    .auth-card { padding: 28px 22px; }
    .account-grid { grid-template-columns: 1fr; }
    .account-actions { margin-left: 0; }
    .order-card { flex-direction: column; gap: 0; }
}

/* =====================================================================
   HEADER — logo | main links | tools   (phones: logo | cart | ☰)
   ===================================================================== */
.site-header { border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }

.topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;    /* equal sides, so the links sit in the true center */
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
}

.topbar > .logo { justify-self: start; }
.topbar > .tools { justify-self: end; }

/* ---------- logo: badge + name + slogan ---------- */
.topbar .logo { gap: 12px; }

.topbar .logo-badge {
    width: 54px;
    height: 54px;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--surface), 0 8px 18px -8px rgba(31, 95, 51, 0.6);
    transition: scale 0.5s var(--spring);
}

.topbar .logo:hover .logo-badge { scale: 1.08; }

.logo-text { display: flex; flex-direction: column; line-height: 1; }
.logo-name { font-size: 1.5rem; letter-spacing: 0.01em; white-space: nowrap; }

.logo-tag {
    margin-top: 4px;
    font-family: var(--body);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--muted);
    white-space: nowrap;
}

.tools-divider {
    width: 1px;
    height: 26px;
    margin: 0 2px;
    background: var(--line);
}

/* desktop: as you scroll, the bar slims down, gets a soft shadow, and the badge turns */
@media (min-width: 861px) {
    @supports (animation-timeline: scroll()) {
        .site-header {
            animation: header-lift linear both;
            animation-timeline: scroll(root);
            animation-range: 0 160px;
        }

        .topbar {
            animation: bar-slim linear both;
            animation-timeline: scroll(root);
            animation-range: 0 160px;
        }

        .topbar .logo-badge {
            animation: badge-small linear both, badge-turn linear both;
            animation-timeline: scroll(root), scroll(root);
            animation-range: 0 160px, normal;
        }

        @keyframes header-lift { to { box-shadow: 0 12px 30px -20px rgba(31, 95, 51, 0.55); } }
        @keyframes bar-slim { to { padding-top: 6px; padding-bottom: 6px; } }
        @keyframes badge-small { to { width: 44px; height: 44px; } }
        @keyframes badge-turn { to { rotate: 360deg; } }
    }
}

/* main links in the middle, current page gets a lime squiggle */
.topbar .main-nav { justify-self: center; display: flex; flex-wrap: nowrap; gap: 4px; }

.topbar .main-nav > a {
    position: relative;
    padding: 9px 16px 11px;
    border-radius: 999px;
    font-weight: 700;
    white-space: nowrap;
    transition: background 0.2s;
}

.topbar .main-nav > a:hover { background: color-mix(in srgb, var(--brand-lime) 22%, transparent); }

.topbar .main-nav > a::after {
    left: 16px;
    right: 16px;
    bottom: 1px;
    height: 7px;
    background: var(--brand-lime);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 7'%3E%3Cpath d='M0 3.5Q3.5 0 7 3.5T14 3.5' fill='none' stroke='black' stroke-width='2.4'/%3E%3C/svg%3E") 0 0 / 14px 7px repeat-x;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 7'%3E%3Cpath d='M0 3.5Q3.5 0 7 3.5T14 3.5' fill='none' stroke='black' stroke-width='2.4'/%3E%3C/svg%3E") 0 0 / 14px 7px repeat-x;
    transform-origin: left;
    transition: scale 0.35s var(--spring);
}

.topbar .main-nav > a.on::after { scale: 1 1; }

/* round tools on the right */
.tools { display: flex; align-items: center; gap: 10px; }

.icon-btn {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--line);
    color: var(--ink);
    cursor: var(--cursor-click, pointer);
    transition: background 0.2s, color 0.2s, border-color 0.2s, scale 0.3s var(--spring);
}

.icon-btn:hover { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.icon-btn:active { scale: 0.92; }
.theme-btn:hover .cart-icon { animation: spin-once 0.6s var(--spring); }

/* ---------- theme dropdown (desktop) ---------- */
.theme-menu { position: relative; }
.theme-menu > summary { list-style: none; }
.theme-menu > summary::-webkit-details-marker { display: none; }
.theme-menu[open] > summary { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.theme-menu[open] > summary:active { scale: none; }

/* invisible layer over the page: clicking anywhere outside closes the dropdown */
.theme-menu[open] > summary::before {
    content: "";
    position: fixed;
    inset: 0;
    cursor: default;
}

.auto-badge {
    position: absolute;
    right: -5px;
    bottom: -5px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand-lime);
    color: var(--brand-green);
    font-size: 0.68rem;
    font-weight: 800;
    box-shadow: 0 0 0 2px var(--bg);
}

.popover {
    position: absolute;
    right: -8px;
    top: calc(100% + 12px);
    z-index: 2;
    width: 250px;
    padding: 12px;
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--line);
    animation: sheet-in 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.popover::before {                 /* little arrow pointing at the button */
    content: "";
    position: absolute;
    top: -6px;
    right: 24px;
    width: 12px;
    height: 12px;
    rotate: 45deg;
    background: var(--surface);
    box-shadow: -1px -1px 0 0 var(--line);
}

.popover .sheet-label { margin: 2px 8px 6px; }

.pop-item {
    position: relative;
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: center;
    column-gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
}

.pop-item .cart-icon { width: 20px; height: 20px; }
.pop-item small { grid-column: 2; font-weight: 500; font-size: 0.78rem; line-height: 1.35; }
.pop-item:hover { background: color-mix(in srgb, var(--brand-lime) 18%, var(--surface)); }
.pop-item.on { background: color-mix(in srgb, var(--brand-lime) 32%, var(--surface)); }

.pop-item.on::after {               /* tick on the current choice */
    content: "";
    position: absolute;
    right: 14px;
    top: 15px;
    width: 6px;
    height: 11px;
    border: solid var(--ink);
    border-width: 0 2.5px 2.5px 0;
    rotate: 45deg;
}

@keyframes spin-once { from { rotate: -90deg; } }

.lang-switch a { padding: 5px 11px; }

/* ---------- hamburger menu (phones only) ---------- */
.mobile-menu { display: none; }
.mobile-menu > summary { list-style: none; }
.mobile-menu > summary::-webkit-details-marker { display: none; }

.burger { gap: 0; }

.burger span {
    position: absolute;
    left: 11px;
    width: 18px;
    height: 2.5px;
    border-radius: 2px;
    background: currentColor;
    /* closing: un-rotate first, then slide the lines apart */
    transition: rotate 0.2s ease-in, translate 0.3s 0.18s var(--spring), scale 0.25s 0.15s, opacity 0.2s 0.15s, background 0.3s;
}

.burger span:nth-child(1) { translate: 0 -6px; }
.burger span:nth-child(3) { translate: 0 6px; }

/* ☰ turns into ✕ */
/* the dark fill is its own small layer that fades in; the button's own colors never animate,
   because the full-screen dim layer belongs to this button and would be redrawn every frame */
.burger::after {
    content: "";
    position: absolute;
    inset: -2px;
    z-index: -1;
    border-radius: 50%;
    background: var(--ink);
    opacity: 0;
    scale: 0.6;
    transition: opacity 0.3s, scale 0.45s var(--spring);
}

.burger { isolation: isolate; }
.icon-btn, .sheet a, .sheet button, .mobile-menu > summary { -webkit-tap-highlight-color: transparent; }
.mobile-menu[open] .burger::after { opacity: 1; scale: 1; }
.mobile-menu[open] .burger span { background: var(--on-ink); }
/* opening: slide the lines together first, then rotate into an X */
.mobile-menu[open] .burger span { transition: translate 0.2s ease-out, rotate 0.35s 0.16s var(--spring), scale 0.2s, opacity 0.15s, background 0.3s; }
.mobile-menu[open] .burger span:nth-child(1) { translate: 0 0; rotate: 45deg; }
.mobile-menu[open] .burger span:nth-child(2) { scale: 0 1; opacity: 0; }
.mobile-menu[open] .burger span:nth-child(3) { translate: 0 0; rotate: -45deg; }
/* (the button itself must never rotate or scale while open: that would shrink the tap-outside layer) */
.burger, .burger:hover { transition: none; background: transparent; color: var(--ink); }
/* no press-shrink while open: a shrink would also shrink the tap-outside overlay */
.mobile-menu[open] .burger:active { scale: none; }

/* side drawer: slides in from the right, out to the right */
.sheet {
    position: fixed;
    top: 65px;                      /* just under the header, so the ✕ stays visible */
    right: 0;
    bottom: 0;
    width: min(86vw, 380px);
    overflow-y: auto;
    padding: 16px 18px 28px;
    background: var(--surface);
    border-radius: 28px 0 0 28px;
    box-shadow: -24px 0 50px -20px rgba(0, 0, 0, 0.4);
    overflow-x: hidden;
    /* closed: parked just off the right edge.
       Only "translate" moves, on its own GPU layer, so the browser never re-lays out the page. */
    translate: 105% 0;
    will-change: translate;
    backface-visibility: hidden;
    contain: layout paint style;
    visibility: hidden;
    /* closing: gentle start, quick finish (iOS sheet curve); hide once it is off screen */
    transition: translate 0.42s cubic-bezier(0.4, 0, 0.6, 1), visibility 0s 0.42s;
}

/* ---------- liquid glass ----------
   White glass in light mode, green glass in dark mode (Auto follows the clock). */
.sheet {
    --glass-tint: rgba(255, 255, 255, 0.5);
    --glass-edge: rgba(255, 255, 255, 0.85);
    --glass-shine: rgba(255, 255, 255, 0.75);
    --glass-chip: rgba(255, 255, 255, 0.55);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.35), transparent 45%),
        var(--glass-tint);
    -webkit-backdrop-filter: blur(20px) saturate(1.9) brightness(1.05);
    backdrop-filter: blur(20px) saturate(1.9) brightness(1.05);
    border: 1px solid var(--glass-edge);
    border-right: 0;
    box-shadow:
        inset 1px 1px 0 var(--glass-shine),          /* bright rim on the top-left edge */
        inset 0 -30px 60px -40px rgba(168, 213, 59, 0.35),   /* lime glow from below */
        -30px 0 60px -24px rgba(10, 40, 20, 0.45);
    isolation: isolate;
}

:root[data-theme="dark"] .sheet {
    --glass-tint: rgba(31, 95, 51, 0.42);
    --glass-edge: rgba(168, 213, 59, 0.35);
    --glass-shine: rgba(214, 240, 160, 0.4);
    --glass-chip: rgba(14, 34, 22, 0.35);
    background:
        linear-gradient(160deg, rgba(168, 213, 59, 0.18), transparent 45%),
        var(--glass-tint);
    -webkit-backdrop-filter: blur(20px) saturate(1.6) brightness(0.9);
    backdrop-filter: blur(20px) saturate(1.6) brightness(0.9);
}

/* ---------- real-glass light ----------
   ::before = soft glare (top-left) + warm caustic glow (bottom-right) that drift slowly,
              like tilting a glass in the sun. No hard edges anywhere.
   ::after  = one soft diagonal glint that crosses the glass once each time it opens. */
.sheet {
    --glare: rgba(255, 255, 255, 0.55);
    --caustic-warm: rgba(255, 182, 39, 0.22);
    --caustic-cool: rgba(168, 213, 59, 0.22);
    --glint: rgba(255, 255, 255, 0.4);
}

:root[data-theme="dark"] .sheet {
    --glare: rgba(214, 240, 160, 0.22);
    --caustic-warm: rgba(255, 182, 39, 0.16);
    --caustic-cool: rgba(168, 213, 59, 0.2);
    --glint: rgba(230, 248, 190, 0.22);
}

.sheet::before {
    content: "";
    position: absolute;
    inset: -15% -30%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 45% 22% at 28% 6%, var(--glare), transparent 70%),
        radial-gradient(ellipse 30% 14% at 60% 3%, var(--glare), transparent 75%),
        radial-gradient(ellipse 40% 30% at 85% 92%, var(--caustic-warm), transparent 70%),
        radial-gradient(ellipse 35% 25% at 55% 100%, var(--caustic-cool), transparent 70%);
    will-change: translate;
    animation: glass-tilt 14s ease-in-out infinite alternate;
}

@keyframes glass-tilt {
    0% { translate: -4% 0; }
    50% { translate: 3% 2%; }
    100% { translate: 5% -1%; }
}

.mobile-menu:not([open]) .sheet::before { animation-play-state: paused; }

.sheet::after {
    content: "";
    position: absolute;
    top: -40%;
    left: 0;
    width: 55%;
    height: 180%;
    z-index: -1;
    pointer-events: none;
    rotate: 18deg;
    /* soft on both sides, so it never shows an edge */
    background: linear-gradient(90deg, transparent 0%, var(--glint) 48%, var(--glint) 52%, transparent 100%);
    opacity: 0.9;
    translate: -160% 0;
    will-change: translate;
}

/* each time the drawer opens, the glint glides across once (after the slide settles) */
.mobile-menu[open] .sheet::after {
    translate: 260% 0;
    transition: translate 1.4s 0.35s cubic-bezier(0.45, 0, 0.25, 1);
}

/* controls sit on the glass as lighter glass chips */
.sheet .switch-big,
.sheet .btn-ghost { background: var(--glass-chip); }
.sheet .sheet-links a.on { background: color-mix(in srgb, var(--brand-lime) 40%, transparent); }
.sheet .sheet-account, .sheet .sheet-settings { border-top-color: var(--glass-edge); }

/* browsers without blur: use a solid-looking card instead */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .sheet { --glass-tint: var(--surface); }
    :root[data-theme="dark"] .sheet { --glass-tint: var(--surface); }
}

/* open: slide into view (right -> left) */
.mobile-menu[open] .sheet {
    translate: 0 0;
    visibility: visible;
    /* opening: fast start, long soft settle */
    transition: translate 0.55s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s;
}

@starting-style {
    .mobile-menu[open] .sheet { translate: 105% 0; }
}

/* Build the drawer ahead of time (browsers normally skip closed <details> content),
   so opening is pure movement with no first-frame hitch. Still hidden and not
   clickable or focusable while closed, via "visibility". */
.mobile-menu::details-content {
    content-visibility: visible;
}

/* the items inside: drop in one after another, float away when closing */
.sheet-links a,
.sheet-account,
.sheet-settings {
    opacity: 0;
    translate: 28px 0;
    will-change: opacity, translate;
    transition: opacity 0.18s ease-in, translate 0.3s cubic-bezier(0.4, 0, 0.6, 1);
}

.mobile-menu[open] :is(.sheet-links a, .sheet-account, .sheet-settings) {
    opacity: 1;
    translate: 0 0;
    transition: opacity 0.4s var(--d, 0.1s) ease-out, translate 0.6s var(--d, 0.1s) cubic-bezier(0.32, 0.72, 0, 1);
}

@starting-style {
    .mobile-menu[open] :is(.sheet-links a, .sheet-account, .sheet-settings) { opacity: 0; translate: 28px 0; }
}

.mobile-menu[open] .sheet-links a:nth-child(1) { --d: 0.08s; }
.mobile-menu[open] .sheet-links a:nth-child(2) { --d: 0.12s; }
.mobile-menu[open] .sheet-links a:nth-child(3) { --d: 0.16s; }
.mobile-menu[open] .sheet-links a:nth-child(4) { --d: 0.2s; }
.mobile-menu[open] .sheet-account { --d: 0.25s; }
.mobile-menu[open] .sheet-settings { --d: 0.3s; }

/* the page behind can't scroll while the menu is open */
html:has(.mobile-menu[open]) { overflow: hidden; }

@keyframes sheet-in {
    from { translate: 0 -12px; opacity: 0; }
}

.topbar .sheet .sheet-links { display: grid; grid-template-columns: 1fr; gap: 4px; }

.sheet-links a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    border-radius: 16px;
    font-family: var(--display);
    font-size: 1.35rem;
    text-decoration: none;
}
.sheet-links a.on, .sheet-links a:active { background: color-mix(in srgb, var(--brand-lime) 26%, var(--surface)); }

.sheet-cup { width: 30px; display: flex; justify-content: center; }
.sheet-cup .cup { font-size: 5px; margin-top: 1.4em; }

.sheet-account, .sheet-settings {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 2px dashed var(--line);
}

.sheet-user { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sheet-user small { display: block; color: var(--muted); }
.avatar-sm { width: 44px; height: 44px; font-size: 1.3rem; box-shadow: none; }

.sheet-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-row .btn { padding: 12px 10px; text-align: center; }
.sheet-signout { display: block; margin: 12px auto 0; }

.sheet-label { margin: 0 0 8px; font-weight: 800; font-size: 0.9rem; color: var(--muted); }
.sheet-label:not(:first-child) { margin-top: 14px; }

.sheet .switch-big { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; font-size: 0.95rem; }
.sheet .switch-big a { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 8px; }
.sheet .switch-big .cart-icon { width: 18px; height: 18px; }

@media (max-width: 1020px) {
    .topbar .main-nav > a { padding: 9px 11px 11px; }
    .topbar .main-nav > a::after { left: 11px; right: 11px; }
}

@media (max-width: 860px) {
    .site-header {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--bg);
    }

    .topbar { grid-template-columns: 1fr auto; padding: 10px 16px; gap: 8px; }
    .topbar .main-nav, .lang-switch, .theme-menu, .tools > .account-link { display: none; }
    .mobile-menu { display: block; }
    .topbar .logo { gap: 9px; }
    .topbar .logo-badge { width: 42px; height: 42px; box-shadow: 0 0 0 2px var(--surface), 0 6px 14px -8px rgba(31, 95, 51, 0.6); }
    .logo-name { font-size: 1.22rem; }
    .logo-tag { font-size: 0.68rem; margin-top: 3px; }
    .tools-divider { display: none; }

    /* dim the page behind the menu; tapping it closes the menu. It always exists
       (invisible and click-through when closed) so it can fade both ways. */
    .mobile-menu > summary::before {
        content: "";
        position: fixed;
        inset: 65px 0 0;
        background: rgba(10, 30, 18, 0.22);
        cursor: default;
        opacity: 0;
        pointer-events: none;
        will-change: opacity;
        contain: strict;
        transition: opacity 0.4s cubic-bezier(0.4, 0, 0.6, 1);
    }

    .mobile-menu[open] > summary::before {
        opacity: 1;
        pointer-events: auto;
        transition: opacity 0.55s cubic-bezier(0.32, 0.72, 0, 1);
    }
}

@keyframes fade-in { from { opacity: 0; } }

/* =====================================================================
   CURSOR — a small glass arrow (lime glass over clickable things)
   and a pearl trail (the trail comes from js/cursor.js)
   ===================================================================== */
@media (hover: hover) and (pointer: fine) {
    :root { --cursor-click: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='bg' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23f2fbd6' stop-opacity='.96'/%3E%3Cstop offset='1' stop-color='%23a8d53b' stop-opacity='.85'/%3E%3C/linearGradient%3E%3Cfilter id='sg' x='-30%25' y='-30%25' width='160%25' height='160%25'%3E%3CfeDropShadow dx='0.8' dy='1.6' stdDeviation='1.1' flood-color='%230e2216' flood-opacity='.45'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M4 2.5 L4 24.5 L9.6 19.2 L13.3 27.6 L17.2 25.9 L13.6 17.6 L21.4 17.6 Z' fill='url%28%23bg%29' stroke='%231f5f33' stroke-width='2.2' stroke-linejoin='round' filter='url%28%23sg%29'/%3E%3Cpath d='M6.2 6.6 L6.2 18.4' stroke='%23fff' stroke-width='2' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E") 3 1, pointer; }

    html, body { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 32 32'%3E%3Cdefs%3E%3ClinearGradient id='bw' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23ffffff' stop-opacity='.96'/%3E%3Cstop offset='1' stop-color='%23d9efb0' stop-opacity='.85'/%3E%3C/linearGradient%3E%3Cfilter id='sw' x='-30%25' y='-30%25' width='160%25' height='160%25'%3E%3CfeDropShadow dx='0.8' dy='1.6' stdDeviation='1.1' flood-color='%230e2216' flood-opacity='.45'/%3E%3C/filter%3E%3C/defs%3E%3Cpath d='M4 2.5 L4 24.5 L9.6 19.2 L13.3 27.6 L17.2 25.9 L13.6 17.6 L21.4 17.6 Z' fill='url%28%23bw%29' stroke='%231f5f33' stroke-width='2.2' stroke-linejoin='round' filter='url%28%23sw%29'/%3E%3Cpath d='M6.2 6.6 L6.2 18.4' stroke='%23fff' stroke-width='2' stroke-linecap='round' opacity='.9'/%3E%3C/svg%3E") 3 1, auto; }

    a, button, summary, label, select, .chip span, .drink, [role="button"] {
        cursor: var(--cursor-click);
    }

    input:not([type="radio"]):not([type="checkbox"]), textarea { cursor: text; }
    button[disabled], .btn[disabled] { cursor: not-allowed; }
}

.cursor-drop {
    position: fixed;
    z-index: 199;
    width: var(--size, 9px);
    height: var(--size, 9px);
    margin: calc(var(--size, 9px) / -2) 0 0 calc(var(--size, 9px) / -2);
    border-radius: 50%;
    pointer-events: none;
    animation: cursor-drop 0.9s cubic-bezier(0.4, 0, 0.8, 0.6) forwards;
}

.cursor-drop.pearl { background: radial-gradient(circle at 35% 30%, #9a6448, #2b1710 60%); }
.cursor-drop.lime { background: radial-gradient(circle at 35% 30%, #e2f5a8, #a8d53b 60%); }
.cursor-drop.orange { background: radial-gradient(circle at 35% 30%, #ffe2a3, #ffb627 60%); }

@keyframes cursor-drop {
    0% { translate: 0 0; scale: 1; opacity: 0.95; }
    100% { translate: var(--drift, 0) 46px; scale: 0.3; opacity: 0; }
}

/* =====================================================================
   KHMER — Khmer letters stack above and below the line, so give them room
   ===================================================================== */
:lang(km) body, body:lang(km) { line-height: 1.8; }
:lang(km) h1, :lang(km) h2, :lang(km) h3, :lang(km) h4 { line-height: 1.45; }
:lang(km) .slide h2 { font-size: clamp(2.1rem, 4.6vw, 3.7rem); line-height: 1.3; max-width: 12ch; }
:lang(km) .bigword { line-height: 1.3; bottom: 30px; }
:lang(km) .cat-text strong { font-size: 1.6rem; line-height: 1.4; }
:lang(km) .menu-head h2, :lang(km) .steps h2 { line-height: 1.35; }
:lang(km) .steps h2 { max-width: 20ch; }
:lang(km) .chip span, :lang(km) .btn { line-height: 1.5; }
:lang(km) .switch a { line-height: 1.6; }
:lang(km) .logo-tag { line-height: 1.5; margin-top: 1px; }

/* =====================================================================
   TABLETS & PHONES
   ===================================================================== */
@media (max-width: 860px) {
    .slide {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        align-items: end;
        padding-top: 10px;
        padding-bottom: 130px;
        gap: 0;
    }
    .slide-art { grid-row: 1; height: auto; align-self: stretch; }
    .slide .cup-xxl { font-size: 26px; }
    .slide .plate { width: 180px; bottom: 4%; }
    .hero { height: 700px; }
    .bigword { top: 3%; bottom: auto; left: 0; right: 0; text-align: center; font-size: 13vw; }

    .categories { grid-template-columns: 1fr; }
    .cat { height: 150px; }
    .cat-cup .cup-lg { font-size: 17px; }

    .steps { padding-top: 64px; }
    .steps ol { grid-template-columns: 1fr; }
    .steps li:not(:last-child)::after { display: none; }

    .builder, .cart-grid { grid-template-columns: 1fr; }
    .builder-art, .checkout { position: static; }
    .stage { height: 340px; padding-bottom: 30px; }
    .stage .cup { font-size: 22px; }
    .builder:has([name="size"][value="large"]:checked) .stage .cup { font-size: 26px; }

    .footer-inner { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
    main { padding: 0 16px 56px; }
    .topbar { padding: 12px 16px; gap: 10px; }
    .topbar nav { gap: 10px 14px; }
    .switch { font-size: 0.8rem; }
    .switch a { padding: 3px 9px; }
    .logo { font-size: 1.35rem; }
    .builder-form, .checkout { padding: 22px; }
    .line { flex-wrap: wrap; }
    .line-side { flex-direction: row; align-items: center; width: 100%; justify-content: space-between; }
    .done { padding: 8px 20px 28px; }

    /* keep "Add to cart" in reach while choosing */
    .add-row {
        position: sticky;
        bottom: 0;
        margin: 24px -22px -22px;
        padding: 16px 22px;
        background: var(--surface);
        border-radius: 0 0 32px 32px;
        box-shadow: 0 -12px 24px -16px rgba(0, 0, 0, 0.3);
    }
}

/* People who turn off motion get a calm, still page */
/* =====================================================================
   PAYMENTS, RECEIPTS, ADMIN DASHBOARD, LIVE CHAT
   ===================================================================== */
:root {
    --ok: #2f8f3a;
    --ok-bg: color-mix(in srgb, var(--brand-lime) 32%, var(--surface));
    --warn: #b06200;
    --warn-bg: color-mix(in srgb, var(--brand-orange) 26%, var(--surface));
    --bad: #c0392b;
    --bad-bg: var(--error-bg);
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="dark"] { --ok: #a8d53b; --warn: #ffb627; --bad: #ff8a7a; }

.mono { font-family: var(--mono); letter-spacing: 0.04em; font-weight: 700; }
.btn-small { padding: 9px 18px; font-size: 0.9rem; margin-top: 12px; }
.eyebrow { margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 800; font-size: 0.78rem; color: var(--accent); }
.btn .cart-icon { vertical-align: -5px; margin-right: 6px; }
.has-badge { position: relative; }
.badge {
    display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin-left: 8px; padding: 0 6px;
    border-radius: 11px; background: var(--bad); color: #fff; font-size: 0.78rem; animation: badge-pop 0.5s var(--spring);
}
@keyframes badge-pop { from { scale: 0; } }

/* ---------- status pills ---------- */
.status {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px 4px 10px; border-radius: 999px;
    font-weight: 700; font-size: 0.82rem; white-space: nowrap;
    background: var(--warn-bg); color: var(--warn);
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-submitted::before { animation: blink 1.2s ease-in-out infinite; }
.status-approved { background: var(--ok-bg); color: var(--ok); }
.status-rejected { background: var(--bad-bg); color: var(--bad); }
@keyframes blink { 50% { opacity: 0.25; scale: 0.7; } }

.order-pills { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

/* ---------- checkout: pay chips ---------- */
.khqr-mini {
    display: inline-block; padding: 1px 7px; border-radius: 6px;
    background: #e1232e; color: #fff; font-size: 0.8rem; letter-spacing: 0.04em;
}

/* ---------- pay box (thank-you page + receipt) ---------- */
.done-pay { margin: 24px 0 18px; text-align: left; }
.done-step { text-align: center; font-weight: 800; color: var(--accent); margin: 0 0 10px; }
.pay-box {
    display: grid; gap: 14px; padding: 24px; border-radius: 26px;
    background: color-mix(in srgb, var(--brand-lime) 14%, var(--surface));
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand-lime) 45%, transparent);
}
.pay-box h2 { font-size: 1.5rem; }
.pay-box p { margin: 0; }
.pay-state { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 1.05rem; }
.pay-icon {
    flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    background: var(--ok); color: var(--surface); font-weight: 900; font-size: 1.3rem;
    animation: badge-pop 0.6s var(--spring);
}
.pay-spin { background: none; border: 4px solid var(--warn-bg); border-top-color: var(--warn); animation: spin 0.9s linear infinite; }
@keyframes spin { to { rotate: 1turn; } }
.pay-approved { background: var(--ok-bg); box-shadow: none; }
.pay-submitted { background: var(--warn-bg); box-shadow: none; }

.khqr-row { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.khqr-card {
    width: 200px; border-radius: 18px; overflow: hidden; background: #fff; color: #111;
    text-align: center; box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.5);
    animation: drop-in 0.6s 0.15s var(--spring) both;
}
.khqr-top {
    position: relative; padding: 9px 0; background: #e1232e; color: #fff;
    font: 800 1.05rem var(--body); letter-spacing: 0.12em;
}
.khqr-top::after {   /* the little red corner of a real KHQR card */
    content: ""; position: absolute; right: 0; bottom: -14px; border: 7px solid transparent;
    border-top-color: #e1232e; border-left-color: #e1232e;
}
.khqr-card img { display: block; width: 100%; height: auto; padding: 14px; }
.khqr-missing { margin: 18px 14px; padding: 18px 12px; border: 2px dashed #ccc; border-radius: 12px; font-size: 0.85rem; color: #555; }
.khqr-name { margin: 0 !important; font-weight: 800; font-size: 0.9rem; }
.khqr-amount { margin: 0 0 12px !important; font: 400 1.6rem var(--display); color: #111; }
.bank { margin: 0; display: grid; gap: 8px; }
.bank div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.bank dt { color: var(--muted); }
.bank dd { margin: 0; text-align: right; }
.paid-form { display: grid; gap: 10px; }
.paid-form label { display: grid; gap: 6px; font-weight: 700; }
.paid-form .btn { justify-self: start; }

/* ---------- receipt ---------- */
.receipt-page { max-width: 1040px; margin: 0 auto; }
.receipt-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.receipt-layout { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 28px; align-items: start; }
.receipt-side { display: grid; gap: 18px; position: sticky; top: 96px; }

.paper {
    --zig: 10px;
    position: relative;
    padding: 34px 30px 40px;
    background: #fffdf6;
    color: #22301f;
    /* torn-paper zigzag at the top and bottom */
    -webkit-mask:
        conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--zig) * 2) var(--zig) repeat-x,
        conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--zig) * 2) var(--zig) repeat-x,
        linear-gradient(#000 0 0) center / 100% calc(100% - var(--zig) * 2 + 1px) no-repeat;
    mask:
        conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / calc(var(--zig) * 2) var(--zig) repeat-x,
        conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / calc(var(--zig) * 2) var(--zig) repeat-x,
        linear-gradient(#000 0 0) center / 100% calc(100% - var(--zig) * 2 + 1px) no-repeat;
    filter: drop-shadow(0 24px 30px rgba(31, 95, 51, 0.25));
    animation: print-out 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    font-size: 0.95rem;
}
@keyframes print-out { from { clip-path: inset(0 0 100% 0); translate: 0 -20px; } to { clip-path: inset(0 0 -40px 0); } }
.paper .muted { color: #5b7562; }
.paper-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding-bottom: 16px; border-bottom: 2px dashed #d3e0c0; }
.paper-head img { border-radius: 50%; }
.paper-brand { margin: 0; font: 400 1.35rem var(--display); color: #1f5f33; line-height: 1; }
.paper-slogan { margin: 2px 0 0; font-size: 0.8rem; color: #5b7562; }
.paper-kind { margin: 0; align-self: start; font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; color: #c06d00; }
.paper-meta { margin: 16px 0 0; display: grid; gap: 6px; }
.paper-meta div { display: flex; justify-content: space-between; gap: 12px; }
.paper-meta dt { color: #5b7562; }
.paper-meta dd { margin: 0; text-align: right; }
.paper-id dd { font-size: 1.15rem; color: #1f5f33; }
.paper .status { font-size: 0.75rem; padding: 2px 9px 2px 8px; }
.paper .status-pending, .paper .status-submitted { background: #ffeccc; color: #9a5600; }
.paper .status-approved { background: #e3f3c4; color: #2f6b1a; }
.paper .status-rejected { background: #fbe4e1; color: #8a1f12; }
.paper-items { list-style: none; margin: 16px 0 0; padding: 14px 0 0; border-top: 2px dashed #d3e0c0; display: grid; gap: 6px; }
.paper-items li { display: flex; justify-content: space-between; gap: 14px; }
.paper-totals { margin: 12px 0 0; padding-top: 10px; border-top: 2px dashed #d3e0c0; }
.paper-totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.paper-totals dd { margin: 0; }
.paper-totals .grand { font-weight: 800; font-size: 1.3rem; color: #1f5f33; }
.paper-qr { display: grid; grid-template-columns: 132px 1fr; gap: 16px; align-items: center; margin-top: 18px; padding-top: 18px; border-top: 2px dashed #d3e0c0; }
.qr-wrap { display: block; padding: 6px; background: #fff; border-radius: 12px; box-shadow: 0 0 0 2px #d3e0c0; }
.qr-wrap svg { display: block; width: 100%; height: auto; }
.paper-qr-id { margin: 0 0 6px; font-size: 1.05rem; color: #1f5f33; }
.paper-qr .muted { font-size: 0.82rem; }
.paper-thanks { margin: 18px 0 0; text-align: center; font-weight: 700; color: #c06d00; }

/* the rubber stamp lands on the paper */
.paper-totals { position: relative; }
.paper-totals .stamp { display: block; }
.stamp {
    position: absolute; top: 50%; left: 50%; translate: -50% -50%; z-index: 2; white-space: nowrap;
    padding: 6px 14px; border: 4px double currentColor; border-radius: 10px;
    font: 400 1.25rem var(--display); text-transform: uppercase; letter-spacing: 0.06em;
    rotate: -12deg; opacity: 0.85; mix-blend-mode: multiply; pointer-events: none;
    color: #c98200;
    animation: stamp 0.55s 0.85s cubic-bezier(0.3, 1.6, 0.5, 1) both;
}
.stamp-approved { color: #2f8f3a; }
.stamp-rejected { color: #c0392b; }
@keyframes stamp { from { scale: 2.6; opacity: 0; rotate: -24deg; } }

.admin-review .review { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- approve / reject buttons ---------- */
.review { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.review .btn { padding: 10px 18px; font-size: 0.92rem; }
.btn-approve { background: var(--ok); color: var(--surface); }
:root[data-theme="dark"] .btn-approve { color: #0e2216; }
.btn-reject:hover { color: var(--bad); }

/* ---------- admin dashboard ---------- */
.admin, .verify, .admin-chats { max-width: 1080px; margin: 0 auto; }
.admin-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin: 8px 0 22px; }
.admin-head h1, .verify h1, .admin-chats h1 { font-size: clamp(2.2rem, 5vw, 3rem); }
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
    position: relative; overflow: hidden;
    padding: 18px 20px; border-radius: 22px; background: var(--surface);
    color: var(--ink); text-decoration: none;
    animation: drop-in 0.5s var(--spring) both;
    transition: translate 0.25s var(--spring), box-shadow 0.25s;
}
.stat:nth-child(2) { animation-delay: 0.05s; }
.stat:nth-child(3) { animation-delay: 0.1s; }
.stat:nth-child(4) { animation-delay: 0.15s; }
a.stat:hover { translate: 0 -3px; box-shadow: var(--shadow); }
.stat p { margin: 0; color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.stat strong { display: block; margin-top: 4px; font: 800 2.2rem var(--body); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-money { background: var(--brand-green); color: var(--brand-cream); }
.stat-money p { color: var(--footer-muted); }
.stat-money::after {   /* a slow liquid wave in the corner */
    content: ""; position: absolute; right: -40px; bottom: -70px; width: 160px; height: 160px; border-radius: 42%;
    background: color-mix(in srgb, var(--brand-lime) 35%, transparent); animation: spin 9s linear infinite;
}
.stat-check.hot { background: var(--warn-bg); }
.stat-check.hot strong { color: var(--warn); animation: badge-pop 0.6s var(--spring); }

.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin-bottom: 16px; border-radius: 999px; background: var(--surface); scrollbar-width: none; }
.admin-tabs a { flex-shrink: 0; padding: 9px 16px; border-radius: 999px; font-weight: 700; color: var(--muted); text-decoration: none; transition: background 0.2s, color 0.2s; }
.admin-tabs a span { margin-left: 4px; padding: 0 7px; border-radius: 9px; background: var(--bg); font-size: 0.8rem; }
.admin-tabs a:hover { color: var(--ink); }
.admin-tabs a.on { background: var(--ink); color: var(--on-ink); }
.admin-tabs a.on span { background: color-mix(in srgb, var(--on-ink) 20%, transparent); }

.pay-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pay-row {
    display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
    padding: 4px 20px 4px 14px; border-radius: 22px; background: var(--surface);
    border-left: 6px solid var(--warn);
    animation: drop-in 0.45s calc(var(--i, 0) * 0.04s) var(--spring) both;
}
.row-submitted { border-left-color: var(--brand-orange); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-orange) 45%, transparent); }
.row-approved { border-left-color: var(--ok); }
.row-rejected { border-left-color: var(--bad); }
.pay-cups { display: flex; align-items: flex-end; }
.pay-main { padding: 14px 0; min-width: 0; }
.pay-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pay-id { color: var(--ink); font-size: 1.05rem; text-underline-offset: 4px; }
.pay-who { margin: 4px 0 0; }
.pay-meta { font-size: 0.88rem; }
.pay-side { display: grid; justify-items: end; gap: 8px; padding: 12px 0; }
.pay-total { font: 400 1.6rem var(--display); }
.small-link { font-size: 0.82rem; }

/* ---------- verify (scan / type) ---------- */
.verify-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 18px; }
.scan-panel { gap: 12px; }
.scan-buttons { display: grid; gap: 10px; }
.photo-btn { position: relative; text-align: center; }
.photo-btn input { position: absolute; inset: 0; opacity: 0; cursor: inherit; }
.scan-msg { margin: 0; min-height: 1.2em; text-align: center; color: var(--muted); font-weight: 500; }
.scan-msg:empty { display: none; }
.or { display: flex; align-items: center; gap: 12px; margin: 4px 0; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.type-form { display: grid; gap: 6px; }
.type-form label { font-weight: 700; }
.type-row { display: flex; gap: 8px; }
.type-row input { flex: 1; min-width: 0; text-transform: uppercase; }
.type-row input::placeholder { text-transform: none; }

.scanner { position: relative; overflow: hidden; aspect-ratio: 1; border-radius: 22px; background: #000; }
.scanner[hidden] { display: none; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 16%; }
.scan-frame i { position: absolute; width: 34px; height: 34px; border: 5px solid var(--brand-lime); transition: border-color 0.2s; }
.scan-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.scan-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.scanner .scan-frame { animation: frame-breathe 1.8s ease-in-out infinite; }
@keyframes frame-breathe { 50% { inset: 18%; } }
.scan-line {
    position: absolute; left: 16%; right: 16%; top: 16%; height: 3px; border-radius: 3px;
    background: var(--brand-lime); box-shadow: 0 0 18px 4px color-mix(in srgb, var(--brand-lime) 70%, transparent);
    animation: scan-move 2s ease-in-out infinite alternate;
}
@keyframes scan-move { to { top: 84%; } }
.scanner.found .scan-frame i { border-color: var(--brand-orange); }
.scanner.found .scan-line { display: none; }
.scanner.found::after { content: ""; position: absolute; inset: 0; background: var(--brand-lime); animation: flash 0.4s ease-out forwards; }
@keyframes flash { from { opacity: 0.6; } to { opacity: 0; } }
.scan-stop { position: absolute; top: 12px; right: 12px; background: rgba(0, 0, 0, 0.55); color: #fff; border: none; }

.verdict {
    display: grid; gap: 10px; justify-items: center; text-align: center;
    padding: 30px 28px; border-radius: 28px; background: var(--surface);
    animation: drop-in 0.5s var(--spring) both;
    --tone: var(--warn); --tone-bg: var(--warn-bg);
}
.verdict-paid { --tone: var(--ok); --tone-bg: var(--ok-bg); }
.verdict-fake, .verdict-rejected { --tone: var(--bad); --tone-bg: var(--bad-bg); }
.verdict-fake { animation: drop-in 0.5s var(--spring) both, shake 0.45s 0.5s; }
.verdict { box-shadow: inset 0 0 0 3px var(--tone-bg); }
.verdict h2 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); color: var(--tone); }
.verdict-icon svg { width: 92px; height: 92px; fill: none; stroke: var(--tone); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.verdict-icon circle { fill: var(--tone-bg); stroke-dasharray: 145; stroke-dashoffset: 145; animation: draw 0.6s 0.1s ease-out forwards; }
.verdict-icon path { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.45s 0.55s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.verdict-reason { margin: 0; max-width: 46ch; font-weight: 500; }
.verdict-id { margin: 0; font-size: 1.25rem; }
.verdict-facts { width: 100%; margin: 6px 0 0; display: grid; gap: 6px; text-align: left; }
.verdict-facts div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.verdict-facts dt { color: var(--muted); }
.verdict-facts dd { margin: 0; text-align: right; }
.verdict-items { width: 100%; margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--bg); text-align: left; list-style: none; display: grid; gap: 4px; }
.verdict-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- live chat ---------- */
.chat-fab {
    position: fixed; right: 24px; bottom: 24px; z-index: 45;
    display: flex; align-items: center; gap: 10px;
    height: 54px; padding: 0 20px 0 15px; border-radius: 999px;
    background: var(--brand-orange); color: var(--brand-green);
    font-weight: 800; text-decoration: none; box-shadow: var(--shadow);
    animation: fab-in 0.6s 0.6s var(--spring) both;
    transition: scale 0.3s var(--spring), translate 0.3s var(--spring);
}
.chat-fab svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.chat-fab svg circle { fill: currentColor; stroke-width: 1.4; }
.chat-fab:hover { scale: 1.05; translate: 0 -2px; }
.chat-fab:hover svg { animation: wiggle 0.5s var(--spring); }
.chat-fab:active { scale: 0.94; }
.chat-fab::before {   /* soft pulse ring */
    content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
    background: var(--brand-orange); animation: pulse 2.6s ease-out infinite;
}
.fab-badge {
    position: absolute; top: -4px; right: -4px; display: grid; place-items: center;
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
    background: var(--bad); color: #fff; font-size: 0.78rem; box-shadow: 0 0 0 3px var(--bg);
    animation: badge-pop 0.6s 1s var(--spring) both;
}
.chat-fab.has-unread { background: var(--brand-lime); }
.chat-fab.has-unread::before { background: var(--brand-lime); }
@keyframes fab-in { from { translate: 0 90px; opacity: 0; } }
@keyframes pulse { from { scale: 1; opacity: 0.5; } 70%, to { scale: 1.35; opacity: 0; } }
@keyframes wiggle { 30% { rotate: -14deg; } 65% { rotate: 10deg; } }

/* the chat bubble sits bottom-right, so "back to top" moves up above it */
body:has(.chat-fab) .to-top { bottom: 92px; }
.js-only[hidden], .chat-empty[hidden], .chat-status[hidden] { display: none !important; }
.photo-btn { display: block !important; }
.admin-review .review { justify-content: flex-start; }
.admin-tabs { flex-wrap: nowrap !important; }
/* Admin button in the top bar (admins only) */
.admin-btn {
    position: relative; display: inline-flex; align-items: center; gap: 7px;
    height: 44px; padding: 0 16px 0 13px; border-radius: 999px;
    background: var(--brand-green); color: var(--brand-cream);
    font-weight: 800; font-size: 0.92rem; text-decoration: none; white-space: nowrap;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-lime) 45%, transparent);
    transition: scale 0.3s var(--spring), background 0.2s, color 0.2s;
}
:root[data-theme="dark"] .admin-btn { background: var(--brand-lime); color: #0e2216; }
.admin-btn:hover { scale: 1.05; background: var(--brand-orange); color: var(--brand-green); }
.admin-btn:hover .cart-icon { animation: wiggle 0.5s var(--spring); }
.admin-btn:active { scale: 0.94; }
.admin-btn.on { box-shadow: 0 0 0 3px var(--brand-orange); }
.topbar nav > a.admin-btn::after { display: none; }

/* "Admin mode" strip with Back to shop, on every admin page */
.admin-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 6px 0 14px; padding: 8px 8px 8px 18px; border-radius: 999px;
    background: color-mix(in srgb, var(--brand-orange) 22%, var(--surface));
    animation: drop-in 0.45s var(--spring) both;
}
.admin-bar-label { display: inline-flex; align-items: center; font-weight: 800; color: var(--accent); }
.btn-shop { padding: 9px 18px; font-size: 0.92rem; background: var(--surface); }
.btn-shop:hover .cart-icon { translate: -4px 0; }
.btn-shop .cart-icon { transition: translate 0.3s var(--spring); }
@media (max-width: 860px) {
    .admin-btn { width: 44px; padding: 0; justify-content: center; }
    .admin-btn-text { display: none; }
}
.count-alert { position: absolute; top: -6px; right: -8px; background: var(--bad); color: #fff; }

.chat-page { max-width: 760px; margin: 0 auto; }
.chat-card { border-radius: 30px; background: var(--surface); overflow: hidden; animation: drop-in 0.5s var(--spring) both; }
.chat-head { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 2px solid var(--line); }
.chat-head img { border-radius: 50%; }
.chat-head h1 { font-size: 1.7rem; }
.chat-head h2 { font-size: 1.35rem; }
.chat-head .muted { margin: 2px 0 0; font-size: 0.9rem; }
.live-dot { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; background: #3fbf4f; box-shadow: 0 0 0 0 #3fbf4f; animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 7px rgba(63, 191, 79, 0); } }

.chat-box { display: flex; flex-direction: column; }
.chat-log {
    list-style: none; margin: 0; padding: 20px 18px;
    height: min(58vh, 560px); overflow-y: auto; overscroll-behavior: contain;
    display: flex; flex-direction: column; gap: 8px;
    background:
        radial-gradient(circle at 12% 20%, color-mix(in srgb, var(--brand-lime) 14%, transparent) 0 4px, transparent 5px) 0 0 / 46px 46px,
        var(--bg);
}
.chat-empty { margin: auto; display: grid; justify-items: center; gap: 10px; color: var(--muted); font-weight: 700; }
.chat-empty-cup .cup { animation: bob 4s ease-in-out infinite; }
.msg { max-width: min(78%, 480px); display: grid; gap: 2px; }
.msg p {
    margin: 0; padding: 10px 14px; border-radius: 20px 20px 20px 6px;
    background: var(--surface); white-space: pre-wrap; overflow-wrap: anywhere;
    box-shadow: 0 6px 14px -10px rgba(31, 95, 51, 0.5);
}
.msg time { font-size: 0.72rem; color: var(--muted); padding: 0 8px; }
.msg.mine { align-self: flex-end; justify-items: end; }
.msg.mine p { border-radius: 20px 20px 6px 20px; background: var(--brand-green); color: var(--brand-cream); }
:root[data-theme="dark"] .msg.mine p { background: var(--brand-lime); color: #0e2216; }
.msg.new { animation: msg-in 0.4s var(--spring) both; transform-origin: bottom left; }
.msg.mine.new { transform-origin: bottom right; }
@keyframes msg-in { from { scale: 0.6; opacity: 0; translate: 0 10px; } }
.chat-status { margin: 0; padding: 8px 18px; background: var(--error-bg); color: var(--error-text); font-weight: 500; }
.chat-form { display: flex; gap: 10px; padding: 14px 16px; border-top: 2px solid var(--line); background: var(--surface); }
.chat-form input { flex: 1; min-width: 0; border-radius: 999px !important; }
.send-btn {
    flex-shrink: 0; display: grid; place-items: center; width: 50px; height: 50px; border: none; border-radius: 50%;
    background: var(--brand-orange); color: var(--brand-green); cursor: var(--cursor-click, pointer);
    transition: scale 0.25s var(--spring), rotate 0.25s var(--spring);
}
.send-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.send-btn:hover { scale: 1.08; rotate: -12deg; }
.chat-form.sending .send-btn { animation: send-off 0.5s ease-in; }
@keyframes send-off { 50% { translate: 8px -8px; opacity: 0; } 51% { translate: -8px 8px; } }
.chat-box noscript { display: block; padding: 0 18px 12px; }

/* admin inbox */
.inbox { display: grid; grid-template-columns: 300px 1fr; margin-top: 18px; border-radius: 28px; overflow: hidden; background: var(--surface); min-height: 520px; }
.inbox-list { border-right: 2px solid var(--line); overflow-y: auto; max-height: 72vh; }
.inbox-list ul { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; }
.inbox-empty { padding: 20px; }
.convo { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 16px; color: var(--ink); text-decoration: none; transition: background 0.2s; }
.convo:hover { background: var(--bg); }
.convo.on { background: color-mix(in srgb, var(--brand-lime) 28%, var(--surface)); }
.convo-text { min-width: 0; display: grid; }
.convo-text strong, .convo-text small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.convo-text small { color: var(--muted); }
.convo time { align-self: start; font-size: 0.72rem; color: var(--muted); }
.convo.unread strong::after { content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 6px; border-radius: 50%; background: var(--bad); vertical-align: 1px; }
.convo.unread small { color: var(--ink); font-weight: 700; }
.inbox-main { display: flex; flex-direction: column; min-width: 0; }
.inbox-main .chat-log { height: min(56vh, 520px); }
.inbox-pick { margin: auto; display: grid; justify-items: center; gap: 8px; }
.inbox-back { display: none; }
.their-payments { padding: 10px 18px 16px; border-top: 2px solid var(--line); }
.their-payments summary { font-weight: 700; cursor: var(--cursor-click, pointer); }
.their-payments ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.their-payments li { display: flex; align-items: center; gap: 12px; }
.their-payments li span:first-of-type { margin-left: auto; font-weight: 700; }

@media (max-width: 860px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .receipt-layout, .verify-grid { grid-template-columns: 1fr; }
    .receipt-side { position: static; }
    .paper { justify-self: center; width: 100%; max-width: 440px; }
    .inbox { grid-template-columns: 1fr; }
    .admin-chats.has-open .inbox-list { display: none; }
    .admin-chats:not(.has-open) .inbox-main { display: none; }
    .inbox-back { display: block; margin: 0; width: 26px; height: 26px; font-size: 0; }
    .inbox-back::before { content: "‹"; font-size: 2rem; line-height: 0.7; }
}
@media (max-width: 620px) {
    .pay-row { grid-template-columns: 1fr; gap: 0; padding: 4px 16px 6px; }
    .pay-cups { display: none; }
    .pay-side { grid-template-columns: auto 1fr; justify-items: start; align-items: center; padding-top: 0; }
    .pay-side .review { justify-content: flex-end; }
    .pay-side .small-link { grid-column: 1 / -1; }
    .khqr-row { grid-template-columns: 1fr; justify-items: center; }
    .bank { width: 100%; }
    .chat-fab { right: 16px; bottom: 16px; padding: 0 15px; }
    body:has(.chat-fab) .to-top { right: 16px; }
    .chat-fab-label { display: none; }
    .paper { padding: 30px 20px 36px; }
    .paper-qr { grid-template-columns: 110px 1fr; }
    .stamp { font-size: 1rem; left: 46%; }
}

/* print just the receipt paper */
@media print {
    body { background: #fff !important; }
    .site-header, .site-footer, .to-top, .chat-fab, .toast, .no-print, .intro, .cursor-drop { display: none !important; }
    .receipt-layout { display: block; }
    .paper { animation: none; filter: none; -webkit-mask: none; mask: none; margin: 0 auto; max-width: 420px; }
    .stamp { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
    .slide:first-of-type { opacity: 1; visibility: visible; }
    .floaters, .hero-dots, .rain, .intro, .fly-cup, .cursor-drop, .scan-line { display: none; }
    .verdict-icon circle, .verdict-icon path { stroke-dashoffset: 0; }
    .toast { animation: none; }
    @view-transition { navigation: none; }
}

/* ---------- Add to cart without reloading (cart.js) ---------- */
.fly-clone {
    position: fixed; z-index: 90; pointer-events: none;
    display: grid; place-items: center;
    will-change: transform, opacity;
    filter: drop-shadow(0 18px 18px rgba(0, 0, 0, 0.25));
}
.fly-clone .cup { margin: 0; }
.add-pearl {
    position: fixed; z-index: 91; pointer-events: none;
    width: 11px; height: 11px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #8a5a3c, #2b1608 70%);
}
.cart-link.catch { animation: cart-catch 0.55s var(--spring); }
.cart-link.catch::after {   /* a soft ring when the cup lands */
    content: ""; position: absolute; inset: -4px; border-radius: 50%;
    border: 3px solid var(--brand-lime); pointer-events: none;
    animation: catch-ring 0.6s ease-out forwards;
}
@keyframes catch-ring { from { scale: 0.7; opacity: 1; } to { scale: 1.7; opacity: 0; } }

.btn-add { position: relative; overflow: hidden; }
.btn-add-done {
    position: absolute; inset: 0; display: grid; place-items: center;
    background: var(--brand-lime); color: #0e2216; font-weight: 800;
    translate: 0 105%; transition: translate 0.35s var(--spring);
}
.btn-add.done .btn-add-done { translate: 0 0; }
.btn-add.busy { pointer-events: none; }
.btn-add.busy .btn-cart { animation: cart-roll 0.6s ease-in-out infinite; }
@keyframes cart-roll { 50% { translate: 6px 0; rotate: -10deg; } }

/* Phones, drink page: the "Add to cart" bar is at the bottom, so lift the floating buttons and the message above it */
@media (max-width: 520px) {
    .page-drink .chat-fab { bottom: 100px; }
    body.page-drink:has(.chat-fab) .to-top { bottom: 166px; }
    .page-drink .toast { bottom: 100px; }
}

/* ---------- Cart: total updates the moment you pick "Delivery" (CSS :has, no reload) ---------- */
.live-totals .fee-row, .live-totals .total-delivery { display: none; }
.checkout:has(input[name="method"][value="delivery"]:checked) .live-totals .fee-row { display: flex; animation: fee-in 0.4s var(--spring); }
.checkout:has(input[name="method"][value="delivery"]:checked) .total-pickup { display: none; }
.checkout:has(input[name="method"][value="delivery"]:checked) .total-delivery { display: inline-block; animation: total-pop 0.45s var(--spring); }
.checkout:has(input[name="method"][value="pickup"]:checked) .total-pickup { display: inline-block; animation: total-pop 0.45s var(--spring); }
@keyframes fee-in { from { opacity: 0; translate: 0 -8px; } }
@keyframes total-pop { 40% { scale: 1.15; color: var(--accent); } }

/* the delivery address only appears when you choose Delivery */
.checkout:has(input[name="method"][value="pickup"]:checked) .address-field { display: none; }
.checkout:has(input[name="method"][value="delivery"]:checked) .address-field { animation: fee-in 0.4s var(--spring); }

/* ---------- Notifications switch (push.js) ---------- */
.push-card { display: grid; gap: 14px; margin: 0 0 22px; animation: drop-in 0.5s var(--spring) both; }
.push-card[hidden] { display: none; }
.push-top { display: flex; gap: 14px; align-items: flex-start; }
.push-top h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 1.4rem; }
.push-top p { margin: 4px 0 0; }
.push-bell {
    flex-shrink: 0; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px;
    background: color-mix(in srgb, var(--brand-orange) 30%, var(--surface)); color: var(--brand-green);
}
:root[data-theme="dark"] .push-bell { color: var(--brand-orange); }
.push-bell svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; transform-origin: 50% 10%; }
.push-card.is-on .push-bell { background: var(--ok-bg); color: var(--ok); }
.push-card.is-on .push-bell svg { animation: ring 1.6s 0.3s ease-in-out; }
@keyframes ring { 10%, 30% { rotate: 14deg; } 20%, 40% { rotate: -14deg; } 50% { rotate: 6deg; } 60% { rotate: 0deg; } }
.push-dot {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px 3px 9px; border-radius: 999px;
    font: 700 0.8rem var(--body); background: var(--bg); color: var(--muted);
}
.push-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.push-card.is-on .push-dot { background: var(--ok-bg); color: var(--ok); }
.push-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.push-actions [hidden] { display: none; }
.push-msg { margin: 0; font-weight: 600; color: var(--accent); }
.push-msg[hidden], .push-ios[hidden] { display: none; }
.push-ios { padding: 14px 18px; border-radius: 16px; background: var(--bg); }
.push-ios p { margin: 0 0 6px; }
.push-ios ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.ios-share { width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: #2f7cf6; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-page .push-card { margin-top: 18px; }

/* ---------- receipt changes live (live.js) ---------- */
.live-updated { animation: live-pop 0.6s var(--spring); }
.paper.live-updated { animation: none; }
.paper.live-updated .stamp { animation: stamp 0.55s 0.15s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes live-pop { from { scale: 0.96; opacity: 0.4; } }

/* ---------- drawer fixes ----------
   1. a little space between the two rows of account buttons
   2. the glass stays still and only the inside scrolls, so the glass light covers the
      whole card (before, the bottom of a scrolled drawer showed a plain band) */
.sheet-row + .sheet-row { margin-top: 8px; }
.sheet { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.sheet-scroll {
    flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
    padding: 16px 18px calc(28px + env(safe-area-inset-bottom));
}

/* ---------- pop-up notifications inside the page (notify.js) ---------- */
.notify-stack {
    position: fixed; top: 84px; right: 18px; z-index: 950;
    display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: none;
}
.notify {
    position: relative; overflow: hidden; pointer-events: auto;
    display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
    padding: 14px 14px 16px; border-radius: 22px;
    color: var(--ink); text-decoration: none;
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
    border: 1px solid color-mix(in srgb, var(--brand-lime) 45%, transparent);
    box-shadow: 0 18px 40px -14px rgba(10, 40, 20, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    animation: notify-in 0.55s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.notify:hover { border-color: var(--brand-orange); }
.notify.leaving { animation: notify-out 0.32s ease-in forwards; }
.notify-icon {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px;
    background: color-mix(in srgb, var(--brand-lime) 30%, var(--surface)); font-size: 1.3rem;
    animation: notify-wiggle 0.7s 0.35s ease-in-out;
}
.notify-text { display: grid; gap: 2px; min-width: 0; }
.notify-text strong { font-size: 0.98rem; line-height: 1.25; }
.notify-text span {
    color: var(--muted); font-size: 0.9rem; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notify-close {
    align-self: start; width: 28px; height: 28px; border: 0; border-radius: 50%;
    background: transparent; color: var(--muted); font-size: 0.85rem; cursor: var(--cursor-click, pointer);
}
.notify-close:hover { background: var(--bg); color: var(--ink); }
.notify-timer {     /* the line at the bottom that shows when it will go away */
    position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; transform-origin: left;
    background: linear-gradient(90deg, var(--brand-lime), var(--brand-orange));
    animation: notify-timer 7s linear forwards;
}
.notify.held .notify-timer { animation-play-state: paused; }
@keyframes notify-in { from { opacity: 0; translate: 40px 0; scale: 0.92; } }
@keyframes notify-out { to { opacity: 0; translate: 40px 0; scale: 0.95; } }
@keyframes notify-wiggle { 25% { rotate: -12deg; } 55% { rotate: 10deg; } 80% { rotate: -4deg; } }
@keyframes notify-timer { to { transform: scaleX(0); } }
@media (max-width: 620px) {
    .notify-stack { top: 74px; left: 12px; right: 12px; width: auto; }
    @keyframes notify-in { from { opacity: 0; translate: 0 -30px; scale: 0.95; } }
    @keyframes notify-out { to { opacity: 0; translate: 0 -30px; } }
}
@media print { .notify-stack { display: none; } }

/* ---------- "typing…" dots in the chat (chat.js) ---------- */
.typing-row {
    display: flex; align-items: center; gap: 8px;
    padding: 0 18px 10px; background: var(--bg);
    animation: msg-in 0.35s var(--spring) both; transform-origin: bottom left;
}
.typing-row[hidden] { display: none; }
.typing-row small { color: var(--muted); font-size: 0.78rem; }
.typing-bubble {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 12px 16px; border-radius: 20px 20px 20px 6px;
    background: var(--surface); box-shadow: 0 6px 14px -10px rgba(31, 95, 51, 0.5);
}
.typing-bubble i {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--muted); opacity: 0.5;
    animation: typing-dot 1.2s ease-in-out infinite;
}
.typing-bubble i:nth-child(2) { animation-delay: 0.16s; }
.typing-bubble i:nth-child(3) { animation-delay: 0.32s; }
@keyframes typing-dot {
    0%, 60%, 100% { translate: 0 0; opacity: 0.45; }
    30% { translate: 0 -6px; opacity: 1; background: var(--brand-green); }
}
:root[data-theme="dark"] .typing-bubble i { background: var(--brand-lime); }

/* =====================================================================
   WELCOME CARDS (first visit): choose language -> agree to terms
   Liquid glass: white glass in light mode, green glass in dark mode.
   ===================================================================== */
html.welcome-open, html:has(.welcome) { overflow: hidden; }
.welcome {
    position: fixed; inset: 0; z-index: 95;          /* under the opening animation, over everything else */
    display: grid; place-items: center; padding: 18px; overflow-y: auto;
    background: color-mix(in srgb, var(--brand-green) 28%, rgba(0, 0, 0, 0.35));
    -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
    animation: welcome-fade 0.5s ease-out both;
}
.welcome.after-intro { animation-delay: 2.3s; }
.welcome.after-intro .welcome-card { animation-delay: 2.45s; }
@keyframes welcome-fade { from { opacity: 0; } }

/* soft colour blobs behind the glass, so the glass has something to bend */
.welcome-blob { position: absolute; border-radius: 50%; filter: blur(30px); opacity: 0.75; pointer-events: none; }
.blob-a { width: 340px; height: 340px; left: 8%; top: 12%; background: var(--brand-lime); animation: blob-float 9s ease-in-out infinite alternate; }
.blob-b { width: 300px; height: 300px; right: 6%; bottom: 10%; background: var(--brand-orange); animation: blob-float 11s ease-in-out infinite alternate-reverse; }
@keyframes blob-float { to { translate: 40px -30px; scale: 1.12; } }

.glass-card {
    --g-tint: rgba(255, 255, 255, 0.42);
    --g-edge: rgba(255, 255, 255, 0.85);
    --g-chip: rgba(255, 255, 255, 0.5);
    position: relative; isolation: isolate; overflow: hidden;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.4), transparent 50%), var(--g-tint);
    -webkit-backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
    backdrop-filter: blur(24px) saturate(1.9) brightness(1.05);
    border: 1px solid var(--g-edge);
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.8), inset 0 -40px 70px -50px rgba(168, 213, 59, 0.5),
                0 30px 70px -25px rgba(10, 40, 20, 0.55);
}
:root[data-theme="dark"] .glass-card {
    --g-tint: rgba(31, 95, 51, 0.45);
    --g-edge: rgba(168, 213, 59, 0.38);
    --g-chip: rgba(14, 34, 22, 0.4);
    background: linear-gradient(150deg, rgba(168, 213, 59, 0.2), transparent 50%), var(--g-tint);
    -webkit-backdrop-filter: blur(24px) saturate(1.6) brightness(0.9);
    backdrop-filter: blur(24px) saturate(1.6) brightness(0.9);
    box-shadow: inset 1px 1px 0 rgba(214, 240, 160, 0.35), 0 30px 70px -25px rgba(0, 0, 0, 0.7);
}
.glass-card::before {        /* glare + warm caustic, drifting like a tilted glass */
    content: ""; position: absolute; inset: -20% -30%; z-index: -1; pointer-events: none;
    background:
        radial-gradient(ellipse 40% 20% at 25% 5%, rgba(255, 255, 255, 0.55), transparent 70%),
        radial-gradient(ellipse 40% 30% at 85% 95%, rgba(255, 182, 39, 0.22), transparent 70%);
    animation: glass-tilt 14s ease-in-out infinite alternate;
}
.glass-card::after {         /* one glint that crosses the card when it appears */
    content: ""; position: absolute; top: -40%; left: 0; width: 45%; height: 180%; z-index: -1; pointer-events: none;
    rotate: 18deg; translate: -170% 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45) 50%, transparent);
    animation: glint-pass 1.6s 0.6s cubic-bezier(0.45, 0, 0.25, 1) forwards;
}
.welcome.after-intro .glass-card::after { animation-delay: 3s; }
@keyframes glint-pass { to { translate: 300% 0; } }

.welcome-card {
    width: min(460px, 100%); padding: 30px 28px 26px; border-radius: 34px; text-align: center;
    animation: welcome-pop 0.7s 0.1s cubic-bezier(0.2, 1.25, 0.4, 1) both;
}
@keyframes welcome-pop { from { opacity: 0; translate: 0 40px; scale: 0.9; } }
.welcome-steps { display: flex; justify-content: center; gap: 6px; margin-bottom: 14px; }
.welcome-steps span { width: 22px; height: 6px; border-radius: 3px; background: var(--g-chip); transition: width 0.3s; }
.welcome-steps .on { width: 40px; background: var(--brand-orange); }
.welcome-steps .is-done { background: var(--brand-lime); }
.welcome-logo { border-radius: 50%; box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5); animation: bob 4s ease-in-out infinite; }
.welcome-card h2 { margin: 12px 0 6px; font-size: clamp(1.5rem, 5vw, 1.9rem); line-height: 1.2; }
.km-line { display: block; margin-top: 6px; font: 700 1.05rem var(--body); color: var(--muted); }
.welcome-lead { margin: 0 0 14px; color: var(--muted); }

.lang-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.lang-choice {
    display: grid; justify-items: center; gap: 4px; padding: 18px 10px; border-radius: 24px;
    background: var(--g-chip); border: 1px solid var(--g-edge); color: var(--ink); text-decoration: none;
    transition: translate 0.3s var(--spring), background 0.25s, box-shadow 0.25s;
    animation: welcome-pop 0.6s 0.35s cubic-bezier(0.2, 1.25, 0.4, 1) both;
}
.lang-choice + .lang-choice { animation-delay: 0.45s; }
.welcome.after-intro .lang-choice { animation-delay: 2.7s; }
.welcome.after-intro .lang-choice + .lang-choice { animation-delay: 2.8s; }
.lang-choice:hover { translate: 0 -4px; background: color-mix(in srgb, var(--brand-lime) 35%, transparent); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.4); }
.lang-choice:active { translate: 0 0; scale: 0.97; }
.lang-flag {
    display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; margin-bottom: 4px;
    background: var(--brand-green); color: var(--brand-cream); font: 400 1.5rem var(--display);
}
.lang-choice:last-child .lang-flag { background: var(--brand-orange); color: var(--brand-green); font-family: "Koulen", var(--body); }
.lang-choice strong { font-size: 1.15rem; }
.lang-choice small { color: var(--muted); font-size: 0.82rem; }

.welcome-points { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; text-align: left; }
.welcome-points li {
    display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
    padding: 10px 12px; border-radius: 16px; background: var(--g-chip); font-size: 0.92rem;
}
.welcome-form { display: grid; gap: 10px; text-align: left; }
.check-row {
    position: relative; display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start;
    padding: 12px 14px; border-radius: 18px; background: var(--g-chip); border: 1px solid transparent;
    cursor: var(--cursor-click, pointer); transition: border-color 0.2s, background 0.2s;
}
.check-row[hidden] { display: none; }
.check-row:has(input:checked) { border-color: color-mix(in srgb, var(--brand-lime) 70%, transparent); }
.check-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
    width: 24px; height: 24px; margin-top: 1px; border-radius: 8px; border: 2px solid var(--muted);
    display: grid; place-items: center; transition: background 0.2s, border-color 0.2s;
}
.check-box::after { content: "✓"; font-weight: 900; color: #0e2216; scale: 0; transition: scale 0.25s var(--spring); }
.check-row input:checked + .check-box { background: var(--brand-lime); border-color: var(--brand-lime); }
.check-row input:checked + .check-box::after { scale: 1; }
.check-row input:focus-visible + .check-box { outline: 3px solid var(--brand-orange); outline-offset: 2px; }
.check-row a { color: inherit; font-weight: 800; text-decoration-color: var(--brand-orange); text-underline-offset: 3px; }
.check-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.82rem; }
.welcome-push.is-off { opacity: 0.55; }
.welcome-ios { margin: 0; padding: 10px 12px; border-radius: 14px; background: var(--g-chip); font-size: 0.85rem; color: var(--muted); }
.welcome-ios[hidden] { display: none; }
.welcome-go { margin-top: 4px; }
.welcome-form:has([name=agree]:not(:checked)) .welcome-go { opacity: 0.55; }
.welcome-back { justify-self: center; font-size: 0.9rem; }

/* Terms / Privacy pages */
.legal { max-width: 760px; margin: 10px auto 30px; padding: 28px clamp(20px, 5vw, 44px); border-radius: 32px; }
.legal h1 { font-size: clamp(2rem, 6vw, 2.8rem); margin: 4px 0; }
.legal h2 { font-size: 1.25rem; margin: 24px 0 6px; }
.legal p, .legal li { line-height: 1.7; }
.legal ul { padding-left: 20px; }
.legal-tabs { display: flex; gap: 8px; margin: 16px 0 4px; flex-wrap: wrap; }
.legal-tabs a { padding: 8px 16px; border-radius: 999px; background: var(--g-chip); color: var(--ink); font-weight: 700; text-decoration: none; }
.legal-tabs a.on { background: var(--ink); color: var(--on-ink); }
.copy a { color: inherit; }

@media (max-width: 520px) {
    .welcome { place-items: end center; padding: 12px; }
    .welcome-card { padding: 24px 18px 20px; border-radius: 30px; }
    .blob-a { width: 220px; height: 220px; }
    .blob-b { width: 200px; height: 200px; }
}
@media (prefers-reduced-motion: reduce) { .glass-card::after { display: none; } }
/* welcome: centre the card, but if it's taller than the screen it scrolls from its top (never cut off) */
.welcome { display: flex; flex-direction: column; align-items: center; }
.welcome-card { margin: auto 0; flex-shrink: 0; }
@media (max-width: 520px) { .welcome-card { margin: auto 0 0; } }
/* agreement step: a bit more compact so it fits on one screen */
.welcome-card:has(.welcome-form) { padding-top: 22px; }
.welcome-card:has(.welcome-form) .welcome-logo { width: 54px; height: 54px; }
.welcome-card:has(.welcome-form) h2 { margin-top: 6px; }
.welcome-points { gap: 6px; margin-bottom: 12px; }
.welcome-points li { padding: 8px 12px; font-size: 0.88rem; }
.check-row { padding: 10px 12px; }

/* ---------- message ticks, like WhatsApp: ✓ sent · ✓✓ delivered · blue ✓✓ read ---------- */
.msg time { display: inline-flex; align-items: center; gap: 4px; }
.ticks { display: inline-flex; width: 19px; height: 12px; color: var(--muted); }
.ticks svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.ticks-sent .t2 { display: none; }                  /* one tick */
.ticks-read { color: #34b7f1; }                      /* WhatsApp blue */
:root[data-theme="dark"] .ticks-read { color: #53bdeb; }
.tick-change { animation: tick-pop 0.45s var(--spring); }
.tick-change .t2 { stroke-dasharray: 12; stroke-dashoffset: 12; animation: tick-draw 0.35s 0.05s ease-out forwards; }
@keyframes tick-pop { 40% { scale: 1.35; } }
@keyframes tick-draw { to { stroke-dashoffset: 0; } }

/* the little label above a tick: "Sent / Delivered / Read" */
.ticks { position: relative; outline: none; cursor: default; }
.ticks::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 8px); right: -6px; z-index: 5;
    padding: 5px 10px; border-radius: 10px; white-space: nowrap;
    background: var(--brand-orange); color: var(--brand-green); font: 700 0.75rem var(--body);
    box-shadow: 0 8px 18px -8px rgba(0, 0, 0, 0.45);
    opacity: 0; translate: 0 4px; pointer-events: none;
    transition: opacity 0.18s, translate 0.18s;
}
.ticks::before {       /* the small arrow under the label */
    content: ""; position: absolute; bottom: calc(100% + 3px); right: 4px; z-index: 5;
    border: 5px solid transparent; border-top-color: var(--brand-orange);
    opacity: 0; transition: opacity 0.18s; pointer-events: none;
}
.ticks:hover::after, .ticks:focus::after { opacity: 1; translate: 0 0; }
.ticks:hover::before, .ticks:focus::before { opacity: 1; }
.ticks-read::after { background: #34b7f1; color: #04202c; }
.ticks-read::before { border-top-color: #34b7f1; }

/* ---------- admin: customers + clear chat / disable ---------- */
.btn-small-pill { padding: 8px 14px; font-size: 0.86rem; }
.btn-small-pill .cart-icon { width: 17px; height: 17px; margin-right: 5px; vertical-align: -3px; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 85%, #000); }
.btn-disable:hover { color: var(--bad); border-color: var(--bad); }
.btn-enable { background: var(--ok); color: var(--surface); }
.manage { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; margin-left: auto; }
.confirm { position: relative; }
.confirm > summary { list-style: none; cursor: var(--cursor-click, pointer); }
.confirm > summary::-webkit-details-marker { display: none; }
.confirm-box {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; width: min(290px, 80vw);
    display: grid; gap: 10px; padding: 14px; border-radius: 18px;
    background: var(--surface); box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.45);
    border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
    animation: drop-in 0.3s var(--spring) both;
}
.confirm-box p { margin: 0; font-weight: 600; font-size: 0.92rem; }
.confirm-box input { width: 100%; }
.chat-head .manage { margin-left: auto; }
.chat-who h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.customer-search input { width: min(320px, 80vw); border-radius: 999px !important; }
.customer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.customer-row {
    display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
    padding: 14px 18px; border-radius: 22px; background: var(--surface);
    animation: drop-in 0.45s calc(var(--i, 0) * 0.04s) var(--spring) both;
}
.customer-row.is-banned { opacity: 0.75; box-shadow: inset 4px 0 0 var(--bad); }
.customer-main { min-width: 0; }
.customer-main p { margin: 0; }
.customer-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.customer-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 4px !important; font-size: 0.86rem; color: var(--muted); }
.customer-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: flex-start; }
@media (max-width: 720px) {
    .customer-row { grid-template-columns: auto 1fr; }
    .customer-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .confirm-box { left: 0; right: auto; }
    .chat-head { flex-wrap: wrap; }
}
/* the "Are you sure?" box opens above the rows below it */
.customer-row, .chat-head { position: relative; }
.customer-row:has(.confirm[open]), .chat-head:has(.confirm[open]) { z-index: 30; }
.customer-search input {
    padding: 11px 18px; border: 2px solid var(--line); background: var(--surface);
    color: var(--ink); font: inherit; outline: none;
}
.customer-search input:focus { border-color: var(--brand-lime); }

.inbox-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- wishlist ♥ ---------- */
.drink-wrap { position: relative; display: grid; }
.drink-wrap > .drink { height: 100%; }
.wish-form { margin: 0; }
.wish-on-card { position: absolute; top: 12px; right: 12px; z-index: 3; }
.wish-on-stage { position: absolute; top: 6px; right: 6px; z-index: 3; }
.wish-btn {
    display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--surface) 60%, transparent);
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    color: var(--ink); cursor: var(--cursor-click, pointer);
    box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.35);
    transition: scale 0.3s var(--spring), background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.wish-on-stage .wish-btn { width: 50px; height: 50px; }
.wish-btn svg { width: 22px; height: 22px; fill: transparent; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; transition: fill 0.2s, stroke 0.2s; }
.wish-btn:hover { scale: 1.1; }
.wish-btn:hover svg { stroke: #ff4d6d; }
.wish-btn:active { scale: 0.9; }
.wish-btn.on svg { fill: #ff4d6d; stroke: #ff4d6d; animation: heart-pop 0.45s var(--spring); }
@keyframes heart-pop { 30% { scale: 1.45; } 60% { scale: 0.9; } }
.wish-bit { position: fixed; z-index: 1001; color: #ff4d6d; font-size: 13px; pointer-events: none; }

.wish-link { position: relative; }
.wish-link .cart-icon { fill: none; }
.wish-link.on { color: #ff4d6d; }
.wish-link .wish-count { position: absolute; top: -6px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; line-height: 22px; font-size: 0.75rem; background: #ff4d6d; color: #fff; }
.wish-count[hidden] { display: none !important; }
.sheet-heart { font-size: 1.6rem; color: #ff4d6d; }
.sheet-links .wish-count { margin-left: auto; background: #ff4d6d; color: #fff; font-family: var(--body); font-size: 0.85rem; }

.wishlist-page { max-width: 1100px; margin: 0 auto; }
.wishlist-page h1 { font-size: clamp(2.2rem, 6vw, 3.2rem); display: flex; align-items: center; gap: 12px; }
.wish-title-heart { color: #ff4d6d; animation: heart-beat 1.6s ease-in-out infinite; display: inline-block; }
@keyframes heart-beat { 0%, 40%, 100% { scale: 1; } 20% { scale: 1.18; } }
.wish-grid { margin-top: 20px; }
.wish-item { animation: drop-in 0.45s calc(var(--i, 0) * 0.05s) var(--spring) both; transition: opacity 0.3s, scale 0.3s; }
.wish-item.leaving { opacity: 0; scale: 0.9; }
.wish-empty { display: grid; justify-items: center; gap: 12px; padding: 40px 20px; text-align: center; }
.wish-empty-heart { font-size: 4rem; color: #ff4d6d; line-height: 1; animation: heart-beat 1.6s ease-in-out infinite; }

/* The wishlist heart lives top-right, so the Best seller / New sticker moves top-left */
.drink-wrap .sticker { right: auto; left: 14px; rotate: -12deg; }

/* =====================================================================
   ORDER TRACKING, DELIVERY RIDERS, LIVE MAPS
   ===================================================================== */
/* ---------- stage pills ---------- */
.trk { background: var(--warn-bg); color: var(--warn); }
.trk-confirmed, .trk-delivered { background: var(--ok-bg); color: var(--ok); }
.trk-preparing::before, .trk-out::before { animation: blink 1.2s ease-in-out infinite; }
.trk-ready { background: color-mix(in srgb, #4fb3ff 22%, var(--surface)); color: #1d6fb8; }
.trk-out { background: color-mix(in srgb, #ff6f3c 20%, var(--surface)); color: #c2410c; }
.trk-rejected { background: var(--bad-bg); color: var(--bad); }
:root[data-theme="dark"] .trk-ready { color: #8fd0ff; }
:root[data-theme="dark"] .trk-out { color: #ffb08f; }

/* ---------- tracking page ---------- */
.track { max-width: 1120px; margin: 0 auto; }
.track-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: start; margin-top: 10px; }
.track-main, .track-side { display: grid; gap: 18px; min-width: 0; }
.track-card, .track-order, .track-steps, .track-map-card, .rider-card {
    border-radius: 28px; background: var(--surface); animation: drop-in 0.5s var(--spring) both;
}
.track-card { padding: 22px 24px 26px; overflow: hidden; }
.track-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.track-live { display: inline-flex; align-items: center; font-weight: 800; font-size: 0.82rem; color: var(--ok); }
.track-stage {
    position: relative; margin: 10px -8px 6px; border-radius: 22px; aspect-ratio: 320 / 220; max-height: 360px;
    background: radial-gradient(120% 90% at 50% 100%, color-mix(in srgb, var(--brand-lime) 26%, var(--surface)), color-mix(in srgb, var(--brand-cream) 60%, var(--surface)));
    overflow: hidden;
}
:root[data-theme="dark"] .track-stage { background: radial-gradient(120% 90% at 50% 100%, #24502f, #173823); }
.track[data-stage="rejected"] .track-stage { background: radial-gradient(120% 90% at 50% 100%, var(--bad-bg), var(--surface)); }
.track-words { text-align: center; }
.track-words.pop-in { animation: live-pop 0.6s var(--spring); }
.track-title { margin: 6px 0 6px; font-size: clamp(1.8rem, 4.4vw, 2.6rem); line-height: 1.1; }
.track-text { margin: 0 auto; max-width: 46ch; color: var(--muted); }
.track-eta {
    display: inline-flex; margin: 14px 0 0; padding: 8px 16px; border-radius: 999px;
    background: color-mix(in srgb, #ff6f3c 16%, var(--surface)); color: #c2410c; font-weight: 800;
}
.track-eta[hidden] { display: none; }
:root[data-theme="dark"] .track-eta { color: #ffb08f; }

/* the steps: a line of dots that fill in */
.track-steps { list-style: none; margin: 0; padding: 22px 18px; display: grid; grid-template-columns: repeat(5, 1fr); counter-reset: s; }
.tstep { position: relative; display: grid; align-content: start; justify-items: center; gap: 6px; text-align: center; font-size: 0.86rem; color: var(--muted); }
.tstep::before {     /* the line to the previous dot */
    content: ""; position: absolute; top: 15px; right: 50%; width: 100%; height: 4px; border-radius: 2px;
    background: linear-gradient(90deg, var(--ok) var(--fill, 0%), var(--line) var(--fill, 0%));
    transition: --fill 0.8s;
}
.tstep:first-child::before { display: none; }
.tstep.is-done::before, .tstep.is-now::before { --fill: 100%; }
.tstep-dot {
    position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: var(--surface); border: 3px solid var(--line); transition: background 0.4s, border-color 0.4s, scale 0.4s var(--spring);
}
.tstep-dot svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; scale: 0.3; transition: 0.4s var(--spring); }
.tstep.is-done .tstep-dot { background: var(--ok); border-color: var(--ok); }
.tstep.is-done .tstep-dot svg { opacity: 1; scale: 1; }
:root[data-theme="dark"] .tstep.is-done .tstep-dot svg { stroke: #0e2216; }
.tstep.is-now .tstep-dot { border-color: var(--brand-orange); background: var(--brand-orange); scale: 1.1; animation: step-ping 1.6s infinite; }
.tstep.is-now { color: var(--ink); font-weight: 800; }
.tstep.is-done { color: var(--ink); font-weight: 700; }
.tstep.is-bad .tstep-dot { background: var(--bad); border-color: var(--bad); animation: none; }
.tstep.is-bad .tstep-dot svg { opacity: 1; scale: 1; }
.tstep-dot .i-no, .tstep.is-bad .tstep-dot .i-ok { display: none; }
.tstep.is-bad .tstep-dot .i-no { display: inline; }
.tstep.is-bad { color: var(--bad); }
.tstep-time { font-size: 0.78rem; color: var(--muted); font-weight: 600; min-height: 1em; font-variant-numeric: tabular-nums; }
@keyframes step-ping { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand-orange) 60%, transparent); } 80%, 100% { box-shadow: 0 0 0 12px transparent; } }
@property --fill { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

.track-order { padding: 22px 24px; }
.track-order h2 { font-size: 1.4rem; margin-bottom: 10px; }
.track-items { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.track-items li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: 0.92rem; }
.track-address { margin: 8px 0 0; font-size: 0.9rem; }
.track-links { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- maps ---------- */
.map { height: 340px; border-radius: 22px; overflow: hidden; background: color-mix(in srgb, var(--brand-lime) 18%, var(--surface)); z-index: 0; }
.track-map-card, .rider-map-card { position: relative; padding: 8px; }
.track-map-card[hidden], .rider-card[hidden] { display: none; }
.map-wait {
    position: absolute; left: 50%; bottom: 22px; translate: -50% 0; z-index: 500; margin: 0;
    padding: 8px 16px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; font-size: 0.86rem; white-space: nowrap;
}
.map-wait[hidden] { display: none; }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(0.85) contrast(0.9) saturate(0.7); }
.leaflet-container { font-family: var(--body); }
.leaflet-control-attribution { font-size: 10px; }
.map-pin-wrap { background: none; border: 0; }
.map-pin {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50% 50% 50% 6px; rotate: -45deg;
    background: var(--brand-green); border: 3px solid #fff; box-shadow: 0 8px 16px -6px rgba(0, 0, 0, 0.5);
}
.map-pin svg { width: 22px; height: 22px; rotate: 45deg; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pin-rider { background: #ff6f3c; animation: pin-bob 1.4s ease-in-out infinite; }
.pin-home { background: #4f7cff; }
.pin-shop { background: var(--brand-orange); }
.pin-shop svg { stroke: var(--brand-green); }
.pin-rider::after {          /* a soft pulse under the rider */
    content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 3px solid #ff6f3c; animation: pin-pulse 1.8s infinite;
}
.map-pin-label {
    position: absolute; left: 50%; top: 100%; translate: -50% 4px; padding: 2px 8px; border-radius: 999px;
    background: var(--surface); color: var(--ink); font-weight: 800; font-size: 11px; white-space: nowrap; box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.4);
}
.map-route { stroke: #ff6f3c; }
@keyframes pin-bob { 50% { translate: 0 -3px; } }
@keyframes pin-pulse { from { opacity: 0.9; scale: 1; } to { opacity: 0; scale: 1.7; } }

/* the rider card on the tracking page */
.rider-card { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; }
.rider-card small { display: block; color: var(--muted); font-weight: 700; }
.rider-card strong { display: block; font-size: 1.1rem; }
.rider-plate { font-size: 0.82rem; color: var(--muted); }
.rider-avatar {
    display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; flex: none;
    background: color-mix(in srgb, #ff6f3c 18%, var(--surface)); color: #c2410c;
}
.rider-avatar.big { width: 64px; height: 64px; }
.rider-avatar-icon { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .rider-avatar { color: #ffb08f; }
.rider-call[hidden] { display: none; }

/* ---------- the animations ---------- */
.scenes, .scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene { display: none; }
.track[data-stage="waiting"] .scene-waiting,
.track[data-stage="confirmed"] .scene-confirmed,
.track[data-stage="rejected"] .scene-rejected,
.track[data-stage="preparing"] .scene-preparing,
.track[data-stage="ready"] .scene-ready,
.track[data-stage="out"] .scene-out,
.track[data-stage="delivered"] .scene-delivered { display: block; animation: scene-in 0.6s var(--spring); }
@keyframes scene-in { from { opacity: 0; scale: 0.92; } }
.scene * { transform-box: fill-box; }
.sc-shadow { fill: rgba(31, 95, 51, 0.14); }
.sc-counter { fill: #c99a6b; }
:root[data-theme="dark"] .sc-counter { fill: #7a5636; }

/* waiting */
.sc-paper { fill: #fff; stroke: #dbe6cf; stroke-width: 2; }
.sc-line { fill: #dfe8d3; } .sc-line.strong { fill: #1f5f33; opacity: 0.8; }
.sc-float { animation: float 3s ease-in-out infinite; }
.sc-clock { fill: #ffb627; } .sc-clock-face { fill: #fff; }
.sc-hand { stroke: #1f5f33; stroke-linecap: round; }
.sc-hand-long { stroke-width: 4; transform-origin: 50% 100%; animation: spin 3s linear infinite; }
.sc-hand-short { stroke-width: 5; transform-origin: 0% 50%; animation: spin 36s linear infinite; }
.sc-dots circle { fill: #1f5f33; animation: dot-bounce 1.2s ease-in-out infinite; }
.sc-dots circle:nth-child(2) { animation-delay: 0.15s; }
.sc-dots circle:nth-child(3) { animation-delay: 0.3s; }
:root[data-theme="dark"] .sc-dots circle { fill: var(--brand-lime); }
@keyframes float { 50% { translate: 0 -8px; } }
@keyframes spin { to { rotate: 360deg; } }
@keyframes dot-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-10px); opacity: 1; } }

/* confirmed */
.sc-ok-ring { fill: none; stroke: var(--brand-lime); stroke-width: 6; opacity: 0.5; transform-origin: center; animation: ring-out 2.4s ease-out infinite; }
.sc-ok-disc { fill: #2f8f3a; transform-origin: center; animation: pop-in 0.6s var(--spring) both; }
.sc-ok-tick { fill: none; stroke: #fff; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; animation: draw 0.5s 0.35s ease-out forwards; }
.sc-confetti rect { fill: var(--c); transform-origin: center; animation: confetti 2.4s var(--w) ease-out infinite; }
@keyframes ring-out { from { scale: 0.8; opacity: 0.7; } to { scale: 1.35; opacity: 0; } }
@keyframes pop-in { from { scale: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes confetti {
    0% { transform: rotate(var(--a)) translateY(0) scale(0.4); opacity: 0; }
    15% { opacity: 1; }
    70%, 100% { transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) rotate(200deg) scale(1); opacity: 0; }
}

/* rejected */
.sc-bad-disc { fill: var(--bad); }
.sc-bad-x { fill: none; stroke: #fff; stroke-width: 10; stroke-linecap: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 0.5s 0.2s ease-out forwards; }
.sc-shake { transform-origin: center; animation: shake 0.6s 0.6s both; }
@keyframes shake { 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }

/* preparing */
.sc-glass { fill: rgba(255, 255, 255, 0.28); stroke: #1f5f33; stroke-width: 3; stroke-linejoin: round; }
:root[data-theme="dark"] .sc-glass { stroke: var(--brand-lime); }
.sc-fill { animation: cup-fill 4.5s ease-in-out infinite; }
.sc-wave { animation: wave 1.2s linear infinite; }
.sc-shaker { transform-origin: 50% 100%; animation: shaker 0.45s ease-in-out infinite alternate; }
.sc-scoop { transform-origin: 100% 50%; animation: scoop 2.2s ease-in-out infinite; }
.sc-drops circle { animation: drop 2.2s ease-in infinite; opacity: 0; }
.sc-drops circle:nth-child(2) { animation-delay: 0.12s; }
.sc-drops circle:nth-child(3) { animation-delay: 0.22s; }
.sc-drops circle:nth-child(4) { animation-delay: 0.34s; }
.sc-twinkle path { transform-origin: center; animation: twinkle 1.6s ease-in-out infinite; }
.sc-twinkle path:nth-child(2) { animation-delay: 0.5s; }
.sc-twinkle path:nth-child(3) { animation-delay: 1s; }
@keyframes cup-fill { 0% { transform: translateY(96px); } 70%, 88% { transform: translateY(10px); } 100% { transform: translateY(96px); } }
@keyframes wave { to { transform: translateX(-40px); } }
@keyframes shaker { from { rotate: -14deg; } to { rotate: 14deg; } }
@keyframes scoop { 0%, 30% { rotate: 0deg; } 45%, 60% { rotate: -28deg; } 80%, 100% { rotate: 0deg; } }
@keyframes drop { 0%, 42% { transform: translateY(0); opacity: 0; } 46% { opacity: 1; } 80% { transform: translateY(118px); opacity: 1; } 84%, 100% { transform: translateY(118px); opacity: 0; } }
@keyframes twinkle { 50% { scale: 0.4; opacity: 0.3; } }

/* ready */
.sc-pop { transform-origin: 50% 100%; animation: bag-hop 1.6s var(--spring) infinite; }
.sc-bell { transform-origin: 50% 0; animation: bell 1.6s ease-in-out infinite; }
.sc-rings path { opacity: 0; animation: ring 1.6s ease-out infinite; }
.sc-rings path:nth-child(2) { animation-delay: 0.15s; }
@keyframes bag-hop { 0%, 60%, 100% { transform: translateY(0) scaleY(1); } 70% { transform: translateY(0) scaleY(0.94); } 80% { transform: translateY(-10px) scaleY(1.03); } }
@keyframes bell { 0%, 50%, 100% { rotate: 0deg; } 10% { rotate: 18deg; } 20% { rotate: -16deg; } 30% { rotate: 12deg; } 40% { rotate: -8deg; } }
@keyframes ring { 0%, 5% { opacity: 0; } 15% { opacity: 1; } 45%, 100% { opacity: 0; transform: translateX(8px); } }

/* out for delivery */
.sc-far { fill: color-mix(in srgb, var(--brand-green) 14%, transparent); }
:root[data-theme="dark"] .sc-far { fill: rgba(168, 213, 59, 0.12); }
.sc-city { animation: city 9s linear infinite; }
.sc-road { fill: #3f4a46; }
.sc-road-line { stroke: #f5fbea; stroke-width: 4; stroke-dasharray: 18 14; animation: road 0.45s linear infinite; }
.sc-bike { animation: bump 0.36s ease-in-out infinite alternate; }
.sc-wheel { transform-origin: center; animation: spin 0.45s linear infinite; }
.sc-speed line { stroke: color-mix(in srgb, var(--brand-green) 45%, transparent); stroke-width: 4; animation: speed 0.7s linear infinite; }
:root[data-theme="dark"] .sc-speed line { stroke: rgba(245, 251, 234, 0.4); }
.sc-speed line:nth-child(2) { animation-delay: 0.2s; }
.sc-speed line:nth-child(3) { animation-delay: 0.4s; }
.sc-puffs circle { fill: #c8d0cc; transform-origin: center; animation: puff 0.9s ease-out infinite; }
.sc-puffs circle:nth-child(2) { animation-delay: 0.45s; }
@keyframes city { to { transform: translateX(-320px); } }
@keyframes road { to { stroke-dashoffset: 32; } }
@keyframes bump { to { transform: translateY(-2.5px); } }
@keyframes speed { from { transform: translateX(30px); opacity: 0; } 30% { opacity: 1; } to { transform: translateX(-40px); opacity: 0; } }
@keyframes puff { from { transform: translate(0, 0) scale(0.4); opacity: 0.9; } to { transform: translate(-34px, -10px) scale(1.6); opacity: 0; } }

/* delivered */
.sc-door { fill: #a0673d; }
:root[data-theme="dark"] .sc-door { fill: #6e4527; }
.sc-parcel { animation: hand-over 3.6s ease-in-out infinite; }
.sc-hearts path { opacity: 0; transform-origin: center; animation: heart-up 3.6s var(--w) ease-out infinite; }
@keyframes hand-over { 0%, 20% { transform: translateX(0); } 45%, 92% { transform: translateX(32px); } 100% { transform: translateX(0); } }
@keyframes heart-up { 0%, 45% { opacity: 0; transform: translateY(10px) scale(0.4); } 55% { opacity: 1; } 90%, 100% { opacity: 0; transform: translateY(-36px) scale(1.2); } }

@media (prefers-reduced-motion: reduce) {
    .scene *, .map-pin, .tstep-dot { animation-duration: 0.01s !important; animation-iteration-count: 1 !important; }
}

/* ---------- order buttons in My orders / receipt ---------- */
.order-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.order-buttons .btn-small { margin-top: 12px; }
.track-btn { justify-self: stretch; text-align: center; }
.receipt-side .track-btn { width: 100%; justify-content: center; }

/* ---------- cart: "Use my location" ---------- */
.locate { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: -4px; }
.locate-note { color: var(--muted); font-weight: 600; }
.locate.is-set .locate-note { color: var(--ok); }
.locate.is-set .locate-btn { border-color: var(--ok); color: var(--ok); }

/* ---------- admin: order progress on each paid order ---------- */
.stage-form { display: grid; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.stage-now { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.stage-rider { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 0.88rem; }
.stage-rider .cart-icon { width: 18px; height: 18px; }
.stage-buttons { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stage-buttons .assign { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.stage-buttons select { padding: 7px 12px; border-radius: 999px; font: inherit; font-size: 0.88rem; max-width: 200px; }
.admin-review .stage-form { border-top: 0; padding-top: 0; }

/* ---------- rider dashboard ---------- */
.rider-page { max-width: 1180px; margin: 0 auto; }
.rider-head {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
    padding: 20px 24px; border-radius: 28px; background: var(--surface); animation: drop-in 0.5s var(--spring) both;
}
.rider-hi { display: flex; align-items: center; gap: 16px; }
.rider-hi h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.05; margin: 0; }
.rider-hi p { margin: 4px 0 0; }
.duty-switch {
    display: inline-flex; align-items: center; gap: 12px; padding: 8px 18px 8px 8px; border: 0; border-radius: 999px;
    background: color-mix(in srgb, var(--muted) 16%, var(--surface)); color: var(--ink); font: inherit; text-align: left;
    cursor: var(--cursor-click, pointer); transition: background 0.3s, scale 0.3s var(--spring);
}
.duty-switch:hover { scale: 1.03; }
.duty-switch.is-on { background: var(--ok-bg); }
.duty-track { position: relative; width: 58px; height: 34px; border-radius: 999px; background: var(--line); transition: background 0.3s; }
.duty-switch.is-on .duty-track { background: var(--ok); }
.duty-knob { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: translate 0.35s var(--spring); }
.duty-switch.is-on .duty-knob { translate: 24px 0; }
.duty-words strong { display: block; font-size: 1.05rem; }
.duty-words small { color: var(--muted); font-weight: 700; }
.duty-switch .btn-spinner { order: 3; }
.loc-status { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 14px 4px 18px; font-weight: 700; font-size: 0.92rem; }
.loc-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.loc-text { flex: 1 1 0; min-width: 0; }
.loc-status small { flex-basis: 100%; padding-left: 18px; }
.loc-status[data-state="on"] .loc-dot { background: #3fbf4f; animation: live 1.8s infinite; }
.loc-status[data-state="asking"] .loc-dot { background: var(--brand-orange); animation: blink 1s infinite; }
.loc-status[data-state="denied"], .loc-status[data-state="none"] { color: var(--bad); }
.loc-status[data-state="denied"] .loc-dot, .loc-status[data-state="none"] .loc-dot { background: var(--bad); }
.rider-stats { grid-template-columns: repeat(3, 1fr); }
.rider-grid, .riders-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.rider-map-card { border-radius: 28px; background: var(--surface); position: sticky; top: 96px; }
.rider-map-card .map { height: min(70vh, 560px); }
.riders-map-card h2 { display: flex; align-items: center; margin: 8px 12px 12px; font-size: 1.3rem; }
.rider-jobs { display: grid; gap: 14px; min-width: 0; }
.rider-jobs h2 { font-size: 1.5rem; margin: 0; }
.rider-empty { display: grid; justify-items: center; gap: 8px; text-align: center; }
.rider-empty-icon { width: 64px; height: 64px; color: var(--muted); animation: float 3s ease-in-out infinite; }
.job-card {
    display: grid; gap: 10px; padding: 18px 20px; border-radius: 24px; background: var(--surface);
    border-left: 6px solid var(--brand-orange); animation: drop-in 0.45s calc(var(--i, 0) * 0.05s) var(--spring) both;
}
.job-card.job-out { border-left-color: #ff6f3c; }
.job-card.job-ready { border-left-color: #4fb3ff; }
.job-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.job-no { font-weight: 800; font-family: var(--mono); }
.job-total { margin-left: auto; font-size: 1.2rem; }
.job-cash, .job-paid { margin: 0; padding: 8px 12px; border-radius: 14px; font-weight: 800; font-size: 0.92rem; }
.job-cash { background: var(--warn-bg); color: var(--warn); }
.job-paid { background: var(--ok-bg); color: var(--ok); }
.job-who { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.job-who strong { font-size: 1.1rem; }
.job-who p { margin: 2px 0 0; }
.job-address { font-weight: 600; }
.job-items { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; display: grid; gap: 2px; }
.job-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.job-actions .confirm-box { right: auto; left: 0; border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.job-card:has(.confirm[open]) { position: relative; z-index: 30; }
.job-wait { font-size: 0.86rem; font-weight: 700; }
.jobs-done-title { margin-top: 10px !important; font-size: 1.2rem !important; }
.jobs-done { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.jobs-done li { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 16px; background: var(--surface); }
.jobs-done strong { margin-left: auto; }

/* header button for riders */
.rider-btn { background: #ff6f3c; color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, #ff6f3c 35%, transparent); }
:root[data-theme="dark"] .rider-btn { background: #ff8a5c; color: #1d0e05; }

/* ---------- admin: riders ---------- */
.add-rider { position: relative; }
.add-rider > summary { list-style: none; cursor: var(--cursor-click, pointer); }
.add-rider > summary::-webkit-details-marker { display: none; }
.add-rider-box {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 40; width: min(380px, 88vw);
    display: grid; gap: 12px; padding: 18px; border-radius: 22px; background: var(--surface);
    box-shadow: 0 24px 50px -18px rgba(0, 0, 0, 0.5); animation: drop-in 0.3s var(--spring) both;
}
.add-rider-box p { margin: 0; font-size: 0.9rem; }
.add-rider-box label, .rider-row .confirm-box label { display: grid; gap: 4px; font-weight: 700; font-size: 0.9rem; }
.add-rider-box select, .add-rider-box input { width: 100%; }
.add-rider-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.add-rider-box .btn { justify-self: start; }
.rider-row { grid-template-columns: auto 1fr; }
.rider-row .customer-actions { grid-column: 1 / -1; justify-content: flex-start; }
.rider-busy { color: #c2410c; font-weight: 800; }
.rider-seen { font-weight: 600; }
.rider-row .confirm-box { left: 0; right: auto; border-color: var(--line); }
.rider-locate.shake { animation: shake 0.45s; }

@media (max-width: 900px) {
    .track-layout, .rider-grid, .riders-grid { grid-template-columns: 1fr; }
    .rider-map-card { position: relative; top: 0; }
    .rider-map-card .map { height: 300px; }
    .rider-grid .rider-map-card { order: -1; }
}
@media (max-width: 560px) {
    .track-card { padding: 16px 16px 20px; }
    .track-steps { grid-template-columns: 1fr; gap: 0; padding: 18px 20px; }
    .tstep { grid-template-columns: 34px 1fr auto; justify-items: start; align-items: center; text-align: left; gap: 12px; min-height: 52px; }
    .tstep::before { top: auto; bottom: 50%; right: auto; left: 15px; width: 4px; height: 100%; background: linear-gradient(180deg, var(--ok) var(--fill, 0%), var(--line) var(--fill, 0%)); }
    .rider-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .rider-stats .stat { padding: 12px; }
    .rider-stats .stat strong { font-size: 1.5rem; }
    .duty-switch { width: 100%; }
    .add-rider-box { right: auto; left: 0; }
    .map { height: 280px; }
}
/* drop-down menus on the Riders page and the "Give to rider" menu */
.add-rider-box select, .stage-buttons select {
    appearance: none; -webkit-appearance: none; font: inherit; color: var(--ink);
    background: var(--input-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b7562' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 16px;
    border: 2px solid var(--line); border-radius: 14px; padding: 11px 38px 11px 14px; cursor: var(--cursor-click, pointer);
}
.stage-buttons select { padding: 7px 34px 7px 12px; border-radius: 999px; font-size: 0.88rem; }
.add-rider-box select:focus, .stage-buttons select:focus { outline: none; border-color: var(--leaf); }

/* =====================================================================
   TOP BAR THAT FITS: js/header-fit.js adds one of these classes to <html>
   when the normal desktop bar is too wide (Khmer words, Admin + Rider buttons...)
   ===================================================================== */
@media (min-width: 861px) {
    /* step 1 (nav-free, above): links centred between logo and buttons
       step 2: tighter, Admin / Rider become round icons */
    :root.nav-free .topbar { grid-template-columns: auto 1fr auto; }
    :root.nav-tight .topbar { grid-template-columns: auto 1fr auto; gap: 14px; }
    :root.nav-tight .tools { gap: 7px; }
    :root.nav-tight .tools-divider { display: none; }
    :root.nav-tight .topbar .main-nav > a { padding: 9px 10px 11px; }
    :root.nav-tight .topbar .main-nav > a::after { left: 10px; right: 10px; }

    :root.nav-tight .admin-btn,
    :root.nav-compact .admin-btn { width: 44px; padding: 0; justify-content: center; }
    :root.nav-tight .admin-btn-text,
    :root.nav-compact .admin-btn-text { display: none; }

    /* step 3: the phone layout with the ☰ menu */
    :root.nav-compact .topbar { grid-template-columns: 1fr auto; gap: 10px; }
    :root.nav-compact .topbar .main-nav,
    :root.nav-compact .lang-switch,
    :root.nav-compact .theme-menu,
    :root.nav-compact .tools > .account-link,
    :root.nav-compact .tools-divider { display: none; }
    :root.nav-compact .mobile-menu { display: block; }
    :root.nav-compact .mobile-menu > summary::before {
        content: ""; position: fixed; inset: 65px 0 0; background: rgba(10, 30, 18, 0.22);
        cursor: default; opacity: 0; pointer-events: none; transition: opacity 0.4s cubic-bezier(0.4, 0, 0.6, 1);
    }
    :root.nav-compact .mobile-menu[open] > summary::before { opacity: 1; pointer-events: auto; }
    /* same height as the phone bar, so the menu drawer starts right under it */
    :root.nav-compact .topbar { padding: 10px 16px; }
    :root.nav-compact .topbar .logo { gap: 9px; }
    :root.nav-compact .topbar .logo-badge { width: 42px; height: 42px; }
    :root.nav-compact .logo-name { font-size: 1.22rem; }
    :root.nav-compact .logo-tag { font-size: 0.68rem; margin-top: 3px; }
}

/* Admin / Rider buttons: the spinner takes the icon's exact place and size
   (round icon-only button: dead centre; button with words: where the icon was) */
.topbar .admin-btn .btn-spinner { width: 20px; height: 20px; margin: 0 1px; border-width: 2.5px; }

/* =====================================================================
   PRODUCTS: photos, labels, sale prices, sold out, promo codes
   ===================================================================== */
/* a drink photo the admin uploaded (instead of the drawn cup). Sizes follow the cup sizes. */
.cup-photo {
    position: relative; flex-shrink: 0; width: 8em; height: 8em; margin-top: 2em;
    border-radius: 1.6em; overflow: hidden;
    background: color-mix(in srgb, var(--tea, #c99d72) 30%, var(--surface));
    box-shadow: 0 1em 2em -1.2em rgba(0, 0, 0, 0.55);
}
.cup-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cup-photo[hidden] { display: none; }
.drink-art .cup-photo { transition: transform 0.45s var(--spring); }
.drink:hover .cup-photo { transform: translateY(-6px) rotate(-3deg); }
.line .cup-photo { margin-top: 0; }

/* labels */
.sticker-hot { background: #ff6f3c; color: #fff; }
.sticker-limited { background: #8f6bd8; color: #fff; }
.sticker-sale { background: #ff4d6d; color: #fff; font-size: 1rem; }
.sticker-hot::before, .sticker-limited::before, .sticker-sale::before { border-color: rgba(255, 255, 255, 0.6); }
.sale-tag {
    position: absolute; left: 14px; bottom: 14px; padding: 4px 10px; border-radius: 999px;
    background: #ff4d6d; color: #fff; font-weight: 800; font-size: 0.85rem;
}
.was { color: var(--muted); font-size: 0.75em; font-weight: 700; text-decoration-thickness: 2px; }
.sale-pill {
    display: inline-block; padding: 2px 10px; border-radius: 999px;
    background: color-mix(in srgb, #ff4d6d 18%, var(--surface)); color: #d6264a; font-weight: 800; font-size: 0.82rem;
}
:root[data-theme="dark"] .sale-pill { color: #ff8fa3; }

/* sold out */
.soldout-band {
    position: absolute; left: 0; right: 0; bottom: 18px; z-index: 2; padding: 8px 12px; text-align: center;
    background: rgba(20, 20, 20, 0.78); color: #fff; font-weight: 800; letter-spacing: 0.02em;
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.soldout-band[hidden] { display: none; }
.drink.is-soldout .cup, .drink.is-soldout .cup-photo { filter: grayscale(0.85) opacity(0.65); }
.drink.is-soldout .price { color: var(--muted); }
.soldout-note {
    display: inline-block; margin: 6px 0 0; padding: 6px 12px; border-radius: 12px;
    background: var(--bad-bg); color: var(--bad); font-weight: 800; font-size: 0.9rem;
}
.line.is-soldout { outline: 2px dashed color-mix(in srgb, var(--bad) 60%, transparent); outline-offset: -2px; }
.line.is-soldout .cup, .line.is-soldout .cup-photo { filter: grayscale(0.85); }
.btn-add:disabled { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.6); }
.base-price .was { margin: 0 4px; }

/* cart: promo code box */
.checkout-col { display: grid; gap: 14px; position: sticky; top: 92px; align-self: start; }
.checkout-col .checkout { position: static; }
.promo-box {
    display: grid; gap: 8px; padding: 18px 22px; border-radius: 24px; background: var(--surface);
    border: 2px dashed color-mix(in srgb, var(--brand-lime) 55%, transparent);
}
.promo-box.is-on { border-style: solid; border-color: var(--ok); }
.promo-box.is-bad { border-color: var(--bad); }
.promo-box > label { font-weight: 800; }
.promo-row-input { display: flex; gap: 8px; }
.promo-row-input input { flex: 1; min-width: 0; text-transform: uppercase; font-family: var(--mono); letter-spacing: 0.06em; }
.promo-now { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; }
.promo-now strong { color: var(--ok); font-size: 1.1rem; }
.promo-now .link { margin-left: auto; }
.promo-chip {
    padding: 5px 12px; border-radius: 10px; background: var(--ok-bg); color: var(--ok);
    font-family: var(--mono); font-weight: 800; letter-spacing: 0.08em;
}
.promo-msg { margin: 0; color: var(--bad); font-weight: 700; font-size: 0.9rem; }
.totals .promo-row dd, .promo-row span:last-child { color: var(--ok); font-weight: 800; }

/* ---------- admin: products ---------- */
.admin-head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.stats-5 { grid-template-columns: repeat(5, 1fr); }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.prod-card {
    display: grid; grid-template-columns: 96px 1fr; gap: 6px 16px; padding: 16px; border-radius: 24px;
    background: var(--surface); animation: drop-in 0.45s calc(var(--i, 0) * 0.04s) var(--spring) both;
}
.prod-card.is-hidden { opacity: 0.6; }
.prod-art {
    position: relative; display: grid; place-items: end center; height: 112px; border-radius: 18px; overflow: hidden;
    background: radial-gradient(circle at 50% 80%, color-mix(in srgb, var(--tea) 45%, var(--surface)), color-mix(in srgb, var(--tea) 14%, var(--surface)));
}
.prod-art .cup { font-size: 9px; margin-bottom: 8px; }
.prod-art .cup-photo { font-size: 10px; margin: 0 0 8px; }
.prod-card.is-out .prod-art .cup, .prod-card.is-out .prod-art .cup-photo { filter: grayscale(0.85) opacity(0.6); }
.mini-badge {
    position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 800;
    background: var(--brand-orange); color: var(--brand-green);
}
.mini-new { background: var(--brand-lime); } .mini-hot { background: #ff6f3c; color: #fff; } .mini-limited { background: #8f6bd8; color: #fff; }
.prod-main { min-width: 0; }
.prod-main h2 { font-size: 1.2rem; margin: 2px 0 0; line-height: 1.2; }
.prod-main h2 a { color: inherit; text-decoration: none; }
.prod-main h2 a:hover { text-decoration: underline; }
.prod-km { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.prod-price { margin: 6px 0; }
.prod-price strong { font-size: 1.15rem; color: var(--accent); }
.prod-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.prod-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* ---------- admin: edit product ---------- */
.pe-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 24px; align-items: start; }
.pe-preview { position: sticky; top: 96px; }
.pe-card { pointer-events: none; }
.pe-forms { display: grid; gap: 16px; }
.pe-form { display: grid; gap: 16px; }
.pe-box { display: grid; gap: 12px; margin: 0; padding: 20px 22px; border: 0; border-radius: 24px; background: var(--surface); }
.pe-box legend { float: left; width: 100%; margin-bottom: 4px; font-family: var(--display); font-size: 1.3rem; }
.pe-box label { display: grid; gap: 6px; font-weight: 700; }
.pe-box label.check, .pf-checks label.check { display: flex; align-items: center; gap: 10px; }
.pe-box label.check input, .pf-checks input { width: 20px; height: 20px; accent-color: var(--ok); }
.pe-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.pe-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: end; }
.pe-discount { transition: opacity 0.3s; }
.pe-discount.is-off { opacity: 0.45; }
.pe-photo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pe-file { cursor: var(--cursor-click, pointer); }
.small { font-size: 0.86rem; }
.pe-box p.small { margin: 0; }
.pe-box select, .pe-box input[type="date"], .pf-row select, .promo-form input[type="date"] {
    font: inherit; color: var(--ink); background: var(--input-bg); border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px;
}
.pe-box input[type="color"] { width: 100%; height: 46px; padding: 4px; border-radius: 14px; border: 2px solid var(--line); background: var(--input-bg); }
.pe-delete { justify-self: start; }
.pe-delete .confirm-box { left: 0; right: auto; }

/* ---------- admin: promo codes ---------- */
.add-promo .add-rider-box { width: min(440px, 92vw); }
.promo-form { display: grid; gap: 12px; }
.promo-form label { display: grid; gap: 4px; font-weight: 700; font-size: 0.9rem; }
.promo-form input.mono { text-transform: uppercase; }
.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pf-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.promo-form .btn { justify-self: start; }
.promo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.promo-card {
    display: grid; grid-template-columns: 190px 1fr auto; gap: 16px; align-items: center; padding: 14px 18px 14px 14px;
    border-radius: 24px; background: var(--surface); animation: drop-in 0.45s calc(var(--i, 0) * 0.04s) var(--spring) both;
}
.promo-card:has(.confirm[open]) { position: relative; z-index: 30; }
.promo-ticket {
    position: relative; display: grid; gap: 2px; justify-items: center; padding: 14px 10px; border-radius: 16px; text-align: center;
    background: color-mix(in srgb, var(--brand-lime) 26%, var(--surface)); border: 2px dashed color-mix(in srgb, var(--brand-green) 35%, transparent);
}
.promo-ticket::before, .promo-ticket::after {      /* the little ticket notches */
    content: ""; position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; border-radius: 50%; background: var(--surface);
}
.promo-ticket::before { left: -9px; } .promo-ticket::after { right: -9px; }
.promo-code-big { font-size: 1.25rem; letter-spacing: 0.1em; }
.promo-ticket strong { color: var(--accent); }
.state-paused .promo-ticket, .state-expired .promo-ticket, .state-used_up .promo-ticket { filter: grayscale(1); opacity: 0.65; }
.promo-info { display: grid; gap: 6px; min-width: 0; }
.promo-info p { margin: 0; }
.promo-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ptag { padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 14%, var(--surface)); font-weight: 700; font-size: 0.82rem; }
.promo-state-active { background: var(--ok-bg); color: var(--ok); }
.promo-state-scheduled { background: color-mix(in srgb, #4fb3ff 22%, var(--surface)); color: #1d6fb8; }
.promo-state-paused { background: var(--warn-bg); color: var(--warn); }
.promo-state-expired, .promo-state-used_up { background: var(--bad-bg); color: var(--bad); }
.promo-uses { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.promo-bar { flex: 0 1 160px; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.promo-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.promo-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.promo-edit-box { width: min(420px, 88vw); right: 0; left: auto; border-color: var(--line); }

@media (max-width: 1000px) {
    .pe-layout { grid-template-columns: 1fr; }
    .pe-preview { position: static; max-width: 340px; }
    .promo-card { grid-template-columns: 160px 1fr; }
    .promo-actions { grid-column: 1 / -1; justify-content: flex-start; }
    .stats-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
    .checkout-col { position: static; }
}
@media (max-width: 560px) {
    .pe-two, .pe-three, .pf-row { grid-template-columns: 1fr; }
    .promo-card { grid-template-columns: 1fr; }
    .promo-edit-box, .promo-actions .confirm-box { left: 0; right: auto; }
    .stats-5 { grid-template-columns: 1fr 1fr; }
    .prod-grid { grid-template-columns: 1fr; }
}
/* small fixes after the visual check */
.drink-foot { gap: 10px; }
.drink-foot .price { white-space: nowrap; }
.prod-actions { align-items: center; align-self: end; }
.pe-box label.pe-file { display: inline-flex; gap: 8px; }

/* =====================================================================
   COUPONS: the cart box, "My coupons" wallet, admin page
   ===================================================================== */
.coupon-box {
    display: grid; gap: 10px; padding: 18px 22px; border-radius: 24px; background: var(--surface);
    border: 2px dashed color-mix(in srgb, #ff6f91 55%, transparent);
}
.coupon-box.is-on { border-style: solid; border-color: var(--ok); }
.coupon-box.is-bad { border-color: var(--bad); }
.coupon-head { display: flex; justify-content: space-between; align-items: center; margin: 0; font-weight: 800; }
.coupon-title { margin: -4px 0 0; }
.wallet-row {
    display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
    padding: 8px 10px 8px 8px; border-radius: 16px; background: color-mix(in srgb, #ff6f91 8%, var(--surface));
}
.mini-ticket {
    position: relative; padding: 8px 12px; border-radius: 10px; font-weight: 800; font-size: 0.86rem; white-space: nowrap;
    background: #ff6f91; color: #fff;
}
.mini-ticket::after {      /* the little perforation on the right */
    content: ""; position: absolute; right: -5px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%;
    background: color-mix(in srgb, #ff6f91 8%, var(--surface));
}
.wallet-info { display: grid; min-width: 0; }
.wallet-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gift-code > summary { cursor: var(--cursor-click, pointer); font-weight: 700; color: var(--muted); font-size: 0.9rem; }
.gift-code[open] > summary { margin-bottom: 8px; }
.free-fee { color: var(--ok); }
.fee-row .was { font-size: 0.85em; }
.sheet-row .btn:nth-child(3):last-child { grid-column: 1 / -1; }

/* the wallet */
.coupons-page { max-width: 760px; margin: 0 auto; }
.coupons-page h1 { font-size: clamp(2.2rem, 5vw, 3rem); margin-bottom: 4px; }
.coupon-empty { font-size: 3rem; }
.coupon-wallet { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 14px; }
.voucher {
    display: grid; grid-template-columns: 150px 1fr; border-radius: 22px; overflow: hidden; background: var(--surface);
    box-shadow: 0 14px 30px -22px rgba(0, 0, 0, 0.5); animation: drop-in 0.45s calc(var(--i, 0) * 0.05s) var(--spring) both;
}
.voucher-left {
    position: relative; display: grid; place-content: center; gap: 4px; padding: 18px 12px; text-align: center;
    background: linear-gradient(150deg, #ff6f91, #ff9a62); color: #fff;
}
.voucher-left::after {     /* torn ticket edge */
    content: ""; position: absolute; right: -7px; top: 0; bottom: 0; width: 14px;
    background: radial-gradient(circle at 7px 8px, var(--surface) 5px, transparent 5.5px) 0 0 / 14px 16px repeat-y;
}
.voucher-value { font-family: var(--display); font-size: 1.5rem; line-height: 1.1; }
.voucher-left small { opacity: 0.9; font-weight: 700; }
.voucher-right { display: grid; gap: 6px; padding: 16px 18px 16px 22px; }
.voucher-right p { margin: 0; }
.voucher-right form { justify-self: start; }
.voucher-title { font-weight: 800; font-size: 1.1rem; }
.voucher-code { color: var(--muted); font-size: 0.86rem; }
.voucher-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.voucher-ready { background: var(--ok-bg); color: var(--ok); }
.voucher-used { background: color-mix(in srgb, var(--muted) 16%, var(--surface)); color: var(--muted); }
.voucher-expired { background: var(--bad-bg); color: var(--bad); }
.voucher.state-used .voucher-left, .voucher.state-expired .voucher-left { filter: grayscale(1); opacity: 0.6; }

/* admin: give coupons */
.coupon-form fieldset { margin: 0; padding: 0; border: 0; }
.coupon-form legend { font-weight: 800; font-size: 0.9rem; margin-bottom: 6px; }
.coupon-form .chips { gap: 6px; }
.coupon-form .for-gift { display: none; }
.coupon-form:has([name="who"][value="gift"]:checked) .for-gift { display: grid; }
.coupon-form:has([name="who"][value="gift"]:checked) .for-one,
.coupon-form:has([name="who"][value="all"]:checked) .for-one { display: none; }
.coupon-form:has(option[value="freeship"]:checked) .coupon-value { visibility: hidden; }
.coupon-card .promo-ticket { background: color-mix(in srgb, #ff6f91 16%, var(--surface)); border-color: color-mix(in srgb, #ff6f91 45%, transparent); }
.coupon-card .promo-code-big { font-size: 1.05rem; }
.gift-codes {
    display: grid; gap: 10px; margin-bottom: 18px; padding: 18px 22px; border-radius: 22px;
    background: var(--ok-bg); border: 2px solid color-mix(in srgb, var(--ok) 40%, transparent);
}
.gift-codes p { margin: 0; }
.gift-codes textarea { font-size: 1rem; }
.gift-codes .btn { justify-self: start; }

@media (max-width: 560px) {
    .voucher { grid-template-columns: 112px 1fr; }
    .voucher-value { font-size: 1.2rem; }
    .wallet-row { grid-template-columns: auto 1fr; }
    .wallet-row .btn { grid-column: 1 / -1; }
}
.give-coupons .add-rider-box { right: auto; left: 0; }

/* pop-up notifications: a colour for each kind of news (notify.js picks the kind) */
.notify { --nk: var(--brand-lime); border-left: 5px solid var(--nk); }
.notify-icon { background: color-mix(in srgb, var(--nk) 26%, var(--surface)); }
.notify-timer { background: var(--nk); }
.notify-order { --nk: #f6a623; }
.notify-pay { --nk: #2fae66; }
.notify-ok { --nk: #2fae66; }
.notify-bad { --nk: #e5484d; }
.notify-chat { --nk: #4f8cff; }
.notify-coupon { --nk: #ff6f91; }
.notify-promo { --nk: #ff4d6d; }
.notify-drink { --nk: #a8d53b; }
.notify-rider { --nk: #ff6f3c; }
.notify-track { --nk: #8f6bd8; }
.notify-info { --nk: var(--brand-lime); }
.notify { touch-action: pan-y; }

/* ---------- sound on/off (sounds.js) ---------- */
.sound-toggle {
    flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 44px; align-self: center;
    border: 2px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink);
    cursor: var(--cursor-click, pointer); transition: background 0.2s, color 0.2s, scale 0.25s var(--spring);
}
.sound-toggle:hover { scale: 1.06; background: color-mix(in srgb, var(--brand-lime) 20%, transparent); }
.sound-toggle svg, .sound-toggle-wide svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sound-toggle .snd-off, .sound-toggle-wide .snd-off { display: none; }
.sound-toggle.is-off .snd-on, .sound-toggle-wide.is-off .snd-on { display: none; }
.sound-toggle.is-off .snd-off, .sound-toggle-wide.is-off .snd-off { display: block; }
.sound-toggle.is-off { color: var(--muted); }
.sound-toggle:not(.is-off) .snd-on path:last-child { animation: snd-wave 1.6s ease-in-out infinite; transform-origin: left center; transform-box: fill-box; }
.sound-toggle-wide { display: inline-flex; align-items: center; gap: 8px; justify-self: start; margin-top: 4px; }
@keyframes snd-wave { 50% { opacity: 0.35; } }
@media (max-width: 520px) { .sound-toggle { width: 40px; height: 40px; } }
