:root {
  --bg: #f7f2ea;
  --ink: #241a12;
  --muted: #7c7065;
  --line: #e7dccd;
  --panel: #fffdf9;
  --brand: #7b461d;
  --brand-dark: #2b1a11;
  --accent: #b67a31;
  --accent-soft: #fbf1e1;
  --success: #168a4a;
  --danger: #b3261e;
  --shadow: 0 18px 45px rgba(43, 26, 17, .14);
  --shadow-card: 0 10px 30px rgba(43, 26, 17, .09);
  --radius: 14px;
  --radius-sm: 10px;
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --font-body: Inter, "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  /* same horizontal gutter as <main>, so the header lines up with the content column */
  padding-inline: clamp(14px, 4vw, 48px);
  background: rgba(43, 26, 17, .96);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 1220px;
  margin: 0 auto;
  padding: 12px 0 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.brand img {
  display: block;
  width: auto;
  height: 40px;
  max-width: 150px;
  object-fit: contain;
}

/* Persistent horizontal category bar with scroll-spy — replaces the iPhone hamburger. */
.category-nav {
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 2px 0 11px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.category-nav::-webkit-scrollbar { display: none; }
.category-nav a {
  flex: 0 0 auto;
  color: #efe2d0;
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid transparent;
  scroll-snap-align: center;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.category-nav a:hover, .category-nav a:focus-visible {
  background: rgba(255, 255, 255, .12);
  outline: none;
}
.category-nav a.active {
  background: var(--accent-soft);
  color: var(--brand-dark);
}

main { padding: 0 clamp(14px, 4vw, 48px) 80px; }
.intro {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 42px 0 24px;
}
.intro h1 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(46px, 7vw, 88px);
  line-height: .98;
  letter-spacing: .003em;
}
.intro p { margin: 0; color: var(--muted); font-size: clamp(16px, 2vw, 20px); }
.order-mode .intro {
  padding: 34px 0 20px;
}
.order-mode .intro h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.0;
  font-weight: 600;
}
.order-mode .intro p {
  max-width: 560px;
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.5;
}

.primary-action, .secondary-action, .checkout-button, .add-button {
  border: 0;
  border-radius: var(--radius);
  background: var(--brand);
  color: white;
  padding: 12px 18px;
  font-weight: 700;
}
.secondary-action {
  background: white;
  color: var(--brand-dark);
  border: 1px solid var(--line);
}
.primary-action:hover, .checkout-button:hover, .add-button:hover { background: var(--brand-dark); }
.secondary-action:hover { border-color: var(--brand); }
button:disabled {
  cursor: not-allowed;
  opacity: .62;
}

/* Add-to-cart control: a full-width "Добавить" button that becomes a − qty + stepper. */
.add-control { display: block; }
.add-button { width: 100%; }
.add-stepper {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  height: 46px;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  overflow: hidden;
  user-select: none;
}
.add-stepper .step-btn {
  height: 100%;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  transition: background .15s ease;
}
.add-stepper .step-btn:hover { background: rgba(255, 255, 255, .16); }
.add-stepper .step-qty {
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.browser-draft {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 1220px;
  margin: 0 auto 10px;
  padding: 16px 18px;
  border: 1px solid #dfcaa9;
  border-radius: var(--radius);
  background: #fff8ec;
}
.browser-draft h2 {
  margin: 0 0 4px;
  font-size: 17px;
}
.browser-draft p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.order-feedback {
  max-width: 1220px;
  margin: 0 auto 18px;
  padding: 14px 16px;
  border: 1px solid rgba(22, 138, 74, .28);
  border-radius: var(--radius);
  background: #eef8f1;
  color: #0d5f32;
  font-weight: 700;
  line-height: 1.45;
}

.menu-root { max-width: 1220px; margin: 0 auto; }
.menu-section { scroll-margin-top: 128px; padding-top: 30px; }
.menu-section > h2 {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(30px, 3.4vw, 44px);
  line-height: 1.05;
  letter-spacing: .005em;
}
.menu-section > h2::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}
.menu-item {
  display: grid;
  grid-template-rows: 220px 1fr;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .2s ease, box-shadow .2s ease;
}
.menu-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 44px rgba(43, 26, 17, .14);
}
.menu-item.is-stopped {
  opacity: .72;
  background: #f4f0ea;
}
.menu-item.is-stopped .photo-button img {
  filter: grayscale(.65);
}
.availability-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eadfd2;
  color: #6b5140;
  font-size: 13px;
  font-weight: 700;
}
.photo-button {
  position: relative;
  border: 0;
  padding: 0;
  background-color: #efe7dc;
  background-image: var(--lqip, none);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.photo-button picture {
  display: block;
  width: 100%;
  height: 100%;
}
.photo-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .28s ease, opacity .45s ease;
}
/* blur-up: hide the real image until it has decoded, revealing the LQIP behind it */
.photo-button.has-lqip img { opacity: 0; }
.photo-button.has-lqip.is-loaded img { opacity: 1; }
.photo-button:hover img { transform: scale(1.04); }
@media (prefers-reduced-motion: reduce) {
  .photo-button img { transition: none; }
}
.item-body {
  display: grid;
  gap: 9px;
  padding: 16px 17px 17px;
}
.item-body h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(21px, 2.4vw, 24px);
  line-height: 1.12;
  letter-spacing: .003em;
}
.item-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}
.item-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-top: 4px;
}
.item-meta strong {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -.01em;
}
.item-meta span {
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
}

