/* Витрина кафе.
   Фирменные цвета и шрифт вынесены в переменные: когда заказчик пришлёт
   логотип и палитру заведения, меняется только этот блок, а не вёрстка. */

:root {
  --ink: #1b1b1d;
  --ink-soft: #5c5c66;
  --line: #e6e4e0;
  --bg: #ffffff;
  --bg-soft: #f7f5f2;
  --accent: #d8362a;
  --accent-ink: #ffffff;
  --warn-bg: #fff6e6;
  --warn-line: #f0d199;

  --radius: 14px;
  --wrap: 1180px;
  --gap: 20px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

/* Скрытое скриптом остаётся скрытым: display у .btn иначе перебивает атрибут. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 16px;
}

.muted { color: var(--ink-soft); font-size: 14px; }

/* --- шапка --- */

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: var(--gap);
  min-height: 68px;
  flex-wrap: wrap;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-right: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 500;
}

.nav__phone { white-space: nowrap; font-weight: 700; }

/* тумблер точек: у заказчика их две, у каждой своё меню и адрес */
.switch { display: flex; gap: 6px; background: var(--bg-soft); padding: 4px; border-radius: 999px; }
.switch form { margin: 0; }

.switch__btn {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ink-soft);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.switch__btn--on { background: var(--bg); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.switch__btn:hover { color: var(--ink); }

/* --- блоки --- */

.hero { padding: 44px 0 32px; }
.hero__title { font-size: clamp(28px, 5vw, 44px); line-height: 1.1; margin: 0 0 12px; letter-spacing: -0.02em; }
.hero__line { margin: 4px 0; color: var(--ink-soft); }

.page-title { font-size: clamp(24px, 4vw, 34px); margin: 32px 0 20px; letter-spacing: -0.02em; }

.block { margin: 40px 0; }
.block__title { font-size: 22px; margin: 0 0 18px; letter-spacing: -0.01em; }

.btn {
  display: inline-block;
  margin-top: 18px;
  padding: 13px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  border: 1px solid var(--line);
}

.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--primary:hover { filter: brightness(0.94); }

.notice {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px auto;
  color: var(--ink-soft);
}

.notice--warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--ink); }

/* --- сетка блюд --- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--gap);
}

.dish {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  transition: box-shadow .15s ease, transform .15s ease;
}

.dish:hover { box-shadow: 0 6px 20px rgba(0,0,0,.07); transform: translateY(-2px); }
.dish--out { opacity: .55; }
.dish--out:hover { transform: none; box-shadow: none; }

/* Цена прижата к низу карточки: описания у блюд разной длины, и без этого
   в одном ряду цены висят на разной высоте — ряд читается как поехавший.
   Поймано снимком боевого 29.08.2026 (Боржоми без описания рядом с
   аджапсандали на восемь строк). */
.dish__link {
  display: flex;
  flex-direction: column;
  padding: 0 0 16px;
  height: 100%;
}

.dish__photo { position: relative; aspect-ratio: 4 / 3; background: var(--bg-soft); }
.dish__photo img { width: 100%; height: 100%; object-fit: cover; }

/* Слот под фото: пока фудфотограф заказчика не снял блюда, здесь честная
   заглушка правильных пропорций, а не сгенерированная картинка. */
.dish__photo-empty {
  display: block;
  width: 100%;
  height: 100%;
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(0,0,0,.03) 12px 24px),
    var(--bg-soft);
}

.dish__badge {
  position: absolute;
  left: 12px;
  top: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
}

/* Раздел над названием: в меню он стоит заголовком секции, а в подборке на
   главной блюда вырваны из разделов, и короткое название кассы («Жареные
   классический 1шт») без него не читается. */
.dish__razdel {
  margin: 12px 16px 0;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: .02em;
}
.dish__razdel + .dish__name { margin-top: 2px; }
.dish__name { font-size: 17px; margin: 14px 16px 6px; line-height: 1.25; }
.dish__text { margin: 0 16px 12px; color: var(--ink-soft); font-size: 14px; }

