/* =========================================================================
   Пивбургер — онлайн-меню. Mobile-first.
   Цвета вынесены в --vars: смена темы = смена 5–8 значений ниже.
   ========================================================================= */
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f1efe9;
  --text: #1a1a1a;
  --text-muted: #6b6b6b;
  --line: #e7e4dc;
  --brand: #f0b033;       /* жёлто-охряный из логотипа (пиво) */
  --brand-dark: #c98a1f;
  --on-brand: #1a1a1a;
  --accent-black: #1a1a1a;
  --danger: #c0392b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(20,20,20,.06);
  --shadow-md: 0 4px 16px rgba(20,20,20,.08);
  --topbar-h: 72px;
  --tabs-h: 52px;
  --cart-bar-h: 60px;
  --container: 1320px;
  --font-display: "Bebas Neue", "Inter", -apple-system, sans-serif;
  --font-nav: "Oswald", "Bebas Neue", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--cart-bar-h) + 16px); /* место для sticky bottom bar */
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; padding: 0; }
h1, h2, h3, h4 { margin: 0; }

/* ─────────── TOP BAR ─────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 0 var(--brand);
  height: var(--topbar-h);
}
.topbar__inner {
  max-width: var(--container); margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px; height: 100%;
}
.brand {
  display: inline-flex; align-items: center;
  color: var(--text);
  height: 100%;
}
.brand__img {
  height: 60px;
  width: auto;
  display: block;
  object-fit: contain;
}
@media (min-width: 768px) {
  .brand__img { height: 64px; }
}

/* ─────────── HERO BANNER ─────────── */
/* Hero — той же ширины что и .layout (max 1320px, по центру).
   По бокам — фон страницы (--bg). Это и есть «обрезка пропорционально меню». */
.hero {
  position: relative;
  max-width: var(--container);
  margin: 16px 16px 0;
  border-radius: var(--radius);
  background: var(--accent-black) no-repeat center/cover;
  color: #fff;
  min-height: 200px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.10) 0%, rgba(0,0,0,.55) 100%);
  pointer-events: none;
}
.hero__inner {
  position: relative; z-index: 1;
  padding: 16px 18px 18px;
  min-height: 200px;
  display: flex; align-items: flex-end; justify-content: flex-end;
}
.hero__addr {
  margin: 0;
  font-family: var(--font-display);
  font-size: 13px; letter-spacing: .04em;
  color: #fff;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,.55);
  padding: 6px 12px; border-radius: 999px;
  backdrop-filter: blur(6px);
}
.hero__pin { font-size: 13px; }

@media (min-width: 768px) {
  .hero { min-height: 240px; }
  .hero__inner { min-height: 240px; padding: 22px 26px; }
  .hero__addr { font-size: 14px; padding: 7px 14px; }
}

@media (min-width: 1024px) {
  /* центрируем как .layout — auto-margin, max-width 1320 */
  .hero { margin: 24px auto 0; min-height: 260px; max-width: var(--container); }
  .hero__inner { min-height: 260px; padding: 24px 32px; }
  .hero__addr { font-size: 15px; }
}
.lang-switcher {
  margin-left: auto;
  display: flex; gap: 4px; align-items: center;
  background: var(--surface-2); padding: 3px; border-radius: 999px;
}
.lang-form { display: inline-flex; margin: 0; }
.lang-btn {
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
}
.lang-btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.cart-link {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px;
  background: var(--surface-2); font-size: 18px;
}
.cart-link__count {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--accent-black); color: var(--brand);
  border-radius: 999px; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.cart-link__count:empty,
.cart-link__count[hidden] { display: none; }

/* ─────────── LAYOUT ─────────── */
.layout {
  max-width: var(--container); margin: 0 auto;
  padding: 0;
}
.layout--detail { padding: 16px; }

