/* =========================================================================
   Киоск самозаказа Aero Coffee — «Терминал» (по брендбуку, 22.10.2026).
   Канон вида — docs/DESIGN_RULES.md. Коротко: кофейня в стиле аэропорта.
   Белый и серебристый титан — база, синий ультрамарин — только главное
   («Начать заказ», «Оформить», выбранная категория). Мотивы брендбука:
   ряды шевронов, серебристый металл с бликом, знак-самолёт, линия отрыва
   посадочного талона. Шрифт — один гротеск (Montserrat вместо платного Stolzl).
   Анимации — только transform/opacity: iPad на стойке работает сутками.
   ========================================================================= */

:root {
  /* ================= ЦВЕТ ЗАВЕДЕНИЯ — ЕДИНСТВЕННОЕ МЕСТО =================
     Синий ультрамарин из брендбука (RGB 26 98 199). В остальном файле цвета
     бренда не разбросаны.
     --accent      плоскости: «Начать заказ», «Оформить», выбранная категория,
                   заливка «заказ принят»; текст на них — --on-accent
     --accent-ink  акцентный ТЕКСТ и значки на светлом, притемнён до 5.5:1
     --accent-2    глубокий край фирменного градиента ультрамарина
     --gradient    оставлен для мастера студии; шаблон его не рисует */
  --accent:      #1A62C7;
  --accent-ink:  #1757B3;
  --accent-2:    #2B4C9B;
  --accent-weak: rgba(26,98,199,0.14);
  --on-accent:   #FFFFFF;
  --gradient: linear-gradient(135deg, #1E88E5, #1A62C7 52%, #2B4C9B);

  /* ---- НЕЙТРАЛЬНЫЕ: белый и серебристый титан ---- */
  --bg: #EEF1F6;          /* светлое серебро: колонка разделов, страницы заказа и поиска */
  --surface: #FFFFFF;     /* белый: витрина, плитки, поля */
  --surface-2: #E2E6EE;   /* подложки: степпер, кадр без фото */
  --ink: #1F2537;         /* тёмный титан: текст и всё нажимаемое */
  --ink-2: #505B74;       /* вторичный текст (6:1 на серебре) */
  --titanium: #6D7993;    /* серебристый титан из брендбука (RGB 109 121 147) */
  --titanium-deep: #4E5672; /* заголовки брендбука */
  --chevron-c: #C9CED9;   /* шевроны — светлый титан */
  --night: #1C2233;       /* тёмные экраны: оплата, клавиатура */
  --line: rgba(31,37,55,.12);
  --danger: #B3261E;
  --tint: color-mix(in srgb, var(--accent) 8%, #F3F5F9);   /* кадр без фото */

  /* Мягкие тени: минимализм брендбука, без жёстких контуров. */
  --shadow: 0 10px 28px rgba(31,37,55,.08), 0 1px 2px rgba(31,37,55,.06);
  --shadow-sm: 0 4px 12px rgba(31,37,55,.08);
  /* Линия отрыва посадочного талона. */
  --tear: 2px dashed rgba(31,37,55,.16);

  /* прежние имена — их ещё читают отдельные правила и библиотеки */
  --text: var(--ink); --hint: var(--ink-2); --card: var(--surface); --border: var(--line);

  --rail-w: clamp(150px, 17.5vw, 192px);   /* колонка разделов */
  --bar-h: 92px;          /* реальную высоту шапки пишет JS (syncBarHeight) */
  --p: 0;                 /* прогресс раскрытия меню, пишет JS */

  /* Брендбук — один гротеск Stolzl (Medium, Regular, Light). Он платный,
     поэтому оба слота — Montserrat: заголовки — прописными, с разрядкой;
     текст — Regular/Medium. */
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Montserrat', -apple-system, sans-serif;

  --ease-out: cubic-bezier(.22,1,.36,1);
  --ease-page: cubic-bezier(.32,.72,0,1);
  /* Ровный ход без перелёта — микроанимации этого вида. */
  --ease-mech: cubic-bezier(.4,0,.2,1);

  --chevron-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 15l7-7 7 7'/%3E%3C/svg%3E");
  /* Шеврон брендбука: толстая «галка» вправо. */
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 40'%3E%3Cpath d='M0 0h13l17 20-17 20H0l17-20z'/%3E%3C/svg%3E");
}
/* Тёмные экраны (оплата, клавиатура): акцентный текст на тёмном — светлый
   вариант цвета. Строку ниже мастер студии находит и переписывает под цвет
   заведения (builder._dark_ink) — формат не менять. Заставка здесь светлая
   и акцентный текст на ней не использует. */
.on-dark, .hero, .payment-screen, .keyboard-panel {
    --accent-ink: #7FB0F2; --accent-weak: rgba(26,98,199,0.16);
}

/* ------------------------------------------------- корень и высота экрана --- */
/* Киоск: ни выделения текста, ни меню по долгому нажатию, ни подсветки тапа. */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
/* Поле, в которое печатает нативная клавиатура (запасной путь), выделяется. */
input { -webkit-user-select: text; user-select: text; }
html {
  margin: 0; padding: 0; height: 100%; overflow: hidden; background: var(--bg);
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  overscroll-behavior: none;
}
body {
  margin: 0; padding: 0; height: var(--app-h, 100%);
  background: var(--bg); color: var(--ink); overflow: hidden;
  font-family: var(--font);
  overscroll-behavior: none;
  /* iPadOS: гасим двойной тап-зум. */
  touch-action: manipulation;
}
/* Высоту задаёт --app-h: реальные пиксели, которые JS перемеряет на каждом
   resize (vh/dvh на первой отрисовке iPad занижены); dvh — запасной. */
#app { height: var(--app-h, 100dvh); display: flex; flex-direction: column; background: var(--bg); }
button { font-family: inherit; color: inherit; -webkit-appearance: none; appearance: none; touch-action: manipulation; }
img { -webkit-user-drag: none; }
.hidden { display: none !important; }

/* Знак заведения: файл логотипа кладёт мастер студии. Нет логотипа (пустая
   заглушка) — места не держим. */
.brand-mark {
  display: inline-block; width: 1.12em; height: 1em; margin-right: .32em;
  background: url("/static/brand-yurt.webp") center / contain no-repeat;
  vertical-align: -.14em;
}
.no-logo .brand-mark { display: none; }

/* ================================================================ ЗАСТАВКА === */
/* HERO — ФОН страницы: панель меню едет поверх, заставка не исчезает.
   Без своих кадров — серебристый металл, как обложка брендбука: по нему
   проходит блик, наискосок пролетает знак-самолёт. Сверху бегут шевроны,
   название стоит табло — стопкой строк, строки по очереди плавно
   переезжают. С кадрами (body.attract-media) — фото во весь экран, строки
   названия садятся белыми плашками над кнопкой. */
.hero {
  position: fixed; inset: 0; z-index: 1;
  height: var(--app-h, 100dvh);
  background: #E6E8EC; overflow: hidden; color: var(--titanium-deep);
}
/* Два слоя сюжетов: живой — 1, второй грузит следующий и ждёт на нуле. */
.attract-slot { position: absolute; inset: 0; opacity: 0; transition: opacity 500ms ease; }
.attract-slot.is-live { opacity: 1; }
.attract-video, .attract-photo, .attract-fallback {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center center;
}
/* Серебристый металл: диагональные полосы света, как на обложке брендбука. */
.attract-fallback {
  overflow: hidden;
  background: linear-gradient(118deg, #D3D6DD 0%, #F3F4F6 22%, #DADDE3 42%, #FFFFFF 58%, #E1E3E8 74%, #D1D4DB 100%);
}
/* Блик проходит по металлу. Только transform. */
.metal-sheen {
  position: absolute; top: -40%; left: -60%; width: 46%; height: 180%;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.75) 50%, rgba(255,255,255,0));
  transform: translate3d(0, 0, 0) rotate(24deg);
  will-change: transform;
  animation: metal-sheen 11s var(--ease-mech) infinite;
}
@keyframes metal-sheen {
  0%, 30%  { transform: translate3d(0, 0, 0) rotate(24deg); }
  70%, 100% { transform: translate3d(360%, 0, 0) rotate(24deg); }
}
/* Знак-самолёт пролетает наискосок снизу вверх и надолго исчезает. */
.fly-mark {
  position: absolute; left: -12%; top: 88%; width: 120px; height: 108px;
  background: url("/static/brand-yurt.webp") center / contain no-repeat;
  opacity: 0; will-change: transform, opacity;
  animation: fly-mark 18s linear infinite;
}
.no-logo .fly-mark { display: none; }
@keyframes fly-mark {
  0%   { transform: translate3d(0, 0, 0) rotate(40deg) scale(.7); opacity: 0; }
  4%   { opacity: .9; }
  40%  { transform: translate3d(130vw, -110vmin, 0) rotate(40deg) scale(1.15); opacity: .9; }
  41%, 100% { transform: translate3d(130vw, -110vmin, 0) rotate(40deg) scale(1.15); opacity: 0; }
}

/* Затемнение при раскрытии меню: alpha пишет JS. */
.hero-scrim { position: absolute; inset: 0; pointer-events: none; background: #0E1220; opacity: 0; }
.hero-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(env(safe-area-inset-top, 0px) + 56px) 48px calc(env(safe-area-inset-bottom, 0px) + 40px);
  pointer-events: none;
}
.hero-overlay > * { pointer-events: auto; }
/* Слой с названием гаснет при раскрытии меню (opacity пишет engine/panel). */
.hero-brand { position: absolute; inset: 0; pointer-events: none !important; }

/* Ряд шевронов брендбука поверху: бежит вправо, как огни рулёжки.
   Лента шире экрана на один шаг и едет ровно на шаг — круг без шва. */
.chevrons { position: absolute; left: 0; right: 0; overflow: hidden; height: 40px; }
.chevrons-top { top: calc(env(safe-area-inset-top, 0px) + 36px); }
.chevrons-track {
  position: absolute; top: 0; bottom: 0; left: -52px; right: 0;
  background: var(--chevron-c);
  -webkit-mask: var(--chev) 0 0 / 52px 40px repeat-x;
          mask: var(--chev) 0 0 / 52px 40px repeat-x;
  will-change: transform;
  animation: chev-run 1.8s linear infinite;
}
@keyframes chev-run { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(52px, 0, 0); } }

