:root {
  --ground: #ffffff;
  --surface: #f3f1ec;
  --surface-2: #e9e6df;
  --ink: #161a17;
  --muted: #5d635e;
  --accent: #1e7a3c;
  --accent-ink: #145a2b;
  --accent-soft: #e3f0e6;
  --field: #11351d;
  --warn: #b5470f;
  --danger: #b3261e;
  --gutter: 16px;
  --bar-h: 60px;
  --cats-h: 112px;
  --dock-h: 0px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--bar-h) + var(--cats-h) + 8px); }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 16px/1.5 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: var(--dock-h);
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }

.promo { margin: 0; background: var(--accent); color: #fff; text-align: center; font-weight: 600; font-size: 15px; padding: 10px var(--gutter); }

/* ---------- верхняя полоса ---------- */
.bar { position: sticky; top: 0; z-index: 30; background: var(--ground); }
.bar-row { height: var(--bar-h); display: flex; align-items: center; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.logo-mark { width: 36px; height: 36px; stroke: none; }
.logo b { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.bar-phone { font-weight: 600; text-decoration: none; }
.bar-cart {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--surface); font-weight: 700; transition: background .15s;
}
.bar-cart:hover { background: var(--surface-2); }
.bar-cart.has { background: var(--accent); color: #fff; }

/* ---------- первый экран ---------- */
.hero { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: center; padding-top: 32px; padding-bottom: 48px; }
.hero h1 { font-size: clamp(34px, 4.6vw, 64px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; max-width: 14ch; }
.lead { font-size: 19px; margin: 20px 0 0; max-width: 34em; }
.terms { list-style: none; margin: 24px 0 28px; padding: 0; display: grid; gap: 10px; }
.terms li { display: flex; gap: 12px; align-items: baseline; font-size: 16px; }
.terms li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; transform: translateY(-2px); }
.terms b { font-weight: 700; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; height: 52px; padding: 0 28px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; transition: background .15s, transform .15s var(--ease);
}
.btn:hover { background: var(--accent-ink); }
.btn:active { transform: scale(.97); }
.hero-pic { margin: 0; }
.hero-pic img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 6px; }

/* ---------- полоса категорий ---------- */
.cats { position: sticky; top: var(--bar-h); z-index: 25; background: var(--ground); }
.cats.stuck { box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .25); }
.cats-row { display: flex; align-items: center; gap: 12px; padding-top: 8px; padding-bottom: 12px; }
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 999px; background: var(--surface); width: 260px; flex: none; }
.search svg { width: 20px; height: 20px; color: var(--muted); }
.search input { border: 0; outline: 0; background: none; width: 100%; height: 100%; font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.tabs::-webkit-scrollbar { display: none; }
.tab { height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 600; white-space: nowrap; scroll-snap-align: start; transition: background .15s, color .15s; }
.tab:hover { background: var(--surface); }
.tab.active { background: var(--ink); color: #fff; }

/* ---------- каталог ---------- */
.loading, .empty { padding: 64px 0; color: var(--muted); text-align: center; }
.section { padding-top: 40px; }
.section h2 { font-size: clamp(28px, 3vw, 40px); font-weight: 800; letter-spacing: -0.03em; margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 20px; }
.card { display: flex; flex-direction: column; min-width: 0; }
.pic { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--surface); }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
.card:hover .pic img { transform: scale(1.04); }
.pic .ph { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; text-align: center; font-weight: 700; color: var(--muted); }
.flag { position: absolute; left: 8px; top: 8px; padding: 4px 10px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 13px; font-weight: 700; }
.flag.out { background: var(--ink); }
.card-name { margin-top: 12px; font-size: 17px; font-weight: 600; line-height: 1.3; text-align: left; }
.card-min { font-size: 14px; color: var(--muted); margin-top: 2px; }
.card-foot { margin-top: auto; padding-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; }
.price { display: flex; flex-direction: column; line-height: 1.15; }
.price b { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
.price span { font-size: 14px; color: var(--muted); }
.price s { font-size: 14px; color: var(--muted); }
.card.is-out .pic img { filter: grayscale(1) opacity(.6); }
.card.is-out .price b { color: var(--muted); }

.plus {
  width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; flex: none;
  transition: background .15s, transform .15s var(--ease);
}
.plus svg { width: 24px; height: 24px; stroke-width: 2.6; }
.plus:hover { background: var(--accent-ink); }
.plus:active { transform: scale(.9); }
.plus:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.step {
  display: grid; grid-template-columns: 44px auto 44px; align-items: center; height: 48px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700; flex: none;
}
.step button { height: 48px; display: grid; place-items: center; border-radius: 999px; }
.step button svg { width: 20px; height: 20px; stroke-width: 2.6; }
.step button:active { background: var(--accent-ink); }
.step span { text-align: center; font-size: 15px; white-space: nowrap; padding: 0 2px; min-width: 44px; }
.card .step.wide { width: 100%; grid-template-columns: 48px 1fr 48px; }

/* ---------- подвал ---------- */
.foot { margin-top: 120px; background: var(--field); color: #fff; padding: 64px 0 48px; }
.foot-name { margin: 0; font-size: clamp(72px, 16vw, 220px); font-weight: 800; letter-spacing: -0.06em; line-height: .9; }
.foot-slogan { margin: 12px 0 48px; font-size: 20px; }
.foot-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.foot h2 { font-size: 17px; font-weight: 700; margin-bottom: 8px; letter-spacing: 0; }
.foot p { margin: 0 0 6px; color: #e4ece6; }
.foot a { color: #fff; }

/* ---------- кнопка «Оформить заказ» ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; pointer-events: none;
  padding: 0 var(--gutter) calc(12px + env(safe-area-inset-bottom));
  animation: dock-in .3s var(--ease);
}
@keyframes dock-in { from { transform: translateY(110%); } }
.dock-btn {
  pointer-events: auto; position: relative; overflow: hidden; width: 100%; max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 64px; padding: 0 22px; border-radius: 999px; background: var(--accent); color: #fff;
  box-shadow: 0 12px 30px -8px rgba(17, 53, 29, .55); transition: transform .15s var(--ease), background .15s;
}
.dock-btn:hover { background: var(--accent-ink); }
.dock-btn:active { transform: scale(.98); }
.dock-left { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; position: relative; z-index: 1; }
.dock-left b { font-size: 18px; }
.dock-left span { font-size: 13px; opacity: .9; white-space: nowrap; }
.dock-left { min-width: 0; }
.dock-sum { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.dock-sum span { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; font-size: 14px; font-weight: 700; }
.dock-sum b { font-size: 18px; white-space: nowrap; }
.dock-fill { position: absolute; left: 0; bottom: 0; height: 4px; background: #f2b33d; transition: width .3s var(--ease); }
.dock-btn.bump { animation: bump .35s var(--ease); }
@keyframes bump { 40% { transform: scale(1.03); } }

/* ---------- листы (товар, корзина) ---------- */
.sheet {
  border: 0; padding: 0; margin: auto; width: min(560px, 100vw); max-height: min(92vh, 900px); border-radius: 20px;
  background: var(--ground); color: var(--ink); box-shadow: 0 24px 80px rgba(0, 0, 0, .3); overflow: hidden;
}
.sheet[open] { display: flex; flex-direction: column; animation: sheet-in .28s var(--ease); }
@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
.sheet::backdrop { background: rgba(10, 14, 11, .5); }
.close { position: absolute; right: 12px; top: 12px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; background: var(--ground); display: grid; place-items: center; }
.close.static { position: static; background: var(--surface); }
.p-pic { aspect-ratio: 4 / 3; background: var(--surface); flex: none; }
.p-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-pic .ph { display: grid; place-items: center; height: 100%; font-weight: 700; color: var(--muted); }
.p-info { padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.p-info h3 { font-size: 26px; line-height: 1.15; font-weight: 800; }
.p-info p { margin: 0; }
.p-min { color: var(--muted); }
.p-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.p-row .price b { font-size: 26px; }
.p-out { color: var(--danger); font-weight: 600; }
.p-ctl .btn { height: 48px; }

.cart-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 8px 20px; flex: none; }
.cart-head h2 { font-size: 24px; font-weight: 800; flex: 1; white-space: nowrap; }
.cart-head { flex-wrap: wrap; gap: 8px; }
.cart-head h2 { flex: 1 1 0 !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ask { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-radius: 16px; background: #fbe3d4; animation: ask-in .2s var(--ease); }
@keyframes ask-in { from { opacity: 0; transform: translateY(-6px); } }
.ask span { flex: 1; font-weight: 600; font-size: 15px; line-height: 1.3; }
.ask button { height: 40px; padding: 0 16px; border-radius: 999px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.ask-no { background: var(--ground); }
.ask-yes { background: var(--danger); color: #fff; }
.link { color: var(--muted); text-decoration: underline; font-size: 15px; padding: 8px; }
.sheet.cart[open] { display: block; overflow-y: auto; overscroll-behavior: contain; }
.cart-head { position: sticky; top: 0; z-index: 2; background: var(--ground); }
.cart-list { padding: 0 20px; }
.line { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 14px 0; }
.line + .line { box-shadow: 0 -1px 0 var(--surface-2); }
.line-pic { width: 64px; height: 64px; border-radius: 6px; overflow: hidden; background: var(--surface); }
.line-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.line-top { display: flex; justify-content: space-between; gap: 8px; }
.line-name { font-weight: 600; line-height: 1.3; }
.line-sum { font-weight: 700; white-space: nowrap; }
.line-sub { font-size: 14px; color: var(--muted); }
.line-sub b { color: var(--danger); font-weight: 600; }
.line-ctl { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.line .step { height: 40px; grid-template-columns: 40px auto 40px; background: var(--accent-soft); color: var(--accent-ink); }
.line .step button { height: 40px; }
.line .step button:active { background: #cfe5d5; }
.line-del { font-size: 14px; color: var(--muted); text-decoration: underline; padding: 8px 0 8px 8px; }
.more { display: block; width: calc(100% - 40px); margin: 4px 20px 16px; height: 48px; border-radius: 999px; background: var(--surface); font-weight: 600; flex: none; }
.more:hover { background: var(--surface-2); }
.cart-empty { padding: 48px 0; text-align: center; color: var(--muted); }
.cart-foot { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; background: var(--surface); flex: none; }
.min { position: relative; height: 36px; border-radius: 999px; background: #fbe3d4; overflow: hidden; }
.min i { position: absolute; inset: 0 auto 0 0; background: #f6c8ab; transition: width .3s var(--ease); }
.min span { position: relative; display: block; text-align: center; line-height: 36px; font-size: 14px; font-weight: 600; color: #7a2e06; }
.min.ok { background: var(--accent-soft); }
.min.ok i { background: #c9e3cf; }
.min.ok span { color: var(--accent-ink); }
.total { display: flex; justify-content: space-between; align-items: baseline; }
.total b { font-size: 26px; font-weight: 800; white-space: nowrap; }
.note { margin: 0; font-size: 14px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field textarea, .extra input {
  width: 100%; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--ground); font-size: 16px; font-weight: 400; resize: vertical;
}
.extra summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--accent-ink); padding: 4px 0; }
.extra input { margin-top: 8px; }
.btn-wa {
  position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 8px 24px -6px rgba(17, 53, 29, .5);
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 56px; border-radius: 999px; flex: none;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 17px; transition: background .15s, transform .15s var(--ease);
}
.btn-wa svg { fill: #fff; stroke: none; }
.btn-wa:hover { background: var(--accent-ink); }
.btn-wa:active { transform: scale(.98); }
.btn-wa:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.btn-wa:disabled svg { fill: var(--muted); }
.err { margin: 0; color: var(--danger); font-size: 14px; text-align: center; }

.toast { position: fixed; left: 50%; bottom: calc(var(--dock-h) + 24px); transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 15px; white-space: nowrap; box-shadow: 0 8px 24px rgba(0, 0, 0, .2); }

@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 16px; padding-bottom: 24px; }
  .hero h1 { max-width: none; }
  .hero-pic { order: -1; }
  .hero-pic img { aspect-ratio: 16 / 9; }
  .cats-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .search { width: 100%; }
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  :root { --bar-h: 56px; }
  .bar-phone { display: none; }
  .logo-mark { width: 32px; height: 32px; }
  .logo b { font-size: 22px; }
  .bar-cart { height: 40px; padding: 0 14px; }
  .hero h1 { font-size: 32px; }
  .lead { font-size: 17px; margin-top: 12px; }
  .terms { margin: 16px 0 0; gap: 6px; }
  .terms li { font-size: 15px; }
  .hero .btn { display: none; }
  .hero-pic img { aspect-ratio: 2 / 1; }
  .tab { height: 40px; padding: 0 14px; }
  .search { height: 42px; }
  .section { padding-top: 28px; }
  .section h2 { font-size: 28px; margin-bottom: 14px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .card-name { font-size: 15px; margin-top: 8px; }
  .card-min { font-size: 13px; }
  .price b { font-size: 17px; }
  .price span, .price s { font-size: 13px; }
  .card-foot { padding-top: 8px; min-height: 48px; }
  .plus { width: 44px; height: 44px; }
  .step { height: 44px; }
  .step button { height: 44px; }
  .card .step.wide { grid-template-columns: 44px 1fr 44px; }
  .step span { font-size: 14px; }
  .foot { margin-top: 72px; padding-top: 48px; }
  .sheet { width: 100vw; max-width: 100vw; max-height: 94vh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  .sheet[open] { animation-name: sheet-up; }
  .dock-btn { height: 60px; padding: 0 18px; }
}
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
