/* ============================================================
   Ayvan · e-menu · версия 1
   Мир взят из самого зала: ночная тушь, слоновая кость ганча,
   латунь люстры. Светлая тема — тот же зал днём.
   Контрасты замерены, значения в комментариях.
   ============================================================ */

/* ---------- токены: тёмная тема (база) ---------- */

:root {
  color-scheme: dark;

  --bg:        #100E0C;
  --surface:   #17130F;
  --surface-2: #1E1913;
  --raised:    #262019;

  --fg:        #F2EADB;                     /* 15.5:1 на карточке */
  --fg-2:      rgba(242, 234, 219, .68);    /*  7.6:1 */
  --fg-3:      rgba(242, 234, 219, .55);    /*  5.3:1 */

  --accent:    #C6A15B;                     /*  7.6:1 */
  --accent-hi: #E3C68C;                     /* 11.2:1 */
  --on-accent: #100E0C;                     /*  7.9:1 на золоте */

  --line:      rgba(198, 161, 91, .22);
  --line-soft: rgba(242, 234, 219, .11);
  --veil:      rgba(8, 7, 6, .66);

  --shadow-sheet: 0 -18px 48px rgba(0, 0, 0, .55);
  --shadow-card:  0 2px 10px rgba(0, 0, 0, .28);

  --hero-veil-2: rgba(14, 10, 5, .52);      /* у самого текста */
  --hero-veil-3: rgba(14, 10, 5, .22);      /* к середине сходит на нет */

  --ornament-ink: #C6A15B;
  --ornament-op: .30;
}

/* ---------- светлая тема ---------- */

/* Тот же зал днём: песочный ганч стен и слоновая кость скатерти.
   Белого здесь нет намеренно — карточка на белом не отделялась от листа.
   Значения стоят в одном месте, ниже их только раскладывают по токенам:
   раньше палитра была записана дважды и любую правку приходилось делать
   в двух местах. Контрасты замерены на карточке. */

:root {
  --d-bg:        #E5DAC2;                   /* страница — песочный ганч */
  --d-surface:   #FAF4E8;                   /* карточка — слоновая кость */
  --d-surface-2: #F0E7D6;
  --d-raised:    #F5EDDD;

  --d-fg:        #221A10;                   /* 15.7:1 */
  --d-fg-2:      rgba(34, 26, 16, .78);     /*  8.0:1 */
  --d-fg-3:      rgba(34, 26, 16, .62);     /*  5.0:1 */

  --d-accent:    #8A6A28;                   /*  4.6:1 */
  --d-accent-hi: #6E5420;                   /*  6.5:1 — им набраны цены */
  --d-on-accent: #FAF4E8;

  --d-line:      rgba(138, 106, 40, .34);
  --d-line-soft: rgba(34, 26, 16, .16);
  --d-veil:      rgba(60, 48, 30, .40);

  --d-shadow-sheet: 0 -18px 48px rgba(74, 56, 24, .20);
  --d-shadow-card:  0 1px 2px rgba(74, 56, 24, .10), 0 6px 16px rgba(74, 56, 24, .06);

  --d-hero-veil-2: rgba(14, 10, 5, .52);
  --d-hero-veil-3: rgba(14, 10, 5, .22);

  --d-ornament-ink: #8A6A28;
  --d-ornament-op: .26;
}

/* системная настройка */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: var(--d-bg);
    --surface: var(--d-surface);
    --surface-2: var(--d-surface-2);
    --raised: var(--d-raised);

    --fg: var(--d-fg);
    --fg-2: var(--d-fg-2);
    --fg-3: var(--d-fg-3);

    --accent: var(--d-accent);
    --accent-hi: var(--d-accent-hi);
    --on-accent: var(--d-on-accent);

    --line: var(--d-line);
    --line-soft: var(--d-line-soft);
    --veil: var(--d-veil);

    --shadow-sheet: var(--d-shadow-sheet);
    --shadow-card: var(--d-shadow-card);

    --hero-veil-2: var(--d-hero-veil-2);
    --hero-veil-3: var(--d-hero-veil-3);

    --ornament-ink: var(--d-ornament-ink);
    --ornament-op: var(--d-ornament-op);
  }
}

