/* =========================================================
   DESIGN TOKENS
   ========================================================= */
:root {
  --bg: #ffffff;
  --text: #1c1c1e;
  --muted: #8a8a8f;          /* подзаголовки разделов */
  --muted-2: #636366;        /* описания блюд */
  --surface: #f2f2f5;        /* серые плашки, пилюли, кнопка + */
  --surface-2: #e8e8ed;
  --line: #e3e3e8;
  --dark: #1c1c1e;           /* активные пилюли, FAB, «Заказать» */
  --on-dark: #ffffff;
  --danger: #ff3b30;

  --r-s: 10px;
  --r: 14px;
  --r-l: 18px;
  --r-xl: 24px;
  --pill: 999px;

  --shadow: 0 8px 28px rgba(0, 0, 0, .18);
  --shadow-s: 0 8px 12px -10px rgba(0, 0, 0, .22);

  --header-h: 60px;
  --searchbar-h: 64px;     /* липкая строка поиска: 48px поле + отступы */
  --pad: 20px;
  --maxw: 640px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Montserrat", var(--font);
  --ease: cubic-bezier(.2, .8, .2, 1);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

/* =========================================================
   BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
img, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; -webkit-tap-highlight-color: transparent; }
.item, .ai-card, .rec-card, .cat { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
body.is-locked { overflow: hidden; }
:focus-visible { outline: 2px solid var(--dark); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* =========================================================
   LOADER
   ========================================================= */
.loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; align-content: center; gap: 16px;
  background: #0e0e10; color: #fff; transition: opacity .3s;
}
.loader.is-done { opacity: 0; pointer-events: none; }
.loader__spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.2); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.loader__error { max-width: 280px; text-align: center; font-size: 15px; opacity: .85; }
.loader__error button { margin-top: 12px; padding: 10px 20px; border-radius: var(--pill); background: #fff; color: #111; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   1. WELCOME
   ========================================================= */
.welcome {
  position: fixed; inset: 0; z-index: 10;
  color: #fff; background: #0e0e10;
  overflow-y: auto;
}
.welcome__bg { position: fixed; inset: 0; }
.welcome__img, .welcome__video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.welcome__video { pointer-events: none; }
/* Прячем системную кнопку ▶ на iPhone (режим энергосбережения) */
.welcome__video::-webkit-media-controls,
.welcome__video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }
.welcome__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,.3) 35%, rgba(0,0,0,.78) 100%);
}
.welcome__content {
  position: relative; min-height: 100%;
  display: flex; flex-direction: column;
}
.welcome__langs {
  display: flex; justify-content: center; gap: 22px;
  padding: calc(18px + var(--safe-t)) 0 0;
  font-size: 14px;
}
.welcome__langs button { opacity: .55; padding: 6px 2px; transition: opacity .2s; }
.welcome__langs button.is-active { opacity: 1; }

.welcome__center {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px; text-align: center;
}
.welcome__logo { width: min(210px, 58vw); height: auto; }
.welcome__name { font-family: var(--font-display); font-size: 40px; font-weight: 700; letter-spacing: .12em; }
.welcome__center.has-logo .welcome__name { display: none; }
.welcome__tagline {
  margin-top: 14px;
  font-family: var(--font-display); font-size: 13px; font-weight: 500;
  letter-spacing: .16em; opacity: .85;
}

.welcome__hours {
  margin-top: 16px; padding: 8px 16px; border-radius: var(--pill);
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3);
  font-size: 13px; font-weight: 500;
}

