/* ==========================================================================
   PizzaGo! — Design System 2026
   Food-delivery grade UI · light/dark · mobile-first · spring animations
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --primary: #FF6B35;
    --primary-ink: #B43B0F;
    --primary-600: #F04E12;
    --primary-700: #D84310;
    --primary-soft: #FFEDE2;
    --secondary: #FFA723;
    --gradient-brand: linear-gradient(135deg, #FFA723 0%, #FF6B35 55%, #F04E12 100%);
    --gradient-text: linear-gradient(135deg, #B43B0F, #D84310);

    --bg: #FFF8F2;
    --surface: #FFFFFF;
    --surface-2: #FDF3EA;
    --ink: #17130E;
    --ink-2: #4A423A;
    --muted: #74695E;
    --line: #F0E7DD;
    --line-2: #E4D8CB;

    --green: #1F9D55;
    --green-ink: #15743F;
    --green-soft: #E3F6EC;
    --red: #E5484D;
    --red-soft: #FDEBEC;
    --amber: #F5A623;
    --violet: #7C5CFF;

    --shadow-sm: 0 1px 2px rgba(23, 19, 14, .05), 0 4px 14px rgba(23, 19, 14, .06);
    --shadow-md: 0 2px 6px rgba(23, 19, 14, .06), 0 12px 32px rgba(23, 19, 14, .10);
    --shadow-lg: 0 6px 16px rgba(23, 19, 14, .08), 0 24px 64px rgba(23, 19, 14, .16);
    --shadow-brand: 0 8px 20px rgba(255, 107, 53, .35);

    --r-sm: 12px;
    --r-md: 16px;
    --r-lg: 22px;
    --r-xl: 28px;
    --r-pill: 999px;

    --ease-out: cubic-bezier(.22, 1, .36, 1);
    --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

    --topbar-h: 66px;
    --catnav-h: 62px;
    --sat: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
    --primary-ink: #FF9A6F;
    --green-ink: #59CF91;
    --gradient-text: var(--gradient-brand);
    --bg: #131009;
    --surface: #1D1913;
    --surface-2: #252017;
    --ink: #F8F3EB;
    --ink-2: #D8CFC2;
    --muted: #9C9184;
    --line: #2C261D;
    --line-2: #3A3227;
    --primary-soft: #3A2113;
    --green-soft: #12291C;
    --red-soft: #33191B;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .35);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, .45), 0 12px 32px rgba(0, 0, 0, .5);
    --shadow-lg: 0 6px 16px rgba(0, 0, 0, .5), 0 24px 64px rgba(0, 0, 0, .6);
}

/* ---------- Base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.55;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: background .35s ease, color .35s ease;
}
body.no-scroll { overflow: hidden; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }
/* el atributo hidden siempre gana sobre cualquier display de clase */
[hidden] { display: none !important; }
h1, h2, h3, h4 { line-height: 1.15; letter-spacing: -.02em; }
::selection { background: var(--primary); color: #17130E; }

::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 2px solid var(--bg); }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: none; border-radius: var(--r-pill);
    font-weight: 700; font-size: .95rem; font-family: inherit;
    padding: 13px 24px; position: relative; overflow: hidden;
    transition: transform .18s var(--ease-out), box-shadow .25s ease, background .2s ease, opacity .2s;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.96); }