/* переключатель в шапке */
html[data-theme="light"] {
  color-scheme: light;
    --bg: var(--d-bg);
    --surface: var(--d-surface);
    --surface-2: var(--d-surface-2);
    --raised: var(--d-raised);

    --fg: var(--d-fg);
    --fg-2: var(--d-fg-2);
    --fg-3: var(--d-fg-3);

    --accent: var(--d-accent);
    --accent-hi: var(--d-accent-hi);
    --on-accent: var(--d-on-accent);

    --line: var(--d-line);
    --line-soft: var(--d-line-soft);
    --veil: var(--d-veil);

    --shadow-sheet: var(--d-shadow-sheet);
    --shadow-card: var(--d-shadow-card);

    --hero-veil-2: var(--d-hero-veil-2);
    --hero-veil-3: var(--d-hero-veil-3);

    --ornament-ink: var(--d-ornament-ink);
    --ornament-op: var(--d-ornament-op);
}

/* Смена темы: на 300 мс всем элементам включаются цветовые переходы,
   и палитра перетекает, а не щёлкает. Класс вешает и снимает toggleTheme.
   Шторки и счётчик исключены: у них свои переходы трансформаций,
   и этот список их бы затёр. */
html.theme-anim,
html.theme-anim *:not(.sheet__card):not(.flip):not(.search):not(.billbar):not(.tally):not(.tally__n) {
  transition: background-color .28s var(--ease), color .28s var(--ease),
              border-color .28s var(--ease), fill .28s var(--ease) !important;
}

/* Узкие экраны: шапке не хватает места на подпись языка, и она распирала
   страницу горизонтальной прокруткой. Остаётся глобус — тапается так же. */
@media (max-width: 374px) {
  #lang-label { display: none; }
  .langbtn { gap: 0; }
  .top__actions { gap: 6px; }
}

/* ---------- шкалы ---------- */

:root {
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 22px; --s6: 30px; --s7: 42px;

  --r-s: 10px; --r-m: 14px; --r-l: 22px;

  --pad: 16px;
  --top-h: 54px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  /* Прежняя кривая была почти отвесной: девять десятых пути шторка проходила
     за первые сто миллисекунд и будто щёлкала на месте. Эта разгоняется мягче
     и тормозит дольше. Читается из JS — перелёт фотографии идёт по ней же. */
  --sheet-ease: cubic-bezier(.32, .72, 0, 1);
  --sheet-ms: 480ms;

  --font-display: 'Cormorant Garamond', 'Songti SC', 'Noto Serif CJK SC', serif;
  --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
             'Hiragino Sans GB', 'Microsoft YaHei', Roboto, Arial, sans-serif;
}

html[data-ui-lang="zh"] {
  --font-display: 'Songti SC', 'Noto Serif CJK SC', 'Source Han Serif SC', 'STSong',
                  'Cormorant Garamond', serif;
}

/* ---------- база ---------- */

* { box-sizing: border-box; }

/* атрибут hidden обязан побеждать любой display ниже */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--accent) transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.45;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  caret-color: var(--accent);
}

body.is-locked { overflow: hidden; }

img { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }

svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5;
      stroke-linecap: round; stroke-linejoin: round; }

/* поверхности, которые рисует браузер, тоже часть дизайна */
::selection { background: var(--accent); color: var(--on-accent); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent-hi);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- общие детали ---------- */

.ornament { background-color: var(--surface-2); position: relative; overflow: hidden; }
.ornament::after {
  content: ''; position: absolute; inset: 0;
  background: var(--ornament-ink);
  opacity: var(--ornament-op);
  -webkit-mask: url(../assets/img/ornament-mask.svg) var(--orn-pos, center) / var(--orn-size, 112px);
  mask: url(../assets/img/ornament-mask.svg) var(--orn-pos, center) / var(--orn-size, 112px);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 20px;
  border: 0; border-radius: 100px;
  background: var(--accent); color: var(--on-accent);
  font-size: 15px; font-weight: 600;
  text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), filter .18s var(--ease);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }

/* Кнопка на обложке. Прежняя была полупрозрачной тёмной: над светлой
   фотографией она превращалась в серое пятно и не читалась как кнопка.
   Теперь это латунь люстры, тот же материал, что арка над заголовком,
   а буквы на ней — цвет зала ночью. */
