/* ===== Токены: палитра E «угли + фирменный бордо» (утверждена, см. docs/SPEC.md) ===== */
:root {
  --bg: #1b1512; --bg2: #231b17; --card: #2c221d; --card-hi: #382b24;
  --text: #f6ece2; --muted: #bca998; --line: rgba(246, 236, 226, .10);
  --accent: #a9325b; --accent-hi: #c13f6b; --accent-deep: #5e1b33; --accent-ink: #fff;
  --price: #e8b96a; --gold: #e3b23c; --open: #6cc28a;
  --brand: "Cinzel", "Forum", serif; /* у Cinzel нет кириллицы — русские буквы берутся из Forum (похожие римские капители) */
  /* Единый код форм (как в первом прототипе): всё, что нажимают, — круглое или «таблетка»;
     плитки выбора, поля ввода и карточки табло — 12; карточки, панели, карта — 18 */
  --r-pill: 999px; --r: 12px; --r-l: 18px;
  --nav-h: 57px;
}

/* ===== База ===== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* иначе display: grid/flex у класса перебивает атрибут hidden */
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text); isolation: isolate;
  font: 400 16px/1.5 "Manrope", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
/* Фактура фона: тёплое свечение по углам + лёгкое зерно (под контентом) */
body::before, body::after { content: ""; position: fixed; inset: 0; pointer-events: none; }
body::after {
  z-index: -2;
  background:
    radial-gradient(60vmax 45vmax at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(55vmax 45vmax at 100% 100%, color-mix(in srgb, var(--price) 10%, transparent), transparent 70%);
}
body::before {
  z-index: -1; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ico { width: 1.15em; height: 1.15em; flex: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--r-pill);
  padding: .75em 1.3em; font-weight: 700; text-decoration: none; transition: background .2s, transform .15s;
}
.btn:hover { background: var(--accent-hi); }
.btn:active { transform: scale(.97); }

/* ===== Шапка-полоса: логотип рядом с названием, круглые фото блюд цепочкой справа (на планшете и телефоне без них) ===== */
.hero { position: relative; overflow: hidden; display: grid; isolation: isolate; }
.hero-shade { position: absolute; inset: 0; z-index: -1; background: radial-gradient(circle at 75% 50%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%); }
.hero-content { display: flex; align-items: center; gap: 22px; align-self: center; }
.logo { width: 84px; height: 84px; color: var(--text); filter: drop-shadow(0 4px 18px rgba(0,0,0,.4)); }
.brand {
  margin: 0; font-family: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  font-size: clamp(2.4rem, 4.4vw, 4rem); line-height: 1; text-shadow: 0 6px 30px rgba(0,0,0,.5);
}
.brand-sub { margin: 6px 0 0; font-weight: 700; text-transform: uppercase; letter-spacing: .32em; font-size: clamp(.8rem, 2.6vw, 1.1rem); color: var(--price); }
.hero-info { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 10px; }
.hero-info a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; font-size: .92rem; font-weight: 600; }
.hero-info a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hero-info .ico { color: var(--price); }

.lang {
  position: absolute; top: 14px; right: 16px; z-index: 2; display: flex; padding: 3px; gap: 2px;
  border-radius: var(--r-pill); background: rgba(0,0,0,.35); border: 1px solid var(--line); backdrop-filter: blur(6px);
}
.lang button { border: 0; background: none; color: var(--muted); font-size: .75rem; font-weight: 800; padding: 5px 9px; border-radius: var(--r-pill); }
.lang button.on { background: var(--text); color: var(--bg); }