.welcome__buttons {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  width: 100%; max-width: 480px; margin: 0 auto;
  padding: 0 24px calc(32px + var(--safe-b));
}
.wbtn {
  display: flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 12px;
  border: 1px solid rgba(255,255,255,.85);
  color: #fff; text-decoration: none; text-align: center;
  font-family: var(--font-display); font-size: 13px; font-weight: 600; letter-spacing: .06em;
  transition: background .2s, color .2s;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.wbtn:active, .wbtn:hover { background: #fff; color: #111; }
.wbtn--primary { grid-column: 1 / -1; background: #fff; color: #111; min-height: 56px; font-size: 14px; }
.wbtn--wide { grid-column: 1 / -1; }
.wbtn--text { border-color: transparent; min-height: 40px; background: none; backdrop-filter: none; }
.wbtn--text:hover { background: none; color: #fff; opacity: .7; }

/* =========================================================
   2. MENU — HEADER
   ========================================================= */
.menu { min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 max(var(--pad), calc(50% - var(--maxw) / 2 + var(--pad)));
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: saturate(180%) blur(16px); backdrop-filter: saturate(180%) blur(16px);
}
.topbar > :first-child { justify-self: start; }
.topbar__brand { display: flex; align-items: center; }
.topbar__logo { height: 30px; width: auto; }
.topbar__name { font-family: var(--font-display); font-size: 20px; font-weight: 800; letter-spacing: -.01em; }

.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.icon-btn--dark { background: var(--dark); color: var(--on-dark); }
.icon-btn--dark svg { margin-left: -2px; }

/* ===== Выбор языка: кнопка с флажком + карточка (варианты оформления — data-lang-style) ===== */
.lang { justify-self: end; position: relative; }
.lang__btn {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px 0 8px; border-radius: var(--pill);
  background: var(--surface); font-size: 15px; font-weight: 600; letter-spacing: .02em;
}
.lang .flag { width: 24px; height: 24px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.lang__chev { opacity: .55; transition: transform .25s var(--ease); }
.lang.is-open .lang__chev { transform: rotate(180deg); }
.lang__list {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 60;
  width: 236px; padding: 8px;
  background: var(--lang-bg, #fff); color: var(--lang-fg, var(--text, #111)); border-radius: 18px;
  box-shadow: 0 18px 40px -12px rgba(40, 14, 10, .35), 0 0 0 1px rgba(0,0,0,.04);
  transform-origin: calc(100% - 28px) -6px;
  opacity: 0; transform: scale(.92) translateY(-6px);
  transition: opacity .18s ease, transform .22s var(--ease);
}
.lang__list.is-open { opacity: 1; transform: none; }
.lang__title { padding: 6px 12px 8px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: currentColor; opacity: .55; }
.lang__opt {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: 12px; text-align: left; color: inherit;
  opacity: 0; transform: translateY(-4px);
  transition: background .15s, opacity .25s ease calc(var(--i) * 45ms + 40ms), transform .3s var(--ease) calc(var(--i) * 45ms + 40ms);
}
.lang__list.is-open .lang__opt { opacity: 1; transform: none; }
.lang__opt .flag { width: 28px; height: 28px; }
.lang__name { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.lang__name b { font-size: 16px; font-weight: 600; }
.lang__name small { font-size: 12px; opacity: .6; }
.lang__check { color: var(--lang-check, var(--dark)); opacity: 0; transform: scale(.5); transition: opacity .2s, transform .3s var(--ease); }
.lang__opt.is-active { background: color-mix(in srgb, currentColor 9%, transparent); }
.lang__opt.is-active .lang__check { opacity: 1; transform: none; }
.lang__opt:active { transform: scale(.98); }

/* Вариант B: тёмная карточка — по умолчанию в цвет акцента ресторана (у Типа Граф бордовый) */
[data-lang-style="dark"] .lang__list { background: var(--lang-bg, var(--dark)); color: var(--lang-fg, #f4ead7); box-shadow: 0 20px 44px -12px rgba(0,0,0,.55); }
[data-lang-style="dark"] .lang__check { color: var(--lang-check, #e9c98f); }
[data-lang-style="dark"] .lang__list .flag { box-shadow: 0 0 0 1.5px rgba(244,234,215,.35); }

/* Вариант C: шторка снизу на весь экран (удобно большим пальцем) */
[data-lang-style="sheet"] .lang__list {
  position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto;
  padding: 14px 10px 10px; border-radius: 26px; transform-origin: 50% 100%;
  transform: translateY(110%); opacity: 1; transition: transform .38s cubic-bezier(.2,.9,.25,1);
  box-shadow: 0 -10px 50px rgba(0,0,0,.25);
}
[data-lang-style="sheet"] .lang__list.is-open { transform: none; }
[data-lang-style="sheet"] .lang__list::before { content: ''; display: block; width: 40px; height: 5px; margin: 0 auto 8px; border-radius: 3px; background: var(--surface-2); }
[data-lang-style="sheet"] .lang__title { text-align: center; font-size: 13px; }
[data-lang-style="sheet"] .lang__opt { padding: 14px 14px; }
[data-lang-style="sheet"] .lang__opt .flag { width: 34px; height: 34px; }
[data-lang-style="sheet"] .lang__list .flag { border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
[data-lang-style="sheet"] .lang__name b { font-size: 17px; }
.lang-backdrop { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.38); opacity: 0; transition: opacity .3s; }
.lang-backdrop.is-open { opacity: 1; }
[data-lang-style="sheet"] .lang__list { z-index: 91; }
@media (prefers-reduced-motion: reduce) { .lang__list, .lang__opt, .lang__check { transition: none; } }

/* =========================================================
   MENU — BODY
   ========================================================= */
.menu__main {
  max-width: var(--maxw); margin: 0 auto;
  padding: 8px var(--pad) calc(120px + var(--safe-b));
}

/* Горизонтальные ленты (акции, категории, рекомендации) */
.hscroll {
  position: relative;
  display: flex; gap: 12px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad);
  margin: 0 calc(-1 * var(--pad)); padding: 4px var(--pad);
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }

/* Акции */
.promo {
  flex: 0 0 76%; max-width: 440px;
  aspect-ratio: 2 / 1.1;
  border-radius: var(--r-l); overflow: hidden;
  background: var(--surface);
  scroll-snap-align: start;
}
.promo img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.promo video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.promo:active img { transform: scale(.98); }

/* Бизнес-ланч: карточка «сегодня / завтра» над поиском */
.lunch { margin: 14px 0 0; }
.lunch__card {
  display: block; width: 100%; text-align: left;
  padding: 16px 16px 14px; border-radius: var(--r-l);
  background: var(--lunch-bg, var(--surface)); color: var(--lunch-fg, var(--text));
  transition: transform .2s var(--ease);
}
.lunch__card:active { transform: scale(.985); }
.lunch__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.lunch__title { display: flex; flex-direction: column; font-family: var(--font-display); font-size: 20px; font-weight: 800; line-height: 1.15; }
.lunch__title small { font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .6; margin-bottom: 3px; }
.lunch__badge {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--pill);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: rgba(127,127,127,.16);
}
.lunch__badge.is-live { background: rgba(52,199,89,.14); color: #1f8a3e; }
.lunch__badge i { width: 7px; height: 7px; border-radius: 50%; background: #34c759; animation: lunchPulse 1.8s ease-in-out infinite; }

.lunch.is-dark .lunch__badge { background: rgba(255,255,255,.14); }
.lunch.is-dark .lunch__badge.is-live { background: rgba(52,199,89,.2); color: #6fe08b; }
@keyframes lunchPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(52,199,89,.5); } 50% { box-shadow: 0 0 0 5px rgba(52,199,89,0); } }
.lunch__list { list-style: none; margin: 12px 0 0; padding: 0; }
.lunch__list li { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px solid rgba(127,127,127,.2); }
.lunch__list li:first-child { border-top: none; }
.lunch__list small { flex: 0 0 74px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .55; }
.lunch__list b { font-size: 15px; font-weight: 600; line-height: 1.3; }
.lunch__foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(127,127,127,.2); }
.lunch__price { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.lunch__more { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 600; opacity: .6; }

.lunch__card--row { display: flex; align-items: center; gap: 10px; padding: 13px 14px 13px 16px; }
.lunch__name { font-family: var(--font-display); font-size: 16px; font-weight: 800; white-space: nowrap; }
.lunch__card--row .lunch__badge { padding: 5px 9px; }
.lunch__card--row .lunch__price { margin-left: auto; font-size: 16px; white-space: nowrap; }
.lunch__chev { flex: none; margin-left: -4px; opacity: .6; }
@media (max-width: 360px) { .lunch__card--row .lunch__badge { display: none; } }

/* Меню ланча на неделю (шторка) */
.lunch-week { padding: 22px var(--pad) 6px; }
.lunch-week__title { font-family: var(--font-display); font-size: 24px; font-weight: 800; padding-right: 40px; }
.lunch-week__sub { margin-top: 4px; font-size: 14px; color: var(--muted-2); }
.lunch-week__tabs { display: flex; gap: 8px; margin: 16px 0 6px; }
.lunch-week__tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 0; border-radius: var(--r); background: var(--surface);
  transition: background .2s, color .2s;
}
.lunch-week__tab b { font-size: 14px; }
.lunch-week__tab small { font-size: 12px; opacity: .6; }
.lunch-week__tab.is-today { box-shadow: inset 0 0 0 1.5px var(--dark); }
.lunch-week__tab.is-active { background: var(--dark); color: var(--on-dark); }
.lunch-week__list li { padding: 11px 0; }
.lunch-week__list b { font-size: 16px; }
.lunch-week__note { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* Поиск */
/* Поиск «липкий»: едет под шапкой при прокрутке, разделы — под ним */
.search-bar {
  position: sticky; top: var(--header-h); z-index: 25;
  margin: 10px calc(-1 * var(--pad)) 8px; padding: 8px var(--pad);
  background: var(--bg);
}
.search { position: relative; display: block; margin: 0; }
.search input {
  width: 100%; height: 48px;
  padding: 0 44px 0 46px;
  border: 1.5px solid #d4d4d9; border-radius: 12px;
  background: #fff; color: var(--text);
  font: inherit; font-size: 17px;           /* ≥16px — iOS не зумит */
  outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color .2s;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { border-color: var(--dark); }
.search__icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search__clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted-2);
}

/* Категории */
.cat {
  flex: 0 0 152px;
  display: flex; flex-direction: column;
  padding: 6px 6px 14px;
  border-radius: var(--r-l);
  background: var(--surface); text-align: left;
  scroll-snap-align: start;
  transition: background .25s, color .25s;
}
.cat__img { width: 100%; aspect-ratio: 1.42; object-fit: cover; border-radius: 12px; background: var(--surface-2); }
.cat__title { padding: 10px 8px 0; font-size: 15px; line-height: 1.25; min-height: calc(2.5em + 10px); }
.cat.is-active { background: var(--dark); color: var(--on-dark); }
.menu__main.is-searching .cats { display: none; }

/* Пилюли разделов (липкие) */
.pills {
  position: sticky; top: calc(var(--header-h) + var(--searchbar-h)); z-index: 20;
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  margin: 18px calc(-1 * var(--pad)) 0; padding: 10px var(--pad) 12px;
  background: var(--bg);
  box-shadow: var(--shadow-s);
}
.pills::-webkit-scrollbar { display: none; }
.pills { isolation: isolate; }
.pill {
  flex: 0 0 auto; position: relative;
  padding: 11px 20px; border-radius: var(--pill);
  background: transparent; font-size: 16px; white-space: nowrap;
  /* цвет текста меняется, когда капля уже ушла/пришла, а не в момент нажатия */
  transition: color .22s var(--ease) .2s;
}
.pill::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: var(--surface); z-index: -1; }
.pill > span { position: relative; z-index: 1; }
.pill.is-active { color: var(--on-dark); }
/* «Капсула» активного раздела: едет под текст пилюли */
.pills__ind {
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none;
  border-radius: var(--pill); background: var(--dark); opacity: 0;
  transform-origin: 50% 50%; transition: opacity .2s;
}

/* Разделы */
.section { padding-top: 30px; }
.section__title { font-family: var(--font-display); font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -.015em; }
.section__sub { margin-top: 10px; font-size: 17px; line-height: 1.4; color: var(--muted); }
.items { margin-top: 10px; }

/* Карточка блюда */
.item {
  display: grid; grid-template-columns: 38% 1fr; gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.item { transition: transform .15s var(--ease), background .15s; border-radius: 4px; }
.item:active { transform: scale(.985); background: var(--surface); }
.item--noimg { grid-template-columns: 1fr; }

/* Заглушка вместо фото, когда его не загрузили — своя иконка на фоне темы,
   а не пустое место. Работает в обоих видах карточек (список и сетка). */
.img-ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; opacity: .5;
}

/* Подробная карточка блюда — по центру экрана (не шторкой снизу, как у акций),
   фото с теми же пропорциями, что в списке (квадрат, не растянуто под широкий баннер).
   Кнопка и крестик закрытия — в акцентный цвет заведения (--dark). */
.overlay.item-detail-overlay {
  align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}
.item-detail-overlay .overlay__panel {
  transform: none; border-radius: var(--r-xl); max-width: 420px;
  /* Высота — по реально видимой части экрана (dvh), а не по полной высоте телефона (vh):
     иначе в браузерах с панелями сверху/снизу окно вылезало и крестик с кнопками не было видно */
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overscroll-behavior: contain;
}
.item-detail__img { width: 100%; aspect-ratio: 1; max-height: 42vh; max-height: 42dvh; object-fit: cover; background: var(--surface); }
.item-detail__img.img-ph { font-size: 48px; }
.item-detail__close { color: var(--dark); }
/* Крестик едет вместе с прокруткой окна и всегда под пальцем (sticky), а не уезжает вверх с фото.
   Отрицательный нижний отступ — чтобы он лежал поверх фото, а не сдвигал его вниз. */
.item-detail-overlay .overlay__close,
#promoModal .overlay__close {
  position: sticky; top: 12px; right: auto;
  display: grid; margin: 12px 12px -46px auto;
}
.item-detail__foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-top: 20px; }
.item-detail__add {
  width: 100%; height: 56px; margin-top: 22px; padding: 0 24px; border-radius: var(--pill);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--dark); color: var(--on-dark); font-size: 17px; font-weight: 700;
  transition: transform .15s var(--ease);
}
.item-detail__add:active { transform: scale(.97); }
/* Если описание длинное и кнопка не помещается — она «прилипает» к низу окна и видна сразу */
.item-detail-overlay .item-detail__add { position: sticky; bottom: 12px; z-index: 2; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.item-detail__add:only-child, .item-detail__add span:only-child { justify-content: center; }
.item-detail__add-price { font-weight: 800; }

/* «С этим берут» в окне блюда */
.detail-recs { margin-top: 26px; }
.detail-recs__title { font-size: 17px; font-weight: 800; margin-bottom: 12px; }
.detail-recs__row {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad) 6px; scrollbar-width: none;
  scroll-padding-inline: var(--pad); /* «примагничивание» к линии текста, а не к краю окна */
}
.detail-recs__row::-webkit-scrollbar { display: none; }
/* Карточки одной высоты (по самой длинной), цена с «+» прижаты к низу — одна линия у всех */
.rec-card { flex: 0 0 132px; scroll-snap-align: start; cursor: pointer; display: flex; flex-direction: column; }
.rec-card__img { width: 132px; height: 132px; border-radius: var(--r); object-fit: cover; background: var(--surface); }
.rec-card__title { margin-top: 8px; min-height: 2.5em; font-size: 14px; font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 6px; }
.rec-card__price { font-size: 14px; font-weight: 700; }
.rec-card__add { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--dark); color: var(--on-dark); }
.rec-card__add:active { transform: scale(.88); }

/* Подсказка «Нажмите на блюдо» — один раз на устройство */
.tip-tap {
  position: relative; display: flex; align-items: center; gap: 10px;
  margin: 14px 0 2px; padding: 12px 14px; border-radius: var(--r);
  background: var(--dark); color: var(--on-dark); font-size: 15px; line-height: 1.35;
  opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s var(--ease);
}
.tip-tap.is-shown { opacity: 1; transform: none; }
.tip-tap::after {
  content: ''; position: absolute; left: 28px; bottom: -7px;
  border: 8px solid transparent; border-bottom: 0; border-top-color: var(--dark);
}
.tip-tap__icon { font-size: 22px; animation: tipTap 1.4s ease-in-out infinite; }
@keyframes tipTap { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
.tip-tap__text { flex: 1; }
.tip-tap__ok { flex: none; padding: 8px 12px; border-radius: var(--pill); background: rgba(255,255,255,.18); color: inherit; font-weight: 700; font-size: 14px; }
.item__img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--r); background: var(--surface);
}
.item__body { display: flex; flex-direction: column; min-width: 0; }
.item-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.item-badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: var(--pill);
  background: var(--surface); color: var(--text);
  font-size: 11px; font-weight: 700; letter-spacing: .01em; white-space: nowrap;
}
.item__title { font-size: 18px; font-weight: 700; line-height: 1.25; }
.item__desc {
  margin-top: 8px; font-size: 15px; line-height: 1.4; color: var(--muted-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* «Подробнее ›» — явный признак того, что на блюдо можно нажать (понятно в любом возрасте) */
.item__more {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 2px;
  margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--dark);
}
.item__more svg { margin-top: 1px; }

/* Вид карточек «Сетка — по 2 в ряд» — переключается в настройках ресторана (item_layout).
   По умолчанию (list) ничего из этого не действует — обычный список, как и раньше. */
#sections[data-item-layout="grid"] .items {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px 14px;
}
#sections[data-item-layout="grid"] .item {
  grid-template-columns: 1fr; gap: 0; padding: 0; border-bottom: none;
  /* Без этого браузер раздаёт лишнюю высоту (когда у соседа название длиннее) и фото, и тексту —
     и подпись короткой карточки «съезжает» вниз. Теперь лишнее место уходит только в текстовый блок. */
  grid-template-rows: auto 1fr; align-content: start;
}
#sections[data-item-layout="grid"] .item__img { aspect-ratio: 1; border-radius: var(--r-l); }
/* В сетке метки («Острое» и т.п.) лежат на углу фото — иначе название с меткой стоит ниже соседнего */
#sections[data-item-layout="grid"] .item { position: relative; }
#sections[data-item-layout="grid"] .item-badges {
  position: absolute; top: 8px; left: 8px; right: 8px; margin: 0; z-index: 1; pointer-events: none;
}
#sections[data-item-layout="grid"] .item-badge { position: relative; z-index: 0; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
/* белая подложка под полупрозрачной меткой, чтобы она читалась поверх любого фото */
#sections[data-item-layout="grid"] .item-badge::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: #fff; }
#sections[data-item-layout="grid"] .item__title { margin-top: 10px; font-size: 15px; }
#sections[data-item-layout="grid"] .item__desc { display: none; }
#sections[data-item-layout="grid"] .item__more { margin-top: 4px; font-size: 13px; }
/* В узкой карточке сетки: «+» чуть компактнее, но всё ещё под палец, и цена не налезает на кнопку */
#sections[data-item-layout="grid"] .item__foot { gap: 6px; }
#sections[data-item-layout="grid"] .add-btn { min-width: 40px; height: 40px; }
#sections[data-item-layout="grid"] .item__price { min-width: 0; white-space: nowrap; }
#sections[data-item-layout="grid"] .item__foot { padding-top: 8px; }
#sections[data-item-layout="grid"] .item__price { font-size: 15px; }