.btn--hero {
  background: linear-gradient(180deg, #E8CE97, #C9A45E);
  color: #17130F;
  border: 0;
  padding: 0 18px 0 22px;
  font-weight: 600; letter-spacing: .01em;
  box-shadow: 0 2px 6px rgba(12, 8, 3, .28), 0 10px 26px rgba(12, 8, 3, .22);
}
.btn--hero svg { width: 16px; height: 16px; stroke-width: 1.8; opacity: .8; }
.btn--hero:hover { filter: brightness(1.05); }

.btn--line { background: transparent; color: var(--fg); border: 1px solid var(--line); font-weight: 500; }

.iconbtn, .langbtn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; min-width: 38px; padding: 0 11px;
  border: 1px solid var(--line-soft); border-radius: 100px;
  background: color-mix(in srgb, var(--fg) 6%, transparent);
  cursor: pointer;
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.iconbtn { width: 38px; padding: 0; justify-content: center; }
.iconbtn, .langbtn { position: relative; }
.iconbtn::before, .langbtn::before { content: ''; position: absolute; inset: -3px -2px; }
.iconbtn svg, .langbtn svg { width: 17px; height: 17px; stroke-width: 1.4; opacity: .9; }
.langbtn span { font-size: 13px; }
.iconbtn:hover, .langbtn:hover { border-color: var(--line); background: color-mix(in srgb, var(--fg) 11%, transparent); }

/* ---------- шапка ---------- */

.top {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  height: calc(var(--top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--pad) 0;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.top.is-stuck { border-bottom-color: var(--line); }

.top__brand {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 8px 6px; margin-left: -6px;
  min-height: 44px; cursor: pointer;
}
.top__mark {
  width: 39px; height: 26px; background: var(--fg);
  -webkit-mask: url(../assets/img/logo-house.png) center / contain no-repeat;
  mask: url(../assets/img/logo-house.png) center / contain no-repeat;
}
.top__name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; line-height: 1;
}
.top__actions { display: flex; align-items: center; gap: 6px; }

/* ---------- заставка: видео с открывающейся книгой меню ----------

   Вертикальный ролик 720×1280 заполняет экран телефона целиком (cover);
   на широком экране кадрируется по центру. Фон под видео тёмный, чтобы
   первые кадры не мигали белым, пока ролик буферизуется. */

.splash {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: #17130e;
  transition: opacity .8s cubic-bezier(.4, 0, .2, 1);
}
.splash.is-done { opacity: 0; pointer-events: none; }
.splash.is-done .splash__video {
  transform: scale(1.06);
  transition: transform .8s cubic-bezier(.4, 0, .2, 1);
}

.splash__video {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}

@media (prefers-reduced-motion: reduce) {
  .splash__video { display: none; }
  .splash.is-done .splash__video { transform: none; }
}

/* на фотографии текст светлый в любой теме — переопределяем токены локально */
.hero {
  --fg:   #F6F0E4;
  --fg-2: rgba(246, 240, 228, .78);
  --fg-3: rgba(246, 240, 228, .62);
  --accent: #E3C68C;
  color: var(--fg);
  position: relative;
  min-height: 62svh;
  display: flex; align-items: flex-end;
  margin-top: calc(-1 * (var(--top-h) + env(safe-area-inset-top)));
  padding: calc(var(--top-h) + var(--s6)) var(--pad) var(--s6);
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
/* Два разных слоя, и путать их нельзя.

   Первый по-настоящему мутит фотографию: `backdrop-filter` размывает то, что за
   ним, а маска решает, где размытие сильное, а где его нет вовсе. У арок наверху
   снимок остаётся резким, к низу, где ложится текст, он уходит в стекло.

   Второй только притеняет — ровно настолько, чтобы светлые буквы держали
   контраст, и узкой полосой внизу сводит обложку в цвет страницы. Раньше всю
   работу делал он один, поэтому на снимок ложилась плёнка вместо размытия. */
.hero__blur {
  position: absolute; inset: 0;
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  -webkit-mask-image: linear-gradient(to top, #000 18%, rgba(0, 0, 0, .6) 34%, rgba(0, 0, 0, .2) 46%, transparent 58%);
  mask-image: linear-gradient(to top, #000 18%, rgba(0, 0, 0, .6) 34%, rgba(0, 0, 0, .2) 46%, transparent 58%);
}
.hero__veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    var(--bg) 0%,
    var(--hero-veil-2) 16%,
    var(--hero-veil-3) 42%,
    transparent 66%);
}
.hero__body { position: relative; width: 100%; }
.hero__mark {
  display: block; width: 84px; height: 56px; background: var(--fg);
  margin-bottom: var(--s3);
  filter: drop-shadow(0 1px 2px rgba(10, 7, 3, .65)) drop-shadow(0 0 10px rgba(10, 7, 3, .35));
  -webkit-mask: url(../assets/img/logo-house.png) center / contain no-repeat;
  mask: url(../assets/img/logo-house.png) center / contain no-repeat;
}
.hero__title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(46px, 15vw, 76px);
  font-weight: 400; letter-spacing: .05em; text-transform: uppercase;
  line-height: .95; margin: 0 0 var(--s2);
  text-shadow: 0 1px 16px rgba(10, 7, 3, .38);
}
.hero__sub {
  margin: 0 0 var(--s1); max-width: 24em; font-size: 15.5px; color: var(--fg-2);
  text-shadow: 0 1px 10px rgba(10, 7, 3, .45);
}
.hero__meta { margin: 0 0 var(--s4); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--fg-3); }

.hero__mark, .hero__title, .hero__sub, .hero__meta, .hero .btn { animation: rise .45s var(--ease) both; }
.hero__title { animation-delay: .04s; }
.hero__sub   { animation-delay: .08s; }
.hero__meta  { animation-delay: .12s; }
.hero .btn   { animation-delay: .16s; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* сокращённое движение — не нулевое: перемещение убираем, проявление оставляем */
@media (prefers-reduced-motion: reduce) {
  .hero__mark, .hero__title, .hero__sub, .hero__meta, .hero .btn {
    animation: fadeIn .2s ease both;
  }
  /* шторка не выезжает, а проявляется — движение убрано, событие осталось */
  .sheet__card { transition: opacity .18s ease; transform: none; opacity: 0; }
  .sheet.is-open .sheet__card { opacity: 1; }
}

/* ---------- навигация ---------- */

.nav {
  position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top));
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--line);
  padding-top: var(--s2);
}

