/* =========================================================================
   Киоск самозаказа — шаблон «Шаблон 1» (дизайн 09.10.2026).
   Графитовые кнопки, светлая бумага, крупная геометрическая типографика.
   Разделы — колонкой слева, витрина — на белом листе справа, заказ и поиск —
   отдельными страницами. Цвет заведения — только переменные --accent* ниже:
   по остальному коду цвета бренда не разбросаны.
   ========================================================================= */

:root {
  /* ---- ЦВЕТ ЗАВЕДЕНИЯ ----
     --accent красит ПЛОСКОСТИ (главная кнопка заставки, «Оформить», выбранная
     категория) и работает с тёмным текстом --on-accent поверх; --accent-ink —
     акцентный ТЕКСТ и значки на светлом, притемнён до читаемого. */
  /* CHUPS coffee & tea — ЭКРАННЫЕ цвета бренда, замерены с файлов логотипа
     (брендбук, ЛОГОТИП/С ФОНОМ). Значения на стр. 15 гайдлайна — печатные,
     тусклее; в киоске всегда экранные (Еламан, 25.10). Синий — плоскости и
     акцентный текст, лайм — одна самая важная кнопка, бежевый — фон. */
  --accent:      #164AFE;   /* синий CHUPS: заливки */
  --accent-ink:  #164AFE;   /* синий как текст на бежевом — читается (6:1) */
  --accent-2:    #002CB2;   /* глубокий синий: оплата */
  --accent-weak: rgba(22,74,254,0.14);
  --on-accent:   #FDF6E4;   /* бежевый поверх синего */
  --gradient: linear-gradient(135deg, #002CB2, #164AFE 60%, #4D74FF);
  --pop:         #E8FF71;   /* лайм: главная кнопка экрана */
  --on-pop:      #0D1114;
  --hero-bg:     #164AFE;   /* фон заставки, пока нет роликов */

  /* ---- НЕЙТРАЛЬНЫЕ ---- */
  --bg: #FDF6E4;          /* бежевый CHUPS: фон шапки и страниц */
  --surface: #FFFFFF;     /* лист витрины, карточки, поля */
  --surface-2: #F3EAD3;   /* подложки: степпер, кадр без фото */
  --ink: #0D1114;         /* почти чёрный CHUPS: текст и кнопки */
  --ink-2: #5C5A55;       /* вторичный текст */
  --line: rgba(13,17,20,.10);
  --danger: #B3261E;
  --tint: #F3E9CF;        /* тёплый крем: фон кадра без фото */

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

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

  /* Шрифт бренда CHUPS — Inter (брендбук, стр. 18–20): и заголовки, и текст. */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --ease-out: cubic-bezier(.22,1,.36,1);
  --ease-page: cubic-bezier(.32,.72,0,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.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 15l7-7 7 7'/%3E%3C/svg%3E");
}

/* Safari до 16.2 не знает color-mix(): там подложки получают готовые цвета,
   иначе фон карточки товара и плиток без фото стал бы прозрачным. */
@supports not (color: color-mix(in srgb, red 50%, blue)) {
  .tap-ripple { background: var(--accent-weak) !important; }
  .cat-btn.cat-top { border-color: var(--accent) !important; }
  .confirm-video + .confirm-shade { background: rgba(22,74,254,.55) !important; }
}

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

/* Знак заведения. Логотипа нет (пустая заглушка) — места не держим. */
.brand-mark {
  display: inline-block; width: 1.16em; 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 — ФОН страницы: панель меню едет поверх, заставка не исчезает. */
.hero {
  position: fixed; inset: 0; z-index: 1;
  height: var(--app-h, 100dvh);
  background: var(--hero-bg); overflow: hidden;
}
/* Два слоя сюжетов: живой — 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;
  -webkit-user-drag: none;
}
/* Роликов ещё нет: графит и медленно плывущие пятна цвета заведения. */
.attract-fallback { background: var(--hero-bg); overflow: hidden; }
/* Фон заставки без роликов — ровный Blue CHUPS, без пятен (Еламан, 25.10). */

/* Затемнение при раскрытии меню: alpha пишет JS. */
.hero-scrim { position: absolute; inset: 0; pointer-events: none; background: #000; opacity: 0; }
.hero-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: stretch;
  padding: calc(env(safe-area-inset-top, 0px) + 64px) 52px calc(env(safe-area-inset-bottom, 0px) + 52px);
  pointer-events: none;
  /* Под текстом всегда лёгкая тень снизу и сверху: на светлом кадре белое
     не пропадает. */
  background:
    linear-gradient(rgba(0,20,90,.28), rgba(0,20,90,0) 30%),
    linear-gradient(to top, rgba(0,20,90,.45), rgba(0,20,90,0) 46%);
}
.hero-overlay > * { pointer-events: auto; }
.hero-brand { color: #fff; }
.attract-logo {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(56px, 11vw, 100px); line-height: .95; letter-spacing: -.03em;
}
.attract-sub {
  margin-top: 16px; font-size: 20px; font-weight: 600; letter-spacing: .24em;
  text-transform: uppercase; opacity: .8;
}
.hero-caption { flex: 1; }
/* Логотип заведения картинкой (KIOSK_BRAND.logo) — вместо набранного названия. */
.attract-logo-img { display: block; width: min(64vw, 460px); height: auto; -webkit-user-drag: none; }
/* Круглый бейдж знака медленно вращается в углу заставки. */
.attract-badge {
  position: absolute; right: 44px; top: calc(env(safe-area-inset-top, 0px) + 48px);
  z-index: 1; width: 170px; height: auto; pointer-events: none; -webkit-user-drag: none;
  animation: badge-spin 28s linear infinite;
}
@keyframes badge-spin { to { transform: rotate(360deg); } }
body.menu-open .attract-badge { animation-play-state: paused; }

/* Главная кнопка заставки: широкая капсула цвета заведения со стрелкой.
   Вокруг неё медленно «дышит» кольцо — заметно издалека. */
.attract-hint {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  min-height: 112px; padding: 0 16px 0 48px; border: 0; border-radius: 999px;
  background: var(--pop); color: var(--on-pop); cursor: pointer;
  font-family: var(--font-display); font-size: clamp(26px, 4vw, 34px); font-weight: 600;
  letter-spacing: -.01em;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
/* Кольцо вокруг кнопки стоит на месте и только мягко проявляется и гаснет.
   Масштаб здесь не годится: у вытянутой капсулы он растягивает кольцо по
   ширине сильнее, чем по высоте, и оно ползёт криво. */
.attract-hint::after {
  content: ""; position: absolute; inset: -12px; border-radius: inherit;
  border: 2px solid var(--pop); opacity: 0; pointer-events: none;
  animation: hint-ring 2.8s ease-in-out infinite;
}
@keyframes hint-ring {
  0%, 100% { opacity: 0; }
  50% { opacity: .55; }
}
/* Стрелка: две галочки по очереди поднимаются внутри круга и тают —
   читается как «вверх», а не как дрожание на месте. */
.attract-hint-arrow {
  flex: 0 0 auto; width: 80px; height: 80px; border-radius: 50%;
  background: var(--ink); position: relative; overflow: hidden;
}
.attract-hint-arrow::before, .attract-hint-arrow::after {
  content: ""; position: absolute; left: 24px; top: 24px; width: 32px; height: 32px;
  background: #fff;
  -webkit-mask: var(--chevron-up) center / contain no-repeat;
          mask: var(--chevron-up) center / contain no-repeat;
  opacity: 0;
  animation: chev-rise 1.8s cubic-bezier(.45,0,.25,1) infinite;
}
.attract-hint-arrow::after { animation-delay: .9s; }
@keyframes chev-rise {
  0% { transform: translateY(14px); opacity: 0; }
  35% { opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translateY(-14px); opacity: 0; }
}
.attract-hint-sub {
  margin-top: 18px; text-align: center; color: rgba(255,255,255,.72);
  font-size: 18px; font-weight: 500; letter-spacing: .02em;
}
/* Пока меню открыто, заставку не видно — бесконечные анимации стоят. */
body.menu-open .attract-hint::after,
body.menu-open .attract-hint-arrow::before,
body.menu-open .attract-hint-arrow::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)) cubic-bezier(.16,1,.3,1); }
/* Шов между шапкой и панелью закрыт полоской того же цвета. */
.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: 22px; font-weight: 700; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-wordmark { display: block; height: 40px; width: auto; max-width: 100%; -webkit-user-drag: none; }
.appbar .brand-sub { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.appbar .spacer { display: none; }
.bar-search {
  flex: 1; min-width: 0; height: 64px; padding: 0 24px;
  display: flex; align-items: center; gap: 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  color: var(--ink-2); font-size: 19px; font-weight: 600; cursor: pointer; text-align: left;
}
.bar-search svg { width: 24px; height: 24px; flex: 0 0 auto; color: var(--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-2); }
.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: 16px; font-weight: 800; letter-spacing: .04em;
  transition: background-color 180ms ease, color 180ms ease;
}
.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: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.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;
}
.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)); }
.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)); }