.btn-primary { background: var(--gradient-brand); color: #17130E; box-shadow: var(--shadow-brand); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(255, 107, 53, .45); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line-2); box-shadow: none; }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary-ink); transform: translateY(-1px); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-google { background: var(--surface); border: 1.5px solid var(--line-2); color: var(--ink); width: 100%; }
.btn-google:hover { background: var(--surface-2); }
.btn-whatsapp { background: #22C55E; color: #fff; box-shadow: 0 8px 20px rgba(34, 197, 94, .35); }
.btn-whatsapp:hover { transform: translateY(-2px); }
.btn-stripe { background: linear-gradient(135deg, #635BFF, #8959FF); color: #fff; box-shadow: 0 8px 20px rgba(99, 91, 255, .3); }
.btn-stripe:hover { transform: translateY(-2px); }
.btn-mp { background: linear-gradient(135deg, #00AEEF, #009EE3); color: #fff; box-shadow: 0 8px 20px rgba(0, 158, 227, .3); }
.btn-mp:hover { transform: translateY(-2px); }
#stripe-payment-btn, #mp-payment-btn { width: 100%; margin-top: 12px; }
#stripe-payment-btn + #mp-payment-btn { margin-top: 10px; }
.pay-ico-stripe { color: #635BFF; }
.pay-ico-mp { color: #009EE3; }
.btn-sm { padding: 9px 16px; font-size: .85rem; }
.btn-lg { padding: 15px 28px; font-size: 1rem; width: 100%; }
.btn-disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-disabled:hover { transform: none; box-shadow: none; }

.icon-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: transparent; border: none; color: var(--ink-2);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; transition: background .2s, color .2s, transform .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--primary-ink); }
.icon-btn:active { transform: scale(.9); }
.lang-btn { font-weight: 800; font-size: .78rem; border: 1.5px solid var(--line-2); }

/* inline SVG icon base */
.pg-ic { width: 1em; height: 1em; display: inline-block; vertical-align: -.12em; flex-shrink: 0; }

/* ---------- Preloader ---------- */
#preloader {
    position: fixed; inset: 0; z-index: 9999;
    background: var(--bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
    transition: opacity .45s ease, visibility .45s;
}
#preloader.fade-out { opacity: 0; visibility: hidden; }
.preloader-logo {
    width: 92px; height: 92px; object-fit: cover; border-radius: 26px;
    box-shadow: 0 12px 32px rgba(255, 107, 53, .28); border: 1px solid var(--line);
    animation: logoPop 1.6s var(--ease-out) infinite;
}
@keyframes logoPop { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.04); } }
.preloader-brand { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; }
.preloader-brand span { color: var(--primary-ink); }
.preloader-bar { width: 130px; height: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.preloader-bar i { display: block; width: 40%; height: 100%; border-radius: 99px; background: var(--gradient-brand); animation: loadBar 1s ease-in-out infinite; }
@keyframes loadBar { 0% { transform: translateX(-120%); } 100% { transform: translateX(340%); } }

/* ---------- Top bar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 900;
    height: var(--topbar-h);
    background: rgba(255, 248, 242, .86);
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .3s, box-shadow .3s, background .3s;
}
[data-theme="dark"] .topbar { background: rgba(19, 16, 9, .86); background: color-mix(in srgb, var(--bg) 86%, transparent); }
.topbar.scrolled { border-color: var(--line); box-shadow: 0 6px 24px rgba(23,19,14,.06); }
.topbar-inner { max-width: 1200px; margin: 0 auto; height: 100%; padding: 0 20px; display: flex; align-items: center; gap: 16px; }

.brand { display: flex; align-items: center; gap: 10px; }
.brand-badge {
    width: 42px; height: 42px; border-radius: 14px; overflow: hidden;
    background: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm); border: 1px solid var(--line);
    transition: transform .3s var(--ease-spring);
}
.brand-badge img { width: 100%; height: 100%; object-fit: cover; }
.brand:hover .brand-badge { transform: rotate(-8deg) scale(1.07); }
.brand-name { font-size: 1.25rem; font-weight: 800; letter-spacing: -.03em; }
.brand-name b { color: var(--primary-ink); }

.pickup-pill {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1.5px solid var(--line);
    padding: 7px 14px 7px 10px; border-radius: var(--r-pill);
    color: var(--ink); text-align: left; transition: border-color .2s, transform .2s;
}
.pickup-pill i { color: var(--primary-ink); font-size: 1rem; }
.pickup-pill:hover { border-color: var(--primary); transform: translateY(-1px); }
.pickup-pill-txt { display: flex; flex-direction: column; line-height: 1.2; }
.pickup-pill-txt b { font-size: .8rem; }
.pickup-pill-txt small { font-size: .68rem; color: var(--muted); }
.pill-chev { font-size: .6rem; color: var(--muted); margin-left: 2px; }

/* branch picker cards */
.branch-card {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
    background: var(--surface); border: 1.5px solid var(--line);
    border-radius: 14px; padding: 13px 14px; margin-bottom: 9px;
    cursor: pointer; transition: all .18s ease; font-family: inherit; color: var(--ink);
}
.branch-card:hover { border-color: var(--line-2); transform: translateX(2px); }
.branch-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.branch-card.selected .c-check { background: var(--primary); border-color: var(--primary); color: #17130E; transform: scale(1.08); }
.branch-ic {
    width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
    background: var(--primary-soft); color: var(--primary-ink);
    display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.branch-ic .pg-ic { width: 20px; height: 20px; }
.branch-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.branch-info b { font-size: .92rem; }
.branch-info small { color: var(--ink-2); font-size: .76rem; }
.branch-info small.muted { color: var(--muted); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.user-chip { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .88rem; padding: 4px 6px; border-radius: var(--r-pill); cursor: pointer; }
.user-chip:hover { background: var(--surface-2); }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary-ink);
    display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.user-avatar-large {
    width: 84px; height: 84px; border-radius: 50%; margin: 0 auto;
    background: var(--primary-soft); color: var(--primary-ink); font-size: 36px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}

.cart-btn {
    position: relative; width: 44px; height: 44px; border-radius: 50%;
    background: var(--surface-2); border: none; color: var(--ink);
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
    transition: transform .2s var(--ease-spring), background .2s;
}
.cart-btn:hover { transform: translateY(-2px) scale(1.05); background: var(--primary-soft); color: var(--primary-ink); }
.cart-count {
    position: absolute; top: -3px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 99px; background: var(--primary); color: #17130E;
    font-size: .68rem; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--bg);
}
.cart-count.bounce { animation: badgeBounce .5s var(--ease-spring); }
@keyframes badgeBounce { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 44px 0 8px; overflow: hidden; }
.hero::before, .hero::after {
    content: ''; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none;
}
.hero::before { width: 480px; height: 480px; background: var(--primary-soft); top: -220px; right: -140px; }
.hero::after { width: 380px; height: 380px; background: #FFE9C9; bottom: -190px; left: -140px; opacity: .6; }
[data-theme="dark"] .hero::after { background: rgba(255, 233, 201, .13); opacity: .5; }

.hero-inner { position: relative; max-width: 1200px; margin: 0 auto; padding: 0 20px; text-align: center; }
.hero-title { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 800; letter-spacing: -.04em; margin-bottom: 22px; }
.hero-title em {
    font-style: italic;
    background: var(--gradient-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.search-wrap {
    position: relative; max-width: 620px; margin: 0 auto 18px;
    background: var(--surface); border-radius: var(--r-pill);
    box-shadow: var(--shadow-md); border: 1.5px solid transparent;
    display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 58px;
    transition: border-color .2s, transform .2s;
}
.search-wrap:focus-within { border-color: var(--primary); transform: translateY(-2px); }
.search-wrap > i { color: var(--muted); font-size: 1.05rem; }
.search-wrap input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 1rem; color: var(--ink); height: 100%;
}
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap input::-webkit-search-cancel-button,
.search-wrap input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
.search-clear { border: none; background: var(--surface-2); color: var(--muted); width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

.hero-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--surface); border: 1px solid var(--line);
    padding: 7px 14px; border-radius: var(--r-pill);
    font-size: .8rem; font-weight: 700; color: var(--ink-2);
    box-shadow: var(--shadow-sm);
}
.hero-badge i { color: var(--amber); }

/* Promo track */
.promo-track {
    position: relative; max-width: 1200px; margin: 0 auto; padding: 6px 20px 18px;
    display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.promo-track::-webkit-scrollbar { display: none; }
.promo-card {
    scroll-snap-align: start; flex: 0 0 300px; position: relative; overflow: hidden;
    border-radius: var(--r-lg); padding: 20px 22px; min-height: 108px;
    display: flex; align-items: center; gap: 6px;
    color: #fff; cursor: pointer; border: none; text-align: left;
    transition: transform .25s var(--ease-out), box-shadow .25s;
    box-shadow: var(--shadow-md);
}
.promo-card:hover { transform: translateY(-4px) scale(1.015); box-shadow: var(--shadow-lg); }
.promo-card::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(120px 90px at 88% 10%, rgba(255,255,255,.28), transparent 70%);
    pointer-events: none;
}
.promo-emoji {
    width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto; margin-right: 14px;
    background: rgba(255,255,255,.18); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center; color: #fff;
    transition: transform .3s var(--ease-spring);
}
.promo-emoji .pg-ic { width: 26px; height: 26px; }
.promo-card:hover .promo-emoji { transform: scale(1.15) rotate(-8deg); }
.promo-txt { display: flex; flex-direction: column; }
.promo-txt b { font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; }
.promo-txt small { opacity: .92; font-size: .82rem; font-weight: 600; }
.promo-txt i.arrow { position: absolute; right: 16px; bottom: 14px; font-size: .8rem; opacity: .85; }

/* ---------- Category nav (chips) ---------- */
.cat-nav {
    position: sticky; top: var(--topbar-h); z-index: 850;
    background: rgba(255, 248, 242, .88);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}
[data-theme="dark"] .cat-nav { background: rgba(19, 16, 9, .88); background: color-mix(in srgb, var(--bg) 88%, transparent); }
.cat-track {
    max-width: 1200px; margin: 0 auto; padding: 0 20px;
    display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.cat-track::-webkit-scrollbar { display: none; }
.cat-chip {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1.5px solid var(--line);
    border-radius: var(--r-pill); padding: 8px 16px;
    font-weight: 700; font-size: .85rem; color: var(--ink-2); font-family: inherit;
    transition: all .22s var(--ease-out); white-space: nowrap;
}
.cat-chip span { display: inline-flex; }
.cat-chip span .pg-ic { width: 17px; height: 17px; }
.cat-chip:hover { border-color: var(--primary); color: var(--primary-ink); transform: translateY(-1px); }
.cat-chip.active {
    background: var(--ink); border-color: var(--ink); color: var(--bg);
    box-shadow: var(--shadow-md); transform: translateY(-1px);
}

/* ---------- Menu layout ---------- */
.menu-layout { max-width: 1200px; margin: 0 auto; padding: 28px 20px 60px; display: grid; grid-template-columns: 1fr; gap: 28px; }
/* evita que el carrusel de favoritos estire la pista 1fr del grid */
.menu-layout > * { min-width: 0; }

/* Desktop rail */
.cat-rail { display: none; }
@media (min-width: 1100px) {
    .cat-nav { display: none; }
    .menu-layout { grid-template-columns: 210px 1fr; }
    .cat-rail {
        display: flex; flex-direction: column; gap: 4px;
        position: sticky; top: calc(var(--topbar-h) + 24px); align-self: start;
        max-height: calc(100vh - var(--topbar-h) - 48px); overflow-y: auto; padding: 4px;
    }
    .rail-item {
        display: flex; align-items: center; gap: 10px;
        padding: 10px 14px; border-radius: 14px; border: none; background: transparent;
        color: var(--ink-2); font-weight: 700; font-size: .9rem; text-align: left;
        transition: all .2s; position: relative;
    }
    .rail-item span { display: inline-flex; }
    .rail-item span .pg-ic { width: 20px; height: 20px; }
    .rail-item:hover { background: var(--surface-2); color: var(--primary-ink); }
    .rail-item.active { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-md); }
}

/* Section heads */
.menu-section { margin-bottom: 42px; scroll-margin-top: calc(var(--topbar-h) + var(--catnav-h) + 12px); }
@media (min-width: 1100px) { .menu-section { scroll-margin-top: calc(var(--topbar-h) + 20px); } }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; }
.section-head p { color: var(--muted); font-size: .88rem; width: 100%; margin-top: 2px; }
.section-count {
    background: var(--primary-soft); color: var(--primary-ink);
    font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: var(--r-pill);
}
.h2-ic { display: inline-flex; vertical-align: -.18em; margin-right: 2px; }
.h2-ic .pg-ic { width: 26px; height: 26px; color: var(--primary-ink); }

/* ---------- Item cards ---------- */
.item-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 18px; margin-top: 16px;
}

.item-card {
    background: var(--surface); border-radius: var(--r-lg); overflow: hidden;
    box-shadow: var(--shadow-sm); border: 1px solid var(--line);
    cursor: pointer; position: relative;
    transition: transform .28s var(--ease-out), box-shadow .28s;
    opacity: 0; transform: translateY(18px);
    -webkit-tap-highlight-color: transparent;
}
.item-card.in { opacity: 1; transform: none; }
.item-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }

.item-media { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--surface-2); }
.item-media img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s ease, transform .45s var(--ease-out); }
.item-media img.loaded { opacity: 1; }
.item-card:hover .item-media img.loaded { transform: scale(1.07); }
.item-media .grad-tile {
    position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: center;
}
.item-media .grad-tile::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(140px 120px at 78% 18%, rgba(255,255,255,.35), transparent 65%);
}
.grad-mark { position: relative; width: 74px; height: 74px; color: rgba(255,255,255,.9); filter: drop-shadow(0 10px 18px rgba(0,0,0,.25)); transition: transform .35s var(--ease-spring); }
.grad-mark .pg-ic { width: 100%; height: 100%; }
.item-card:hover .grad-tile .grad-mark { transform: scale(1.14) rotate(-6deg); }
.item-media.img-broken img { display: none; }
.item-media.img-broken .grad-tile { display: flex; }

/* badges */
.tag-row { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; z-index: 2; }
.tag {
    font-size: .64rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
    padding: 4px 9px; border-radius: var(--r-pill); color: #fff; backdrop-filter: blur(4px);
}
.tag-popular { background: var(--primary); color: #17130E; }
.tag-new { background: #6944E0; }
.tag-deal { background: var(--green); color: #17130E; }
.tag-spicy { background: var(--red); color: #17130E; }
.tag-veggie { background: #22B573; color: #17130E; }
.tag-strike {
    position: absolute; top: 10px; right: 10px; z-index: 2;
    background: rgba(0,0,0,.62); color: #fff; border-radius: var(--r-pill);
    font-size: .68rem; font-weight: 800; padding: 4px 10px; text-decoration: line-through; opacity: .9;
}

.rating-chip {
    position: absolute; bottom: 10px; left: 10px; z-index: 2;
    background: rgba(255,255,255,.94); color: #17130E;
    border-radius: var(--r-pill); padding: 4px 9px;
    font-size: .74rem; font-weight: 800; display: flex; align-items: center; gap: 5px;
    box-shadow: var(--shadow-sm);
}
.rating-chip i { color: var(--amber); font-size: .72rem; }

.item-body { padding: 14px 16px 16px; }
.item-name { font-size: 1.02rem; font-weight: 800; letter-spacing: -.01em; margin-bottom: 3px; }
.item-desc {
    color: var(--muted); font-size: .8rem; line-height: 1.45; margin-bottom: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    min-height: 2.3em;
}
.item-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .72rem; font-weight: 600; margin-bottom: 12px; }
.item-meta i { color: var(--primary-ink); font-size: .7rem; }

.item-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.item-price { display: flex; flex-direction: column; line-height: 1.1; }
.item-price b { font-size: 1.18rem; font-weight: 800; letter-spacing: -.02em; }
.item-price small { color: var(--muted); font-size: .68rem; font-weight: 600; }
.item-price s { color: var(--muted); font-size: .78rem; font-weight: 600; }

.add-btn {
    width: 44px; height: 44px; border-radius: 50%; border: none;
    background: var(--primary-soft); color: var(--primary-ink);
    font-size: 1rem; display: flex; align-items: center; justify-content: center;
    transition: transform .2s var(--ease-spring), background .2s, color .2s;
    flex: 0 0 auto;
}
.add-btn:hover { background: var(--primary); color: #17130E; transform: scale(1.1); }
.add-btn:active { transform: scale(.9); }
.add-btn.success { background: var(--green); color: #fff; animation: addPop .45s var(--ease-spring); }
@keyframes addPop { 0% { transform: scale(1); } 45% { transform: scale(1.28) rotate(8deg); } 100% { transform: scale(1); } }

/* ---------- Favorites track ---------- */
.fav-track {
    display: grid; grid-auto-flow: column; grid-auto-columns: 258px;
    gap: 16px; overflow-x: auto; padding: 16px 4px 22px;
    scroll-snap-type: x mandatory; scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.fav-track::-webkit-scrollbar { display: none; }
.fav-track .item-card { scroll-snap-align: start; }
.fav-track .item-media { aspect-ratio: 16/11; }

/* ---------- Mobile list layout ---------- */
@media (max-width: 640px) {
    .item-grid { grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
    .item-card { display: flex; align-items: stretch; border-radius: var(--r-md); }
    .item-card .item-media { width: 116px; min-width: 116px; aspect-ratio: auto; align-self: stretch; }
    .item-card .grad-tile { font-size: 40px; }
    .item-card .item-body { flex: 1; padding: 12px 14px; display: flex; flex-direction: column; }
    .item-card .item-desc { margin-bottom: auto; -webkit-line-clamp: 2; }
    .item-card .rating-chip { display: none; }
    .item-card .item-meta { margin-bottom: 8px; }
    .item-card .item-price b { font-size: 1.05rem; }
    .add-btn { width: 40px; height: 40px; }
    .item-media .tag-strike { top: auto; bottom: 8px; right: auto; left: 8px; }
}

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 70px 20px; }
.empty-ic {
    display: inline-flex; align-items: center; justify-content: center;
    width: 84px; height: 84px; border-radius: 28px; margin-bottom: 16px;
    background: var(--primary-soft); color: var(--primary-ink);
}
.empty-ic .pg-ic { width: 40px; height: 40px; }
.empty-state h3 { font-size: 1.3rem; margin-bottom: 6px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }

/* ---------- Sheet (item detail) ---------- */
.sheet-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(15, 10, 5, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s;
}
.sheet-overlay.active { opacity: 1; visibility: visible; }
.sheet {
    position: relative; width: 100%; max-width: 520px; max-height: 92dvh;
    background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0;
    display: flex; flex-direction: column;
    transform: translateY(100%); transition: transform .42s var(--ease-out);
    box-shadow: var(--shadow-lg);
}
.sheet-overlay.active .sheet { transform: translateY(0); }
@media (min-width: 769px) {
    .sheet-overlay { align-items: center; padding: 24px; }
    .sheet { border-radius: var(--r-xl); max-height: 88vh; transform: translateY(30px) scale(.96); }
    .sheet-overlay.active .sheet { transform: translateY(0) scale(1); }
}
.sheet-handle {
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 44px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.65); z-index: 5;
}
@media (min-width: 769px) { .sheet-handle { display: none; } }
.sheet-close {
    position: absolute; top: 14px; right: 14px; z-index: 5;
    width: 38px; height: 38px; border-radius: 50%; border: none;
    background: rgba(255,255,255,.92); color: #17130E; font-size: .95rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-md); transition: transform .2s var(--ease-spring);
}
.sheet-close:hover { transform: rotate(90deg) scale(1.05); }

.sheet-media { position: relative; min-height: 200px; max-height: 260px; overflow: hidden; background: var(--surface-2); border-radius: var(--r-xl) var(--r-xl) 0 0; flex-shrink: 0; }
.sheet-media img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.sheet-media img.loaded { opacity: 1; }
.sheet-media .grad-tile { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.sheet-media .grad-mark { width: 110px; height: 110px; }

.sheet-body { flex: 1; overflow-y: auto; padding: 20px 22px 8px; }
.sheet-title-wrap { display: flex; align-items: flex-start; gap: 10px; justify-content: space-between; margin-bottom: 4px; }
.sheet-title-wrap h3 { font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em; }
.sheet-desc { color: var(--muted); font-size: .9rem; margin: 6px 0 12px; }
.sheet-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.meta-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface-2); border-radius: var(--r-pill);
    font-size: .74rem; font-weight: 700; color: var(--ink-2); padding: 5px 11px;
}
.meta-chip i { color: var(--amber); font-size: .7rem; }
.meta-chip .hot { color: var(--red); }
.meta-chip .leaf { color: var(--green-ink); }

.opt-group { margin-bottom: 20px; animation: fadeUp .4s var(--ease-out) both; }
.opt-group-title { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.opt-group-title h4 { font-size: .95rem; font-weight: 800; }
.req-pill {
    font-size: .6rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    background: var(--primary-soft); color: var(--primary-ink); padding: 3px 8px; border-radius: var(--r-pill);
}
.opt-note { font-size: .74rem; color: var(--muted); margin-left: auto; }

.choice {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border: 1.5px solid var(--line);
    border-radius: 14px; padding: 12px 14px; margin-bottom: 8px;
    cursor: pointer; transition: all .18s ease; position: relative;
}
.choice:hover { border-color: var(--line-2); transform: translateX(2px); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .c-check {
    width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
    border: 2px solid var(--line-2); display: flex; align-items: center; justify-content: center;
    transition: all .18s var(--ease-spring); color: transparent; font-size: .6rem;
}
.choice.radio .c-check { border-radius: 50%; }
.choice.check .c-check { border-radius: 7px; }
.choice .c-label { flex: 1; font-weight: 700; font-size: .9rem; }
.choice .c-label small { display: block; font-weight: 500; color: var(--muted); font-size: .74rem; }
.choice .c-price { font-weight: 800; font-size: .85rem; color: var(--ink-2); }
.choice .c-price.plus { color: var(--green-ink); }
.choice.selected { border-color: var(--primary); background: var(--primary-soft); }
.choice.selected .c-check { background: var(--primary); border-color: var(--primary); color: #17130E; transform: scale(1.08); }
.choice.selected .c-price { color: var(--primary-ink); }

.notes-field textarea, .notes-field input {
    width: 100%; border: 1.5px solid var(--line); border-radius: 14px;
    background: var(--surface); color: var(--ink); padding: 12px 14px;
    font-size: .88rem; resize: none; outline: none; transition: border-color .2s;
    font-family: inherit;
}
.notes-field textarea:focus, .notes-field input:focus { border-color: var(--primary); }

.sheet-foot {
    flex-shrink: 0; display: flex; align-items: center; gap: 14px;
    padding: 14px 20px calc(16px + var(--sat));
    border-top: 1px solid var(--line); background: var(--surface);
    border-radius: 0 0 var(--r-xl) var(--r-xl);
}
@media (min-width: 769px) { .sheet-foot { border-radius: 0 0 var(--r-xl) var(--r-xl); } }
.qty-stepper {
    display: flex; align-items: center; gap: 4px;
    background: var(--surface-2); border-radius: var(--r-pill); padding: 5px;
}
.qty-btn {
    width: 38px; height: 38px; border-radius: 50%; border: none;
    background: var(--surface); color: var(--ink); font-size: .85rem; font-weight: 800;
    box-shadow: var(--shadow-sm); transition: transform .15s var(--ease-spring), color .2s;
    display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { color: var(--primary-ink); }
.qty-btn:active { transform: scale(.85); }
.qty-btn:disabled { opacity: .35; cursor: not-allowed; }
.qty-val { min-width: 30px; text-align: center; font-weight: 800; font-size: 1.05rem; }
.qty-val.bump { animation: qtyBump .3s var(--ease-spring); }
@keyframes qtyBump { 40% { transform: scale(1.35); color: var(--primary-ink); } }
.sheet-add-btn { flex: 1; justify-content: space-between; padding-left: 22px; }
.sheet-add-btn .price-in-btn { font-size: 1.02rem; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Cart drawer ---------- */
.cart-drawer {
    position: fixed; top: 0; right: -440px; width: min(420px, 100vw); height: 100dvh;
    background: var(--surface); z-index: 2100;
    display: flex; flex-direction: column;
    box-shadow: var(--shadow-lg);
    transition: right .45s var(--ease-out);
    border-left: 1px solid var(--line);
}
.cart-drawer.active { right: 0; }
.cart-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.cart-head h3 { font-size: 1.15rem; font-weight: 800; display: flex; gap: 10px; align-items: center; }
.cart-head i { color: var(--primary-ink); }
.cart-scroll { flex: 1; overflow-y: auto; padding: 16px 20px; }

.cart-empty { text-align: center; padding: 46px 12px; }
.cart-empty .empty-ic { width: 72px; height: 72px; }
.cart-empty .empty-ic .pg-ic { width: 34px; height: 34px; }
.cart-empty h3 { font-size: 1.15rem; margin-bottom: 4px; }
.cart-empty p { color: var(--muted); font-size: .88rem; margin-bottom: 18px; }

.cart-item {
    display: flex; gap: 12px; padding: 12px; border-radius: var(--r-md);
    background: var(--surface-2); margin-bottom: 10px;
    border: 1px solid var(--line);
    animation: fadeUp .35s var(--ease-out);
}
.cart-thumb {
    width: 62px; height: 62px; border-radius: 12px; overflow: hidden; flex-shrink: 0;
    background: var(--surface); position: relative;
}
.cart-thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.cart-thumb .grad-tile { position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: center; }
.cart-thumb .grad-mark { width: 34px; height: 34px; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 800; font-size: .92rem; letter-spacing: -.01em; }
.cart-item-opts { color: var(--muted); font-size: .74rem; line-height: 1.4; margin: 2px 0 6px; }
.cart-item-price { font-weight: 800; color: var(--primary-ink); font-size: .9rem; }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.cart-mini-qty { display: flex; align-items: center; gap: 2px; background: var(--surface); border-radius: var(--r-pill); padding: 3px; border: 1px solid var(--line); }
.cart-mini-qty button {
    width: 26px; height: 26px; border-radius: 50%; border: none; background: transparent;
    color: var(--ink-2); display: flex; align-items: center; justify-content: center; font-size: .68rem;
    transition: background .15s, color .15s;
}
.cart-mini-qty button:hover { background: var(--primary); color: #17130E; }
.cart-mini-qty span { min-width: 20px; text-align: center; font-weight: 800; font-size: .85rem; }
.cart-remove { background: none; border: none; color: var(--muted); font-size: .8rem; padding: 4px; transition: color .2s, transform .2s; }
.cart-remove:hover { color: var(--red); transform: scale(1.15); }

/* upsell */
.cart-upsell { margin-top: 20px; }
.cart-upsell h4 { font-size: .85rem; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.upsell-track { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
.upsell-track::-webkit-scrollbar { display: none; }
.upsell-card {
    flex: 0 0 auto; width: 118px; border: 1.5px solid var(--line); border-radius: var(--r-md);
    background: var(--surface); padding: 8px; text-align: center; cursor: pointer;
    transition: all .2s var(--ease-out);
}
.upsell-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-sm); }
.upsell-thumb { width: 100%; height: 64px; border-radius: 10px; overflow: hidden; background: var(--surface-2); position: relative; margin-bottom: 6px; }
.upsell-thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.upsell-thumb .grad-tile { position: absolute; inset: 0; z-index: 0; display: flex; align-items: center; justify-content: center; }
.upsell-thumb .grad-mark { width: 34px; height: 34px; }
.upsell-card b { display: block; font-size: .74rem; line-height: 1.25; margin-bottom: 2px; }
.upsell-card span { font-size: .74rem; font-weight: 800; color: var(--primary-ink); }

.cart-foot { flex-shrink: 0; border-top: 1px solid var(--line); padding: 16px 20px calc(18px + var(--sat)); background: var(--surface); }
.totals { margin-bottom: 14px; }
.total-row { display: flex; justify-content: space-between; font-size: .88rem; padding: 3px 0; color: var(--ink-2); font-weight: 600; }
.total-row b { font-weight: 800; }
.total-row.muted, .total-row.muted b { color: var(--green-ink); font-size: .8rem; }
.total-row.grand { font-size: 1.05rem; color: var(--ink); font-weight: 800; padding-top: 8px; margin-top: 4px; border-top: 1px dashed var(--line-2); }
.total-row.grand b { color: var(--primary-ink); font-size: 1.15rem; }

/* ---------- Floating cart bar ---------- */
.float-cart {
    position: fixed; left: 50%; transform: translateX(-50%) translateY(90px);
    bottom: calc(84px + var(--sat)); z-index: 950;
    display: flex; align-items: center; gap: 10px;
    background: var(--ink); color: var(--bg);
    border: none; border-radius: var(--r-pill);
    padding: 13px 20px; font-weight: 800; font-size: .92rem; font-family: inherit;
    box-shadow: var(--shadow-lg); cursor: pointer;
    transition: transform .4s var(--ease-spring), opacity .3s;
    opacity: 0; pointer-events: none;
}
.float-cart.show { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.float-cart:active { transform: translateX(-50%) scale(.95); }
.float-cart-count {
    background: var(--primary); color: #17130E; min-width: 24px; height: 24px; border-radius: 99px;
    display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; padding: 0 7px;
}
.float-cart-sep { opacity: .4; }
.float-cart-total { color: var(--secondary); }
.float-cart > i:last-child { transition: transform .25s var(--ease-spring); }
.float-cart:hover > i:last-child { transform: translateX(4px); }
@media (min-width: 769px) { .float-cart { bottom: 28px; } }

/* ---------- Bottom nav ---------- */
.bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 940;
    background: rgba(255, 255, 255, .92);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding: 8px 10px calc(10px + var(--sat));
    justify-content: space-around;
}
[data-theme="dark"] .bottom-nav { background: rgba(29, 25, 19, .92); background: color-mix(in srgb, var(--surface) 92%, transparent); }
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    color: var(--muted); font-size: .66rem; font-weight: 700; flex: 1;
    padding: 4px 0; border-radius: 12px; transition: color .2s, transform .2s;
    cursor: pointer;
}
.nav-item i { font-size: 1.15rem; transition: transform .25s var(--ease-spring); }
.nav-item.active { color: var(--primary-ink); }
.nav-item.active i { transform: translateY(-2px) scale(1.08); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--bg); padding: 54px 20px 30px; margin-top: 20px; }
[data-theme="dark"] .footer { background: #0D0B07; color: #F8F3EB; }
.footer-grid {
    max-width: 1200px; margin: 0 auto 30px;
    display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 34px;
}
.footer-brand { font-size: 1.6rem; margin-bottom: 10px; }
.footer-brand b { color: var(--primary-ink); }
.footer-note { opacity: .65; font-size: .88rem; max-width: 320px; }
.footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; opacity: .55; margin-bottom: 12px; }
.footer p { font-size: .88rem; opacity: .82; margin-bottom: 6px; display: flex; align-items: center; gap: 9px; }
.footer p i { opacity: .6; width: 16px; text-align: center; }
.footer-bottom {
    max-width: 1200px; margin: 0 auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.1);
    text-align: center; font-size: .78rem; opacity: .5;
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; gap: 24px; } }

/* ---------- Modals ---------- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: rgba(15, 10, 5, .55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
    width: 100%; max-width: 500px; max-height: 90dvh;
    background: var(--surface); border-radius: var(--r-xl);
    display: flex; flex-direction: column; overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: translateY(24px) scale(.96); transition: transform .35s var(--ease-out);
}
.modal-overlay.active .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-head h3 { font-size: 1.1rem; font-weight: 800; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); flex-shrink: 0; }

@media (max-width: 768px) {
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal { max-width: 100%; max-height: 92dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; transform: translateY(100%); transition: transform .42s var(--ease-out); }
    .modal-overlay.active .modal { transform: none; }
    .modal::before {
        content: ''; display: block; width: 44px; height: 5px; border-radius: 99px;
        background: var(--line-2); margin: 10px auto 2px; flex-shrink: 0;
    }
}

/* forms */
.form-group { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.form-group label { font-weight: 800; font-size: .85rem; letter-spacing: -.01em; }
.form-group input {
    padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 14px;
    background: var(--surface); color: var(--ink); font-size: .95rem; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(255,107,53,.12); }
.auth-form button { margin-top: 4px; }
.auth-toggle { text-align: center; font-size: .85rem; color: var(--muted); margin-top: 14px; }
.auth-toggle a { color: var(--primary-ink); font-weight: 800; cursor: pointer; }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: .78rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.profile-view { text-align: center; padding: 6px 0; }

/* payment cards */
.pay-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-card {
    position: relative; display: flex; align-items: center; gap: 10px;
    border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 13px 14px;
    cursor: pointer; transition: all .2s;
}
.pay-card input { position: absolute; opacity: 0; }
.pay-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 1.05rem; color: var(--primary-ink); flex-shrink: 0; }
.pay-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.pay-txt b { font-size: .88rem; }
.pay-txt small { color: var(--muted); font-size: .7rem; }
.pay-radio {
    margin-left: auto; width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--line-2); transition: all .2s; flex-shrink: 0;
}
.pay-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pay-card:has(input:checked) .pay-radio { border-color: var(--primary); border-width: 6px; }

.checkout-summary {
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
    padding: 14px 16px; margin-bottom: 18px;
}
.checkout-summary h4 { font-size: .82rem; font-weight: 800; margin-bottom: 8px; display: flex; justify-content: space-between; }
.checkout-summary h4 span { color: var(--primary-ink); cursor: pointer; font-weight: 700; }
.co-line { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; color: var(--ink-2); padding: 3px 0; }
.co-line b { white-space: nowrap; }

/* confirmation */
.confirmation { text-align: center; padding: 20px 6px 10px; position: relative; }
.check-anim { width: 84px; height: 84px; margin: 0 auto 14px; display: block; }
.check-anim circle, .check-anim path { fill: none; stroke: var(--green); stroke-width: 3.5; stroke-linecap: round; }
.check-anim circle { stroke-dasharray: 160; stroke-dashoffset: 160; animation: drawCircle .6s var(--ease-out) forwards; }
.check-anim path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: drawCheck .4s .5s var(--ease-out) forwards; }
@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }
.confirmation h2 { font-size: 1.5rem; margin-bottom: 6px; }
.confirmation > p { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.order-id {
    display: inline-block; background: var(--surface-2); border: 1px dashed var(--line-2);
    padding: 10px 22px; border-radius: var(--r-pill); font-family: ui-monospace, monospace;
    font-size: 1.02rem; color: var(--primary-ink); font-weight: 700; margin: 8px 0 18px; letter-spacing: .05em;
}

.confetti { position: absolute; inset: -20px 0 0 0; pointer-events: none; overflow: visible; }
.confetti i {
    position: absolute; left: 50%; top: 40px; width: 9px; height: 14px; border-radius: 2px;
    opacity: 0; animation: confettiFly 1.4s var(--ease-out) forwards;
}
@keyframes confettiFly {
    0% { transform: translate(0, 0) rotate(0) scale(.6); opacity: 1; }
    70% { opacity: 1; }
    100% { transform: translate(var(--cx), var(--cy)) rotate(var(--cr)) scale(1); opacity: 0; }
}

/* orders */
.orders-list { display: flex; flex-direction: column; gap: 14px; }
.order-card-item {
    border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px;
    background: var(--surface); transition: transform .2s, box-shadow .2s;
    animation: fadeUp .4s var(--ease-out) both;
}
.order-card-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.order-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.order-top b { font-size: .95rem; }
.order-top small { color: var(--muted); font-size: .74rem; }
.order-items { font-size: .82rem; color: var(--ink-2); margin-bottom: 10px; }
.order-items div { padding: 2px 0; }
.order-total-row { display: flex; justify-content: space-between; font-weight: 800; font-size: .92rem; margin-bottom: 14px; }
.order-total-row span:last-child { color: var(--primary-ink); }
.eta-chip {
    display: inline-flex; align-items: center; gap: 7px;
    background: #FFF6E5; border: 1px solid #FFE3AC; color: #92600A;
    border-radius: var(--r-pill); padding: 6px 12px; font-size: .76rem; font-weight: 800; margin-bottom: 14px;
}
[data-theme="dark"] .eta-chip { background: #332711; border-color: #4A3814; color: #F5C36B; }

/* tracker */
.tracker { position: relative; padding-left: 6px; }
.trk-step { display: flex; gap: 14px; position: relative; padding-bottom: 22px; }
.trk-step:last-child { padding-bottom: 4px; }
.trk-step::before {
    content: ''; position: absolute; left: 13px; top: 28px; bottom: 2px; width: 2px;
    background: var(--line-2); border-radius: 2px; transition: background .4s;
}
.trk-step:last-child::before { display: none; }
.trk-step.done::before, .trk-step.now::before { background: var(--primary); }
.trk-dot {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; z-index: 1;
    background: var(--surface); border: 2px solid var(--line-2);
    display: flex; align-items: center; justify-content: center; font-size: .7rem; color: var(--muted);
    transition: all .3s;
}
.trk-step.done .trk-dot { background: var(--primary); border-color: var(--primary); color: #17130E; }
.trk-step.now .trk-dot {
    background: var(--primary); border-color: var(--primary); color: #17130E;
    box-shadow: 0 0 0 0 rgba(255,107,53,.5); animation: trkPulse 1.8s ease-out infinite;
}
@keyframes trkPulse {
    0% { box-shadow: 0 0 0 0 rgba(255,107,53,.45); }
    70% { box-shadow: 0 0 0 12px rgba(255,107,53,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,107,53,0); }
}
.trk-info b { font-size: .88rem; display: block; }
.trk-info small { color: var(--muted); font-size: .74rem; }
.trk-step:not(.done):not(.now) .trk-info b { color: var(--muted); font-weight: 600; }
.cancelled-badge {
    display: block; text-align: center; background: var(--red-soft); color: var(--red);
    border-radius: var(--r-pill); padding: 8px; font-weight: 800; font-size: .82rem;
}

.loading-inline { display: flex; justify-content: center; padding: 40px 0; }
.spinner {
    width: 36px; height: 36px; border: 3.5px solid var(--line); border-top-color: var(--primary);
    border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toasts ---------- */
.toasts {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(90px + var(--sat)); z-index: 3000;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    pointer-events: none; width: min(92vw, 420px);
}
@media (min-width: 769px) { .toasts { bottom: 30px; } }
.toast {
    display: flex; align-items: center; gap: 10px;
    background: var(--ink); color: var(--bg);
    border-radius: var(--r-pill); padding: 11px 18px;
    font-size: .86rem; font-weight: 700; box-shadow: var(--shadow-lg);
    max-width: 100%; animation: toastIn .45s var(--ease-spring);
}
.toast.out { animation: toastOut .3s ease forwards; }
.toast i { color: var(--secondary); }
.toast.error i { color: #FF8A8D; }
@keyframes toastIn { from { opacity: 0; transform: translateY(24px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(14px) scale(.92); } }

/* ---------- Overlay ---------- */
.overlay {
    position: fixed; inset: 0; z-index: 1990;
    background: rgba(15, 10, 5, .45); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    opacity: 0; visibility: hidden; transition: opacity .35s ease, visibility .35s;
}
.overlay.active { opacity: 1; visibility: visible; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .55s var(--ease-out), transform .55s var(--ease-out); }

/* ---------- Responsive: topbar ---------- */
@media (max-width: 900px) {
    .topbar-inner { flex-wrap: wrap; }
    .pickup-pill { display: flex; order: 3; flex-basis: 100%; margin: 0 0 8px; justify-content: center; }
    :root { --topbar-h: 100px; }
}
@media (max-width: 768px) {
    :root { --topbar-h: 100px; }
    body { padding-bottom: calc(74px + var(--sat)); }
    .bottom-nav { display: flex; }
    .topbar-actions #auth-button, .topbar-actions #orders-button, .topbar-actions #user-info { display: none !important; }
    .hero { padding-top: 26px; }
    .search-wrap { height: 52px; }
    .hero-badges { margin-bottom: 18px; }
    .promo-card { flex-basis: 264px; min-height: 96px; padding: 16px 18px; }
    .promo-emoji { font-size: 36px; }
    .cart-drawer { width: 100%; right: -100%; border-left: none; }
    .cat-nav { padding: 8px 0; }
    .cat-chip { font-size: .8rem; padding: 7px 14px; }
    .menu-layout { padding: 20px 16px 50px; gap: 0; }
    .section-head h2 { font-size: 1.3rem; }
}
@media (max-width: 420px) {
    .brand-name { display: none; }
    .lang-btn { width: 34px; height: 34px; font-size: .68rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
    html { scroll-behavior: auto; }
}

/* ==========================================================================
   Agente IA (chat de pedidos) + puerta de tienda multi-tenant
   ========================================================================== */
.ai-fab {
    position: fixed; right: 18px; bottom: calc(96px + var(--sat)); z-index: 960;
    display: flex; align-items: center; gap: 8px;
    background: var(--gradient-brand); color: #17130E; border: none;
    border-radius: var(--r-pill); padding: 13px 20px;
    font-weight: 800; font-size: .9rem; font-family: inherit;
    box-shadow: 0 10px 26px rgba(255, 107, 53, .45);
    animation: aiFabIn .5s var(--ease-spring); cursor: pointer;
    transition: transform .25s var(--ease-spring);
}
.ai-fab:active { transform: scale(.94); }
.ai-fab:hover { transform: translateY(-2px); }
@keyframes aiFabIn { from { opacity: 0; transform: translateY(20px) scale(.9); } to { opacity: 1; transform: none; } }
@media (min-width: 769px) { .ai-fab { bottom: 28px; } }

.ai-drawer {
    position: fixed; right: 14px; bottom: calc(90px + var(--sat)); z-index: 970;
    width: min(380px, calc(100vw - 28px)); height: min(600px, calc(100dvh - 130px));
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
    box-shadow: var(--shadow-lg); overflow: hidden;
    opacity: 0; transform: translateY(24px) scale(.96); pointer-events: none;
    transition: all .35s var(--ease-spring);
}
.ai-drawer.active { opacity: 1; transform: none; pointer-events: auto; }
@media (min-width: 769px) { .ai-drawer { bottom: 90px; } }
@media (max-width: 768px) {
    .ai-drawer { right: 8px; left: 8px; width: auto; height: min(560px, calc(100dvh - 120px)); }
}

.ai-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px;
    background: var(--gradient-brand); color: #17130E; }
.ai-avatar { width: 40px; height: 40px; border-radius: 14px; background: rgba(255,255,255,.22);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem; }
.ai-head-info { flex: 1; line-height: 1.25; }
.ai-head-info b { display: block; font-size: .95rem; }
.ai-head-info small { opacity: .9; font-size: .72rem; font-weight: 600; }
.ai-close { background: rgba(255,255,255,.18); border: none; color: #fff; width: 34px; height: 34px;
    border-radius: 50%; cursor: pointer; font-size: 1rem; }

.ai-log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 8px;
    background: var(--bg); }
.ai-msg { max-width: 84%; padding: 10px 14px; border-radius: 16px; font-size: .88rem; line-height: 1.45;
    white-space: pre-wrap; word-break: break-word; animation: aiMsgIn .3s var(--ease-spring); }
.ai-msg.ai-them { align-self: flex-start; background: var(--surface); border: 1px solid var(--line);
    border-bottom-left-radius: 4px; }
.ai-msg.ai-me { align-self: flex-end; background: var(--gradient-brand); color: #17130E;
    border-bottom-right-radius: 4px; }
.ai-msg.ai-typing { opacity: .6; font-weight: 800; letter-spacing: .2em; }
@keyframes aiMsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.ai-cart { border-top: 1px solid var(--line); padding: 10px 14px 0; background: var(--surface); }
.ai-cart ul { list-style: none; display: flex; flex-direction: column; gap: 4px; max-height: 120px; overflow-y: auto; }
.ai-cart li { display: flex; justify-content: space-between; align-items: baseline; font-size: .84rem; }
.ai-cart li small { opacity: .6; }
.ai-cart-total-row { display: flex; justify-content: space-between; padding: 6px 0; font-weight: 800; }
.ai-cart-total-row b { color: var(--primary-ink); }
.ai-confirm {
    width: 100%; border: none; background: var(--green); color: #fff; font-weight: 800;
    border-radius: var(--r-pill); padding: 12px; margin-bottom: 10px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px; font-family: inherit;
}

.ai-input-row { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.ai-input-row input { flex: 1; border: 1.5px solid var(--line-2); border-radius: 99px;
    padding: 11px 16px; font-size: .9rem; font-family: inherit; background: var(--bg); color: var(--ink); outline: none; }
.ai-input-row input:focus { border-color: var(--primary); }
.ai-input-row button { width: 46px; height: 46px; border-radius: 50%; border: none;
    background: var(--gradient-brand); color: #17130E; cursor: pointer; font-size: 1rem; }

/* ---- puerta de tienda ---- */
.tenant-gate {
    position: fixed; inset: 0; z-index: 2000; display: none;
    align-items: center; justify-content: center; padding: 20px;
    background: var(--bg);
}
.tenant-gate.active { display: flex; }
.tenant-gate-card { max-width: 420px; text-align: center; }
.tenant-gate-card img { width: 84px; height: 84px; border-radius: 24px; object-fit: cover;
    box-shadow: var(--shadow-md); margin-bottom: 18px; }
.tenant-gate-card h2 { font-size: 1.4rem; letter-spacing: -.02em; margin-bottom: 8px; }
.tenant-gate-card p { color: var(--muted); font-size: .95rem; }

/* ---------- Accesibilidad: foco visible con la marca ---------- */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent);
    outline-offset: 2px;
    border-radius: 10px;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

#checkout-status { margin: 14px 0; }
.checkout-error { color: var(--danger, #b42318); }
#checkout-next { display: flex; flex-wrap: wrap; gap: 10px; }
#catalog-state { padding: 28px 12px; }
[inert] { pointer-events: none; }

.item-open { all: unset; cursor: pointer; }
.item-open:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; border-radius: 4px; }