.cart-fab, .scroll-top {
  position: fixed;
  z-index: 30;
  border: 0;
  color: white;
  box-shadow: var(--shadow);
}
.cart-fab {
  left: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 999px;
  background: var(--brand);
  transition: transform .18s ease, opacity .18s ease, background .18s ease;
}
.cart-fab.pulse { animation: cart-pulse .28s ease; }
.cart-fab b {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  border-radius: 999px;
  background: white;
  color: var(--brand-dark);
}
@keyframes cart-pulse {
  50% { transform: translateY(-2px) scale(1.04); }
}
.scroll-top {
  right: 20px;
  bottom: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-dark);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: .2s ease;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.order-mode .scroll-top { bottom: 82px; }

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  background: rgba(35, 24, 18, .46);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.cart-drawer.open { opacity: 1; pointer-events: auto; }
.cart-panel {
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  height: 100%;
  background: var(--panel);
  transform: translateX(100%);
  transition: transform .24s ease;
}
.cart-drawer.open .cart-panel { transform: translateX(0); }
.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: 22px;
  border-bottom: 1px solid var(--line);
}
.cart-header h2 { margin: 0; }
.cart-header p { margin: 4px 0 0; color: var(--muted); }
.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  font-size: 23px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(43, 26, 17, .12);
}
.icon-button:hover { border-color: var(--brand); }
.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px;
}
.empty-cart { color: var(--muted); }
.cart-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.cart-row-image {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #efe7dc;
}
.cart-row-info { min-width: 0; }
.cart-row h3 { margin: 0; font-size: 15px; }
.cart-row p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.cart-row-total {
  grid-column: 2 / -1;
  justify-self: end;
  font-size: 15px;
}
.quantity {
  display: grid;
  grid-template-columns: 32px 30px 32px;
  align-items: center;
  text-align: center;
}
.quantity button {
  height: 32px;
  border: 1px solid var(--line);
  background: white;
}
.order-form {
  display: grid;
  gap: 11px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
}
.order-form fieldset {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.order-form legend { grid-column: 1 / -1; margin-bottom: 2px; font-weight: 700; }
.order-form label { display: grid; gap: 7px; font-weight: 700; }
.order-form fieldset label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}
.order-form fieldset label:has(input:checked) {
  border-color: var(--brand);
  background: #fff7ed;
  box-shadow: inset 0 0 0 1px var(--brand);
}
.order-form input[type="text"], .order-form input:not([type]) {
  width: 100%;
}
.order-form input {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: white;
}
.cart-summary {
  display: grid;
  gap: 7px;
  padding-top: 4px;
}
.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}
.summary-line strong { color: var(--ink); }
.discount-line strong { color: var(--success); }
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  font-size: 19px;
}
.order-status { min-height: 21px; margin: 0; color: var(--muted); }

.photo-dialog {
  border: 0;
  padding: 0;
  background: transparent;
}
.photo-dialog[open] {
  display: grid;
  place-items: center;
}
.photo-dialog::backdrop { background: rgba(0,0,0,.78); }
.photo-dialog img {
  max-width: min(92vw, 1080px);
  max-height: 86vh;
  border-radius: var(--radius);
}
.photo-dialog .icon-button {
  position: fixed;
  top: 20px;
  right: 20px;
}

@media (max-width: 760px) {
  .intro { align-items: start; flex-direction: column; padding-top: 26px; }
  .browser-draft { align-items: stretch; flex-direction: column; }
  .items-grid { grid-template-columns: 1fr; }
  .menu-item { grid-template-rows: 240px auto; }
  .cart-row { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .cart-row-image { width: 58px; height: 58px; }
  .cart-row-total { grid-column: 2 / -1; }
  .order-form fieldset { grid-template-columns: 1fr; }
  .cart-fab { left: 14px; bottom: 14px; }
  .scroll-top { display: none; }
}

@media (min-width: 1024px) {
  .items-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