.dish__bottom { display: flex; align-items: baseline; gap: 10px; margin: auto 16px 0; }
.dish__price { font-size: 18px; font-weight: 700; }
.dish__weight { color: var(--ink-soft); font-size: 14px; }

/* --- категории и якоря --- */

.cats { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }

.cats__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
}

.cats__item:hover { border-color: var(--ink); }
.cats__count { color: var(--ink-soft); font-size: 13px; }

.anchors {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 68px;
  background: var(--bg);
  z-index: 5;
}

.anchors a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; background: var(--bg-soft); font-size: 14px; }
.anchors a:hover { background: var(--line); }

/* --- карточка блюда --- */

.crumbs { margin: 24px 0 16px; color: var(--ink-soft); font-size: 14px; display: flex; gap: 8px; }
.crumbs a:hover { color: var(--ink); }

.card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin-bottom: 48px; }
.card__photo { aspect-ratio: 4 / 3; background: var(--bg-soft); border-radius: var(--radius); overflow: hidden; }
.card__photo img { width: 100%; height: 100%; object-fit: cover; }
.card__name { font-size: clamp(24px, 3.5vw, 34px); margin: 0 0 14px; letter-spacing: -0.02em; }
.card__text { color: var(--ink-soft); margin: 0 0 20px; }
.card__meta { display: flex; align-items: baseline; gap: 14px; }
.card__price { font-size: 26px; font-weight: 700; }

/* --- подвал --- */

.footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 28px 0 40px; background: var(--bg-soft); }
.footer__inner { display: flex; justify-content: space-between; gap: var(--gap); flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); }
.footer__name { font-weight: 700; color: var(--ink); margin-bottom: 4px; }

/* --- узкие экраны --- */