/* Знак и подпись: как на обложке брендбука — самолёт и строка рядом. */
.hero-top {
  position: absolute; left: 48px; right: 48px;
  top: calc(env(safe-area-inset-top, 0px) + 112px);
  display: flex; align-items: center; gap: 10px;
  font-size: 64px;
}
.attract-sub {
  min-width: 0; font-size: 20px; font-weight: 400; letter-spacing: .02em;
  color: var(--titanium-deep); text-wrap: balance;
}

/* Табло: стопка строк. Кегль каждой строки подбирает Hero.jsx (fitPoster) —
   слово занимает ширину афиши, но не выше своей доли высоты; остаток ширины
   (--slack) — ход строки. Нечётные строки стоят слева и едут вправо, чётные —
   наоборот; по очереди, плавно, без перелёта. */
.poster {
  position: absolute; left: 48px; right: 48px;
  top: calc(env(safe-area-inset-top, 0px) + 208px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 268px);
  display: flex; flex-direction: column; justify-content: center; row-gap: 14px;
}
.poster-row {
  --dir: 1;
  display: flex; justify-content: flex-start; white-space: nowrap;
  will-change: transform;
  animation: poster-shift 14s var(--ease-mech) infinite;
  animation-delay: calc(var(--i, 0) * 900ms);
}
.poster-alt, .poster-foot { --dir: -1; justify-content: flex-end; }
@keyframes poster-shift {
  0%, 12%   { transform: translate3d(0, 0, 0); }
  24%, 56%  { transform: translate3d(calc(var(--slack, 0px) * var(--dir, 1)), 0, 0); }
  68%, 100% { transform: translate3d(0, 0, 0); }
}
.poster-word { display: inline-flex; align-items: center; }
/* Строки названия: прописные с разрядкой, как «AERO COFFEE» в логотипе.
   line-height с запасом сверху — Й, Ё, Ә, Қ не срезаются. */
.poster-name .poster-word {
  font-family: var(--font-display); font-weight: 500; font-size: 120px;
  line-height: 1.1; padding-top: .06em; letter-spacing: .02em;
  color: var(--titanium-deep);
}
.poster-alt .poster-word { color: var(--accent); }
/* Строка-зазывала: белая капсула со знаком-самолётом. */
.poster-kicker .poster-word {
  gap: 14px; padding: 12px 24px 12px 16px; border-radius: 999px;
  background: rgba(255,255,255,.82); box-shadow: var(--shadow-sm);
  font-size: 19px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  color: var(--titanium-deep);
}
.kicker-plane {
  display: inline-block; width: 34px; height: 30px; flex: 0 0 auto;
  background: url("/static/brand-yurt.webp") center / contain no-repeat;
  transform: rotate(90deg);
}
.no-logo .kicker-plane { display: none; }
/* Нижний ряд шевронов — навстречу верхнему, как во врезках брендбука. */
.chevrons-row { gap: 6px; height: 40px; color: var(--chevron-c); }
.chev {
  display: block; width: 30px; height: 40px; background: currentColor;
  -webkit-mask: var(--chev) center / contain no-repeat;
          mask: var(--chev) center / contain no-repeat;
  transform: scaleX(-1);
}

/* Свои кадры есть: фото на весь экран, тень снизу под текст; строки названия
   садятся белыми плашками над кнопкой (синий — только у «Начать заказ»). */
.attract-media .hero-overlay {
  background: linear-gradient(to top, rgba(14,18,32,.55), rgba(14,18,32,0) 52%);
}
.attract-media .poster { top: 50%; row-gap: 10px; }
.attract-media .poster-foot, .attract-media .chevrons-top { display: none; }
.attract-media .poster-name .poster-word {
  padding: .08em .26em 0; border-radius: .16em;
  background: #fff; color: var(--titanium-deep);
}

/* Главная кнопка заставки: широкая синяя капсула у руки, синяя стрелка
   в белом квадрате. Под ней мягко «дышит» подсказка. */