.hero-plates { display: none; position: relative; pointer-events: none; }
.hero-plates img {
  position: absolute; border-radius: 50%; object-fit: cover; aspect-ratio: 1;
  box-shadow: 0 24px 60px rgba(0,0,0,.55), 0 0 0 6px color-mix(in srgb, var(--text) 8%, transparent);
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-14px) rotate(3deg); } }
.hero-plates .p2 { animation-delay: -2s; }
.hero-plates .p3 { animation-delay: -4s; }
.hero-plates .p4 { animation-delay: -5s; }
/* шапку прокрутили (класс ставит app.js) — тарелки замирают: их анимация заставляет перерисовывать экран каждый кадр */
.hero-off .hero-plates img { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .hero-plates img { animation: none; } }
/* ПК и планшет: текст слева, ровно над меню */
@media (min-width: 761px) {
  .hero { padding-inline: max(0px, calc((100% - 1240px) / 2)); }
  .hero-content { padding: 40px 16px 32px; }
}
/* ПК: справа «сцена» 2:1 с тарелками */
@media (min-width: 1001px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .hero-plates { display: block; grid-column: 2; grid-row: 1; width: min(100%, 520px); aspect-ratio: 2 / 1; justify-self: center; margin: 12px 16px; }
  .hero-plates .p1 { width: 44%; right: 6%; top: 4%; }
  .hero-plates .p2 { width: 30%; left: 4%; top: 30%; }
  .hero-plates .p3 { width: 24%; right: -6%; top: 56%; }
  .hero-plates .p4 { width: 20%; left: 30%; top: 2%; }
  .hero-content { grid-column: 1; grid-row: 1; padding: 28px 0 28px 16px; }
}
/* Телефон: логотип слева от текста; сверху место под переключатель языков */
@media (max-width: 760px) {
  .hero-content { justify-content: center; gap: 14px; padding: 66px 16px 22px; }
  .logo { width: 62px; height: 62px; }
  .brand { font-size: clamp(2.2rem, 11vw, 3rem); }
  .brand-sub { letter-spacing: .2em; font-size: .78rem; }
  .hero-info { gap: 4px 16px; }
  .hero-info a { font-size: .85rem; }
}

/* Статус «geöffnet» */
.open-status { display: inline-flex; margin: 10px 0 0; font-size: .9rem; font-weight: 700; align-items: center; gap: 8px; }
.open-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.open-status.is-open::before { background: var(--open); box-shadow: 0 0 0 4px color-mix(in srgb, var(--open) 22%, transparent); }
.open-status span { color: var(--muted); font-weight: 500; }

/* ===== Панель категорий + поиск ===== */
.catnav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.catnav-inner { max-width: 1240px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 0; background: var(--card); color: var(--text);
  padding: 7px 15px; border-radius: var(--r-pill); font-size: .88rem; font-weight: 600; white-space: nowrap; transition: background .2s;
}
.chip:hover { background: var(--card-hi); }
.chip.active { background: var(--accent); color: var(--accent-ink); }
.search {
  flex: none; display: flex; align-items: center; gap: 6px; width: 230px; height: 36px; padding: 0 6px 0 10px;
  background: var(--card); border-radius: var(--r-pill); color: var(--muted); cursor: text;
}
.search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: 600 .9rem "Manrope", sans-serif; outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search:focus-within { outline: 2px solid var(--accent); }
.search-clear { display: none; border: 0; background: none; color: var(--muted); padding: 4px; }
.catnav.searching .search-clear { display: grid; }
/* Телефон: поиск свёрнут в иконку; при поиске занимает всю панель вместо категорий */
@media (max-width: 700px) {
  .search { width: 36px; padding: 0; justify-content: center; }
  .search input, .search-clear { display: none; }
  .catnav.searching .chips { display: none; }
  .catnav.searching .search { flex: 1; width: auto; padding: 0 6px 0 10px; justify-content: flex-start; }
  .catnav.searching .search input { display: block; }
}
.no-results { max-width: 1240px; margin: 40px auto; padding: 0 16px; text-align: center; color: var(--muted); font-size: 1.05rem; }

/* ===== Меню ===== */
main { max-width: 1240px; margin: 0 auto; padding: 8px 16px 40px; }
.cat { padding-top: 34px; scroll-margin-top: calc(var(--nav-h) + 4px); }
.cat-title { margin: 0 0 4px; font-family: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.cat-note { margin: 0; color: var(--muted); font-size: .9rem; }
.cat[hidden], .dish[hidden] { display: none !important; }

/* Карточки: компактные — фото слева, текст справа; на ПК до трёх в ряд, на телефоне список сверху вниз */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; margin-top: 18px; }
.card {
  position: relative; display: flex; flex-direction: row; text-align: left; padding: 0; border: 1px solid var(--line);
  background: var(--card); border-radius: var(--r-l); overflow: hidden; transition: transform .2s, background .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); background: var(--card-hi); box-shadow: 0 14px 34px rgba(0,0,0,.35); }
/* фото блюд квадратные (photos/CODEX.md): колонка шириной примерно с высоту карточки — фото видно почти целиком;
   у карточек с длинным описанием срезаются только поля фона по бокам */