/* ================================================================= ПАНЕЛЬ === */
/* Колонка разделов слева + белый лист витрины справа. Двигается ТОЛЬКО
   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; }

/* --- витрина: белый лист под шапкой ------------------------------------------- */
.panel-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 36px 36px 0 0;
  overflow: hidden;
}
/* Ряд разделов (Кофе, Не кофе…). Прилипает над витриной; когда каталог уехал под
   него, снизу появляется мягкая тень. */
.nav-stack { flex: 0 0 auto; position: relative; z-index: 6; padding-top: 18px; background: var(--surface); }
.nav-stack::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 18px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(22,21,19,.07), rgba(22,21,19,0));
  opacity: 0; transition: opacity 160ms linear;
}
.nav-stack.stuck::after { opacity: 1; }
.categories {
  display: flex; gap: 10px; padding: 0 22px 14px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }
.cat-btn {
  /* Разделов мало — кнопки делят ряд поровну; много — ряд прокручивается. */
  flex: 1 0 0; min-width: max-content; 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: 16px; font-weight: 700;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
.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) 60%, 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: 38px; }
.menu-section-title {
  margin: 8px 0 18px; font-family: var(--font-display);
  font-size: 30px; font-weight: 600; letter-spacing: -.025em; line-height: 1.1;
}
/* Две плитки в ряд: крупный кадр и читаемое название на вытянутой руке. */
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px 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;
  /* Карточка — замкнутый мир: смена счётчика не перекладывает соседей. */
  contain: layout paint;
}
/* Жёсткий aspect-ratio — условие кэша геометрии скроллспая (§7.7): фото не
   сдвигают секции при загрузке. */