/* Вариации: цена ........ объём */
.variants { margin-top: 14px; display: flex; flex-direction: column; gap: 7px; }
.variant { display: flex; align-items: baseline; gap: 4px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.variant__dots {
  flex: 1 1 auto; min-width: 12px;
  border-bottom: 2px dotted currentColor; opacity: .6;
  transform: translateY(-4px);
}

.item__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; }
.item__price { font-size: 17px; font-weight: 700; }

.add-btn {
  flex: none; margin-left: auto;
  min-width: 44px; height: 44px; padding: 0 8px; border-radius: var(--pill);
  display: grid; place-items: center;
  background: var(--surface); color: var(--text);
  font-size: 15px; font-weight: 700;
  transition: background .2s, color .2s, transform .15s;
}
.add-btn:active { transform: scale(.88); }
.add-btn.is-in { background: var(--dark); color: var(--on-dark); }
.add-btn.bump { animation: bump .35s var(--ease); }
@keyframes bump { 40% { transform: scale(1.25); } }

.item.flash { animation: flash 1.8s ease; }
@keyframes flash { 0%, 60% { background: #fff4c2; box-shadow: 0 0 0 12px #fff4c2; } 100% { background: transparent; box-shadow: 0 0 0 12px transparent; } }

.not-found { padding: 48px 0; text-align: center; color: var(--muted); font-size: 17px; }

/* Floating buttons */
.fab {
  position: fixed; z-index: 40;
  bottom: calc(20px + var(--safe-b));
  background: var(--dark); color: var(--on-dark);
  box-shadow: var(--shadow);
  transition: transform .3s var(--ease), opacity .3s;
}
.fab.is-hidden { opacity: 0; transform: translateY(24px) scale(.9); pointer-events: none; }
.fab-top {
  left: max(20px, calc(50% - var(--maxw) / 2 + 20px));
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
}
.fab-cart {
  right: max(20px, calc(50% - var(--maxw) / 2 + 20px));
  height: 58px; padding: 0 24px 0 18px; border-radius: var(--pill);
  display: flex; align-items: center; gap: 12px;
  font-size: 19px; font-weight: 600;
}
.fab-cart__count {
  position: absolute; top: -4px; left: 34px;
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--danger); color: #fff;
  font-size: 12px; font-weight: 700; border: 2px solid #fff;
}
.fab-cart.bump { animation: bump .35s var(--ease); }

/* =========================================================
   3. CART
   ========================================================= */
.cart {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: var(--bg);
  transform: translateX(100%); visibility: hidden;
  transition: transform .35s var(--ease), visibility 0s linear .35s;
}
.cart.is-open { transform: none; visibility: visible; transition: transform .35s var(--ease), visibility 0s; }
.cart__scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.cart__inner { max-width: var(--maxw); margin: 0 auto; padding: calc(16px + var(--safe-t)) var(--pad) calc(120px + var(--safe-b)); }
.cart__head { display: flex; align-items: center; gap: 16px; padding: 8px 0 12px; }
.cart__title { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; }

.citem {
  display: grid; grid-template-columns: 100px 1fr; gap: 20px;
  padding: 16px 0 22px; border-bottom: 1px solid var(--line);
}
.citem__img { width: 100px; aspect-ratio: 1; object-fit: cover; border-radius: 12px; background: var(--surface); }
.citem__body { display: flex; flex-direction: column; min-width: 0; }
.citem__top { display: flex; align-items: flex-start; gap: 8px; }
.citem__title { flex: 1; font-size: 19px; font-weight: 500; line-height: 1.25; }
.citem__remove { color: var(--muted); padding: 2px; margin: -2px -2px 0 0; }
.citem__variant { margin-top: 8px; font-size: 15px; color: var(--muted-2); }
.citem__row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.citem__sum { font-size: 18px; font-weight: 700; white-space: nowrap; }

.qty { display: flex; align-items: center; gap: 12px; }
.qty button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); }
.qty span { min-width: 18px; text-align: center; font-size: 18px; font-weight: 500; }