.nav__groups {
  display: flex; gap: 3px;
  margin: 0 var(--pad) var(--s2);
  padding: 3px;
  background: color-mix(in srgb, var(--fg) 7%, transparent);
  border-radius: 100px;
}
.nav__group {
  flex: 1; min-height: 44px;
  border: 0; border-radius: 100px; background: transparent;
  color: var(--fg-2); font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: color .22s var(--ease), background-color .22s var(--ease);
}
.nav__group:hover { color: var(--fg); }
.nav__group[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }

.nav__chips-wrap { position: relative; }
.nav__chips-wrap::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 30px;
  background: linear-gradient(to left, var(--bg), transparent);
  pointer-events: none;
}
.nav__chips {
  display: flex; gap: 6px;
  padding: 0 var(--pad) var(--s2);
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.nav__chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  min-height: 32px; padding: 0 14px;
  border: 1px solid var(--line-soft); border-radius: 100px;
  background: transparent; color: var(--fg-2);
  font-size: 13.5px; white-space: nowrap; cursor: pointer;
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease);
}
.chip { position: relative; }
.chip::before { content: ''; position: absolute; inset: -6px -2px; }   /* 32 + 12 = 44 */
.chip:hover { color: var(--fg); border-color: var(--line); }
.chip.is-active {
  color: var(--accent-hi); border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* ---------- «сегодня закончилось» ---------- */

/* Блюдо остаётся в меню — гость видит, что оно бывает, — но карточка
   приглушена, фото обесцвечено, счётчика нет. */
.dishwrap--stop .dish { opacity: .62; }
.dishwrap--stop .dish__media img { filter: grayscale(.85); }
.tag--stop {
  color: var(--fg-2);
  border-color: var(--line-soft);
  background: color-mix(in srgb, var(--fg) 7%, transparent);
}
.dish__min { font-size: 11.5px; color: var(--accent-hi); white-space: nowrap; }

/* ---------- счёт гостя ---------- */

/* Счётчик лежит рядом с карточкой, а не внутри неё: карточка сама кнопка,
   а кнопку в кнопку вкладывать нельзя. Обёртка нужна только чтобы дать
   счётчику точку отсчёта. */
.dishwrap { position: relative; display: block; }
.dishwrap > .dish { height: 100%; }

.tally {
  position: absolute; z-index: 2;
  display: inline-flex; align-items: center;
  border-radius: 100px;
  background: color-mix(in srgb, var(--raised) 92%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .14);
  transition: background-color .2s var(--ease), border-color .2s var(--ease);
}
.dishwrap .tally { right: 8px; bottom: 8px; }

.tally.is-on { background: var(--accent); border-color: transparent; }

.tally__btn {
  position: relative;
  width: 40px; height: 40px; padding: 0;
  border: 0; background: none; cursor: pointer;
  color: var(--accent-hi);
  display: grid; place-items: center;
}
.tally.is-on .tally__btn { color: var(--on-accent); }
.tally__btn svg { width: 17px; height: 17px; stroke-width: 2; }
/* палец толще кружка: невидимая подложка добирает зону нажатия до 46 px */
.tally__btn::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; }
.tally__btn:active { transform: scale(.92); }

.tally__n {
  min-width: 18px; text-align: center;
  font-size: 14.5px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--on-accent);
}

/* Пока пусто — виден только плюс. Минус и число не прячутся display'ем,
   а сложены в ноль ширины: так пилюля раскрывается плавно, а не рывком. */