.product-card-image {
  width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover;
  border-radius: 26px; background: var(--surface-2);
  -webkit-user-drag: none; -webkit-user-select: none; user-select: none;
  transition: transform 160ms ease;
}
.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-body { padding: 14px 4px 0; display: flex; flex-direction: column; gap: 4px; }
.product-card-name {
  font-size: 20px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.5em;
}
.product-card-volume { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.product-card-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; min-height: 56px; }
.product-card-price { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.product-card.unavailable { opacity: .45; }
.product-card-stop {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  padding: 7px 14px; border-radius: 999px; background: rgba(22,21,19,.82); color: #fff;
  font-size: 14px; font-weight: 700;
}
/* «+» на плитке: позиция без выбора — сразу в корзину, иначе открывает карточку. */
.card-add {
  width: 56px; height: 56px; flex: 0 0 auto; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--ink); color: #fff; font-size: 30px; line-height: 1; padding: 0 0 3px;
  display: flex; align-items: center; justify-content: center;
  transition: transform 120ms ease;
}
.card-add:active { transform: scale(.88); }
/* Взятая позиция: «− 2 +» на месте «+». */
.card-qty {
  display: flex; align-items: center; gap: 2px; padding: 5px;
  border-radius: 999px; background: var(--ink); color: #fff;
  animation: card-qty-in 300ms cubic-bezier(.34,1.56,.64,1);
}
.card-qty-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; line-height: 1; background: transparent; color: #fff;
  transition: transform 120ms ease;
}
.card-qty-plus { background: var(--accent); color: var(--on-accent); }
.card-qty-btn:active { transform: scale(.86); }
.card-qty-n {
  min-width: 30px; text-align: center; font-size: 19px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  animation: count-pop 260ms cubic-bezier(.34,1.56,.64,1);
}
@keyframes card-qty-in { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes count-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { 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 var(--accent); background: color-mix(in srgb, var(--accent) 20%, transparent);
  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(--accent);
  border-radius: 24px; opacity: .95;
  transition: transform 560ms cubic-bezier(.5,-0.2,.3,1), opacity 560ms ease-in, border-radius 560ms ease-in;
  will-change: transform, opacity;
}

/* ========================================================= ПОЛОСА ЗАКАЗА === */
/* Графитовая капсула над нижним краем: выезжает с первым товаром. */
.cart-bar {
  position: fixed; left: 16px; right: 16px; z-index: 20;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 18px;
  min-height: 96px; padding: 0 14px 0 26px; border-radius: 32px;
  background: var(--ink); color: #fff; cursor: pointer;
  box-shadow: 0 20px 50px rgba(22,21,19,.35);
  transform: none; transition: transform 340ms var(--ease-out);
}
.cart-bar.off { transform: translateY(150%); }
.cart-bar-info { flex: 1; min-width: 0; }
.cart-bar-line { font-size: 15px; font-weight: 600; color: rgba(255,255,255,.62); letter-spacing: .02em; }
.cart-bar-total { font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
#cart-bar-total { display: inline-block; font-variant-numeric: tabular-nums; }
#cart-bar-total.bump { animation: cart-bump 420ms cubic-bezier(.34,1.56,.64,1); }
@keyframes cart-bump { 0% { transform: scale(1); } 30% { transform: scale(1.14); } 55% { transform: scale(.96); } 100% { transform: scale(1); } }
.cart-bar-next {
  position: relative; height: 70px; padding: 0 30px 0 34px; border: 0; border-radius: 24px;
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: var(--pop); color: var(--on-pop);
  font-size: 21px; font-weight: 800; letter-spacing: .01em;
}
.cart-bar-arrow { font-size: 24px; transition: transform 200ms ease; }
.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: 15px; font-weight: 800;
  animation: count-pop 260ms cubic-bezier(.34,1.56,.64,1);
}

/* ======================================================= КАРТОЧКА ТОВАРА === */
.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:not(.open) { pointer-events: none; }
/* Лист выбора при открытии поднимается снизу, при закрытии опускается. */
.modal .modal-card { transition: transform 460ms var(--ease-out); }
.modal:not(.open) .modal-card { transform: translateY(80px); }

/* Кадр-двойник: летит между плиткой и карточкой (форму и место ведёт JS).
   Плитка под ним на время полёта спрятана — видно один предмет, а не два. */
.morph-ghost {
  position: fixed; z-index: 35; pointer-events: none; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background-color: var(--tint); background-size: cover; background-position: center;
  color: var(--accent-ink);
  will-change: left, top, width, height, transform;
}
.morph-ghost .morph-ico { width: 30%; height: auto; opacity: .55; }
.product-card-image.morph-hidden { visibility: hidden; }
/* Сдвинутая пальцем карточка скругляется и отрывается тенью от меню. */
.modal.swiping, .modal.swiping .modal-bg { border-radius: 36px; overflow: hidden; }
.modal.swiping { box-shadow: 0 30px 70px rgba(0,0,0,.4); }
/* Свайпы по фото разбираем сами — браузеру жест не отдаём. */
.modal-bg { position: absolute; inset: 0; z-index: 1; overflow: hidden; touch-action: none; background: var(--tint); }
/* Фото — над листом выбора; лист заходит на кадр скруглённым краем. */
/* Кадр — на весь экран, допы и цена плавают поверх него (как в Drinkit). */
.modal-bg-video, .modal-bg-image {
  position: absolute; left: 0; right: 0; top: 0; height: 100%;
}
.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: 150px; bottom: var(--card-h, 40%);
  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 640ms var(--ease-out); }