@media (max-width: 720px) {
  .topbar__inner { min-height: 60px; padding-top: 10px; padding-bottom: 10px; }
  .logo { font-size: 18px; }
  .switch { order: 3; width: 100%; overflow-x: auto; }
  .nav { gap: 14px; font-size: 15px; }
  .anchors { top: 0; }
  .card { grid-template-columns: 1fr; gap: 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .dish__razdel { margin: 10px 12px 0; font-size: 11px; }
  .dish__name { font-size: 15px; margin: 12px 12px 4px; }
  .dish__text { margin: 0 12px 10px; font-size: 13px; }
  .dish__bottom { margin: auto 12px 0; }
}

/* --- согласие на обработку данных ---
   Флажок намеренно оставлен родным: перерисованный чекбокс легко «теряется»
   на чужой теме, а гость обязан видеть, что именно он отмечает. */

.consent { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 20px; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.consent__box { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--accent); }
.consent a { color: inherit; }
.consent--bad { color: var(--accent); }
.consent--bad .consent__box { outline: 2px solid var(--accent); outline-offset: 2px; }

.footer__legal { margin-top: 10px; }
.footer__legal a { color: inherit; }
.footer__author { margin-top: 18px; font-size: 13px; color: var(--ink-soft); opacity: .8; }
.footer__author a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* --- текстовые документы: политика, оферта --- */

.doc { max-width: 760px; }
.doc h2 { font-size: 20px; margin: 32px 0 10px; }
.doc p, .doc li { color: var(--ink-soft); line-height: 1.65; }
.doc ul { padding-left: 20px; margin: 10px 0 16px; }
.doc li { margin-bottom: 6px; }
.doc strong { color: var(--ink); }

/* --- формы: поля, радио, количество ---
   Подпись над полем, а не сбоку: на телефоне подпись сбоку съедает половину
   ширины ввода, и адрес набирается в щель. */

.field { display: block; margin-bottom: 16px; }
.field__title { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; }

/* Карта гостя: кнопка и подпись стоят в строку, а когда подпись не влезает —
   уходит под кнопку целиком. Без flex её вторая строка обтекала кнопку и
   начиналась от левого края: на телефоне это читается как поехавшая вёрстка.
   Ответы проверки бывают длиннее исходной подписи («баллов пока нет, начислим
   за этот заказ»), так что дело не только в первом экране. */
[data-loyalty] { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
[data-loyalty] .field__title { flex-basis: 100%; margin-bottom: 0; }
[data-loyalty] [data-loyalty-answer] { flex: 1 1 240px; }

.input {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
}
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.input::placeholder { color: #a8a49e; }
.input--bad { border-color: var(--accent); background: #fff8f7; }
textarea.input { resize: vertical; min-height: 88px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: right 18px center, right 13px center; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 36px; }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; margin: 0 0 16px; }
legend { padding: 0 6px; font-size: 14px; color: var(--ink-soft); }

.radio { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; }
.radio input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; }

.qty { display: flex; align-items: center; gap: 10px; }
.qty__label { font-size: 14px; color: var(--ink-soft); }
.qty__input { width: 72px; padding: 10px 12px; font: inherit; font-size: 16px; text-align: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }

.btn--ghost { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--ink-soft); }

/* --- корзина --- */

.lines { display: flex; flex-direction: column; gap: 2px; margin-bottom: 24px; }
.line { display: grid; grid-template-columns: 72px 1fr auto auto auto; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line--out { opacity: 0.55; }
.line__photo { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--bg-soft); }
.line__body { min-width: 0; }
.line__name { font-weight: 600; margin-bottom: 4px; }
.line__out { font-size: 13px; color: var(--accent); }
.line__qty { display: flex; align-items: center; gap: 8px; }
.line__total { font-weight: 700; white-space: nowrap; min-width: 84px; text-align: right; }
.line__remove { background: none; border: 0; padding: 8px; font: inherit; font-size: 14px; color: var(--ink-soft); cursor: pointer; border-radius: 8px; }
.line__remove:hover { color: var(--accent); background: var(--bg-soft); }

.total { border-top: 2px solid var(--ink); padding-top: 16px; margin-bottom: 24px; }
.total__row { display: flex; justify-content: space-between; gap: 20px; padding: 5px 0; color: var(--ink-soft); }
.total__row--big { font-size: 20px; font-weight: 700; color: var(--ink); padding-top: 10px; }

/* --- оформление ---
   Сводка держится рядом при прокрутке: гость видит сумму, пока заполняет адрес. */

.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.checkout__form { min-width: 0; }
.checkout__summary { position: sticky; top: 20px; background: var(--bg-soft); border-radius: var(--radius); padding: 20px 22px 24px; }

.summary { margin-bottom: 18px; padding: 0; list-style: none; }
.summary__row { display: flex; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: 15px; border-bottom: 1px solid var(--line); }
.summary__row:last-child { border-bottom: 0; }

/* --- карточка блюда: добавки и заказ --- */

.card__body { min-width: 0; }
.order-form { margin-top: 24px; }
.order-form__bottom { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 20px; }

.options { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 18px; }
.options__title { font-weight: 600; margin-bottom: 4px; }
.options__req { font-size: 13px; color: var(--accent); margin-bottom: 10px; }
.options__row { display: flex; align-items: center; gap: 10px; padding: 7px 0; cursor: pointer; }
.options__row input { width: 20px; height: 20px; accent-color: var(--accent); flex: 0 0 auto; }
.options__name { flex: 1 1 auto; }
.options__price { color: var(--ink-soft); white-space: nowrap; }

/* --- страница заказа --- */

.order { max-width: 720px; }
.order__block { margin-bottom: 28px; }
.hero--order { background: var(--bg-soft); border-radius: var(--radius); padding: 28px 30px; margin-bottom: 28px; }

/* --- корзина в шапке и всплывающие сообщения --- */

.nav__cart--full { font-weight: 700; }
.nav__count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; }
.notice--flash { background: var(--bg-soft); border-color: var(--line); }