.attract-hint {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 124px; padding: 0 18px 0 48px; border: 0; border-radius: 30px;
  background: var(--accent); color: var(--on-accent); cursor: pointer;
  font-family: var(--font-display); font-size: clamp(28px, 3.6vw, 38px); font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  box-shadow: 0 18px 40px rgba(26,98,199,.32);
  transition: transform 140ms var(--ease-mech);
}
.attract-hint:active { transform: scale(.97); }
.attract-hint-arrow {
  flex: 0 0 auto; width: 88px; height: 88px; border-radius: 22px;
  background: #fff; color: var(--accent); position: relative;
}
.attract-hint-arrow::before {
  content: ""; position: absolute; inset: 24px; background: currentColor;
  -webkit-mask: var(--chevron-up) center / contain no-repeat;
          mask: var(--chevron-up) center / contain no-repeat;
  animation: attract-bounce 1.8s var(--ease-mech) infinite;
}
@keyframes attract-bounce { 0%, 100% { transform: translateY(4px); } 50% { transform: translateY(-5px); } }
.attract-hint-sub {
  margin-top: 20px; text-align: center; color: var(--titanium-deep);
  font-size: 18px; font-weight: 500; letter-spacing: .04em;
  animation: hint-breathe 3s var(--ease-mech) infinite;
}
@keyframes hint-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
/* Пока меню открыто, заставку не видно — все её бесконечные анимации стоят. */
body.menu-open #hero *,
body.menu-open #hero *::before,
body.menu-open #hero *::after { animation-play-state: paused; }

/* ================================================================== ШАПКА === */
/* Выезжает ОТДЕЛЬНОЙ фазой, когда панель встала. Темп — общий --motion. */
.appbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; align-items: center; gap: 14px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 20px 14px 24px;
  background: var(--bg); color: var(--ink);
  transform: translateY(-100%);
  transition: transform calc(180ms * var(--motion, 1)) cubic-bezier(.4,0,1,1);
}
.appbar.in { transform: none; transition: transform calc(280ms * var(--motion, 1)) var(--ease-mech); }
/* Шов между шапкой и панелью закрыт полоской того же цвета. */
.appbar::after { content: ""; position: absolute; left: 0; right: 0; top: calc(100% - 2px); height: 6px; background: var(--bg); opacity: 0; pointer-events: none; }
.appbar.in::after { opacity: 1; }
.brand-row {
  flex: 0 0 auto; width: calc(var(--rail-w) - 10px); min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
}
.appbar .brand {
  font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: .04em; line-height: 1.15;
  text-transform: uppercase; color: var(--titanium-deep);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.appbar .brand .brand-mark { width: 1.5em; height: 1.35em; vertical-align: -.36em; margin-right: .3em; }
.appbar .brand-sub { font-size: 12px; font-weight: 500; letter-spacing: .02em; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .spacer { display: none; }
.bar-search {
  flex: 1; min-width: 0; height: 64px; padding: 0 24px;
  display: flex; align-items: center; gap: 14px;
  border: 0; border-radius: 999px; background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink-2); font-size: 18px; font-weight: 500; cursor: pointer; text-align: left;
  transition: transform 120ms var(--ease-mech);
}
.bar-search svg { width: 24px; height: 24px; flex: 0 0 auto; color: var(--accent-ink); }
.bar-search span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-search:active { transform: scale(.98); }
/* Язык — сегмент из двух: выбранный залит тёмным титаном. */
.lang-switch { display: flex; padding: 5px; gap: 2px; border-radius: 999px; background: var(--surface); box-shadow: var(--shadow-sm); }
.lang-btn {
  min-width: 70px; height: 54px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-2); cursor: pointer;
  font-size: 15px; font-weight: 600; letter-spacing: .06em;
  transition: background-color 180ms ease, color 180ms ease, transform 120ms var(--ease-mech);
}
.lang-btn.active { background: var(--ink); color: #fff; }
.clock { display: none; }
.back-to-attract {
  width: 64px; height: 64px; flex: 0 0 auto; border-radius: 50%; cursor: pointer;
  border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  transition: transform 120ms var(--ease-mech);
}
.back-to-attract svg { width: 26px; height: 26px; }
.back-to-attract:active, .lang-btn:active { transform: scale(.94); }
/* Содержимое шапки проявляется следом за ней, лесенкой. */
.appbar .brand-row, .appbar .bar-search, .appbar .lang-switch, .appbar .back-to-attract {
  opacity: 0; transition: opacity calc(200ms * var(--motion, 1)) linear, transform 120ms var(--ease-mech);
}
.appbar.in .brand-row       { opacity: 1; transition-delay: calc(80ms * var(--motion, 1)); }
.appbar.in .bar-search      { opacity: 1; transition-delay: calc(120ms * var(--motion, 1)), 0ms; }
.appbar.in .lang-switch     { opacity: 1; transition-delay: calc(150ms * var(--motion, 1)); }
.appbar.in .back-to-attract { opacity: 1; transition-delay: calc(180ms * var(--motion, 1)), 0ms; }

/* ================================================================= ПАНЕЛЬ === */
/* Колонка разделов слева + белый лист витрины справа. Двигается ТОЛЬКО
   transform (пишет JS); стартовое положение — за нижним краем. */
.panel {
  position: fixed; left: 0; right: 0; z-index: 2;
  top: var(--bar-h);
  height: calc(var(--app-h, 100dvh) - var(--bar-h));
  display: flex; flex-direction: row;
  transform: translateY(100%);
  will-change: transform;
  /* touch-action: none здесь НЕ ставить: заглушит прокрутку каталога. */
}
/* Фон панели — неподвижный слой, у которого меняется только прозрачность. */
.panel-bg { position: absolute; inset: 0; z-index: -1; background: var(--bg); opacity: 0; }
.panel-edge { display: none; }

/* --- разделы: колонка слева, прокручивается сама (3 раздела или 15) -------- */
.buckets {
  flex: 0 0 var(--rail-w); min-height: 0;
  display: flex; flex-direction: column; gap: 8px;
  padding: 10px 10px 150px 14px;
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
  scrollbar-width: none; touch-action: pan-y;
}
.buckets::-webkit-scrollbar { display: none; }
.bucket-btn {
  position: relative; flex: 0 0 auto; min-height: 84px; width: 100%;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 10px;
  padding: 16px 14px 16px 16px; border: 0; border-radius: 22px; cursor: pointer;
  background: transparent; color: var(--ink-2); text-align: left;
  font-size: 16px; font-weight: 600; line-height: 1.2;
  overflow-wrap: break-word; hyphens: auto;
  transition: background-color 200ms ease, color 200ms ease, transform 120ms var(--ease-mech);
}
.bucket-btn:active { transform: scale(.96); }
.bucket-btn.active { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
/* Метка выбранного раздела — синий шеврон. */
.bucket-btn.active::before {
  content: ""; position: absolute; top: 16px; right: 16px;
  width: 10px; height: 14px; background: var(--accent);
  -webkit-mask: var(--chev) center / contain no-repeat;
          mask: var(--chev) center / contain no-repeat;
}
.bucket-thumb { width: 60px; height: 60px; border-radius: 18px; object-fit: cover; background: var(--surface-2); }
/* Раздел без фото, когда у соседей фото есть: значок на светлой подложке. */
.bucket-thumb-ph { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; background: var(--tint); color: var(--accent-ink); }
.bucket-thumb-ph .ph-ico { width: 36px; height: 36px; opacity: .75; }

/* --- витрина: белый лист справа ------------------------------------------- */
.panel-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 36px 0 0 0;
  box-shadow: -1px 0 0 var(--line);
  overflow: hidden;
}
/* Ряд категорий раздела. Прилипает над витриной; когда каталог уехал под
   него, снизу появляется мягкая тень. Один раздел — ряда нет. */
.nav-stack { flex: 0 0 auto; position: relative; z-index: 6; padding-top: 18px; background: var(--surface); }
.nav-stack:has(.categories:empty) { padding-top: 8px; }
.nav-stack::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 18px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(31,37,55,.07), rgba(31,37,55,0));
  opacity: 0; transition: opacity 160ms linear;
}
.nav-stack.stuck::after { opacity: 1; }
.categories {
  display: flex; gap: 8px; padding: 0 22px 14px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.categories:empty { display: none; }
.categories::-webkit-scrollbar { display: none; }
.cat-btn {
  flex: 0 0 auto; min-height: 52px; padding: 0 22px; cursor: pointer; white-space: nowrap;
  border: 1.5px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--ink); font-size: 15px; font-weight: 600;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 120ms var(--ease-mech);
}
.cat-btn:active { transform: scale(.96); }
.cat-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cat-btn.cat-top { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

/* Пейджер: обрезка и сдвиг — на РАЗНЫХ элементах (окно стоит, лента едет). */
.pager { flex: 1; min-height: 0; overflow: hidden; touch-action: pan-y; }
.pager-track { display: flex; height: 100%; will-change: transform; }
.page { flex: 0 0 100%; min-width: 100%; display: flex; flex-direction: column; min-height: 0; }
.page-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  touch-action: pan-y; overscroll-behavior: contain;
  /* -webkit-overflow-scrolling НЕ ставить (Г-1): не шлёт scroll на инерции. */
}
.menu { touch-action: pan-y; padding: 6px 22px 210px; }
.menu-section { margin-bottom: 40px; }
/* Заголовок раздела — прописными с разрядкой, цветом титана, и ряд шевронов. */
.menu-section-title {
  display: flex; align-items: center; gap: 16px;
  margin: 10px 0 20px; font-family: var(--font-display);
  font-size: 26px; font-weight: 600; letter-spacing: .06em; line-height: 1.15;
  text-transform: uppercase; color: var(--titanium-deep);
  text-wrap: balance;
}
.menu-section-title::after {
  content: ""; flex: 0 0 auto; width: 96px; height: 18px; background: var(--chevron-c);
  -webkit-mask: var(--chev) 0 0 / 16px 18px repeat-x;
          mask: var(--chev) 0 0 / 16px 18px repeat-x;
}
/* Две крупные плитки в ряд: фото позиции хорошо видно с вытянутой руки. */
.menu-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 18px; }
.loading { padding: 60px 0; text-align: center; color: var(--ink-2); font-size: 20px; }