.tally [data-bill-minus],
.tally__n {
  max-width: 40px;
  transition: max-width .25s var(--ease), opacity .2s var(--ease);
  overflow: hidden;
}
.tally:not(.is-on) [data-bill-minus],
.tally:not(.is-on) .tally__n {
  /* min-width побеждает max-width, поэтому его тоже надо в ноль —
     иначе вместо круга получается овал с пустотой вместо числа */
  max-width: 0; min-width: 0; opacity: 0; pointer-events: none;
}

/* Счётчик стоит в правом нижнем углу, поэтому потесниться должна одна строка —
   та, где цена и выход. Название и состав остаются во всю ширину карточки:
   на телефоне отступ во весь блок съедал бы половину описания.
   Пока в счёте пусто, счётчик — кружок, и хватает узкой полосы; как только
   гость добавил позицию, он разворачивается в пилюлю, и отступ вырастает. */
/* Кнопка не ложится на текст никогда: вся правая колонка карточки
   зарезервирована под неё. Пока это кружок — колонка узкая, набрал
   позицию — колонка расширяется вместе с пилюлей. Селектор с .dish
   нужен для веса: правило про .dish--photo ниже по файлу задаёт body
   свой padding и иначе перекрывает этот. */
.dishwrap > .dish .dish__body { padding-right: 58px; transition: padding-right .25s var(--ease); }
.dishwrap:has(.tally.is-on) > .dish .dish__body { padding-right: 108px; }
.dishwrap .dish__foot { padding-right: 0; }

/* в компактной строке кнопки чуть мельче — подложка добирает нажатие до 44 px */
.dishwrap:not(.dishwrap--photo) .tally__btn { width: 36px; height: 36px; }
.dishwrap:not(.dishwrap--photo) .tally__btn::after { inset: -4px; }
.dishwrap:not(.dishwrap--photo) .tally.is-on .tally__n { min-width: 16px; }
.dishwrap:not(.dishwrap--photo) .tally__n { font-size: 14px; }

/* ---------- счётчик в шторке блюда ---------- */

.sheet__tally { margin-top: var(--s4); display: flex; flex-direction: column; gap: var(--s2); }
.sheet__tally:empty { display: none; }
.tallyrow {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s2) var(--s2) var(--s2) var(--s3);
  border: 1px solid var(--line-soft); border-radius: var(--r-m);
  background: var(--surface-2);
}
.sheet__tally.is-single .tallyrow__label { display: none; }
.tallyrow__label { font-size: 13px; color: var(--fg-2); }
.tallyrow__price { flex: 1; font-size: 15px; font-weight: 600; color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.tallyrow__price small { font-weight: 400; font-size: 11px; color: var(--fg-2); margin-left: 2px; }
.tally--lg { position: static; }

/* ---------- полоса внизу ---------- */

.billbar {
  position: fixed; z-index: 60;
  left: var(--pad); right: var(--pad);
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: var(--s2);
  min-height: 50px; padding: 0 16px;
  border: 0; border-radius: 100px;
  background: var(--accent); color: var(--on-accent);
  font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22), 0 14px 34px rgba(0, 0, 0, .18);
  animation: billIn .32s var(--ease) both;
}
.billbar:active { transform: scale(.985); }
.billbar__n {
  min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 100px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--on-accent) 22%, transparent);
  font-size: 13px; font-variant-numeric: tabular-nums;
}
.billbar__label { flex: 1; text-align: left; }
.billbar__sum { font-variant-numeric: tabular-nums; }
.billbar__sum small { font-weight: 400; font-size: 11.5px; opacity: .8; margin-left: 2px; }

@keyframes billIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* уходит так же, как пришла: вниз и в прозрачность; hidden ставит JS после перехода */
.billbar.is-leaving { opacity: 0; transform: translateY(14px); transition: opacity .22s var(--ease), transform .22s var(--ease); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .billbar { animation: fadeIn .2s ease both; } .billbar.is-leaving { transform: none; } }

/* полоса не должна закрывать ни кнопку «наверх», ни последнюю карточку */
body.has-bill .totop { bottom: calc(76px + env(safe-area-inset-bottom)); }
body.has-bill .foot { padding-bottom: calc(var(--s6) + 62px + env(safe-area-inset-bottom)); }

/* ---------- шторка со счётом ---------- */

.bill__list { margin: var(--s3) 0 0; }
.bill__row {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line-soft);
}
.bill__info { flex: 1; min-width: 0; }
.bill__name { display: block; font-family: var(--font-display); font-size: 16px; font-weight: 600; line-height: 1.2; }
.bill__price { display: block; margin-top: 2px; font-size: 13.5px; color: var(--accent-hi); font-variant-numeric: tabular-nums; }
.bill__price small { font-weight: 400; font-size: 11px; color: var(--fg-2); margin-left: 2px; }
.bill__unit { color: var(--fg-2); font-size: 11.5px; margin-left: 6px; }
.tally--row { position: static; }
.bill__empty { padding: var(--s5) 0; text-align: center; color: var(--fg-3); font-size: 14px; }