/* ─────────── TABS BAR ─────────── */
.tabs-bar {
  position: sticky; top: var(--topbar-h); z-index: 40;
  background: var(--surface); border-bottom: 1px solid var(--line);
  height: var(--tabs-h);
  display: flex; align-items: center; gap: 0; padding: 0 8px;
}
.tabs-bar__all {
  flex: 0 0 auto;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--text-muted);
  border-right: 1px solid var(--line);
  margin-right: 6px;
}
.tabs-bar__scroll {
  flex: 1; overflow-x: auto; overflow-y: hidden;
  display: flex; gap: 4px; align-items: center;
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.tabs-bar__scroll::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  display: inline-flex; align-items: center;
  height: 40px; padding: 0 14px;
  font-weight: 600; font-size: 14px; color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab.is-active {
  color: var(--text); border-bottom-color: var(--text);
}

/* Sheet «Усі категорії» */
.cats-sheet[hidden] { display: none; }
.cats-sheet {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
}
.cats-sheet__backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,.45);
}
.cats-sheet__panel {
  position: relative; width: 100%; max-width: 600px;
  background: var(--surface); border-radius: 16px 16px 0 0;
  max-height: 80vh; overflow-y: auto;
  padding: 16px 20px 24px;
}
.cats-sheet__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cats-sheet__close { font-size: 28px; line-height: 1; padding: 4px 8px; color: var(--text-muted); }
.cats-sheet__list { list-style: none; margin: 0; padding: 0; }
.cats-sheet__list li { border-top: 1px solid var(--line); }
.cats-sheet__list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px; font-weight: 500;
}
.cats-sheet__count { color: var(--text-muted); font-size: 13px; }

/* ─────────── SECTION ─────────── */
.content { padding: 0 16px 32px; }
.section { padding: 20px 0 8px; scroll-margin-top: calc(var(--topbar-h) + var(--tabs-h) + 8px); }
.section + .section { border-top: 1px solid var(--line); }
.section__title {
  font-family: var(--font-nav);   /* Oswald — единый шрифт навигации и заголовков секций */
  font-size: 26px; font-weight: 700; letter-spacing: .03em;
  text-transform: uppercase;
  margin: 0 0 16px;
  position: relative;
  padding-bottom: 10px;
}
.section__title::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 48px; height: 4px; background: var(--brand); border-radius: 2px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* ─────────── CARD ─────────── */
.card {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  min-height: 146px;
}
.card__title {
  font-size: 16px; font-weight: 700; margin: 0 0 4px; line-height: 1.25;
}
.card__title a { color: var(--text); }
.card__desc {
  margin: 0 0 6px;
  font-size: 13px; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__desc--ingredients { font-style: italic; }
.card__meta { margin: 0; font-size: 12px; color: var(--text-muted); }
.card__variants-hint { margin: 4px 0 0; font-size: 12px; color: var(--brand-dark); }
.card__footer {
  margin-top: auto; padding-top: 8px;
  display: flex; align-items: center; gap: 8px;
}
.card__price { font-weight: 700; font-size: 16px; }
.card__unavailable { color: var(--danger); font-size: 13px; }
.card__add {
  margin-left: auto;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-black); color: var(--brand);
  font-size: 24px; font-weight: 400; line-height: 1;
  box-shadow: var(--shadow-md);
  transition: transform .08s ease, background .12s ease;
}
.card__add:hover { background: #000; }
.card__add:active { transform: scale(0.92); }

.card__photo {
  display: block; width: 132px; height: 132px;
  border-radius: var(--radius-sm); overflow: hidden;
  background: var(--surface-2);
  align-self: start;
}
.card__photo img { width: 100%; height: 100%; object-fit: cover; }
.card__photo-stub {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: var(--text-muted);
}

.cart-aside { display: none; }
.empty { text-align: center; color: var(--text-muted); padding: 80px 0; }

/* ─────────── BACK LINK / TITLES ─────────── */
.back-link {
  display: inline-block; padding: 8px 0 12px;
  font-size: 14px; color: var(--text-muted);
}
.page-title { font-size: 22px; font-weight: 700; margin: 0 0 16px; }

/* ─────────── PRODUCT DETAIL ─────────── */
.product { display: grid; grid-template-columns: 1fr; gap: 16px; }
.product__photo {
  width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2);
}
.product__photo img { width: 100%; height: 100%; object-fit: cover; }
.product__photo-stub {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 80px; color: var(--text-muted);
}
.product__body { background: var(--surface); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.product__title { font-size: 22px; font-weight: 700; margin: 0 0 4px; }
.product__meta { color: var(--text-muted); margin: 0 0 12px; font-size: 13px; }
.product__desc { margin: 8px 0 12px; }
.product__ingredients summary {
  cursor: pointer; font-weight: 600; padding: 6px 0; color: var(--text);
}
.product__ingredients p { color: var(--text-muted); margin: 4px 0 12px; }

.variants { margin: 12px 0; }
.variants__label { font-weight: 600; margin: 0 0 8px; }
.variants__list { display: flex; flex-direction: column; gap: 8px; }
.variant {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color .12s ease, background .12s ease;
}
.variant:has(input:checked) { border-color: var(--brand); background: rgba(224,155,58,.08); }
.variant input { accent-color: var(--brand); }
.variant__label { flex: 1; }
.variant__price { font-weight: 700; }

.product__cta {
  display: flex; align-items: center; gap: 12px;
  padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line);
}
.product__price { font-size: 20px; font-weight: 700; flex: 1; }