@keyframes ph-float { from { transform: translateY(24px) scale(.92); 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,.92); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(22,21,19,.18);
}
.modal-close svg { width: 28px; height: 28px; }
.modal-close:active { transform: scale(.92); }

/* Матовое стекло поверх кадра. Внутрь стекла стекло не кладём (iPad мигает),
   и пока карточка едет или её тянут пальцем — размытие выключено. */
.glass {
  background: rgba(255,255,255,.62);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
}
.modal.animating .glass, .modal.swiping .glass { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255,255,255,.86); }

/* Верх: название, КБЖУ, «подробнее». */
.product-top {
  position: absolute; z-index: 11; top: calc(env(safe-area-inset-top, 0px) + 20px); left: 24px; right: 108px;
  padding: 18px 24px 16px; border-radius: 30px; color: var(--ink);
}
.product-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.product-head h2 {
  margin: 0; font-family: var(--font-display); font-size: 32px; font-weight: 600;
  line-height: 1.08; letter-spacing: -.03em;
}
.product-volume-tag {
  padding: 6px 14px; border-radius: 999px; background: rgba(13,17,20,.08);
  font-size: 15px; font-weight: 800; white-space: nowrap;
}
.product-volume-tag.flash { animation: tag-flash 600ms ease; }
@keyframes tag-flash { 0% { background: var(--accent); color: var(--on-accent); transform: scale(1.08); } 100% { transform: none; } }
.product-nutrition { display: flex; gap: 26px; margin-top: 12px; }
.nutri { display: flex; flex-direction: column; gap: 2px; }
.nutri b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nutri small { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.product-more {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 12px; min-height: 40px; padding: 0 14px;
  border: 0; border-radius: 999px; background: rgba(13,17,20,.08); color: var(--ink);
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.product-more svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform 200ms ease; }
.product-more.open svg { transform: rotate(180deg); }
.product-desc { margin: 10px 0 0; max-width: 60ch; font-size: 17px; line-height: 1.45; color: var(--ink-2); }
.product-base-price { display: none; }

/* Низ: ряд групп допов и панель цены. Фона у блока нет — только у плиток. */
.modal-card {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 11;
  display: flex; flex-direction: column; gap: 14px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.modal-card > * { pointer-events: auto; }
.mod-area { position: relative; }
.mod-rail {
  display: flex; gap: 10px; padding: 8px 24px; overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; overscroll-behavior-x: contain;
}
.mod-rail::-webkit-scrollbar { display: none; }
.mod-tile {
  flex: 0 0 auto; width: 128px; height: 132px; padding: 12px 8px 10px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px;
  border: 0; border-radius: 26px; color: var(--ink); text-align: center;
  transition: transform 200ms var(--ease-out), background-color 180ms ease, box-shadow 180ms ease;
}
.mod-tile:active { transform: scale(.95); }
.mod-tile.open { transform: translateY(-6px) scale(1.04); box-shadow: inset 0 0 0 3px var(--accent), 0 10px 30px rgba(13,17,20,.18); }
.mod-tile-ico {
  width: 48px; height: 48px; flex: 0 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(13,17,20,.07); color: var(--ink);
}
.mod-tile-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mod-tile.has .mod-tile-ico { background: var(--accent); color: var(--on-accent); }
.mod-tile-name { font-size: 14px; font-weight: 800; line-height: 1.15; }
.mod-tile-sub {
  max-width: 100%; font-size: 13px; font-weight: 600; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mod-tile.need { box-shadow: inset 0 0 0 2.5px var(--accent); }
/* Мини-плитка «Айс / горячая версия»: кадр пары крупнее значка группы. */
.twin-tile { justify-content: space-between; }
.twin-ico { width: 72px; height: 72px; border-radius: 20px; overflow: hidden; background: rgba(13,17,20,.06); color: var(--accent-ink); }
.twin-ico img { width: 100%; height: 100%; object-fit: cover; }
.twin-ico-svg { width: 44px; height: 44px; opacity: .7; }

/* Сетка вариантов раскрытой группы — над рядом, поверх кадра. */
.opt-pop {
  position: absolute; left: 0; right: 0; bottom: 100%; margin-bottom: 4px;
  max-height: calc(var(--app-h, 100dvh) - var(--card-h, 300px) - 250px);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none;
  padding: 0 24px 6px;
}
.opt-pop::-webkit-scrollbar { display: none; }
/* Появление — сдвигом самих плиток, без прозрачности: opacity/transform на
   родителе стеклянных плиток на iPad даёт мигание размытия. */
.opt-pop .opt-tile { animation: pop-in 240ms var(--ease-out) both; }
@keyframes pop-in { from { transform: translateY(16px) scale(.96); } to { transform: none; } }
.opt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-content: end; }
.opt-tile {
  position: relative; min-height: 170px; padding: 14px 8px 12px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  border-radius: 26px; color: #fff;
  background: rgba(13,17,20,.52);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
  transition: background-color 180ms ease, color 180ms ease, transform 120ms ease;
  -webkit-user-select: none; user-select: none;
}
.modal.animating .opt-tile, .modal.swiping .opt-tile { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(13,17,20,.72); }
.opt-tile:active { transform: scale(.95); }
.opt-tile-ico {
  width: 56px; height: 56px; flex: 0 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.14); color: currentColor;
}
.opt-tile-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* Фото варианта на прозрачном фоне: сквозь него видно размытое стекло плитки. */
.opt-tile-img { width: 92px; height: 92px; margin: -6px 0 -4px; object-fit: contain; -webkit-user-drag: none; pointer-events: none; }
.mod-tile-img { width: 60px; height: 60px; margin: -6px 0 -6px; object-fit: contain; -webkit-user-drag: none; pointer-events: none; }
.opt-tile-name { font-size: 15px; font-weight: 700; line-height: 1.15; }
.opt-tile-price { font-size: 13px; font-weight: 600; opacity: .7; }
.opt-tile-mark { margin-top: auto; font-size: 24px; line-height: 1; font-weight: 400; }
.opt-tile.chosen { box-shadow: inset 0 0 0 3px var(--accent); }   /* фон тот же — прозрачное размытое стекло */
.opt-tile.chosen .opt-tile-ico { background: var(--accent); color: var(--on-accent); }
.opt-tile.chosen .opt-tile-mark {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); font-size: 18px; font-weight: 800;
}
.opt-tile.unavailable { opacity: .35; pointer-events: none; }
.opt-tile-step { margin-top: auto; display: flex; align-items: center; gap: 6px; }
.opt-tile-step button {
  width: 40px; height: 40px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.18); color: #fff; font-size: 22px; line-height: 1;
}
.opt-tile-step b { min-width: 18px; font-size: 18px; }