.bill__total {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: var(--s4); padding-top: var(--s3);
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--fg-2);
}
.bill__sum { font-size: 21px; font-weight: 600; color: var(--fg); font-variant-numeric: tabular-nums; }
.bill__sum small { font-size: 12px; font-weight: 400; color: var(--fg-2); margin-left: 3px; }
.bill__note { margin: var(--s3) 0 0; font-size: 12px; line-height: 1.45; color: var(--fg-3); }
.bill__clear { width: 100%; margin-top: var(--s4); }

/* ---------- меню ---------- */


.menu { padding-bottom: var(--s4); }
/* класс вешает renderGroup на один кадр — новое содержимое проявляется */
.menu.is-swapped, .nav__chips.is-swapped { animation: fadeIn .22s var(--ease); }

.cat { padding-top: var(--s5); scroll-margin-top: 148px; }

.cat__head { display: flex; align-items: baseline; gap: var(--s3); margin: 0 var(--pad); }
.cat__title { font-family: var(--font-display); font-size: 24px; font-weight: 600; margin: 0; line-height: 1.15; }
.cat__rule { flex: 1; height: 1px; background: var(--line); align-self: center; }
.cat__count { font-size: 11.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.cat__note {
  margin: var(--s2) var(--pad) 0; font-size: 12px; color: var(--fg-3);
  padding-left: var(--s3); border-left: 1px solid var(--line);
}

.cat__list { margin: var(--s3) var(--pad) 0; display: flex; flex-direction: column; gap: var(--s2); }

.dish {
  position: relative; display: block; width: 100%;
  padding: 0; text-align: left; cursor: pointer; color: inherit;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-m);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: border-color .2s var(--ease);
}
.dish:hover { border-color: var(--line); }

.dish--photo .dish__media {
  display: block; position: relative; aspect-ratio: 16 / 10;
  background-color: var(--surface-2); overflow: hidden;
}
.dish--photo .dish__media img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: hover) and (pointer: fine) {
  .dish--photo .dish__media img { transition: transform .2s var(--ease); }
  .dish--photo:hover .dish__media img { transform: scale(1.03); }
}
.dish--photo .dish__body { padding: var(--s3) var(--s3) var(--s3); }
.dish--photo .dish__name { font-size: 18px; }

.dish--row { display: flex; align-items: stretch; }
.dish--row .dish__media {
  flex: 0 0 78px; width: 78px; align-self: stretch; min-height: 78px;
  background-color: var(--surface-2); overflow: hidden; position: relative;
}
.dish--row .dish__media img { width: 100%; height: 100%; object-fit: cover; }
.dish--row .dish__media.ornament { --orn-size: 84px; }
.dish--row .dish__body { flex: 1; padding: var(--s2) var(--s3); min-width: 0; }
.dish--row .tag { font-size: 9.5px; letter-spacing: .03em; padding: 1px 6px; text-transform: none; }