.card .ph { flex: none; width: 150px; overflow: hidden; background: var(--bg2); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .ph img { transform: scale(1.05); }
/* во время прокрутки наведение выключено (класс ставит app.js): без этого прокрутка колесом дёргается */
.scrolling .card, .scrolling .mcard { pointer-events: none; }
.card .body { display: flex; flex-direction: column; gap: 4px; padding: 11px 12px 11px 14px; flex: 1; min-width: 0; min-height: 150px; }
.card .name { font-weight: 800; font-size: .98rem; line-height: 1.25; }
.card .desc { color: var(--muted); font-size: .84rem; line-height: 1.4; flex: 1; }
.card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.price { font-weight: 800; color: var(--price); font-size: 1.05rem; white-space: nowrap; }
.price small { font-weight: 600; color: var(--muted); font-size: .72rem; margin-right: 3px; }
/* круг 38 px на глаз равен прежнему квадрату 34 px (у круга меньше площадь) */
.add { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); flex: none; }
.add .ico { width: 19px; height: 19px; }
@media (max-width: 560px) {
  .card .ph { width: 128px; }
  .card .body { min-height: 128px; }
}
/* Длинные категории: сначала LIST_LIMIT блюд, остальные — по кнопке */
.grid.collapsed .card:nth-child(n+10) { display: none; }
.more { margin-top: 12px; border: 1px solid var(--line); background: none; color: var(--text); border-radius: var(--r-pill); padding: 9px 18px; font-weight: 700; font-size: .9rem; }
.more:hover { background: var(--card); }

/* «Lieblings Menüs» в стиле жёлтого табло из зала */
.cat.board { margin-top: 34px; padding: 0; border: 2px solid var(--gold); border-radius: var(--r-l); background: #120e0b; overflow: hidden; }
.board-head { background: var(--gold); color: #1b1512; padding: 12px 18px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.board-head .cat-title { margin: 0; color: #1b1512; font-size: clamp(1.4rem, 4vw, 2rem); }
.board-head .cat-note { color: #3a2a12; font-weight: 600; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; padding: 16px; }
.mcard {
  position: relative; display: grid; grid-template-columns: 42% minmax(0, 1fr); text-align: left; padding: 0; overflow: hidden;
  background: #1d1611; border: 2px solid color-mix(in srgb, var(--gold) 70%, transparent); border-radius: var(--r);
  transition: border-color .2s;
}
.mcard:hover { border-color: var(--gold); }
.mcard img { width: 100%; height: 100%; min-height: 130px; object-fit: cover; }
.mcard .mbody { display: flex; flex-direction: column; padding: 12px 14px; gap: 4px; }
.mcard .mtab { align-self: flex-start; background: var(--gold); color: #1b1512; font-weight: 800; font-size: .8rem; padding: 3px 8px; border-radius: 4px; }
.mcard .mdesc { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.mcard .mprice { margin-top: auto; align-self: flex-end; font-family: var(--brand); font-weight: 700; color: var(--gold); font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; }

/* ===== «So findest du uns» ===== */
.location { max-width: 1240px; margin: 0 auto; padding: 30px 16px 60px; }
.loc-grid { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 16px; margin-top: 18px; }
@media (max-width: 760px) { .loc-grid { grid-template-columns: 1fr; } }
.loc-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); padding: 22px; display: flex; flex-direction: column; gap: 4px; }
.loc-card p { margin: 0 0 8px; }
.loc-name { font-weight: 800; font-size: 1.1rem; }
.logo.small { width: 52px; height: 52px; margin-bottom: 8px; }
.map-wrap { position: relative; display: block; min-height: 300px; border-radius: var(--r-l); overflow: hidden; border: 1px solid var(--line); background: var(--bg2); text-decoration: none; }
/* Светлую OSM-карту делаем тёмной и тёплой фильтром */
.map-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: invert(.92) hue-rotate(180deg) sepia(.35) saturate(.7) brightness(.85); transition: transform .5s; }
.map-wrap:hover .map-img { transform: scale(1.04); }
.map-wrap::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 45%, transparent 30%, color-mix(in srgb, var(--bg) 55%, transparent)); }
.map-marker {
  position: absolute; z-index: 1; left: 50%; top: 50%; width: 58px; height: 58px; translate: -50% -100%;
  display: grid; place-items: center; border-radius: 50% 50% 50% 0; rotate: -45deg; background: var(--accent); box-shadow: 0 10px 24px rgba(0,0,0,.5);
}
.map-marker .logo { width: 40px; height: 40px; rotate: 45deg; color: var(--accent-ink); }
.map-btn { position: absolute; z-index: 1; left: 50%; bottom: 18px; translate: -50% 0; white-space: nowrap; }
.map-wrap:hover .map-btn { background: var(--accent-hi); }
.map-attr { position: absolute; z-index: 1; right: 8px; bottom: 4px; font-size: .65rem; color: var(--muted); }