/* ================================================================= ПЛИТКА === */
/* Белая карточка с мягкой тенью, фото в скруглённом «иллюминаторе». */
.product-card {
  position: relative; display: flex; flex-direction: column; cursor: pointer;
  padding: 10px 10px 18px; border-radius: 30px;
  background: var(--surface); box-shadow: var(--shadow);
  /* Карточка — замкнутый мир: смена счётчика не перекладывает соседей. */
  contain: layout paint;
}
.product-card-media { position: relative; }
/* Жёсткий aspect-ratio — условие кэша геометрии скроллспая (§7.7): фото не
   сдвигают секции при загрузке. 4:3 — под плиточные копии (768x576). */
.product-card-image {
  width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover;
  border-radius: 22px; background: var(--surface-2);
  transition: transform 160ms var(--ease-mech);
}
.product-card:active .product-card-image { transform: scale(.97); }
.product-card.unavailable:active .product-card-image { transform: none; }
/* Нет фото — светлая подложка с оттенком ультрамарина и линейный значок. */
.product-card-ph { display: flex; align-items: center; justify-content: center; background: var(--tint); color: var(--accent-ink); }
.product-card-ph .ph-ico { width: 30%; height: auto; opacity: .55; }
/* Пока фото карточки летит в плитку (или из неё), плитка пустая — её
   картинку заменяет летун; кнопка проявится, когда он сядет. */
.product-card[data-flying] .product-card-image,
.product-card[data-flying] .card-add,
.product-card[data-flying] .card-qty { opacity: 0; transition: none; }
/* Под фото: название слева, цена справа на той же строке — у соседних
   плиток цены стоят на одной высоте. */
.product-card-body {
  padding: 16px 8px 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline;
  column-gap: 12px; row-gap: 4px;
}
.product-card-name {
  grid-column: 1; grid-row: 1;
  font-size: 19px; font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-wrap: pretty;
}
.product-card-price {
  grid-column: 2; grid-row: 1;
  font-family: var(--font-display); font-size: 20px; font-weight: 600; white-space: nowrap;
  color: var(--accent-ink);
}
.product-card-volume { grid-column: 1 / -1; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card.unavailable { opacity: .45; }
.product-card-stop {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  padding: 8px 14px; border-radius: 999px; background: rgba(31,37,55,.86); color: #fff;
  font-size: 14px; font-weight: 600;
}
/* «+» прямо на фото, в правом нижнем углу: позиция без выбора — сразу в
   корзину, иначе открывает карточку. */
.card-add {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  width: 64px; height: 64px; border: 0; border-radius: 50%; cursor: pointer; padding: 0;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(31,37,55,.24), 0 0 0 4px rgba(255,255,255,.9);
  transition: transform 120ms var(--ease-mech), opacity 180ms ease-out;
}
.card-add svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.card-add:active { transform: scale(.88); }
/* Взятая позиция: «− 2 +» на том же месте. */
.card-qty {
  position: absolute; right: 12px; bottom: 12px; z-index: 2;
  display: flex; align-items: center; gap: 2px; padding: 5px;
  border-radius: 999px; background: var(--ink); color: #fff;
  box-shadow: 0 8px 20px rgba(31,37,55,.24), 0 0 0 4px rgba(255,255,255,.9);
  animation: card-qty-in 240ms var(--ease-mech);
  transition: opacity 180ms ease-out;
}
.card-qty-btn {
  width: 50px; height: 50px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; line-height: 1; background: transparent; color: #fff;
  transition: transform 120ms var(--ease-mech);
}
.card-qty-plus { background: #fff; color: var(--ink); }
.card-qty-btn:active { transform: scale(.86); }
.card-qty-n {
  min-width: 30px; text-align: center; font-size: 20px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  animation: count-pop 240ms var(--ease-mech);
}
@keyframes card-qty-in { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes count-pop { from { transform: scale(.6); } to { transform: none; } }

/* Круг из точки касания — обратная связь на быстрый тап. */
.tap-ripple {
  position: fixed; z-index: 9999; pointer-events: none;
  width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.75); background: rgba(26,98,199,.16);
  animation: tap-ripple 520ms cubic-bezier(0.22,0.61,0.36,1) forwards;
}
@keyframes tap-ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(11); opacity: 0; } }

/* Клон позиции летит в корзину. */
.fly-ghost {
  position: fixed; z-index: 90; pointer-events: none;
  background-size: cover; background-position: center; background-color: var(--tint);
  border-radius: 22px; opacity: .95;
  transition: transform 560ms var(--ease-mech), opacity 560ms cubic-bezier(.5,0,.75,0);
  will-change: transform, opacity;
}