.dish__body { display: flex; flex-direction: column; gap: 3px; }
.dish__name { display: block; font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.2; margin: 0; }
.dish__desc {
  margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--fg-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dish__foot { display: flex; align-items: baseline; gap: var(--s2); margin-top: 2px; }
.dish__price {
  font-size: 14.5px; font-weight: 600; color: var(--accent-hi);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.dish__price small { font-weight: 400; font-size: 11px; color: var(--fg-2); margin-left: 2px; }
.dish__weight { font-size: 11.5px; color: var(--fg-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

.tagrow { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 10px; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 100px;
  border: 1px solid var(--line); color: var(--accent);
}
.tag--veg   { border-color: rgba(62, 143, 139, .55); color: #6FBFB9; }
.tag--spicy { border-color: rgba(200, 90, 60, .55);  color: #E08A6E; }
html[data-theme="light"] .tag--veg   { color: #216F6A; }
html[data-theme="light"] .tag--spicy { color: #A8462A; }

/* ---------- о ресторане ---------- */

.about { margin: var(--s6) var(--pad) 0; border-top: 1px solid var(--line); padding-top: var(--s5); }
.about__photo {
  border-radius: var(--r-m); overflow: hidden; margin-bottom: var(--s4);
  background-color: var(--surface-2);
}
.about__photo img { width: 100%; height: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.about__title { font-family: var(--font-display); font-size: 23px; font-weight: 600; margin: 0 0 var(--s2); }
.about__text { margin: 0 0 var(--s4); font-size: 14px; line-height: 1.6; color: var(--fg-2); max-width: 62ch; }
.hours { margin: 0 0 var(--s4); }
.hours__title {
  margin: 0 0 var(--s2);
  font-size: 10.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-3);
}
.hours__list {
  margin: 0;
  display: grid; grid-template-columns: max-content 1fr; align-items: baseline;
  gap: 6px var(--s3);
  font-size: 13.5px; line-height: 1.3;
}
.hours__list dt { color: var(--fg-2); }
.hours__list dd { margin: 0; color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; }

.about__contacts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.about__note { margin: 0 0 var(--s1); font-size: 11.5px; color: var(--fg-3); }

.foot {
  display: flex; flex-direction: column; align-items: center; gap: var(--s2);
  padding: var(--s6) var(--pad) calc(var(--s6) + env(safe-area-inset-bottom));
  color: var(--fg-3);
}
.foot__mark {
  width: 63px; height: 42px; background: var(--fg); opacity: .75;
  -webkit-mask: url(../assets/img/logo-house.png) center / contain no-repeat;
  mask: url(../assets/img/logo-house.png) center / contain no-repeat;
}
.foot p { margin: 0; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; }

/* ---------- наверх ---------- */

.totop {
  position: fixed; right: 14px; z-index: 55;
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--raised) 92%, transparent);
  backdrop-filter: blur(10px);
  color: var(--fg-2); cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; transform: translateY(8px) scale(.9); pointer-events: none;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.totop svg { width: 18px; height: 18px; }
.totop.is-on { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- шторки ---------- */

.sheet { position: fixed; inset: 0; z-index: 96; }  /* выше поиска: блюдо открывают из его результатов */
/* пока шторка уезжает, она не должна ловить клики */
.sheet:not(.is-open) { pointer-events: none; }
.sheet__back {
  position: absolute; inset: 0; background: var(--veil);
  backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .34s var(--ease);
}
.sheet.is-open .sheet__back { opacity: 1; }

.sheet__card {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92svh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface);
  border-radius: var(--r-l) var(--r-l) 0 0;
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-sheet);
  transform: translateY(101%);
  transition: transform var(--sheet-ms) var(--sheet-ease);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.is-open .sheet__card { transform: none; }

.sheet__close {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: color-mix(in srgb, var(--bg) 65%, transparent);
  backdrop-filter: blur(8px);
  color: var(--fg); cursor: pointer; display: grid; place-items: center;
}
.sheet__close svg { width: 16px; height: 16px; }

.sheet__media { position: relative; background-color: var(--surface-2); }
.sheet__media img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }

.sheet__body { padding: var(--s4) var(--pad) var(--s5); }
.sheet__tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: var(--s2); }
.sheet__tags:empty { display: none; }
.sheet__name { font-family: var(--font-display); font-size: 25px; font-weight: 600; line-height: 1.18; margin: 0 0 var(--s2); }
.sheet__name--sm { font-size: 19px; margin: 0 0 var(--s3); }
.sheet__desc { margin: 0; font-size: 14px; line-height: 1.55; color: var(--fg-2); max-width: 58ch; }
.sheet__desc:empty { display: none; }
.sheet__foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3);
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line);
}
.sheet__weight { font-size: 12.5px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.sheet__price {
  font-family: var(--font-display); font-size: 24px; font-weight: 600;
  color: var(--accent-hi); font-variant-numeric: tabular-nums;
}
.sheet__price small { font-size: 12.5px; font-weight: 400; color: var(--fg-3); }

.sheet__card--sm { padding: var(--s4) var(--pad) var(--s5); }
.langlist { display: flex; flex-direction: column; }
.langlist button {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 50px; padding: 0 2px;
  background: none; border: 0; border-bottom: 1px solid var(--line-soft);
  color: var(--fg); font-size: 16px; cursor: pointer; text-align: left;
}
.langlist button:last-child { border-bottom: 0; }
.langlist button[aria-current="true"] { color: var(--accent-hi); }
.langlist .tick { width: 18px; height: 18px; opacity: 0; }
.langlist button[aria-current="true"] .tick { opacity: 1; }

/* ---------- поиск ---------- */

.search {
  position: fixed; inset: 0; z-index: 95;
  background: var(--bg);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(10px);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.search:not(.is-open) { pointer-events: none; }
.search.is-open { opacity: 1; transform: none; }

.search__bar {
  display: flex; align-items: center; gap: var(--s2);
  padding: calc(var(--s2) + env(safe-area-inset-top)) var(--pad) var(--s3);
  border-bottom: 1px solid var(--line);
}
.search__icon { width: 18px; height: 18px; flex: 0 0 18px; color: var(--fg-3); }
.search__bar input {
  flex: 1; min-width: 0; height: 42px;
  background: none; border: 0; outline: none; font-size: 16px; color: var(--fg);
}
.search__bar input::placeholder { color: var(--fg-3); }
.search__cancel { background: none; border: 0; color: var(--accent); font-size: 14px; cursor: pointer; padding: 8px; }
.search__results { flex: 1; overflow-y: auto; padding: var(--s3) var(--pad) var(--s7); }
.search__results .dishwrap { margin-bottom: var(--s2); }
.search__empty { padding: var(--s7) 0; text-align: center; color: var(--fg-3); font-size: 14px; }
.search__cat { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--fg-3); margin: 0 0 2px; }

/* ---------- перелёт фотографии ---------- */

.flip { position: fixed; z-index: 97; pointer-events: none; overflow: hidden; background: var(--surface-2); }
.flip img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- блюдо дня ---------- */

/* Лента над навигацией: это не раздел меню, а сегодняшнее предложение,
   поэтому она видна в любой вкладке. Карточка та же, что в ленте меню, -
   значит счётчик, метки и «сегодня закончилось» работают без отдельных
   правил. */

.specials { padding-top: var(--s5); }
.specials__title { color: var(--accent-hi); }

.specials__list {
  /* по верху, а не враспор: рядом стоят карточка с фотографией и компактная
     строка без неё, и растянутая под соседку строка превращается в пустую
     плиту с орнаментом во всю высоту */
  display: flex; align-items: flex-start; gap: var(--s3);
  margin-top: var(--s3);
  /* нижний отступ - под тень карточки, она иначе срезается прокруткой */
  padding: 0 var(--pad) 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-left: var(--pad);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.specials__list::-webkit-scrollbar { display: none; }

.specials__list > .dishwrap {
  flex: 0 0 min(76vw, 300px);
  scroll-snap-align: start;
}
/* одна позиция - незачем оставлять справа пустое место под несуществующую вторую */
.specials__list > .dishwrap:only-child { flex: 0 0 min(88vw, 420px); }

/* Кадр держим одинаковым на любой ширине: в ленте карточки узкие, и широкий
   срез из правил меню (21/9, 24/8) превратил бы фотографию в полоску. */
.specials .dish--photo .dish__media { aspect-ratio: 16 / 10; }

/* ---------- десктоп ---------- */

@media (min-width: 700px) {
  :root { --pad: 28px; }
  body { font-size: 16px; }
  .hero { min-height: 66svh; }
  .hero__sub { font-size: 17px; }
  main { max-width: 1100px; margin: 0 auto; }
  .cat__list { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); align-items: stretch; }
  .dishwrap--photo { grid-column: span 2; }
  .dish--photo .dish__media { aspect-ratio: 21 / 9; }
  /* мышью ленту не листают - на широком экране это обычный ряд с переносом.
     Потолок ширины держит одинокую карточку и «хвост» переноса от того,
     чтобы растянуться во всю строку. */
  .specials__list { flex-wrap: wrap; overflow-x: visible; }
  .specials__list > .dishwrap,
  .specials__list > .dishwrap:only-child { flex: 1 1 200px; max-width: 360px; }
  .about { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); align-items: center; }
  .about__photo { margin-bottom: 0; }
  .sheet__card {
    max-width: 600px; margin: 0 auto; border-radius: var(--r-l); bottom: auto;
    top: 50%; transform: translateY(calc(-50% + 16px)); opacity: 0;
    transition: transform var(--sheet-ms) var(--sheet-ease), opacity .24s var(--ease);
  }
  .sheet.is-open .sheet__card { transform: translateY(-50%); opacity: 1; }
  .search__results { max-width: 700px; margin: 0 auto; width: 100%; }
}

@media (min-width: 1000px) {
  .cat__list { grid-template-columns: repeat(3, 1fr); }
  .dishwrap--photo { grid-column: span 3; }
  .dish--photo .dish__media { aspect-ratio: 24 / 8; }
}

/* иконка темы: показываем ту, на которую переключимся */
#btn-theme .ico-moon { display: none; }
html[data-theme="dark"] #btn-theme .ico-sun { display: block; }
html[data-theme="dark"] #btn-theme .ico-moon { display: none; }
html[data-theme="light"] #btn-theme .ico-sun { display: none; }
html[data-theme="light"] #btn-theme .ico-moon { display: block; }
@media (prefers-color-scheme: light) {
  html:not([data-theme]) #btn-theme .ico-sun { display: none; }
  html:not([data-theme]) #btn-theme .ico-moon { display: block; }
}