.totals__row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 22px 0; border-bottom: 1px solid var(--line);
  font-size: 22px;
}
.totals__row--muted { font-size: 17px; color: var(--muted-2); padding: 16px 0; }

.recs__title { margin: 34px 0 12px; font-size: 20px; font-weight: 400; }
.rec {
  flex: 0 0 158px; display: flex; flex-direction: column;
  padding: 10px 10px 12px; border-radius: var(--r);
  background: var(--surface); text-align: left;
  scroll-snap-align: start;
}
.rec__img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-s); background: var(--surface-2); }
.rec__title {
  margin-top: 12px; font-size: 16px; line-height: 1.3; min-height: 2.6em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rec__price {
  margin-top: 16px; padding: 12px; border-radius: var(--pill);
  background: #fff; text-align: center; font-size: 16px; white-space: nowrap;
}

.cart__empty { padding: 60px 0; text-align: center; }
.cart__empty p { font-size: 18px; color: var(--muted-2); }
.cart__empty button { margin-top: 20px; padding: 14px 28px; border-radius: var(--pill); background: var(--dark); color: #fff; font-size: 16px; font-weight: 600; }

.cart__foot {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 24px var(--pad) calc(16px + var(--safe-b));
  background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 40%);
  pointer-events: none;
}
.order-btn {
  display: block; width: 100%; max-width: 600px; height: 62px; margin: 0 auto;
  border-radius: var(--pill); background: var(--dark); color: #fff;
  font-size: 20px; font-weight: 500;
  pointer-events: auto; transition: transform .15s, opacity .2s;
}
.order-btn:active { transform: scale(.98); }
.order-btn:disabled { opacity: .35; }

.fallback-link {
  display: block; width: 100%; max-width: 600px; margin: 10px auto 0;
  text-align: center; font-size: 13px; color: var(--muted); text-decoration: underline;
  pointer-events: auto;
}

/* =========================================================
   OVERLAYS (акция, выбор варианта)
   ========================================================= */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.5);
  opacity: 0; transition: opacity .25s;
}
.overlay.is-open { opacity: 1; }
.overlay__panel {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; overflow-y: auto;
  background: #fff; border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding-bottom: calc(20px + var(--safe-b));
  transform: translateY(40px); transition: transform .3s var(--ease);
}
.overlay.is-open .overlay__panel { transform: none; }
@media (min-width: 700px) {
  .overlay { align-items: center; padding: 24px; }
  .overlay__panel { border-radius: var(--r-xl); padding-bottom: 20px; }
}
.overlay__close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.92); box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.promo-full__img { width: 100%; aspect-ratio: 2 / 1.1; object-fit: cover; background: var(--surface); }
.promo-full__body { padding: 20px var(--pad) 4px; }
/* «Внешний вид блюда может отличаться от фото» — под фото в окне блюда и одной строкой над меню */
.dish-photo-note, .menu-photo-note { display: flex; gap: 6px; margin: 0; font-size: 12px; line-height: 1.35; color: var(--muted); }
.dish-photo-note svg, .menu-photo-note svg { flex: none; margin-top: 1px; opacity: .8; }
.dish-photo-note { align-items: flex-start; padding: 8px var(--pad) 0; }
.promo-full__body--after-note { padding-top: 10px; }
.menu-photo-note { align-items: flex-start; padding: 14px var(--pad) 0; }
.promo-full__title { font-family: var(--font-display); font-size: 24px; font-weight: 800; line-height: 1.2; }
.promo-full__desc { margin-top: 10px; font-size: 16px; line-height: 1.45; color: var(--muted-2); white-space: pre-line; }
.notice__text { font-size: 15px; line-height: 1.55; white-space: pre-line; }

