/* Терраса — клиентская часть */
:root {
  --bg: #f5f0e6;
  --surface: #fffdf8;
  --ink: #1f2420;
  --muted: #6c6a60;
  --line: #e4dccb;
  --green: #1d3328;
  --green-2: #2b4a3a;
  --accent: #c2622f;
  --accent-ink: #fff;
  --ok: #2f8a4f;
  --warn: #b5432a;
  --wa: #1fa855;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(31, 36, 32, .06), 0 8px 24px rgba(31, 36, 32, .07);
  --serif: Georgia, "Times New Roman", "PT Serif", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 130px; }
body {
  margin: 0;
  font: 16px/1.45 var(--sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: inherit; }
[hidden], .is-hidden { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

/* ── Шапка ─────────────────────────────── */
.hero {
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(194, 98, 47, .28), transparent 55%),
    linear-gradient(160deg, var(--green-2), var(--green));
  color: #f4efe3;
}
.hero__inner {
  max-width: 1120px; margin: 0 auto;
  padding: 28px 16px 24px;
  display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-end; justify-content: space-between;
}
.hero__brand { display: flex; gap: 14px; align-items: center; }
.hero__mark { width: 52px; height: 52px; color: #e9b48e; flex: none; }
.hero__mark svg { width: 100%; height: 100%; }
.hero__title { margin: 0; font: 600 clamp(30px, 6vw, 44px)/1 var(--serif); letter-spacing: .01em; }
.hero__tagline { margin: 6px 0 0; color: #cfd8cf; font-size: 15px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 14px; }
.hero__addr { color: #cfd8cf; }
.hero__call {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1);
}
.hero__call svg { width: 16px; height: 16px; }
.hero__call:hover { background: rgba(255, 255, 255, .18); }

.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 999px; font-weight: 600;
  background: rgba(255, 255, 255, .1);
}
.status-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa39a; }
.status-pill.is-open .status-pill__dot { background: #5fd38a; box-shadow: 0 0 0 4px rgba(95, 211, 138, .2); }
.status-pill.is-closed .status-pill__dot { background: #f08a6b; }

.closed-banner {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  padding: 12px 16px; background: #fbe4d6; color: #7a2f12; font-weight: 600; text-align: center;
  border-bottom: 1px solid #f1c9b1;
}
.closed-banner svg { width: 20px; height: 20px; flex: none; }

/* ── Поиск и категории ─────────────────── */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.toolbar__inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px 0; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 0 12px; height: 44px;
}
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; min-width: 0; height: 100%; font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }
.search__clear { border: 0; background: var(--line); width: 24px; height: 24px; border-radius: 50%; line-height: 1; font-size: 18px; color: var(--muted); }

.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 10px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface);
  padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: #cdbfa5; }