/* ─────────── BUTTONS ─────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 15px;
  letter-spacing: .02em;
  transition: background .12s ease, transform .08s ease, box-shadow .12s ease;
}
.btn--primary {
  background: var(--accent-black);
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.btn--primary:hover { background: #000; box-shadow: 0 4px 14px rgba(0,0,0,.22); }
.btn--primary:active { transform: scale(0.98); }
.btn--ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn--big { width: 100%; padding: 14px; font-size: 16px; }

/* ─────────── CART PAGE ─────────── */
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  gap: 12px; align-items: center;
  background: var(--surface); padding: 12px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.cart-item__photo { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.cart-item__photo img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__body { min-width: 0; }
.cart-item__name { margin: 0 0 4px; font-weight: 600; font-size: 14px; }
.cart-item__name small { color: var(--text-muted); font-weight: 400; }
.cart-item__price { margin: 0; font-size: 13px; color: var(--text-muted); }
.cart-item__qty { display: inline-flex; align-items: center; gap: 8px; }
.cart-item__qty button {
  width: 32px; height: 32px; border-radius: 8px; background: var(--surface-2); font-size: 18px; font-weight: 600;
}
.cart-item__qty span { min-width: 18px; text-align: center; font-weight: 600; }
.cart-item__remove { width: 32px; height: 32px; font-size: 22px; color: var(--text-muted); }

.cart-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 4px; margin-top: 16px; font-size: 18px;
  border-top: 1px solid var(--line);
}
.cart-actions { display: flex; gap: 12px; margin-top: 12px; }
.cart-actions .btn { flex: 1; }
.empty-state { text-align: center; padding: 40px 0; }
.empty-state .btn { margin-top: 16px; }