/* Летун: фото товара между плиткой и карточкой (engine/flight.js). Рамка
   режет содержимое по своему скруглению; двигает её WAAPI — только
   transform/opacity, без transition. */
.flyer {
  position: fixed; z-index: 35; overflow: hidden; pointer-events: none;
  background: var(--tint); transform-origin: 50% 50%;
  will-change: transform;
}
/* display не задаём: у клона заглушки он свой (flex — значок по центру). */
.flyer-layer {
  position: absolute; margin: 0; max-width: none; aspect-ratio: auto;
  border-radius: 0 !important; transition: none !important;
  transform-origin: 50% 50%; will-change: transform, opacity;
}
.flyer-photo { background-size: cover; background-position: center; }

/* ========================================================= ПОЛОСА ЗАКАЗА === */
/* Тёмная капсула над нижним краем, у руки: выезжает с первым товаром. */
.cart-bar {
  position: fixed; left: 16px; right: 16px; z-index: 20;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 18px;
  min-height: 96px; padding: 0 14px 0 28px; border-radius: 32px;
  background: var(--ink); color: #fff; cursor: pointer;
  box-shadow: 0 20px 50px rgba(31,37,55,.32);
  transform: none; transition: transform 340ms var(--ease-mech);
}
.cart-bar.off { transform: translateY(150%); }
.cart-bar-info { flex: 1; min-width: 0; }
.cart-bar-line { font-size: 14px; font-weight: 500; color: rgba(255,255,255,.66); letter-spacing: .04em; }
.cart-bar-total { font-family: var(--font-display); font-size: 32px; font-weight: 600; line-height: 1.15; }
#cart-bar-total { display: inline-block; font-variant-numeric: tabular-nums; }
#cart-bar-total.bump { animation: cart-bump 380ms var(--ease-mech); }
@keyframes cart-bump { 0% { transform: scale(1); } 40% { transform: scale(1.1); } 100% { transform: scale(1); } }
.cart-bar-next {
  position: relative; height: 72px; padding: 0 30px 0 34px; border: 0; border-radius: 24px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: var(--accent); color: var(--on-accent);
  font-size: 19px; font-weight: 600; letter-spacing: .02em;
  transition: transform 120ms var(--ease-mech);
}
.cart-bar:active .cart-bar-next { transform: scale(.97); }
.cart-bar-arrow { font-size: 24px; transition: transform 200ms var(--ease-mech); }
.cart-bar-next:active .cart-bar-arrow { transform: translateX(5px); }
.cart-bar-count {
  position: absolute; top: -10px; right: -8px;
  min-width: 32px; height: 32px; padding: 0 8px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: var(--ink); border: 3px solid var(--ink);
  font-size: 14px; font-weight: 700;
  animation: count-pop 240ms var(--ease-mech);
}


/* ======================================================= КАРТОЧКА ТОВАРА === */
.modal {
  position: fixed; inset: 0; z-index: 30; height: var(--app-h, 100dvh);
  background: var(--tint);
  opacity: 0; transition: opacity 320ms ease;
}
.modal.open { opacity: 1; }
/* Лист выбора поднимается снизу вместе с проявлением карточки и уходит туда
   же при закрытии; фото в это время летит из плитки / в плитку. */
.modal .modal-card { transform: translateY(48px); transition: transform 420ms var(--ease-out); }
.modal.open .modal-card { transform: none; }
/* Сдвинутая пальцем карточка скругляется и отрывается тенью от меню. */
.modal.swiping, .modal.swiping .modal-bg { border-radius: 36px; overflow: hidden; }
.modal.swiping { box-shadow: 0 30px 70px rgba(14,18,32,.4); }
/* Свайпы по фото разбираем сами — браузеру жест не отдаём. */
.modal-bg { position: absolute; inset: 0; z-index: 1; overflow: hidden; touch-action: none; background: var(--tint); }
/* Фото — над листом выбора; лист заходит на кадр скруглённым краем. */
.modal-bg-video, .modal-bg-image {
  position: absolute; left: 0; right: 0; top: 0;
  height: calc(100% - var(--card-h, 55%) + 44px);
}
.modal-bg-video { width: 100%; object-fit: cover; }
.modal-bg-image { background-size: cover; background-position: center; }
.modal-ph {
  position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--card-h, 55%) - 44px);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent-ink); pointer-events: none;
}
.modal-ph-ico { width: min(32vw, 250px); height: auto; opacity: .4; }
.modal.open .modal-ph-ico { animation: ph-float 600ms var(--ease-mech); }
@keyframes ph-float { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: .4; } }
.modal-close {
  position: absolute; z-index: 12; top: calc(env(safe-area-inset-top, 0px) + 20px); right: 20px;
  width: 68px; height: 68px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.94); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(31,37,55,.16);
}
.modal-close svg { width: 28px; height: 28px; }
.modal-close { transition: transform 120ms var(--ease-mech); }
.modal-close:active { transform: scale(.92); }

/* Лист выбора: белый, по верху — линия отрыва посадочного талона;
   прокручивается сам, «В корзину» всегда внизу. */
.modal-card {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 11;
  max-height: calc(100% - 220px);
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 40px 40px 0 0;
  box-shadow: 0 -18px 50px rgba(31,37,55,.12);
}
.modal-card::before {
  content: ""; position: absolute; left: 32px; right: 32px; top: 14px; height: 0;
  border-top: var(--tear); pointer-events: none;
}
.card-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 38px 32px 10px; }
.product-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.product-head h2 {
  margin: 0; font-family: var(--font-display); font-size: 36px; font-weight: 600;
  line-height: 1.1; letter-spacing: .01em; color: var(--ink);
}
.product-volume-tag {
  padding: 8px 16px; border-radius: 999px; background: var(--accent-weak); color: var(--accent-ink);
  font-size: 15px; font-weight: 600; white-space: nowrap;
}
.product-volume-tag.flash { animation: tag-flash 500ms var(--ease-mech); }
@keyframes tag-flash { 0% { transform: scale(1.12); } 100% { transform: none; } }
.product-desc { margin: 14px 0 0; max-width: 60ch; font-size: 18px; font-weight: 400; line-height: 1.5; color: var(--ink-2); }
.product-nutrition { margin-top: 10px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.product-base-price { display: none; }
.card-section { margin-top: 26px; }
.card-sizes:has(.size-row.hidden) { display: none; }
.card-label, .opt-group-title {
  font-size: 15px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--titanium-deep);
}
.card-label { margin-bottom: 14px; }