/* Панель цены: объём, количество, «В корзину». */
.modal-footer {
  display: flex; align-items: center; gap: 12px;
  margin: 0 24px; padding: 10px; border-radius: 40px;
}
.size-seg { display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(13,17,20,.07); -webkit-backdrop-filter: none; backdrop-filter: none; }
.size-seg-btn {
  min-width: 64px; height: 60px; padding: 0 14px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--ink); font-size: 16px; font-weight: 800; white-space: nowrap;
  transition: background-color 180ms ease, color 180ms ease;
}
.size-seg-btn.chosen { background: #fff; box-shadow: 0 2px 8px rgba(13,17,20,.14); }
.modal-footer .stepper { background: rgba(13,17,20,.07); }
#product-add { background: var(--accent); color: var(--on-accent); border-radius: 32px; min-height: 76px; }

/* ============================================ общие: степпер и кнопки === */
.stepper { display: flex; align-items: center; gap: 4px; padding: 5px; border-radius: 999px; background: var(--surface-2); }
.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 2px rgba(22,21,19,.08);
  transition: transform 120ms ease;
}
.stepper-btn:active { transform: scale(.88); }
.stepper-value { min-width: 44px; text-align: center; font-size: 23px; font-weight: 800; font-variant-numeric: tabular-nums; }
.btn-primary {
  border: 0; border-radius: 26px; cursor: pointer;
  background: var(--ink); color: #fff; font-weight: 800;
  transition: transform 120ms ease, 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: 21px;
  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; letter-spacing: -.02em; }