/* ─────────── CHECKOUT ─────────── */
.checkout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.checkout__form { display: flex; flex-direction: column; gap: 14px; background: var(--surface); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.checkout__pickup-fixed {
  background: var(--surface-2); padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 500;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 13px; font-weight: 600; color: var(--text); }
.field__optional { color: var(--text-muted); font-weight: 400; }
.field input,
.field textarea {
  font: inherit; color: inherit;
  padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--surface);
}
.field input:focus,
.field textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.field input.is-invalid { border-color: var(--danger); }
.field--group { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.radio input { accent-color: var(--brand); }
.field__when { margin-top: 6px; }

.checkout__summary { background: var(--surface); padding: 18px; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.checkout__summary-title { font-size: 17px; margin: 0 0 12px; }
.checkout__items { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.checkout__item { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: baseline; font-size: 14px; }
.checkout__item-name { min-width: 0; }
.checkout__item-qty { color: var(--text-muted); }
.checkout__item-total { font-weight: 600; }
.checkout__total { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); font-size: 17px; }

/* ─────────── SUCCESS ─────────── */
.success { background: var(--surface); padding: 32px 20px; border-radius: var(--radius); box-shadow: var(--shadow-sm); text-align: center; }
.success__icon { font-size: 64px; margin-bottom: 12px; }
.success__title { font-size: 24px; margin: 0 0 6px; }
.success__number { margin: 0 0 16px; color: var(--text-muted); }
.success__hint { color: var(--text-muted); margin: 0 0 20px; }
.success__hint--small { font-size: 12px; margin-top: 12px; }
.success__telegram { width: 100%; }
.success__details { text-align: left; margin: 24px 0; }
.success__details summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.success__items { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.success__items li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.success__total { display: flex; justify-content: space-between; padding-top: 8px; border-top: 1px solid var(--line); }

/* ─────────── CART BOTTOM BAR (mobile sticky) ─────────── */
.cart-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: var(--accent-black); color: var(--brand);
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 20px;
  height: var(--cart-bar-h);
  box-shadow: 0 -4px 12px rgba(0,0,0,.18);
  font-weight: 700; font-size: 15px;
  letter-spacing: .02em;
}
.cart-bar__right { font-family: var(--font-display); font-size: 20px; letter-spacing: .04em; }
.cart-bar[hidden] { display: none; }

/* =========================================================================
   TABLET (≥768px)
   ========================================================================= */
@media (min-width: 768px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .card { grid-template-columns: 1fr 158px; min-height: 168px; }
  .card__photo { width: 158px; height: 158px; }
  .product { grid-template-columns: 1fr 1fr; align-items: start; }
  .product__photo { aspect-ratio: 1 / 1; }
  .checkout { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .cart-actions { justify-content: flex-end; }
  .cart-actions .btn { flex: 0 0 auto; min-width: 220px; }
}

/* =========================================================================
   DESKTOP (≥1024px) — sidebar tabs + cart sidebar справа
   ========================================================================= */
@media (min-width: 1024px) {
  body { padding-bottom: 0; }

  /* Шапка остаётся горизонтальной, под ней — layout с тремя колонками */
  .layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 320px;
    gap: 32px;
    padding: 24px 28px;
  }
  .layout--detail { grid-template-columns: 1fr; max-width: 1000px; }

  /* Вкладки → вертикальный sidebar */
  .tabs-bar {
    position: sticky; top: calc(var(--topbar-h) + 20px);
    height: auto; max-height: calc(100vh - var(--topbar-h) - 40px);
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 8px 0;
    align-self: start;
  }
  .tabs-bar__all { display: none; }
  .tabs-bar__scroll { flex-direction: column; align-items: stretch; gap: 2px; overflow: visible; padding: 0; }
  .tab {
    height: auto;
    padding: 12px 18px;
    border-bottom: 0;
    border-left: 4px solid transparent;
    text-align: left;
    font-family: var(--font-nav);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text);
    line-height: 1.15;
  }
  .tab:hover { background: rgba(0,0,0,.03); }
  .tab.is-active {
    background: var(--accent-black);
    color: var(--brand);
    border-left-color: var(--brand);
  }

  .content { padding: 0; }
  .section { padding: 8px 0 24px; scroll-margin-top: calc(var(--topbar-h) + 20px); }
  .section + .section { border-top: 0; margin-top: 8px; }
  .section__title { font-size: 26px; }

  .cards { grid-template-columns: 1fr 1fr; gap: 16px; }
  .card { padding: 16px; }

  /* Cart aside */
  .cart-aside {
    display: block;
    position: sticky; top: calc(var(--topbar-h) + 20px);
    align-self: start;
    background: var(--surface); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow-sm);
    max-height: calc(100vh - var(--topbar-h) - 40px);
    overflow-y: auto;
  }
  .cart-aside__title { font-size: 17px; margin: 0 0 12px; }
  .cart-aside__list { display: grid; gap: 10px; }
  .cart-aside__empty { color: var(--text-muted); margin: 0; }
  .cart-aside__item {
    display: grid; grid-template-columns: 1fr auto; gap: 6px;
    padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 14px;
  }
  .cart-aside__item:last-child { border-bottom: 0; }
  .cart-aside__total { display: flex; justify-content: space-between; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); font-size: 16px; }
  .cart-aside__checkout { display: block; margin-top: 12px; text-align: center; width: 100%; }

  /* На desktop нижний sticky bar не нужен */
  .cart-bar { display: none !important; }

  /* На desktop кнопку «☰ Все категории» прячем — sidebar и так весь список */
  .cats-sheet { display: none !important; }
}

/* 1024–1199: контента мало, ужимаем сайдбары и оставляем 1 колонку карточек */
@media (min-width: 1024px) and (max-width: 1199px) {
  .layout {
    grid-template-columns: 200px minmax(0, 1fr) 280px;
    gap: 20px; padding: 20px;
  }
  .cards { grid-template-columns: 1fr; }
}

/* 1200+: всегда 2 карточки в строку (3-я колонка не лезет рядом с cart aside) */
@media (min-width: 1200px) {
  .cards { grid-template-columns: 1fr 1fr; }
}
