:root {
  --bg: #120a07;
  --panel: rgba(22, 11, 7, 0.74);
  --line: rgba(255, 140, 40, 0.38);
  --text: #fff1e0;
  --muted: #d9b99a;
  --fire-1: #ff3b00;
  --fire-2: #ff8a00;
  --fire-3: #ffd23f;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 500;
  line-height: 1.4;
}

/* ---------- Видео и фон ---------- */
.bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -3;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse at 85% 12%, rgba(10, 5, 3, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at center, rgba(10, 5, 3, 0.15) 0%, rgba(10, 5, 3, 0.40) 100%),
    linear-gradient(to bottom, rgba(10, 5, 3, 0.15), rgba(10, 5, 3, 0.12));
}

.fallback-burger {
  display: none;
  position: fixed;
  left: 50%;
  top: 56%;
  width: min(42vw, 420px);
  transform: translate(-50%, -50%);
  z-index: -1;
  filter: drop-shadow(0 0 30px rgba(255, 110, 0, 0.45));
}
.fallback-burger svg { width: 100%; height: auto; display: block; }

body.no-video {
  background:
    radial-gradient(ellipse at 50% 110%, rgba(255, 90, 0, 0.35), transparent 60%),
    var(--bg);
}
body.no-video .fallback-burger { display: block; }

/* ---------- Шапка ---------- */
.page { min-height: 100vh; display: flex; flex-direction: column; }

.top { text-align: center; padding: 28px 16px 8px; }

.fire-title {
  margin: 0;
  font-family: 'Russo One', Impact, 'Arial Black', sans-serif;
  font-weight: 400;
  font-size: clamp(52px, 11vw, 132px);
  letter-spacing: 0.04em;
  line-height: 1;
  filter:
    drop-shadow(0 0 10px rgba(255, 120, 0, 0.9))
    drop-shadow(0 -8px 24px rgba(255, 60, 0, 0.7));
  animation: flicker 2.2s ease-in-out infinite alternate;
}

.fire-title span {
  display: inline-block;
  background: linear-gradient(to top, #a80c00 0%, var(--fire-1) 28%, var(--fire-2) 58%, var(--fire-3) 100%);
  background-size: 100% 220%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: flame 2.8s ease-in-out infinite alternate;
  transform-origin: 50% 100%;
}

@keyframes flame {
  0%   { background-position: 0 0;   transform: skewX(0deg) scaleY(1); }
  50%  { background-position: 0 14%; transform: skewX(-1.2deg) scaleY(1.02); }
  100% { background-position: 0 28%; transform: skewX(1deg) scaleY(0.99); }
}

@keyframes flicker {
  0%   { filter: drop-shadow(0 0 8px rgba(255, 120, 0, 0.8)) drop-shadow(0 -6px 20px rgba(255, 60, 0, 0.6)); }
  40%  { filter: drop-shadow(0 0 14px rgba(255, 150, 0, 1)) drop-shadow(0 -10px 30px rgba(255, 70, 0, 0.85)); }
  100% { filter: drop-shadow(0 0 10px rgba(255, 110, 0, 0.85)) drop-shadow(0 -7px 24px rgba(255, 50, 0, 0.7)); }
}

.tagline {
  margin: 10px 0 0;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(12px, 1.6vw, 16px);
}

/* ---------- Раскладка ---------- */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(290px, 380px) 1fr minmax(290px, 360px);
  gap: 24px;
  align-items: start;
  padding: 10px 24px 40px;
}

.center-space { min-height: 40vh; }

.panel {
  background: var(--panel);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  animation: rise 0.7s ease both;
}
.cart { animation-delay: 0.12s; }

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

.panel h2 {
  margin: 0 0 14px;
  font-family: 'Russo One', Impact, sans-serif;
  font-weight: 400;
  font-size: 24px;
  color: var(--fire-3);
  letter-spacing: 0.02em;
}

/* Заголовки в меню: меньше воздуха до списка */
.menu h2 { margin-bottom: 0; }
.menu .items li:first-child { padding-top: 6px; }
.panel h2.sub-title { margin-top: 18px; }

.group {
  margin: 18px 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  font-weight: 700;
}

/* ---------- Меню ---------- */
.items { list-style: none; margin: 0; padding: 0; }

.items li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 170, 90, 0.2);
}
.items li:last-child { border-bottom: 0; }

.items .price { color: var(--fire-3); font-weight: 700; white-space: nowrap; }

.name-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.name-wrap .name {
  font-weight: 700;
  line-height: 1.25;
}

.name-wrap .desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  font-weight: 500;
}

.add {
  flex: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--fire-2), var(--fire-1));
  color: #fff;
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 0 0 rgba(255, 110, 0, 0);
}
.add:hover { transform: scale(1.12); box-shadow: 0 0 18px rgba(255, 110, 0, 0.8); }
.add:active { transform: scale(0.95); }

/* ---------- Корзина ---------- */
.cart.bump { animation: bump 0.4s ease; }
@keyframes bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.035); }
  100% { transform: scale(1); }
}

.cart-hint {
  margin: 0 0 12px;
  padding: 8px 10px;
  background: rgba(255, 138, 0, 0.12);
  border: 1px solid rgba(255, 138, 0, 0.25);
  border-radius: 8px;
  font-size: 12px;
  color: var(--fire-3);
  text-align: center;
}

.cart-list { list-style: none; margin: 0; padding: 0; }

.cart-list > li.burger-item {
  display: block;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(255, 170, 90, 0.25);
}