/* ===== Подвал ===== */
.footer { position: relative; border-top: 1px solid var(--line); text-align: center; padding: 26px 16px 110px; color: var(--muted); font-size: .9rem; }
.footer p { margin: 4px 0; }

/* ===== Корзина: полоса снизу ===== */
.cart-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 30; width: min(460px, calc(100% - 32px));
  display: flex; align-items: center; gap: 10px; padding: 14px 20px; border: 0; border-radius: var(--r-pill); font-weight: 700; text-decoration: none;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.cart-bar .cart-sum { margin-left: auto; }
.cart-bar-count { opacity: .8; font-weight: 600; }
.cart-bar.bump { animation: bumpbar .35s; }
@keyframes bumpbar { 40% { transform: translateX(-50%) scale(1.05); } }

/* ===== Окно блюда (выезжает снизу) ===== */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); display: grid; place-items: end center; animation: fade .2s; }
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.dialog {
  position: relative; width: min(520px, 100%); max-height: 92dvh; overflow: auto;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 24px 24px 0 0; box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: up .3s cubic-bezier(.2,.8,.2,1);
}
@keyframes up { from { transform: translateY(100%); } }
.dlg-close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.5); color: #fff; font-size: 1.5rem; line-height: 1;
}
.dlg-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; } /* квадратное фото: срезаются только поля фона сверху и снизу */
.dlg-body { padding: 18px 20px 6px; }
.dlg-body h3 { margin: 0 0 6px; font-size: 1.45rem; line-height: 1.2; }
.dlg-body > .muted { margin: 0 0 8px; }
.opt { margin-top: 16px; }
.opt-title { font-weight: 800; font-size: .95rem; margin-bottom: 8px; display: flex; justify-content: space-between; }
.opt-title span { color: var(--muted); font-weight: 500; font-size: .8rem; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg.wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.seg label, .tags label { cursor: pointer; }
.seg input, .tags input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 11px 10px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--card); font-weight: 700; font-size: .9rem; transition: .15s; }
.seg span small { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.seg input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--card)); }
.seg input:focus-visible + span, .tags input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: .88rem; transition: .15s; }
/* «Ohne» — отмеченное зачёркивается; добавки — подсвечиваются галочкой */
.tags input:checked + span { border-color: var(--accent); color: var(--muted); text-decoration: line-through; text-decoration-color: var(--accent); }
.tags input:checked + span::before { content: "✕"; color: var(--accent); font-size: .75rem; }
.tags.extras span small { color: var(--price); font-weight: 700; font-size: .78rem; }
.tags.extras input:checked + span { color: var(--text); text-decoration: none; background: color-mix(in srgb, var(--accent) 16%, var(--card)); }
.tags.extras input:checked + span::before { content: "✓"; }
.dlg-foot { position: sticky; bottom: 0; display: flex; gap: 12px; align-items: center; padding: 14px 20px 18px; margin-top: 12px; background: linear-gradient(to top, var(--bg2) 75%, transparent); }
.btn-wide { flex: 1; padding: 14px 12px; white-space: nowrap; font-size: clamp(.86rem, 3.6vw, 1rem); } /* таблетка в одну строку и на узком телефоне */
.stepper { display: flex; align-items: center; background: var(--card); border-radius: var(--r-pill); border: 1px solid var(--line); }
.stepper button { width: 40px; height: 44px; border: 0; background: none; font-size: 1.3rem; font-weight: 700; }
.stepper span { min-width: 22px; text-align: center; font-weight: 800; }

/* ===== Тост ===== */
.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: var(--r-pill); font-weight: 700; font-size: .9rem;
  transition: .25s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== Панель сравнения вариантов (только прототип, не часть сайта) ===== */