/* Отдельный класс (не .overlay) — чтобы route() не закрывал уведомление вместе с модалками акций/вариантов */
.notice-overlay {
  position: fixed; inset: 0; z-index: 85;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.5);
  opacity: 0; transition: opacity .25s;
}
.notice-overlay.is-open { opacity: 1; }
.notice-overlay .overlay__panel { transform: none; border-radius: var(--r-xl); }

/* Кнопка «Согласен(-на)» под уведомлением — отдельный, самостоятельный стиль,
   не общий с кнопкой акции (promo-full__btn), чтобы не зависеть от контекста другого компонента */
.notice-overlay__btn {
  display: block; width: 100%; height: 54px; margin-top: 20px;
  border-radius: var(--pill); background: var(--dark); color: #fff;
  font-size: 17px; font-weight: 600; text-align: center;
}

/* Выбор языка при входе в меню — свой класс (не .overlay), по той же причине,
   что и .notice-overlay: route() не должен случайно закрыть его за компанию с другими модалками */
/* ===== Окно выбора языка при первом входе ===== */
.lang-overlay {
  position: fixed; inset: 0; z-index: 86;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(20, 10, 8, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s ease;
}
.lang-overlay.is-open { opacity: 1; }
.lang-overlay.is-closing { opacity: 0; transition-duration: .28s; }
.lang-overlay__panel {
  width: 100%; max-width: 360px; padding: 26px 18px 18px; border-radius: 28px; text-align: center;
  background: var(--lang-bg, #fff); color: var(--lang-fg, var(--text, #111));
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.5);
  transform: translateY(24px) scale(.94); transition: transform .45s cubic-bezier(.2,.9,.25,1);
}
.lang-overlay.is-open .lang-overlay__panel { transform: none; }
.lang-overlay.is-closing .lang-overlay__panel { transform: scale(.96); transition-duration: .28s; }
.lang-overlay.is-dark .lang-overlay__panel { background: var(--lang-bg, var(--dark)); color: var(--lang-fg, #f4ead7); }
.lang-overlay__logo { display: block; max-width: 190px; max-height: 64px; margin: 0 auto 16px; object-fit: contain; }
.lang-overlay__name { font-family: var(--font-display); font-size: 24px; font-weight: 800; margin-bottom: 14px; }
.lang-overlay__title { display: flex; flex-direction: column; gap: 4px; margin-bottom: 18px; }
.lang-overlay__title b { font-size: 19px; font-weight: 700; }
.lang-overlay__title span { font-size: 13px; opacity: .6; }
.lang-overlay__list { display: flex; flex-direction: column; gap: 8px; }
.lang-overlay__btn {
  position: relative; display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 14px 16px; border-radius: 18px; text-align: left; color: inherit;
  background: color-mix(in srgb, currentColor 6%, transparent);
  border: 1.5px solid color-mix(in srgb, currentColor 10%, transparent);
  opacity: 0; transform: translateY(10px);
  transition: opacity .35s ease calc(.12s + var(--i) * 70ms), transform .45s cubic-bezier(.2,.9,.25,1) calc(.12s + var(--i) * 70ms), background .2s, border-color .2s;
}
.lang-overlay.is-open .lang-overlay__btn { opacity: 1; transform: none; }
.lang-overlay__btn:active { transform: scale(.98); }
.lang-overlay__btn .flag { width: 38px; height: 38px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1.5px color-mix(in srgb, currentColor 18%, transparent); }
.lang-overlay__lbl { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lang-overlay__lbl b { font-size: 17px; font-weight: 600; }
.lang-overlay__lbl small { font-size: 12.5px; opacity: .6; }
.lang-overlay__go { flex: none; opacity: .45; transition: opacity .2s, transform .2s; }
.lang-overlay__btn .lang__check { position: absolute; right: 16px; color: var(--lang-check, var(--dark)); opacity: 0; transform: scale(.4); }
.lang-overlay.is-dark .lang-overlay__btn .lang__check { color: var(--lang-check, #e9c98f); }
.lang-overlay__btn.is-picked { background: color-mix(in srgb, currentColor 14%, transparent); border-color: color-mix(in srgb, currentColor 30%, transparent); }
.lang-overlay__btn.is-picked .lang-overlay__go { opacity: 0; transform: translateX(6px); }
.lang-overlay__btn.is-picked .lang__check { opacity: 1; transform: none; transition: opacity .2s, transform .3s cubic-bezier(.2,.9,.25,1); }
@media (prefers-reduced-motion: reduce) { .lang-overlay__panel, .lang-overlay__btn { transition: none; transform: none; } }

.sheet__head { padding: 24px 60px 8px var(--pad); }
.sheet__title { font-family: var(--font-display); font-size: 22px; font-weight: 800; line-height: 1.2; }
.sheet__sub { margin-top: 4px; color: var(--muted-2); font-size: 15px; }
.sheet__list { padding: 8px var(--pad) 4px; display: flex; flex-direction: column; gap: 8px; }
.sheet__opt {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 16px 18px; border-radius: var(--r);
  background: var(--surface); font-size: 17px; font-weight: 600; text-align: left;
  transition: background .15s;
}
.sheet__opt:active { background: var(--surface-2); }
.sheet__opt .variant__dots { opacity: .35; }

/* Toast */
.toast {
  position: fixed; left: 50%; z-index: 90;
  bottom: calc(92px + var(--safe-b));
  max-width: calc(100% - 40px);
  padding: 12px 20px; border-radius: var(--pill);
  background: rgba(28,28,30,.94); color: #fff; font-size: 15px; font-weight: 500;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease);
}
.toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* Небольшие экраны */
@media (max-width: 360px) {
  :root { --pad: 16px; }
  .item { gap: 14px; }
  .section__title { font-size: 25px; }
}

/* =========================================================
   ПРЕСЕТЫ ОФОРМЛЕНИЯ
   Задаются в таблице Restaurants → колонка theme (modern | premium | friendly | bold).
   Меняют только акцентный цвет, шрифт заголовков и радиус скруглений —
   вся остальная вёрстка (сетка, размеры, поведение) общая для всех клиентов.
   accentColor в той же таблице переопределяет --dark поверх любого пресета.
   ========================================================= */

/* modern — по умолчанию, ничего переопределять не нужно (токены заданы в :root выше) */

/* premium — рестораны высокой кухни: почти чёрный акцент, засечки, острые углы */
:root[data-preset="premium"] {
  --dark: #15130f;
  --font-display: 'Playfair Display', Georgia, serif;
  --r-s: 3px; --r: 3px; --r-l: 3px; --r-xl: 3px; --pill: 3px;
}

/* friendly — кофейни и детские меню: тёплый акцент, круглый шрифт, крупные скругления */
:root[data-preset="friendly"] {
  --dark: #ff7a45;
  --font-display: 'Fredoka', var(--font);
  --r-s: 14px; --r: 20px; --r-l: 26px; --r-xl: 30px;
}

/* bold — бары и стрит-фуд: яркий акцент, плотный крупный шрифт, прямые углы */
:root[data-preset="bold"] {
  --dark: #d81e3d;
  --font-display: 'Bebas Neue', var(--font);
  --r-s: 2px; --r: 2px; --r-l: 2px; --r-xl: 2px; --pill: 2px;
}
:root[data-preset="bold"] .section__title,
:root[data-preset="bold"] .welcome__name { letter-spacing: .02em; }

/* ===== Умный поиск (ИИ) ===== */
.ai-pick { margin: 0 0 16px; }
.menu__main.is-searching .menu-photo-note { display: none; }
.ai-pick__offer {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border: 1.5px solid var(--dark); border-radius: 16px;
  background: color-mix(in srgb, var(--dark) 6%, var(--bg, #fff)); color: var(--text, #111);
  font: inherit; cursor: pointer;
}
.ai-pick__offer:active { transform: scale(.98); }
.ai-pick__icon {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: var(--dark); color: var(--on-dark, #fff);
}
.ai-pick__text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ai-pick__text b { font-size: 15px; }
.ai-pick__text small, .ai-pick__head small { font-size: 12.5px; line-height: 1.35; color: var(--muted); font-weight: 400; }
.ai-pick__go { flex: none; color: var(--dark); }
.ai-pick__panel { border: 1.5px solid color-mix(in srgb, var(--dark) 22%, transparent); border-radius: 18px; padding: 12px; background: var(--bg, #fff); }
.ai-pick__head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 15px; }
.ai-pick__head > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.ai-card { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line, #eee); cursor: pointer; }
.ai-card:first-of-type { border-top: 0; }
.ai-card__img { flex: none; width: 64px; height: 64px; border-radius: 12px; object-fit: cover; background: var(--surface); font-size: 24px; display: grid; place-items: center; }
.ai-card__body { flex: 1; min-width: 0; }
.ai-card__title { font-weight: 600; font-size: 15px; line-height: 1.25; }
.ai-card__reason { margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--muted-2, #666); }
.ai-card__price { margin-top: 4px; font-weight: 700; font-size: 14px; }
.ai-card__add { flex: none; }
.ai-pick__note { margin: 8px 0 0; font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.ai-card--skeleton { cursor: default; }
.ai-card--skeleton span { width: 64px; height: 64px; border-radius: 12px; }
.ai-card--skeleton i { flex: 1; height: 34px; border-radius: 8px; }
.ai-card--skeleton span, .ai-card--skeleton i {
  background: linear-gradient(90deg, var(--surface) 25%, color-mix(in srgb, var(--surface) 55%, #fff) 50%, var(--surface) 75%);
  background-size: 200% 100%; animation: aiShimmer 1.2s infinite linear;
}
.ai-pick__panel.is-loading .ai-pick__icon { animation: aiPulse 1.2s infinite ease-in-out; }
@keyframes aiShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes aiPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }

/* Подсказка при фокусе на поиске + примеры */
.ai-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-chips__label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.ai-chip { padding: 9px 14px; border-radius: var(--pill); background: color-mix(in srgb, var(--dark) 8%, var(--bg)); color: var(--dark); font: inherit; font-size: 14px; font-weight: 500; }
.ai-chip:active { transform: scale(.96); }
/* Кнопка «Подобрать с ИИ» мягко пульсирует — видно, что её надо нажать */
.ai-pick__offer { animation: aiOfferPulse 1.8s ease-in-out infinite; }
@keyframes aiOfferPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--dark) 28%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--dark) 0%, transparent); }
}
@media (prefers-reduced-motion: reduce) { .ai-pick__offer { animation: none; } }

/* Появление при прокрутке */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity .5s var(--ease) var(--reveal-delay, 0ms), transform .5s var(--ease) var(--reveal-delay, 0ms); }
/* Полёт фото в корзину */
.fly-ghost { position: fixed; z-index: 200; border-radius: 14px; object-fit: cover; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } .pills__ind { transition: none; } }

/* AR «на столе» и 360° */
.item-detail__media { position: relative; }
.view-btns { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 8px; }
.view-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px 0 11px; border-radius: var(--pill);
  background: rgba(20,20,22,.62); color: #fff; font-size: 14px; font-weight: 600;
  -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4);
  transition: transform .2s var(--ease);
}
.view-btn:active { transform: scale(.95); }
.viewer-overlay { z-index: 120; }
.viewer { padding: 0; overflow: hidden; }
.viewer__stage { position: relative; width: 100%; aspect-ratio: 1; max-height: 62vh; max-height: 62dvh; background: radial-gradient(ellipse at 50% 60%, #fbfaf8 0%, #ecebe8 70%); }
.viewer__stage model-viewer { width: 100%; height: 100%; --poster-color: transparent; }
.viewer__loading, .viewer__note { position: absolute; left: 0; right: 0; text-align: center; font-size: 14px; color: var(--muted); }
.viewer__loading { top: 50%; transform: translateY(-50%); }
.viewer__note { top: 16px; padding: 0 56px; }
.viewer__ar {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%);
  height: 48px; padding: 0 22px; border-radius: var(--pill); background: var(--dark); color: var(--on-dark);
  font-size: 16px; font-weight: 700; white-space: nowrap; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.viewer__stage--spin { cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.viewer__stage--spin.is-drag { cursor: grabbing; }
.viewer__stage--spin img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.viewer__drag { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--pill); background: rgba(255,255,255,.88); font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; transition: opacity .3s; }
.viewer__stage--spin.is-drag .viewer__drag { opacity: 0; }
.viewer__body { padding: 16px var(--pad) 22px; }
.viewer__body h3 { font-family: var(--font-display); font-size: 21px; font-weight: 800; padding-right: 40px; }
.viewer__body p { margin-top: 6px; font-size: 14px; color: var(--muted-2); line-height: 1.45; }

/* Рекомендации: после добавления — «Добавлено» и «− N +» */
.rec-step { display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 3px; border-radius: var(--pill); background: var(--dark); color: var(--on-dark); }
.rec-step button { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: inherit; }
.rec-step button:active { background: rgba(255,255,255,.18); }
.rec-step b { min-width: 16px; text-align: center; font-size: 15px; font-weight: 700; }
.rec-card__foot.is-added { flex-direction: column; align-items: stretch; gap: 6px; }
.rec-card__foot.is-added .rec-card__price { color: #1f8a3e; font-weight: 700; font-size: 13px; }
.rec-card__foot.is-added .rec-step { justify-content: space-between; width: 100%; }
.rec.is-added { box-shadow: inset 0 0 0 2px var(--dark); }
.rec__added { margin-top: 10px; font-size: 13px; font-weight: 700; color: #1f8a3e; }
.rec__step { margin-top: 6px; display: flex; align-items: center; justify-content: space-between; padding: 4px; border-radius: var(--pill); background: var(--dark); color: var(--on-dark); }
.rec__step button { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: inherit; }
.rec__step button:active { background: rgba(255,255,255,.18); }
.rec__step b { font-size: 17px; font-weight: 700; }

/* «Показать официанту» — крупный список на весь экран */
.waiter { position: fixed; inset: 0; z-index: 140; background: #fff; display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .38s var(--ease); visibility: hidden; }
.waiter.is-open { transform: none; visibility: visible; }
.waiter__panel { flex: 1; overflow-y: auto; padding: calc(var(--safe-t, 0px) + 22px) var(--pad) 20px; }
.waiter__head { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.waiter__logo { height: 40px; max-width: 200px; object-fit: contain; }
.waiter__hint { display: inline-flex; padding: 8px 14px; border-radius: var(--pill); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--muted-2); }
.waiter__title { margin-top: 22px; font-family: var(--font-display); font-size: 30px; font-weight: 800; display: flex; justify-content: space-between; align-items: baseline; }
.waiter__title span { font-family: var(--font); font-size: 15px; font-weight: 600; color: var(--muted); }
.waiter__list { list-style: none; margin: 14px 0 0; padding: 0; }
.waiter__list li { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--line, #eee); }
.waiter__list li:first-child { border-top: 0; }
.waiter__qty { font-size: 24px; font-weight: 800; color: var(--dark); }
.waiter__name { font-size: 21px; font-weight: 600; line-height: 1.25; }
.waiter__name small { display: block; margin-top: 3px; font-size: 15px; font-weight: 500; color: var(--muted-2); }
.waiter__sum { font-size: 17px; font-weight: 600; white-space: nowrap; color: var(--muted-2); }
.waiter__total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding-top: 16px; border-top: 2px solid var(--text); font-size: 16px; color: var(--muted-2); }
.waiter__total strong { font-size: 28px; color: var(--text); }
.waiter__fee { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 12px; font-size: 16px; color: var(--muted-2); }
.waiter__note { margin-top: 14px; font-size: 13px; color: var(--muted); text-align: center; }
.waiter__foot { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 12px var(--pad) calc(12px + var(--safe-b)); border-top: 1px solid var(--line, #eee); background: #fff; }
.waiter__edit { height: 56px; padding: 0 22px; border-radius: var(--pill); background: var(--surface); font-size: 16px; font-weight: 700; }
.waiter__done { height: 56px; border-radius: var(--pill); background: var(--dark); color: var(--on-dark); font-size: 16px; font-weight: 700; }

/* =========================================================
   СТОРИС — акции квадратиками (как в 2ГИС) + полноэкранный просмотр
   ========================================================= */
.stories {
  display: flex; gap: 10px;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  margin: 0 calc(-1 * var(--pad)); padding: 6px var(--pad) 4px;
}
.stories::-webkit-scrollbar { display: none; }
.story {
  position: relative; flex: 0 0 auto;
  width: 132px; aspect-ratio: 1 / 1.12;
  padding: 3px; border-radius: 20px;
  background: var(--dark);
  transition: transform .15s var(--ease);
}
.story.is-seen { background: var(--line); }
.story:active { transform: scale(.96); }
.story__media {
  position: absolute; inset: 3px; border-radius: 17px; overflow: hidden;
  background: var(--surface); border: 2px solid var(--bg);
}
.story__media video, .story__media img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; display: block; }
.story__media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.62) 0%, rgba(0,0,0,0) 58%);
}
.story__title {
  position: absolute; left: 12px; right: 10px; bottom: 11px; z-index: 1;
  font-size: 14px; font-weight: 700; line-height: 1.18; color: #fff; text-align: left;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 6px rgba(0,0,0,.35);
}

.sv { position: fixed; inset: 0; z-index: 140; }
.sv__bg { position: absolute; inset: 0; background: #000; opacity: 0; transition: opacity .25s; }
.sv.is-open .sv__bg { opacity: 1; }
.sv__card {
  position: absolute; inset: 0; overflow: hidden; background: #000; color: #fff;
  opacity: 0; transition: opacity .2s;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.sv.is-open .sv__card { opacity: 1; }
.sv__stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.sv__video, .sv__img { position: relative; width: 100%; height: 100%; object-fit: contain; }
.sv__blur {
  position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px);
  object-fit: cover; filter: blur(28px) brightness(.55); transform: scale(1.1);
}
.sv__stage.is-vertical .sv__video, .sv__stage.is-vertical .sv__img { object-fit: cover; }
.sv__stage.is-vertical .sv__blur { display: none; }
.sv__top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3;
  padding: calc(10px + var(--safe-t)) 12px 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,.5), rgba(0,0,0,0));
  transition: opacity .2s;
}
.sv__bars { display: flex; gap: 4px; }
.sv__bar { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.35); overflow: hidden; }
.sv__bar i { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }
.sv__head { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.sv__title { flex: 1; font-size: 16px; font-weight: 700; padding-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv__btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: rgba(255,255,255,.14); }
.sv__btn[hidden] { display: none; }
.sv__tap { position: absolute; top: 90px; bottom: 120px; z-index: 2; }
.sv__tap--prev { left: 0; width: 32%; }
.sv__tap--next { right: 0; width: 68%; }
.sv__foot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 26px var(--pad) calc(22px + var(--safe-b));
  background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0));
  transition: opacity .2s;
}
.sv__foot:empty { display: none; }
.sv__desc { font-size: 15px; line-height: 1.4; white-space: pre-line; margin-bottom: 14px; }
.sv__goto { width: 100%; height: 54px; border-radius: var(--pill); background: #fff; color: #111; font-size: 16px; font-weight: 700; }
.sv.is-hold .sv__top, .sv.is-hold .sv__foot { opacity: 0; }

/* Блюдо, к которому перешли из акции/истории: остальные тускнеют, у нужного — рамка и плашка */
.has-spot .item { transition: opacity .35s ease, filter .35s ease; }
.has-spot .item:not(.is-spot) { opacity: .28; filter: grayscale(.4); }
.item.is-spot { position: relative; z-index: 2; border-radius: 14px; animation: spot-ring 1.05s ease-out 3; }
.item.is-spot::after {
  content: attr(data-spot); position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--dark); color: var(--on-dark); font-size: 13px; font-weight: 700; line-height: 1;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.18);
  animation: spot-tag 3.2s ease forwards; pointer-events: none;
}
@keyframes spot-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--dark) 55%, transparent), 0 0 0 2px var(--dark); }
  100% { box-shadow: 0 0 0 16px transparent, 0 0 0 2px var(--dark); }
}
@keyframes spot-tag { 0% { opacity: 0; transform: translate(-50%, 6px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .item.is-spot { animation: none; box-shadow: 0 0 0 2px var(--dark); } .item.is-spot::after { animation: none; } }