.cart-list > li.burger-item:last-child {
  border-bottom: 0;
}

.burger-item.active {
  background: rgba(255, 138, 0, 0.08);
  margin: 0 -10px;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 10px;
}

.burger-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.burger-head .c-name {
  font-weight: 700;
  font-size: 15px;
}

.burger-head .c-sum {
  color: var(--fire-3);
  font-weight: 700;
  white-space: nowrap;
}

/* Выбор соуса в комбо */
.sauce-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 4px;
}
.sauce-label { font-size: 12px; color: var(--muted); margin-right: 2px; }

.burger-extras {
  list-style: none;
  margin: 4px 0 8px 0;
  padding: 0 0 0 10px;
}

.burger-extras li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-size: 13px;
  color: var(--muted);
}

.burger-extras .c-ctrl {
  display: flex;
  gap: 4px;
}

.burger-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.select-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.select-btn:hover {
  border-color: var(--fire-2);
  color: var(--text);
}

.select-btn.is-active {
  background: rgba(255, 138, 0, 0.25);
  border-color: var(--fire-2);
  color: var(--fire-3);
  font-weight: 700;
}

.qty-btn, .del-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.qty-btn:hover { background: rgba(255, 138, 0, 0.3); border-color: var(--fire-2); }
.del-btn { font-size: 18px; }
.del-btn:hover { background: rgba(255, 60, 0, 0.35); border-color: var(--fire-1); }

.empty { margin: 8px 0 14px; color: var(--muted); }

.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 16px 0 14px;
  font-size: 18px;
}
.total-row strong { font-size: 26px; color: var(--fire-3); }

.checkout {
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--fire-2), var(--fire-1));
  color: #fff;
  font: 700 16px 'Montserrat', Arial, sans-serif;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.checkout:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(255, 90, 0, 0.55); }
.checkout:disabled { opacity: 0.45; cursor: not-allowed; }

.min-order {
  margin: 8px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  opacity: 0.9;
}

.clear {
  margin-top: 10px;
  width: 100%;
  background: none;
  border: 0;
  color: var(--muted);
  font: 500 13px 'Montserrat', Arial, sans-serif;
  text-decoration: underline;
  cursor: pointer;
}
.clear:hover { color: var(--text); }

/* ---------- Окно заказа ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(5, 2, 1, 0.78);
}
.modal[hidden] { display: none; }

.modal-box {
  position: relative;
  width: min(480px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: #1b0e08;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px 22px 22px;
  animation: rise 0.3s ease both;
}
.modal-box h2 {
  margin: 0 0 14px;
  font-family: 'Russo One', Impact, sans-serif;
  font-weight: 400;
  font-size: 22px;
  color: var(--fire-3);
}
.modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--text); }

.modal label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.modal input, .modal textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: 500 15px 'Montserrat', Arial, sans-serif;
}
.modal input:focus, .modal textarea:focus {
  outline: 2px solid var(--fire-2);
  outline-offset: 1px;
}
.modal textarea { resize: vertical; margin-bottom: 14px; }
.modal label textarea { margin-bottom: 0; }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.form-error { color: #ff8a70; font-size: 14px; margin: 0 0 12px; }

/* ---------- Широкий экран: меню слева на уровне заголовка, корзина внизу справа ---------- */
@media (min-width: 1280px) {
  /* заголовок сужается вместе с экраном, чтобы не заезжать на меню слева */
  :root { --title-size: clamp(52px, calc((100vw - 880px) / 6.2), 132px); }
  .fire-title { font-size: var(--title-size); }

  /* меню вынесено из потока: стоит у верхнего края слева и не растягивает страницу */
  .menu { position: absolute; top: 16px; left: 24px; width: 380px; z-index: 2; }
  .center-space { grid-column: 2; }
  .cart { grid-column: 3; }

  /* корзина прижата к низу экрана (14px — как у строки ИНН) и растёт вверх */
  .layout { align-items: end; padding-bottom: 14px; }
  /* но не выше штампа «Доставка бесплатно»: длинный список внутри корзины прокручивается */
  .cart { display: flex; flex-direction: column; max-height: max(340px, calc(100vh - 290px)); }
  .cart-list { overflow-y: auto; min-height: 0; margin: 0 -10px; padding: 0 10px; }
}

/* Если экран достаточно высокий — нижний край меню тоже на уровне строки ИНН.
   Закреплено относительно окна; если меню вдруг выше окна, оно прокручивается внутри. */
@media (min-width: 1280px) and (min-height: 900px) {
  .menu { position: fixed; top: auto; bottom: 14px; max-height: calc(100vh - 32px); overflow-y: auto; }
}

/* ---------- Реквизиты ---------- */
.legal {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  margin: 0;
  z-index: 5;
  pointer-events: none;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}
.legal span + a::before,
.legal a + a::before {
  content: "·";
  display: inline-block;
  margin: 0 10px;
  color: var(--muted);
}
.legal a {
  pointer-events: auto;
  color: inherit;
  text-decoration: none;
}
.legal a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
  .legal {
    position: static;
    transform: none;
    text-align: center;
    padding: 0 14px 20px;
    white-space: normal;
    line-height: 1.8;
  }
  .layout {
    grid-template-columns: 1fr;
    padding: 12px 14px 32px;
  }
  .center-space { order: -1; min-height: 34vh; }
  .menu { order: 1; }
  .cart { order: 2; }
  .fallback-burger { top: 42%; width: min(70vw, 320px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