/* Объём — силуэты стаканчиков растущей высоты: размер видно до цифр. */
.size-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; }
.size-cup {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  min-height: 160px; padding: 16px 10px 14px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 26px; background: var(--surface); color: var(--ink);
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease, transform 120ms var(--ease-mech);
}
.size-cup:active { transform: scale(.96); }
.size-cup-ico { width: auto; height: calc(64px * var(--cup-k, 1)); margin-bottom: 8px; overflow: visible; }
.size-cup-ico path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.size-cup-ico .cup-band { fill: var(--accent-weak); stroke: none; }
.size-cup-label { font-size: 17px; font-weight: 600; }
.size-cup-price { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.size-cup.chosen { background: var(--ink); border-color: var(--ink); color: #fff; }
.size-cup.chosen .size-cup-price { color: rgba(255,255,255,.7); }
.size-cup.chosen .cup-band { fill: rgba(255,255,255,.3); }

/* Группы выбора: подпись + чипсы. Всё на виду, ничего не свёрнуто. */
.modifier-rail { display: flex; flex-direction: column; gap: 26px; }
.opt-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.opt-group-hint { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.opt-group.need .opt-group-hint { color: var(--accent-ink); font-weight: 600; }
.opt-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.opt-chip {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 64px; padding: 0 22px 0 10px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font-size: 16px; font-weight: 500;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 120ms var(--ease-mech);
}
.opt-chip:active { transform: scale(.95); }
.opt-chip-ico {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--accent-ink);
  transition: background-color 180ms ease, color 180ms ease;
}
.opt-chip-ico svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.opt-chip-price { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.opt-chip-count { padding: 2px 9px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 13px; font-weight: 700; }
.opt-chip.chosen { background: var(--ink); border-color: var(--ink); color: #fff; }
.opt-chip.chosen .opt-chip-ico { background: #fff; color: var(--ink); }
.opt-chip.chosen .opt-chip-price { color: rgba(255,255,255,.7); }
.opt-chip.unavailable { opacity: .35; }

.modal-footer {
  flex: 0 0 auto; display: flex; align-items: center; gap: 16px;
  padding: 16px 24px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--surface); border-radius: 0;
}

/* ============================================ общие: степпер и кнопки === */
.stepper { display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; background: var(--bg); }
.stepper-btn {
  width: 60px; height: 60px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface); color: var(--ink); font-size: 28px; line-height: 1;
  box-shadow: 0 1px 3px rgba(31,37,55,.1);
  transition: transform 120ms var(--ease-mech);
}
.stepper-btn:active { transform: scale(.88); }
.stepper-value { min-width: 44px; text-align: center; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.btn-primary {
  border: 0; border-radius: 26px; cursor: pointer;
  background: var(--ink); color: #fff; font-weight: 600;
  transition: transform 120ms var(--ease-mech), opacity 160ms ease;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary[disabled] { opacity: .3; }
.btn-big {
  flex: 1; min-height: 80px; padding: 0 28px; font-size: 20px; letter-spacing: .02em;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.btn-block { width: 100%; }
#product-add .add-total { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
#product-line-total, #checkout-total, .cart-item-total, #pay-amount { font-variant-numeric: tabular-nums; }

/* ============================================== СТРАНИЦЫ: ЗАКАЗ И ПОИСК === */
/* Въезжают справа на весь экран и уходят туда же (стрелка «назад» или
   свайп вправо за шапку). */
.sheet {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; flex-direction: column;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 420ms var(--ease-page);
  box-shadow: -24px 0 60px rgba(31,37,55,.16);
}
.sheet.open { transform: none; }
/* Клавиатура снизу: страница заканчивается над ней, итог прячется — место полям. */
body.keyboard-open .sheet { bottom: var(--kb-h, 0px); }
body.keyboard-open .sheet-footer { display: none; }
.checkout-scrim {
  position: fixed; inset: 0; z-index: 29;
  background: rgba(14,18,32,.4); opacity: 0; transition: opacity 420ms ease;
}
.checkout-scrim.open { opacity: 1; }
.sheet-header {
  flex: 0 0 auto; display: flex; align-items: center; gap: 18px;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 24px 16px;
  touch-action: none; cursor: grab;
}
.sheet-header h2 {
  margin: 0; font-family: var(--font-display); font-size: 30px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--titanium-deep);
}
.sheet-count { margin-left: auto; font-size: 16px; font-weight: 500; color: var(--ink-2); }
.page-back {
  width: 68px; height: 68px; flex: 0 0 auto; border-radius: 50%; cursor: pointer;
  border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
  transition: transform 120ms var(--ease-mech);
}
.page-back svg { width: 30px; height: 30px; }
.page-back:active { transform: scale(.92); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 24px 28px; }
/* Итог — корешок посадочного талона: белый, по верху линия отрыва. */
.sheet-footer {
  position: relative;
  flex: 0 0 auto; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 22px;
  padding: 24px 24px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-radius: 32px 32px 0 0; box-shadow: 0 -12px 30px rgba(31,37,55,.06);
}
.sheet-footer::before {
  content: ""; position: absolute; left: 32px; right: 32px; top: 10px; height: 0;
  border-top: var(--tear); pointer-events: none;
}
.sheet-total { display: flex; flex-direction: column; }
.sheet-total-label { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.sheet-total-sum { font-family: var(--font-display); font-size: 34px; font-weight: 600; }
/* «Оформить» — главное действие страницы: единственная кнопка цвета заведения. */
#checkout-btn { min-height: 84px; font-size: 21px; background: var(--accent); color: var(--on-accent); box-shadow: 0 14px 30px rgba(26,98,199,.28); }
.btn-arrow { font-size: 26px; }
.pay-note { grid-column: 1 / -1; margin: 6px 0 0; text-align: center; color: var(--ink-2); font-size: 14px; }

/* --- строки заказа --- */
.cart-items { display: flex; flex-direction: column; }
.cart-row-wrap { padding-bottom: 12px; }
.cart-item-row {
  position: relative;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px 14px 14px; border-radius: 28px; background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.cart-item-img { width: 80px; height: 80px; flex: 0 0 auto; border-radius: 20px; object-fit: cover; background: var(--surface-2); -webkit-user-drag: none; }
.cart-item-ph { display: flex; align-items: center; justify-content: center; background: var(--tint); color: var(--accent-ink); }
.cart-item-ph svg { width: 40px; height: 40px; opacity: .65; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 18px; font-weight: 600; }
.cart-item-mods { margin-top: 4px; font-size: 14px; font-weight: 400; color: var(--ink-2); }
.cart-item-row .stepper-btn { width: 52px; height: 52px; font-size: 24px; }
.cart-item-total { min-width: 104px; text-align: right; font-family: var(--font-display); font-size: 19px; font-weight: 600; }
/* Вспышка строки, в которую добавили позицию: гаснет слой поверх (opacity). */
.cart-item-row::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: var(--accent-weak); opacity: 0;
}
.cart-item-row.cart-row-flash::after { animation: cart-row-flash 900ms ease-out; }
@keyframes cart-row-flash { from { opacity: 1; } to { opacity: 0; } }
.cart-empty { padding: 40px 0; text-align: center; color: var(--ink-2); font-size: 19px; }
.cart-nutrition { display: none; }

/* --- «вместе вкуснее» --- */
.cart-upsell { margin-top: 20px; }
.cart-upsell-title { margin-bottom: 12px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.cart-upsell-rail { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.cart-upsell-rail::-webkit-scrollbar { display: none; }
.upsell-card {
  position: relative; flex: 0 0 auto; width: 156px; padding: 0; border: 0; cursor: pointer;
  border-radius: 24px; overflow: hidden; background: var(--surface); color: var(--ink); text-align: left;
  box-shadow: var(--shadow-sm);
}
.upsell-card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; -webkit-user-drag: none; }
.upsell-card-body { padding: 10px 12px 12px; font-size: 14px; font-weight: 600; }
.upsell-card-body span { display: block; }
.upsell-card-body span:first-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; min-height: 2.5em; }
.upsell-card-price { margin-top: 4px; color: var(--accent-ink); font-weight: 700; }
.upsell-card-badge { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; }
.upsell-card.in-cart { box-shadow: inset 0 0 0 2px var(--ink); }

/* --- форма --- */
.checkout-form { margin-top: 28px; display: flex; flex-direction: column; gap: 26px; }
.checkout-form label { display: block; font-size: 16px; font-weight: 600; color: var(--ink); }
.serving-label { font-size: 16px; font-weight: 600; }
.field-required { margin-left: 4px; font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.field-optional { margin-left: 4px; font-size: 13px; font-weight: 400; color: var(--ink-2); }
.field-hint { display: block; margin-top: 8px; color: var(--danger); font-size: 15px; font-weight: 600; }
.checkout-form input {
  display: block; width: 100%; height: 72px; margin-top: 10px; padding: 0 22px;
  border: 1.5px solid var(--line); border-radius: 22px; background: var(--surface);
  color: var(--ink); font-family: var(--font); font-size: 20px; font-weight: 500;
  outline: none; transition: border-color 160ms ease, box-shadow 160ms ease;
}
.checkout-form input::placeholder, .finder-input::placeholder { color: rgba(31,37,55,.38); font-weight: 400; }
.checkout-form input.input-focused, .finder-input.input-focused {
  border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-weak);
}
/* Готовые имена — полноценная замена клавиатуре. */
.name-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.name-suggest-btn {
  min-height: 54px; padding: 0 22px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 16px; font-weight: 500;
  transition: transform 120ms var(--ease-mech);
}
.name-suggest-btn:active { transform: scale(.96); }
.name-suggest-btn.chosen { background: var(--ink); border-color: var(--ink); color: #fff; }
/* Подача — две крупные плитки. «Здесь» выбрано заранее. */
.serving-field { display: flex; flex-direction: column; gap: 12px; }
.serving-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.serving-btn {
  min-height: 100px; border-radius: 26px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 18px; font-weight: 600;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 120ms var(--ease-mech);
}
.serving-btn:active { transform: scale(.97); }
.serving-ico { width: 34px; height: 34px; }
.serving-btn.chosen { background: var(--ink); border-color: var(--ink); color: #fff; }

/* --- поиск --- */
.finder-input {
  display: block; width: 100%; height: 76px; margin: 2px 0 22px; padding: 0 28px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink); font-family: var(--font); font-size: 21px; font-weight: 500; outline: none;
}
.finder-sheet.mode-top .finder-input { display: none; }
.finder-empty { padding: 40px 0; text-align: center; color: var(--ink-2); font-size: 19px; }
.finder-grid { grid-template-columns: repeat(3, 1fr); padding-bottom: 20px; }

.scrim { position: fixed; inset: 0; z-index: 28; background: rgba(14,18,32,.45); }

/* ================================================================= ОПЛАТА === */
/* Ночное небо: тёмный титан с переходом в глубокий синий, сумма крупно,
   кнопка цвета заведения, в кольце — знак-самолёт на белом. */
.payment-screen {
  position: fixed; inset: 0; z-index: 38;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(170deg, #1C2233 0%, #232C45 60%, #263463 100%); color: #fff;
  opacity: 0; transition: opacity 260ms ease;
}
.payment-screen.open { opacity: 1; }
.pay-card {
  width: min(600px, 86vw);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  transform: translateY(28px); transition: transform 420ms var(--ease-mech);
}
.payment-screen.open .pay-card { transform: none; }
.pay-ring { position: relative; width: 200px; height: 200px; }
.pay-ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: pay-spin 1.8s linear infinite; }
.pay-ring-track { fill: rgba(255,255,255,.96); stroke: rgba(255,255,255,.14); stroke-width: 3; }
.pay-ring-arc { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 88 264; }
@keyframes pay-spin { to { transform: rotate(360deg); } }
.pay-logo {
  position: absolute; left: 50%; top: 50%; width: 56%; height: 56%;
  transform: translate(-50%, -50%);
  background: url("/static/brand-yurt.webp") center / contain no-repeat;
}
.pay-ico { display: none; }
.no-logo .pay-logo { display: none; }
.no-logo .pay-ico {
  display: block; position: absolute; left: 50%; top: 50%; width: 42%; height: 42%;
  transform: translate(-50%, -50%); color: var(--ink);
  animation: pay-tap 1.6s ease-in-out infinite;
}
@keyframes pay-tap { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, -57%); } }
.pay-title { margin: 34px 0 0; font-size: 16px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.pay-amount { margin-top: 10px; font-family: var(--font-display); font-size: 88px; font-weight: 600; line-height: 1; }
.pay-hint { margin: 22px 0 42px; font-size: 20px; font-weight: 400; line-height: 1.45; color: rgba(255,255,255,.76); }
#pay-done { justify-content: center; min-height: 88px; font-size: 22px; background: var(--accent); color: var(--on-accent); box-shadow: 0 16px 36px rgba(0,0,0,.3); }
.pay-back {
  margin-top: 16px; min-height: 60px; padding: 0 24px; border: 0; background: none; cursor: pointer;
  color: rgba(255,255,255,.72); font-size: 18px; font-weight: 500;
}
.pay-timer { position: fixed; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(255,255,255,.08); }
.pay-timer i { display: block; height: 100%; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }

/* ========================================================= ЗАКАЗ ПРИНЯТ === */
.fullscreen { position: fixed; inset: 0; z-index: 40; }
#confirm-screen { display: block; overflow: hidden; color: var(--on-accent); }
/* Шаг 1. Заливка ультрамарином раскрывается кругом над галочкой. Круг —
   небольшой слой, который растёт масштабом (transform, не clip-path) и в
   конце накрывает экран целиком с запасом. */
.confirm-flood { position: absolute; inset: 0; overflow: hidden; }
.confirm-disc {
  position: absolute; left: 50%; top: 30%;
  width: 50vmax; height: 50vmax; margin: -25vmax 0 0 -25vmax;
  border-radius: 50%; background: var(--accent);
  transform: scale(.02); opacity: 0;
}
#confirm-screen.play .confirm-disc { animation: confirm-flood 1100ms cubic-bezier(0.4,0,0.2,1) forwards; }
@keyframes confirm-flood {
  0% { transform: scale(.02); opacity: .6; }
  18% { opacity: 1; }
  100% { transform: scale(6.2); opacity: 1; }
}
/* Ролик экрана «принят» (по желанию) проявляется поверх заливки. */
.confirm-media { position: absolute; inset: 0; opacity: 0; }
#confirm-screen.play .confirm-media { animation: confirm-rise-soft 900ms ease-out 900ms forwards; }
.confirm-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.confirm-shade { display: block; position: absolute; inset: 0; background: color-mix(in srgb, var(--accent) 55%, transparent); }
/* Шаг 2. Кольцо и галочка рисуются линией. */
.confirm-mark {
  position: absolute; left: 50%; top: 20vh; width: 190px; height: 190px; margin-left: -95px;
  opacity: 0; transform: scale(.8);
}
.confirm-mark svg { width: 100%; height: 100%; overflow: visible; }
.confirm-ring { fill: rgba(255,255,255,.16); stroke: var(--on-accent); stroke-width: 4; stroke-dasharray: 340; stroke-dashoffset: 340; }
.confirm-check { fill: none; stroke: var(--on-accent); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; }
#confirm-screen.play .confirm-mark { animation: confirm-pop 500ms var(--ease-mech) 700ms forwards; }
#confirm-screen.play .confirm-ring { animation: confirm-draw 800ms ease-out 800ms forwards; }
#confirm-screen.play .confirm-check { animation: confirm-draw 500ms ease-out 1400ms forwards; }
@keyframes confirm-pop { to { opacity: 1; transform: none; } }
@keyframes confirm-draw { to { stroke-dashoffset: 0; } }
/* Шаг 3. Заголовок, затем имя — крупно: по нему гость узнаёт свой заказ. */
.confirm-title {
  position: absolute; left: 0; right: 0; top: 43vh; margin: 0; padding: 0 32px;
  text-align: center; font-family: var(--font-display); font-weight: 600;
  font-size: min(7vw, 58px); line-height: 1.08; letter-spacing: .01em;
  opacity: 0; transform: translateY(24px);
}
html[lang="kk"] .confirm-title { font-size: min(5.4vw, 46px); }
.confirm-thanks {
  position: absolute; left: 0; right: 0; top: 58vh; margin: 0; padding: 0 32px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.confirm-thanks-word { font-size: 22px; font-weight: 500; opacity: 0; transform: translateY(14px); }
#confirm-guest-name {
  display: block; max-width: 100%; margin-top: 6px;
  font-family: var(--font-display); font-size: clamp(56px, 11vw, 96px); font-weight: 600;
  line-height: 1.1; letter-spacing: .01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  opacity: 0; transform: translateY(22px);
}
.confirm-pickup { margin-top: 22px; font-size: 19px; font-weight: 500; opacity: 0; transform: translateY(14px); }
#confirm-screen.play .confirm-title { animation: confirm-rise 800ms var(--ease-mech) 1500ms forwards; }
#confirm-screen.play .confirm-thanks-word { animation: confirm-rise 700ms var(--ease-mech) 2300ms forwards; }
#confirm-screen.play #confirm-guest-name { animation: confirm-rise 900ms var(--ease-mech) 2600ms forwards; }
#confirm-screen.play .confirm-pickup { animation: confirm-rise-soft 800ms var(--ease-mech) 3300ms forwards; }
@keyframes confirm-rise { to { opacity: 1; transform: none; } }
@keyframes confirm-rise-soft { to { opacity: .8; transform: none; } }
/* Полоска автосброса сверху. Ширину гонит JS (linear — это часы). */
.confirm-progress { position: absolute; left: 0; right: 0; top: 0; z-index: 2; height: 6px; background: rgba(0,0,0,.1); overflow: hidden; }
.confirm-progress i { display: block; height: 100%; width: 100%; background: var(--on-accent); opacity: .6; transform: scaleX(0); transform-origin: 0 50%; }

/* ==================================================== ЭКРАННАЯ КЛАВИАТУРА === */
/* Тёмный титан поверх страниц. Клавиши крупные: палец, а не курсор. */
.keyboard-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  background: var(--night); color: #fff; border-radius: 30px 30px 0 0;
  box-shadow: 0 -16px 40px rgba(14,18,32,.25);
}
.keyboard-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 4px 8px 14px; }
.keyboard-echo { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.keyboard-label { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.keyboard-preview {
  min-height: 34px; font-size: 25px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left;
}
.keyboard-preview:empty::before { content: "…"; color: rgba(255,255,255,.35); }
.keyboard-done {
  min-height: 58px; padding: 0 32px; border: 0; border-radius: 18px; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font-size: 17px; font-weight: 600;
}
.keyboard-done:active { transform: scale(.96); }
.simple-keyboard.hg-theme-default { background: transparent; padding: 0; font-family: var(--font); }
.simple-keyboard.hg-theme-default .hg-row:not(:last-child) { margin-bottom: 8px; }
.simple-keyboard.hg-theme-default .hg-row .hg-button:not(:last-child) { margin-right: 8px; }
.simple-keyboard.hg-theme-default .hg-button {
  height: 64px; border-radius: 16px; border: 0; box-shadow: none;
  background: #2D3550; color: #fff; font-size: 22px; font-weight: 500;
}
.simple-keyboard.hg-theme-default .hg-button.hg-functionBtn { background: #3B4462; }
.simple-keyboard.hg-theme-default .hg-button.hg-activeButton { background: #56607F; color: #fff; }
.hg-theme-numeric .hg-button { max-width: 33%; }

/* ================================================================= ПЛАШКИ === */
/* Ошибка — текстом поверх, а не системным alert(). */
.toast {
  position: fixed; left: 50%; bottom: 140px; z-index: 70;
  transform: translate(-50%, 20px); max-width: min(600px, calc(100vw - 40px));
  padding: 20px 28px; border-radius: 24px; background: var(--ink); color: #fff;
  font-size: 17px; font-weight: 500; line-height: 1.35; text-align: center;
  box-shadow: 0 16px 44px rgba(14,18,32,.35);
  opacity: 0; pointer-events: none;
  transition: opacity 240ms ease, transform 240ms var(--ease-mech);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* Меню не загрузилось: слой поверх витрины, пока идут повторы. */
.menu-error {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding: 40px; text-align: center; background: var(--bg); color: var(--ink);
}
.menu-error-title { font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--titanium-deep); }
.menu-error-hint { max-width: 520px; font-size: 19px; line-height: 1.45; color: var(--ink-2); }

/* ===================================================== уменьшение движения === */
/* Меньше и мягче, а не ноль: табло, шевроны, блик и самолёт стоят, переходы —
   короткие проявления. Полёт карточки в плитку engine/flight.js при этом не
   запускает. */
@media (prefers-reduced-motion: reduce) {
  .panel, .pager, .appbar { transition: opacity 150ms linear !important; }
  .attract-slot, .sheet, .checkout-scrim, .toast, .cart-bar, .modal .modal-card { transition: none; }
  .metal-sheen, .fly-mark, .chevrons-track, .poster-row, .attract-hint-sub, .attract-hint-arrow::before,
  .card-qty, .card-qty-n, .cart-bar-count, .no-logo .pay-ico, .tap-ripple { animation: none; }
  .fly-mark { display: none; }
  .pay-ring-svg { animation-duration: 4s; }
  #confirm-screen.play .confirm-disc, #confirm-screen.play .confirm-media,
  #confirm-screen.play .confirm-mark, #confirm-screen.play .confirm-ring,
  #confirm-screen.play .confirm-check, #confirm-screen.play .confirm-title, #confirm-screen.play .confirm-thanks-word,
  #confirm-screen.play #confirm-guest-name, #confirm-screen.play .confirm-pickup {
    animation-duration: 1ms; animation-delay: 0ms;
  }
}

/* ===== Публичная демо-копия (DEMO_MODE, kiosks-public/shablon-4-publish) =====
   Номер демо-заказа на экране «принят»: тихо, внизу, в цветах экрана. */
.confirm-demo {
  position: absolute; left: 24px; right: 24px; z-index: 2; margin: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 5vh); text-align: center;
  font-size: 15px; font-weight: 500; letter-spacing: .02em;
  opacity: 0; transform: translateY(14px);
}
#confirm-screen.play .confirm-demo { animation: confirm-rise-soft 800ms var(--ease-mech) 3600ms forwards; }
@media (prefers-reduced-motion: reduce) { #confirm-screen.play .confirm-demo { animation: none; opacity: .8; transform: none; } }