#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(22,21,19,.18);
}
.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(22,21,19,.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: 36px; font-weight: 600; letter-spacing: -.03em; }
.sheet-count { margin-left: auto; font-size: 18px; font-weight: 700; color: var(--ink-2); }
.page-back {
  width: 68px; height: 68px; flex: 0 0 auto; border-radius: 50%; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}
.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 {
  flex: 0 0 auto; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 22px;
  padding: 18px 24px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
  border-radius: 32px 32px 0 0; box-shadow: 0 -12px 30px rgba(22,21,19,.06);
}
.sheet-total { display: flex; flex-direction: column; }
.sheet-total-label { font-size: 14px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.sheet-total-sum { font-family: var(--font-display); font-size: 34px; font-weight: 600; letter-spacing: -.03em; }
#checkout-btn { min-height: 84px; font-size: 22px; }
.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; }

/* --- строки заказа --- */
/* Окно заказа как в Drinkit: светлый фон, всё — на белых карточках. */
#cart-sheet { background: var(--sheet-bg, #F3F3F1); }
#cart-sheet .sheet-footer { background: var(--surface); }
.cart-prep {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 64px; margin-bottom: 14px; border-radius: 22px; background: var(--surface);
  font-size: 20px; font-weight: 600; color: var(--ink);
}
.cart-prep svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cart-items { display: flex; flex-direction: column; }
.cart-row-wrap { padding-bottom: 14px; }
.cart-item-row {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 20px 22px 18px 18px; border-radius: 32px; background: var(--surface);
}
.cart-item-img { width: 112px; height: 112px; flex: 0 0 auto; border-radius: 24px; object-fit: contain; background: transparent; -webkit-user-drag: none; }
.cart-item-volume { font-size: 16px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.cart-item-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.cart-item-mods span { margin-right: 6px; font-weight: 700; }
.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: .6; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.cart-item-mods { margin-top: 6px; font-size: 16px; font-weight: 500; line-height: 1.35; color: var(--ink-2); }
.cart-item-row .stepper-btn { width: 52px; height: 52px; font-size: 24px; }
.cart-item-total { font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.cart-item-row .stepper { background: var(--sheet-bg, #F3F3F1); }
.cart-item-row.cart-row-flash { animation: cartRowFlash 900ms ease-out; }
@keyframes cartRowFlash { from { background: var(--accent-weak); } to { background: var(--surface); } }
.cart-empty { padding: 40px 0; text-align: center; color: var(--ink-2); font-size: 19px; }
.cart-nutrition {
  display: flex; justify-content: space-around; gap: 12px;
  padding: 20px 18px; margin-top: 2px; border-radius: 28px; background: var(--surface);
}
.cart-nutrition .nutri { align-items: center; }
.cart-nutrition .nutri b { font-size: 21px; font-weight: 600; }
.cart-nutrition .nutri small { font-size: 15px; }

/* --- «вместе вкуснее» --- */
.cart-upsell { margin-top: 30px; }
.cart-upsell-title { margin-bottom: 16px; font-family: var(--font-display); font-size: 32px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); }
.cart-upsell-rail { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; }
.cart-upsell-rail::-webkit-scrollbar { display: none; }
.upsell-card {
  position: relative; flex: 0 0 auto; width: 190px; padding: 16px 0 0; border: 0; cursor: pointer;
  border-radius: 30px; overflow: hidden; background: var(--surface); color: var(--ink); text-align: left;
}
.upsell-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; -webkit-user-drag: none; }
.upsell-card-ph { width: 100%; aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; color: var(--accent-ink); }
.upsell-card-ph svg { width: 56px; height: 56px; opacity: .55; }
.upsell-card-body { padding: 10px 16px 16px; font-size: 17px; font-weight: 600; }
.upsell-card-foot { display: flex !important; align-items: center; justify-content: space-between; margin-top: 10px; }
.upsell-card-body .upsell-card-plus {
  width: 44px; height: 44px; margin-left: auto; border-radius: 50%; background: var(--sheet-bg, #F3F3F1);
  display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 400; line-height: 1;
}
.no-prices .cart-item-bottom { justify-content: flex-end; }
.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 { color: var(--ink); font-weight: 600; }
.upsell-card-badge { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 800; }
.upsell-card.in-cart { box-shadow: inset 0 0 0 2px var(--ink); }

/* --- форма --- */
.checkout-form {
  margin-top: 30px; display: flex; flex-direction: column; gap: 24px;
  padding: 26px 24px; border-radius: 32px; background: var(--surface);
}
.checkout-form label { display: block; font-size: 17px; font-weight: 800; color: var(--ink); }
.serving-label { font-size: 17px; font-weight: 800; }
.field-required { margin-left: 4px; font-size: 13px; font-weight: 700; color: var(--accent-ink); }
.field-optional { margin-left: 4px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.field-hint { display: block; margin-top: 8px; color: var(--danger); font-size: 15px; font-weight: 700; }
.checkout-form input {
  display: block; width: 100%; height: 72px; margin-top: 10px; padding: 0 22px;
  border: 1.5px solid transparent; border-radius: 22px; background: var(--sheet-bg, #F3F3F1);
  color: var(--ink); font-family: var(--font); font-size: 21px; font-weight: 700;
  outline: none; transition: border-color 160ms ease, box-shadow 160ms ease;
}
.checkout-form input::placeholder, .finder-input::placeholder { color: rgba(22,21,19,.35); font-weight: 600; }
.checkout-form input.input-focused, .finder-input.input-focused {
  border-color: var(--ink); 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: 17px; font-weight: 700;
}
.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; }
/* Пометка «обязательно / необязательно» — справа внутри пустого поля. */
.checkout-form .field-wrap { position: relative; }
.field-wrap input { padding-right: 170px; }
.field-tag {
  position: absolute; right: 18px; top: 10px; height: 72px; display: flex; align-items: center;
  font-size: 15px; font-weight: 600; color: var(--ink-2); pointer-events: none;
}
.field-tag-required { color: var(--accent-ink); font-weight: 700; }
.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 transparent; background: var(--sheet-bg, #F3F3F1); color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 19px; font-weight: 800;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}
.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: 22px; font-weight: 700; 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(22,21,19,.45); }

/* ================================================================= ОПЛАТА === */
/* Графитовый экран целиком: сумма крупно, кнопка цвета заведения. */
.payment-screen {
  position: fixed; inset: 0; z-index: 38;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-2); 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-out);
}
.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,.05); stroke: rgba(255,255,255,.12); stroke-width: 3; }
.pay-ring-arc { fill: none; stroke: var(--pop); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 88 264; }
@keyframes pay-spin { to { transform: rotate(360deg); } }
.pay-yurt {
  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-yurt { display: none; }
.no-logo .pay-ico {
  display: block; position: absolute; left: 50%; top: 50%; width: 42%; height: 42%;
  transform: translate(-50%, -50%); color: #fff;
  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: 17px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; color: rgba(255,255,255,.55); }
.pay-amount { margin-top: 10px; font-family: var(--font-display); font-size: 88px; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.pay-hint { margin: 22px 0 42px; font-size: 21px; line-height: 1.45; color: rgba(255,255,255,.72); }
#pay-done { justify-content: center; min-height: 88px; font-size: 23px; background: var(--pop); color: var(--on-pop); }
.pay-back {
  margin-top: 16px; min-height: 60px; padding: 0 24px; border: 0; background: none; cursor: pointer;
  color: rgba(255,255,255,.7); font-size: 19px; font-weight: 700;
}
.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: 0; background: var(--pop); }

/* ========================================================= ЗАКАЗ ПРИНЯТ === */
.fullscreen { position: fixed; inset: 0; z-index: 40; }
#confirm-screen { display: block; overflow: hidden; color: var(--on-accent); }
/* Шаг 1. Заливка цветом заведения раскрывается кругом из центра. */
.confirm-flood {
  position: absolute; inset: 0; background: var(--accent);
  -webkit-clip-path: circle(0% at 50% 34%); clip-path: circle(0% at 50% 34%); opacity: 0;
}
#confirm-screen.play .confirm-flood { animation: confirm-flood 1100ms cubic-bezier(0.4,0,0.2,1) forwards; }
@keyframes confirm-flood {
  0% { -webkit-clip-path: circle(0% at 50% 34%); clip-path: circle(0% at 50% 34%); opacity: .6; }
  18% { opacity: 1; }
  100% { -webkit-clip-path: circle(150vmax at 50% 34%); clip-path: circle(150vmax at 50% 34%); opacity: 1; }
}
.confirm-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.confirm-shade { display: none; }
.confirm-video + .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(.7);
}
.confirm-mark svg { width: 100%; height: 100%; overflow: visible; }
.confirm-ring { fill: var(--pop); stroke: var(--pop); stroke-width: 4; stroke-dasharray: 340; stroke-dashoffset: 340; }
.confirm-check { fill: none; stroke: var(--on-pop); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 80; stroke-dashoffset: 80; }
#confirm-screen.play .confirm-mark { animation: confirm-pop 600ms cubic-bezier(.34,1.56,.64,1) 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(7.4vw, 62px); line-height: 1.05; letter-spacing: -.03em;
  opacity: 0; transform: translateY(24px);
}
html[lang="kk"] .confirm-title { font-size: min(5.6vw, 48px); }
.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: 24px; font-weight: 700; 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: 700;
  line-height: 1.02; letter-spacing: -.03em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  opacity: 0; transform: translateY(22px);
}
.confirm-pickup { margin-top: 22px; font-size: 20px; font-weight: 600; opacity: 0; transform: translateY(14px); }
#confirm-screen.play .confirm-title { animation: confirm-rise 900ms var(--ease-out) 1500ms forwards; }
#confirm-screen.play .confirm-thanks-word { animation: confirm-rise 800ms var(--ease-out) 2300ms forwards; }
#confirm-screen.play #confirm-guest-name { animation: confirm-rise 1000ms var(--ease-out) 2600ms forwards; }
#confirm-screen.play .confirm-pickup { animation: confirm-rise-soft 800ms var(--ease-out) 3300ms forwards; }
@keyframes confirm-rise { to { opacity: 1; transform: none; } }
@keyframes confirm-rise-soft { to { opacity: .72; transform: none; } }
/* Полоска автосброса сверху. Ширину гонит JS (linear — это часы). */
.confirm-progress { position: absolute; left: 0; right: 0; top: 0; z-index: 2; height: 6px; background: rgba(0,0,0,.08); overflow: hidden; }
.confirm-progress i { display: block; height: 100%; width: 0; background: var(--on-accent); opacity: .5; }