.dp-toggle {
  position: fixed; left: 0; top: 50%; z-index: 45; transform: translateY(-50%); writing-mode: vertical-rl; rotate: 180deg;
  border: 0; border-radius: 10px 0 0 10px; padding: 14px 8px; background: #fff; color: #222; font: 700 13px/1 system-ui, sans-serif;
  box-shadow: 0 4px 18px rgba(0,0,0,.4);
}
.dp {
  position: fixed; left: 12px; top: 12px; bottom: 12px; z-index: 80; width: min(360px, calc(100% - 24px)); overflow: auto;
  background: #fbfaf8; color: #1f1f1f; border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; padding: 14px 14px 18px;
}
.dp[hidden] { display: none; }
.dp-head { display: flex; justify-content: space-between; align-items: center; font-size: 16px; margin-bottom: 4px; }
.dp-head button { border: 0; background: #eee; border-radius: 8px; width: 30px; height: 30px; font-size: 18px; color: #222; }
.dp-group { margin-top: 14px; }
.dp-group h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #777; }
.dp-opts { display: grid; gap: 5px; }
.dp-opts button { display: flex; gap: 8px; align-items: baseline; text-align: left; border: 1.5px solid #e3e0da; background: #fff; color: #222; border-radius: 10px; padding: 8px 10px; font: inherit; }
.dp-opts button em { font-style: normal; color: #8a6d2f; font-size: 12px; margin-left: auto; white-space: nowrap; }
.dp-opts button.on { border-color: #222; background: #f1efe9; }
.dp-actions { display: flex; gap: 8px; margin-top: 16px; }
.dp-actions button { flex: 1; border: 0; border-radius: 10px; padding: 10px; background: #222; color: #fff; font: 600 13px system-ui, sans-serif; }
.dp-actions button:first-child { background: #e9e5dd; color: #222; }
.dp-summary { margin: 10px 0 0; font-size: 12px; color: #666; }

/* ===== Телефон: доводка новых блоков ===== */
@media (max-width: 560px) {
  /* табло меню-сетов — тоже лента вбок, чтобы не занимать 7 экранов над донером */
  .board-grid {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 86%;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; scroll-padding: 0 16px;
  }
  .board-grid::-webkit-scrollbar { display: none; }
  .mcard { scroll-snap-align: start; }
}

/* ===== Фон категории: приглушённое фото еды из этой категории ===== */
/* слой на всю ширину экрана за секцией; сверху и снизу растворяется, чтобы соседние категории перетекали друг в друга */
html { overflow-x: clip; }
.cat { position: relative; }
.cat-bg {
  position: absolute; z-index: -1; top: -40px; bottom: -40px; left: calc(50% - 50vw); width: 100vw; pointer-events: none; /* без transform: с ним фон перестаёт быть неподвижным */
  background-size: cover; background-position: center; background-attachment: fixed;
  opacity: .14;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
}
/* iOS не поддерживает background-attachment: fixed — там фото просто прокручивается вместе с секцией */
@supports (-webkit-touch-callout: none) { .cat-bg { background-attachment: scroll; } }

/* ===== Страница оформления (warenkorb.html) ===== */
.topbar { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.back { display: inline-flex; align-items: center; gap: 6px; justify-self: start; text-decoration: none; font-weight: 700; font-size: .92rem; color: var(--muted); }
.back:hover { color: var(--text); }
.topbar-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 1.35rem; }
.topbar-brand .logo { width: 34px; height: 34px; filter: none; }
.topbar .lang { position: static; justify-self: end; }
@media (max-width: 560px) {
  .topbar-inner { grid-template-columns: auto 1fr auto; }
  .topbar-brand { display: none; } /* на телефоне: «← к меню» и языки, название не помещается */
}

.checkout { max-width: 1080px; margin: 0 auto; padding: 26px 16px 40px; }
.checkout > .cat-title { margin-bottom: 18px; }
.co-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 860px) { .co-grid { grid-template-columns: 1fr; } }
.co-main { display: grid; gap: 14px; }
.co-side { position: sticky; top: 76px; }
.co-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px 20px; }
.co-h { margin: 0 0 12px; font-size: 1.05rem; font-weight: 800; }

/* позиции */
.co-lines { list-style: none; margin: 0; padding: 0; }
.co-line { display: grid; grid-template-columns: minmax(0, 1fr) auto 76px auto; grid-template-areas: "main step price remove"; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.co-line:first-child { padding-top: 0; }
.co-line:last-child { border-bottom: 0; padding-bottom: 0; }
.co-line-main { grid-area: main; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.co-line-name { font-weight: 800; }
.co-line-opts { color: var(--muted); font-size: .85rem; }
.co-line .stepper { grid-area: step; }
.co-line .stepper button { width: 34px; height: 36px; }
.co-line .price { grid-area: price; text-align: right; }
.co-remove { grid-area: remove; width: 34px; height: 34px; border-radius: 50%; border: 0; background: none; color: var(--muted); display: grid; place-items: center; }
.co-remove:hover { background: var(--card-hi); color: var(--text); }
@media (max-width: 560px) {
  .co-line { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "main main remove" "step price price"; row-gap: 8px; }
}

/* доставка / самовывоз — плитки с иконкой */
.co-mode span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 10px; }
.co-mode .ico { width: 24px; height: 24px; margin-bottom: 2px; color: var(--price); }
.seg input:disabled + span { opacity: .4; cursor: not-allowed; }
.co-note { margin: 10px 0 0; color: var(--price); font-size: .9rem; font-weight: 600; }

/* поля ввода */
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
@media (max-width: 560px) { .fields { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; }
.field[hidden] { display: none; }
#coTimeField { margin-top: 12px; max-width: 260px; }
.field-label { font-weight: 700; font-size: .88rem; }
.field-label small { color: var(--muted); font-weight: 500; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 13px; border-radius: var(--r); border: 1.5px solid var(--line); background: var(--bg2);
  color: var(--text); font: 600 .95rem "Manrope", sans-serif; transition: border-color .15s;
}
.field textarea { resize: vertical; min-height: 64px; }
.field input::placeholder, .field textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); font-weight: 500; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field [aria-invalid="true"] { border-color: #e0605a; }
.field-hint { color: var(--muted); font-size: .8rem; }
.field-error { color: #f08a84; font-size: .82rem; font-weight: 600; }
.field-error:empty { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: .88rem; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

/* итог */
.co-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; color: var(--muted); }
.co-total { color: var(--text); font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; }
.co-total span:last-child { color: var(--price); }
.co-cash { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; padding: 10px 12px; border-radius: var(--r); background: color-mix(in srgb, var(--price) 10%, transparent); font-size: .88rem; }
.co-cash .ico { color: var(--price); margin-top: 1px; }
.co-cash > span { display: flex; flex-direction: column; gap: 1px; } /* «Nur Barzahlung» и подсказка — двумя строками */
.co-cash span span { color: var(--muted); }
.co-summary .btn-wide { width: 100%; }
.co-summary .btn:disabled { opacity: .45; cursor: not-allowed; }
#coBlock { margin: 0 0 10px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; } /* ловушка для ботов */

/* пусто */
.co-empty { text-align: center; padding: 50px 16px; color: var(--muted); }
.co-empty .ico { width: 48px; height: 48px; color: var(--line); color: color-mix(in srgb, var(--muted) 50%, transparent); }
.co-empty p { font-size: 1.1rem; margin: 10px 0 20px; }

/* ===== Страница статуса заказа (bestellung.html) ===== */
.status { max-width: 600px; margin: 0 auto; padding: 26px 16px 40px; display: grid; gap: 14px; }
.st-kicker { margin: 0; color: var(--price); font-weight: 800; }
.status .cat-title { margin: 2px 0 6px; }
.st-lead { margin: 0 0 20px; color: var(--muted); }
/* шкала шагов: точка, название, время; под названием — подробность (время готовности, причина отказа) */
.st-steps { list-style: none; margin: 0; padding: 0; }
.st-step { position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; column-gap: 14px; row-gap: 2px; align-items: center; padding-bottom: 22px; }
.st-step:last-child { padding-bottom: 0; }
.st-step::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--line); }
.st-step:last-child::before { display: none; }
.st-step.done::before { background: var(--accent); }
.st-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line); background: var(--bg2); color: var(--accent-ink); }
.st-dot .ico { width: 14px; height: 14px; }
.st-step.done .st-dot { background: var(--accent); border-color: var(--accent); }
.st-step.now .st-dot { border-color: var(--accent); background: var(--accent-deep); animation: st-pulse 1.8s ease-in-out infinite; }
.st-step.bad .st-dot { background: #c9483f; border-color: #c9483f; }
@keyframes st-pulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 22%, transparent); } }
@media (prefers-reduced-motion: reduce) { .st-step.now .st-dot { animation: none; } }
.st-name { font-weight: 800; }
.st-step.todo .st-name { color: var(--muted); font-weight: 600; }
.st-time { color: var(--muted); font-size: .9rem; font-variant-numeric: tabular-nums; }
.st-sub { grid-column: 2 / -1; color: var(--price); font-size: .9rem; font-weight: 600; }
.st-step.bad .st-sub { color: #f08a84; }
.st-live { display: flex; align-items: center; gap: 8px; margin: 20px 0 0; color: var(--muted); font-size: .8rem; }
.st-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--open); flex: none; }
.st-live.off::before { background: var(--muted); }
/* чек */
.st-meta { margin: -4px 0 10px; color: var(--muted); font-size: .9rem; }
.st-lines { list-style: none; margin: 0 0 6px; padding: 0; }
.st-lines li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.st-lines li small { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; }
#stPriceNote { margin: 8px 0 0; }
.st-call { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 0; color: var(--muted); font-size: .9rem; }
.st-call a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 700; text-decoration: none; }
.st-call .ico { color: var(--price); }