.chip.is-active { background: var(--green); border-color: var(--green); color: #fff; }

/* ── Меню ──────────────────────────────── */
.menu { max-width: 1120px; margin: 0 auto; padding: 8px 16px 120px; min-height: 50vh; }
.cat { padding-top: 22px; }
.cat__title { margin: 0 0 14px; font: 600 26px/1.15 var(--serif); }
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: grid; grid-template-columns: 1fr 112px; gap: 12px;
  background: var(--surface); border-radius: var(--radius); padding: 12px;
  box-shadow: var(--shadow); border: 1px solid transparent; text-align: left;
  transition: transform .15s, border-color .15s;
}
.card:hover { border-color: var(--line); }
@media (min-width: 680px) {
  .card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; }
  .card .card__img { order: -1; width: 100%; height: auto; aspect-ratio: 4 / 3; border-radius: 0; }
  .card .card__body { padding: 14px 16px 16px; }
}
.card__img {
  width: 112px; height: 112px; border-radius: 12px; overflow: hidden; background: #ece4d3;
  cursor: pointer;
}
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.ph {
  width: 100%; height: 100%; display: grid; place-items: center; color: #b8a888;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.6), transparent 60%),
    repeating-linear-gradient(45deg, #ece4d3 0 10px, #e7dec9 10px 20px);
}
.ph svg { width: 40%; height: 40%; }
.card__body { display: flex; flex-direction: column; min-width: 0; }
.card__name { margin: 0; font-weight: 650; font-size: 16px; line-height: 1.25; cursor: pointer; }
.card__weight { color: var(--muted); font-size: 13px; margin-top: 2px; }
.card__desc {
  color: var(--muted); font-size: 14px; margin: 6px 0 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-weight: 700; font-size: 17px; white-space: nowrap; }

.add-btn {
  border: 0; background: var(--accent); color: var(--accent-ink);
  height: 38px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 15px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: filter .15s, transform .1s;
}
.add-btn:hover { filter: brightness(1.05); }
.add-btn:active { transform: scale(.97); }
.stepper {
  display: inline-flex; align-items: center; height: 38px; border-radius: 10px;
  background: var(--green); color: #fff; overflow: hidden;
}
.stepper button { border: 0; background: transparent; color: inherit; width: 38px; height: 100%; font-size: 20px; line-height: 1; }
.stepper button:hover { background: rgba(255,255,255,.12); }
.stepper span { min-width: 26px; text-align: center; font-weight: 700; }

.empty { text-align: center; color: var(--muted); padding: 60px 16px; }
.empty strong { display: block; color: var(--ink); font: 600 22px var(--serif); margin-bottom: 6px; }

/* ── Подвал ────────────────────────────── */
.footer { background: var(--green); color: #dfe6de; }
.footer__inner {
  max-width: 1120px; margin: 0 auto; padding: 32px 16px calc(110px + var(--safe-b));
  display: grid; gap: 24px; grid-template-columns: 1fr;
}
@media (min-width: 680px) { .footer__inner { grid-template-columns: 1fr 1fr; } }
.footer p { margin: 4px 0; }
.footer__title { margin: 0 0 6px; font: 600 24px var(--serif); color: #fff; }
.footer__sub { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .08em; color: #a9b8ab; }
.hours { list-style: none; margin: 0; padding: 0; max-width: 320px; }
.hours li { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,.15); }

/* ── Кнопка корзины ────────────────────── */
.cartbar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + var(--safe-b));
  width: min(560px, calc(100% - 24px)); height: 58px;
  border: 0; border-radius: 16px; padding: 0 18px;
  background: var(--accent); color: #fff; box-shadow: 0 10px 30px rgba(120, 50, 15, .35);
  display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 600;
  animation: rise .25s ease-out;
}
.cartbar__count {
  min-width: 28px; height: 28px; border-radius: 999px; background: rgba(255,255,255,.22);
  display: grid; place-items: center; font-size: 14px; padding: 0 6px;
}
.cartbar__label { flex: 1; text-align: left; }
.cartbar.bump { animation: bump .3s ease-out; }
@keyframes rise { from { transform: translate(-50%, 30px); opacity: 0; } }
@keyframes bump { 50% { transform: translateX(-50%) scale(1.04); } }

/* ── Модальные окна ────────────────────── */
.modal, .drawer { position: fixed; inset: 0; z-index: 50; }
.modal__backdrop, .drawer__backdrop { position: absolute; inset: 0; background: rgba(20, 26, 22, .5); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.icon-btn {
  border: 0; background: var(--bg); width: 36px; height: 36px; border-radius: 50%;
  font-size: 24px; line-height: 1; color: var(--ink); display: grid; place-items: center;
}
.modal__card {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(520px, calc(100% - 24px)); max-height: calc(100% - 40px); overflow: auto;
  background: var(--surface); border-radius: 20px; animation: pop .2s ease-out;
}
@keyframes pop { from { transform: translate(-50%, -46%); opacity: 0; } }
.modal__x { position: absolute; right: 12px; top: 12px; z-index: 2; background: rgba(255,255,255,.9); }
.dish__img { aspect-ratio: 4 / 3; background: #ece4d3; }
.dish__img img { width: 100%; height: 100%; object-fit: cover; }
.dish__body { padding: 18px 20px 20px; }
.dish__body h2 { margin: 0; font: 600 24px/1.2 var(--serif); }
.dish__weight { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.dish__desc { margin: 12px 0 0; white-space: pre-line; }
.dish__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; gap: 12px; }
.dish__price { font-size: 22px; font-weight: 700; }

.drawer__panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(480px, 100%);
  background: var(--surface); display: flex; flex-direction: column;
  animation: slide .25s ease-out;
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@media (max-width: 560px) {
  .drawer__panel { top: auto; height: 94vh; height: 94dvh; border-radius: 20px 20px 0 0; animation-name: sheet; }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
}
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 10px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { margin: 0; font: 600 24px var(--serif); }
.drawer__scroll { flex: 1; overflow-y: auto; padding: 4px 16px 16px; overscroll-behavior: contain; }
.drawer__foot { border-top: 1px solid var(--line); padding: 12px 16px calc(14px + var(--safe-b)); background: var(--surface); }

.lines { list-style: none; margin: 0; padding: 0; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line__img { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: #ece4d3; }
.line__img img { width: 100%; height: 100%; object-fit: cover; }
.line__name { font-weight: 600; line-height: 1.25; }
.line__meta { color: var(--muted); font-size: 13px; }
.line__right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.line__sum { font-weight: 700; white-space: nowrap; }
.line .stepper { height: 32px; border-radius: 8px; background: var(--bg); color: var(--ink); }
.line .stepper button { width: 32px; font-size: 18px; }
.line .stepper button:hover { background: var(--line); }
.link-btn { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 10px 0; font-size: 14px; }

.checkout { margin-top: 8px; }
.seg { border: 0; margin: 16px 0 0; padding: 0; }
.seg legend, .field label { font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
.seg__opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.seg__opt { position: relative; }
.seg__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg__opt span {
  display: flex; align-items: center; justify-content: center; text-align: center; height: 46px; padding: 0 8px;
  border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; font-size: 15px; background: var(--surface);
  transition: border-color .15s, background .15s;
}
.seg__opt input:checked + span { border-color: var(--green); background: #e7efe9; color: var(--green); }
.seg__opt input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); }
.seg.is-invalid .seg__opt span { border-color: var(--warn); }
.hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }

.field { margin-top: 16px; display: flex; flex-direction: column; }
.field .opt { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; background: var(--surface);
  font-size: 16px; outline: none; transition: border-color .15s; resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--green-2); }
.field.is-invalid input, .field.is-invalid textarea { border-color: var(--warn); background: #fdf3ef; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.totals { display: grid; gap: 4px; margin-bottom: 10px; font-size: 15px; }
.totals div { display: flex; justify-content: space-between; }
.totals .muted { color: var(--muted); }
.totals .total { font-size: 19px; font-weight: 700; margin-top: 2px; }
.form-error { margin: 0 0 10px; color: var(--warn); font-weight: 600; font-size: 14px; }

.btn {
  width: 100%; height: 54px; border: 0; border-radius: 14px; font-size: 17px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.btn svg { width: 22px; height: 22px; }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { filter: brightness(1.05); }
.btn[disabled] { background: #b9b4a6; cursor: not-allowed; filter: none; }
.fine { margin: 8px 0 0; text-align: center; color: var(--muted); font-size: 12.5px; }

.toast {
  position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translate(-50%, 20px);
  z-index: 60; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

body.no-scroll { overflow: hidden; }

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