/* ==================================================== ЭКРАННАЯ КЛАВИАТУРА === */
/* Графитовая, поверх страниц. Клавиши крупные: палец, а не курсор. */
.keyboard-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  background: #1F1E1B; color: #fff; border-radius: 30px 30px 0 0;
  box-shadow: 0 -16px 40px rgba(0,0,0,.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: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.5); }
.keyboard-preview {
  min-height: 34px; font-size: 26px; font-weight: 700;
  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(--pop); color: var(--on-pop); font-size: 18px; font-weight: 800;
}
.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: #36342F; color: #fff; font-size: 23px; font-weight: 600;
}
.simple-keyboard.hg-theme-default .hg-button.hg-functionBtn { background: #4B4842; }
.simple-keyboard.hg-theme-default .hg-button.hg-activeButton { background: var(--accent); color: var(--on-accent); }
.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: 18px; font-weight: 700; line-height: 1.35; text-align: center;
  box-shadow: 0 16px 44px rgba(0,0,0,.35);
  opacity: 0; pointer-events: none;
  transition: opacity 240ms ease, transform 240ms var(--ease-out);
}
.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: 36px; font-weight: 600; letter-spacing: -.03em; }
.menu-error-hint { max-width: 520px; font-size: 20px; line-height: 1.45; color: var(--ink-2); }