/* ===== Плашки незавершённых заказов в меню — над корзиной, по одной на заказ (app.js) ===== */
.order-pills {
  position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); z-index: 30; width: max-content; max-width: calc(100% - 32px);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.order-pill {
  width: 100%; /* несколько плашек — одной ширины */
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: var(--card-hi); color: var(--text); font-weight: 700; font-size: .9rem; text-decoration: none; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.order-pill::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--open); box-shadow: 0 0 0 4px color-mix(in srgb, var(--open) 22%, transparent); }
.order-pill.bad::before { background: #e0605a; box-shadow: none; }
.order-pill-text { overflow: hidden; text-overflow: ellipsis; }
.order-pill .ico { width: 1em; height: 1em; margin-left: auto; transform: scaleX(-1); color: var(--muted); }
.has-order .toast { bottom: calc(96px + var(--pills) * 46px); }
.has-order .footer { padding-bottom: calc(110px + var(--pills) * 46px); }

/* ===== Аллергены: строка в окне блюда (app.js, renderAz) и страница allergene.html ===== */
.az-sup { margin-left: .25em; font-size: .6em; font-weight: 600; color: var(--muted); vertical-align: super; line-height: 0; white-space: nowrap; letter-spacing: .02em; }
.mtab .az-sup { color: #1b1512; opacity: .7; }
.dlg-body h3 .az-sup { font-size: .5em; }
.az { margin-top: 14px; color: var(--muted); font-size: .75rem; line-height: 1.45; }
.az a { color: inherit; white-space: nowrap; }
.az-page { max-width: 860px; margin: 0 auto; padding: 26px 16px 40px; display: grid; gap: 14px; }
.az-page .cat-title { margin: 0; }
.az-lead { margin: 0; color: var(--muted); }
.az-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .az-legend { grid-template-columns: 1fr; } }
.az-keys { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: center; font-size: .92rem; }
.az-keys dt { min-width: 26px; height: 26px; padding: 0 6px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--card-hi); color: var(--price); font-weight: 800; font-size: .82rem; }
.az-keys dd { margin: 0; }
.az-cat .co-h { margin-bottom: 4px; }
.az-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.az-row:last-child { border-bottom: 0; padding-bottom: 0; }
.az-row small { display: block; color: var(--muted); font-size: .8rem; }
.az-row.sub { padding-left: 14px; }
.az-codes { text-align: right; font-weight: 700; font-size: .88rem; font-variant-numeric: tabular-nums; }
.az-codes .a { color: var(--price); }
.az-codes .z { color: var(--muted); }
.az-codes .none { color: var(--muted); font-weight: 500; font-style: italic; }
.az-cats { display: grid; gap: 14px; }
.az-keys dd::first-letter { text-transform: uppercase; } /* «geschwärzt» в списке — с заглавной */
/* Юридические страницы (impressum.html) — та же раскладка, что у allergene.html */
.legal .co-box p { margin: 0 0 10px; line-height: 1.6; }
.legal .co-box p:last-child { margin-bottom: 0; }
.legal a { color: var(--text); font-weight: 700; }