@media (max-width: 900px) {
  .checkout { grid-template-columns: 1fr; gap: 24px; }
  /* 🩸 30.08.2026: в одну колонку сводка вставала ПОСЛЕ формы, то есть «Итого» и состав
     заказа оказывались НИЖЕ кнопки «Оформить заказ». Гость с телефона подтверждал заказ,
     не видя суммы — а доставку открывают с телефона чаще, чем с ноутбука. Поднимаем
     сводку над формой: сначала что и почём, потом поля. */
  .checkout__summary { position: static; order: -1; }
}

@media (max-width: 720px) {
  .line { grid-template-columns: 56px 1fr auto; grid-template-areas: "photo body total" "photo qty remove"; gap: 10px 12px; align-items: start; }
  .line__photo { grid-area: photo; width: 56px; height: 56px; }
  .line__body { grid-area: body; }
  .line__qty { grid-area: qty; }
  .line__total { grid-area: total; min-width: 0; }
  .line__remove-form { grid-area: remove; justify-self: end; }
  .line__remove { padding: 4px 8px; }
  .hero--order { padding: 20px 18px; }
  .checkout__summary { padding: 18px 16px 20px; }
}

/* --- мои заказы --- */

.zakazy { list-style: none; padding: 0; margin: 20px 0 0; display: flex; flex-direction: column; gap: 12px; }
.zakaz { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.zakaz__head { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; margin-bottom: 8px; }
.zakaz__number { font-weight: 700; color: var(--ink); text-decoration: none; }
.zakaz__number:hover { color: var(--accent); }
.zakaz__status { font-size: 14px; color: var(--ink-soft); }
.zakaz__lines { font-size: 14px; margin-bottom: 14px; }
.zakaz__bottom { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.zakaz__total { font-size: 18px; font-weight: 700; }

/* --- поверхности браузера ---
   Всё, что рисует сам браузер и потому обычно остаётся дефолтным:
   выделение текста, курсор в поле, обводка при ходьбе табом, полоса прокрутки. */

::selection { background: var(--accent); color: var(--accent-ink); }
.input, .textarea { caret-color: var(--accent); }

/* Видимая обводка при навигации с клавиатуры. Мышью она не появляется:
   гостю с мышью она мешает, гостю без мыши без неё сайт непроходим. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
[tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Цены и суммы моноширинными цифрами: при пересчёте корзины итог
   не пляшет по ширине, а колонка сумм стоит ровно. */
.dish__price, .card__price, .line__total, .total__row, .options__price,
.zakaz__total { font-variant-numeric: tabular-nums; }

/* Ссылки внутри текста (политика, описания) — подчёркивание не режет буквы. */
.prose a, .policy a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* Полоса прокрутки под палитру сайта, а не системная серая. */
html { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* --- меньше движения ---
   В системе стоит галочка «уменьшить анимацию» — у части людей движение
   вызывает тошноту и головокружение. Гасим сдвиги, оставляем цвет. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .dish:hover { transform: none; }
}

.hero__cuisine { margin: -6px 0 12px; font-size: 17px; color: var(--accent); font-weight: 600; letter-spacing: .01em; }

/* --- количество в корзине ---
   Минус и плюс вместо отдельной кнопки «Пересчитать»: на телефоне лишнее
   нажатие стоит заказов. Зона нажатия 40 пикселей — попадают пальцем. */

.qty { display: flex; align-items: center; gap: 6px; }
.qty__btn {
  width: 40px; height: 40px; flex: none;
  border: 1px solid var(--line); background: var(--bg);
  border-radius: 10px; color: var(--ink);
  font-size: 20px; line-height: 1; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.qty__btn:hover { border-color: var(--ink-soft); }
.qty__btn:disabled { opacity: .35; cursor: default; }
.qty .qty__input { width: 56px; height: 40px; text-align: center; }