/* ===================================================== уменьшение движения === */
@media (prefers-reduced-motion: reduce) {
  .attract-hint-arrow::before { opacity: 1; transform: none; }
  .attract-hint-arrow::after { display: none; }
  .panel, .pager, .appbar { transition: opacity 150ms linear !important; }
  .attract-slot, .sheet, .checkout-scrim, .toast, .cart-bar { transition: none; }
  .attract-hint::after, .attract-hint-arrow::before, .attract-hint-arrow::after, .attract-fallback::before, .attract-fallback::after,
  .card-qty, .card-qty-n, .cart-bar-count, .no-logo .pay-ico, .tap-ripple, .attract-badge { animation: none; }
  .pay-ring-svg { animation-duration: 4s; }
  #confirm-screen.play .confirm-flood, #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;
  }
}

/* Цен ещё нет (KIOSK_BRAND.hidePrices в index.html) — суммы не показываем нигде. */
.no-prices .product-card-price, .no-prices .opt-tile-price, .no-prices #product-add .add-total,
.no-prices .cart-bar-total, .no-prices .cart-item-total, .no-prices .upsell-card-price,
.no-prices .sheet-total, .no-prices .pay-amount, .no-prices .size-cup-price { display: none !important; }
.no-prices .product-card-meta { justify-content: flex-end; }

/* Низ окна заказа как в Drinkit: «Итого» справа над кнопкой, кнопка во всю ширину. */
#cart-sheet .sheet-footer { grid-template-columns: 1fr; }
#cart-sheet .sheet-total { align-items: flex-end; }
#cart-sheet #checkout-btn { width: 100%; justify-content: center; }
#cart-sheet #checkout-btn { background: var(--accent); color: var(--on-accent); border-radius: 32px; }

/* «+ 1 700 ₸» на кнопке карточки; без цен — «+ В корзину». */
#product-add { justify-content: center; gap: 10px; }
#product-add .add-plus { font-size: 30px; font-weight: 400; line-height: 1; }
#product-add .add-label { display: none; }
.no-prices #product-add .add-label { display: inline; font-size: 21px; }
#product-add .add-total { font-size: 24px; }
#cart-sheet #checkout-btn { gap: 12px; }
#cart-sheet .checkout-btn-sum { font-variant-numeric: tabular-nums; }
.no-prices .checkout-btn-sum { display: none; }
/* Сумма к оплате — на самой кнопке «Оплатить», отдельное «Итого» не нужно. */
#cart-sheet .sheet-total { display: none; }

/* ===== Публичная демо-копия (DEMO_MODE, kiosks-public/shablon-1-2-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-out) 3600ms forwards; }
@media (prefers-reduced-motion: reduce) { #confirm-screen.play .confirm-demo { animation: none; opacity: .8; transform: none; } }
