/* PANDA CHEF — минимализм: воздух, крупные фото, один акцент на действии «заказать». */

:root {
  /* Фирменная палитра (Guideline, стр. 13) */
  --brand-black: #24231D;
  --brand-red: #C5342A;
  --brand-blue: #71A5D2;
  --brand-green: #6EAD68;
  --brand-sand: #E5AE3A;

  --bg: #ffffff;
  --surface: #f6f5f2;
  --text: var(--brand-black);
  --muted: #76746e;
  --line: #e9e7e2;
  --accent: var(--brand-red);
  --accent-hover: #a92b22;
  --accent-soft: #fbecea;
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 68px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
img, video { max-width: 100%; height: auto; display: block; }
/* Логотип и значки — оформление, а не контент: их нельзя выделить или утащить мышью */
.logo img, .badges img, .footer__logo { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; pointer-events: none; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, dl, dd, fieldset { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.container { width: 100%; max-width: 1232px; margin: 0 auto; padding: 0 16px; }
.container--narrow { max-width: 892px; }
.main { flex: 1; padding-bottom: 56px; }

/* --- Плашки ------------------------------------------------------------ */
.notice {
  background: var(--text); color: #fff; text-align: center;
  padding: 10px 16px; font-size: 14px; line-height: 1.4;
}
.alert {
  margin-top: 16px; padding: 16px 20px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: #7a2415; font-weight: 500;
}

/* --- Шапка ------------------------------------------------------------- */
/* Фон сплошной: фильтры на шапке ломают позиционирование выезжающего меню. */
.header { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.header__row { display: flex; align-items: center; gap: 10px; height: var(--header-h); }

.logo { display: flex; align-items: center; flex-shrink: 0; margin-right: auto; }
.logo img { height: 25px; width: auto; }

.header__burger {
  width: 44px; height: 44px; margin-left: -8px; padding: 0; border: 0; background: none; flex-shrink: 0;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
}
.header__burger span { width: 20px; height: 2px; border-radius: 2px; background: var(--text); transition: transform .2s, opacity .2s; }
.header__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.header__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.header__phone {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 44px; height: 44px; border-radius: 999px; background: var(--surface);
  font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.header__phone span { display: none; }

.cart-button {
  position: relative; display: flex; align-items: center; gap: 8px; flex-shrink: 0;
  height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600; white-space: nowrap;
  transition: background .15s;
}
.cart-button:hover { background: var(--accent-hover); }
.cart-button__count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: #fff; color: var(--accent); font-size: 12px; line-height: 20px; text-align: center;
}
.cart-button.is-bumped { animation: bump .3s ease; }
@keyframes bump { 50% { transform: scale(1.08); } }
@media (max-width: 379px) { .cart-button__sum { display: none; } .logo img { height: 21px; } }

/* Меню категорий: на узких экранах — выезжающая панель */
.nav {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: min(84vw, 320px);
  padding: 20px 16px; background: var(--bg); overflow-y: auto;
  transform: translateX(-100%); visibility: hidden;
  transition: transform .25s ease, visibility .25s;
}
.nav.is-open { transform: none; visibility: visible; }
.nav__inner { display: flex; flex-direction: column; gap: 2px; }
.nav__link { padding: 12px; border-radius: var(--radius-sm); font-size: 17px; font-weight: 500; }
.nav__link:hover, .nav__link.is-active { background: var(--surface); }
.nav__link.is-active { color: var(--accent); }
.nav__link--muted { color: var(--muted); }
.nav__link--first { margin-top: 8px; }
.nav__search { margin-bottom: 12px; }
.nav__search input {
  width: 100%; height: 44px; padding: 0 14px; border: 0; border-radius: var(--radius-sm);
  background: var(--surface); outline-offset: 0;
}
.nav-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .4); }

@media (min-width: 480px) {
  .logo img { height: 29px; }
  .header__phone { width: auto; padding: 0 10px; background: none; }
  .header__phone span { display: inline; }
  .header__phone svg { display: none; }
}

/* Широкие экраны: первая строка — логотип, поиск, телефон, корзина; вторая — категории.
   Категорий может быть сколько угодно: строка прокручивается и ничего не сдвигает. */
@media (min-width: 900px) {
  :root { --header-h: 80px; --nav-h: 50px; }
  html { scroll-padding-top: calc(var(--header-h) + var(--nav-h) + 16px); }
  .header__burger, .nav-backdrop, .nav__search { display: none !important; }
  .header__row { gap: 20px; }
  .logo img { height: 36px; }
  .header__phone { font-size: 17px; }
  .nav {
    position: static; width: auto; padding: 0; background: none; overflow: visible;
    transform: none; visibility: visible; transition: none; border-top: 1px solid var(--line);
  }
  .nav__inner {
    flex-direction: row; align-items: center; gap: 2px; height: var(--nav-h);
    max-width: 1232px; margin: 0 auto; padding: 0 8px;
    overflow-x: auto; scrollbar-width: none;
  }
  .nav__inner::-webkit-scrollbar { display: none; }
  .nav__link { padding: 7px 12px; font-size: 16px; white-space: nowrap; flex-shrink: 0; border-radius: 999px; }
  .nav__link--first { margin: 0 0 0 auto; }
}

/* --- Кнопки ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
  font-weight: 600; white-space: nowrap; transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); }
.btn--soft { background: var(--accent-soft); color: var(--accent); }
.btn--soft:hover { background: var(--accent); color: #fff; }
.btn--sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn--lg { height: 54px; padding: 0 28px; font-size: 17px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; pointer-events: none; }

/* --- Секции ------------------------------------------------------------ */
.section { margin-top: 48px; }
.section--first { margin-top: 28px; }
.section__head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.section__title { font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; margin-bottom: 20px; }
.section__head .section__title { margin-bottom: 0; }

.search { position: relative; width: 100%; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input {
  width: 100%; height: 44px; padding: 0 16px 0 42px; border: 0; border-radius: 999px;
  background: var(--surface); outline-offset: 0;
}

@media (min-width: 700px) {
  .section { margin-top: 72px; }
  .section--first { margin-top: 36px; }
  .section__head { flex-direction: row; align-items: center; justify-content: space-between; margin-bottom: 28px; }
  .section__title { font-size: 34px; margin-bottom: 28px; }
  .search { width: 320px; }
}

/* --- Слайдер баннеров -------------------------------------------------- */
/* Две картинки: для телефона 1080×1080 (рамка 1:1) и для компьютера 2000×800 (от 700px, рамка 5:2).
   Картинка заполняет баннер, белые надписи внизу слева на мягком затемнении (у баннера без надписей его нет).
   Нет картинки для телефона — на телефоне виден центр картинки для компьютера.
   Точки — под баннером, стрелки — по центру баннера у краёв. */
.hero { margin-top: 16px; }
.slider { position: relative; }
.slider__track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  overscroll-behavior-x: contain; border-radius: var(--radius);
}
.slider__track::-webkit-scrollbar { display: none; }
.banner {
  position: relative; flex: 0 0 100%; scroll-snap-align: start; min-width: 0; overflow: hidden;
  display: block; aspect-ratio: 1 / 1; background: var(--surface);
  container-type: inline-size; /* размер надписей зависит от ширины баннера */
}
.banner picture { display: contents; }
.banner__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner__content {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px;
  padding: 24px 20px; color: #fff; overflow-wrap: anywhere; hyphens: auto;
  background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, .28) 40%, rgba(0, 0, 0, 0) 70%);
  text-shadow: 0 1px 12px rgba(0, 0, 0, .25);
}
/* Длинные надписи обрезаются многоточием, а не вылезают за край баннера */
.banner__kicker, .banner__title, .banner__text {
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden;
}
/* Высота строки не меньше 1.35: иначе обрезка срезает хвосты «ц», «у», «д», «Щ» у последней строки */
.banner__kicker { -webkit-line-clamp: 1; line-clamp: 1; }
.banner__title { -webkit-line-clamp: 3; line-clamp: 3; }
.banner__text { -webkit-line-clamp: 3; line-clamp: 3; }
.banner__kicker {
  font-size: clamp(12px, 3.4cqw, 14px); line-height: 1.35; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  opacity: .9;
}
.banner__title { font-size: clamp(24px, 8.5cqw, 36px); line-height: 1.35; font-weight: 800; text-wrap: balance; }
/* Значок в заголовке ([new], [hot]...) — по высоте строки, как буква */
.banner__badge {
  display: inline-block; height: 1em; width: auto; margin: 0 .08em; vertical-align: -.12em;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .25)); user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.banner__text { font-size: clamp(15px, 4.6cqw, 19px); line-height: 1.35; opacity: .92; }

.slider__arrow {
  display: none; position: absolute; z-index: 1;
  top: calc((100% - 20px) / 2); transform: translateY(-50%); /* центр баннера: 20px снизу — точки */
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--text); font-size: 26px; line-height: 1; padding-bottom: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}
.slider__arrow--prev { left: 16px; }
.slider__arrow--next { right: 16px; }
.slider__dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.slider__dots button {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px;
  background: var(--line); transition: width .2s, background .2s;
}
.slider__dots button.is-active { width: 22px; background: var(--text); }

@media (min-width: 700px) {
  .hero { margin-top: 24px; }
  .banner { aspect-ratio: 5 / 2; }
  .banner__content {
    gap: 12px; padding: 40px clamp(32px, 5cqw, 64px) clamp(32px, 5cqw, 64px);
    background:
      linear-gradient(to right, rgba(0, 0, 0, .4), rgba(0, 0, 0, 0) 55%),
      linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 60%);
  }
  .banner__kicker, .banner__title, .banner__text { max-width: min(640px, 55%); }
  .banner__kicker { font-size: clamp(13px, 1.2cqw, 16px); }
  .banner__title { font-size: clamp(30px, 3.6cqw, 56px); line-height: 1.35; }
  .banner__text { font-size: clamp(16px, 1.6cqw, 21px); -webkit-line-clamp: 2; line-clamp: 2; }
  .slider__arrow { display: block; opacity: 0; transition: opacity .2s; }
  .slider:hover .slider__arrow, .slider__arrow:focus-visible { opacity: 1; }
}

/* --- Плитка категорий -------------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tile {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border-radius: var(--radius); background: var(--surface);
}
.tile__img, .tile .img-placeholder { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s; }
.tile:hover .tile__img { transform: scale(1.04); }
.tile__name { padding: 12px 14px 14px; font-weight: 600; }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(4, 1fr); gap: 16px; } .tile__name { font-size: 17px; padding: 14px 18px 16px; } }

/* --- Блюдо дня: квадратное фото на цветной подложке, текст справа ------------
   Высота задаётся размером фото (ПК — 228px, телефон — 112px), текст обрезается по строкам. */
.dish-day__card {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  border-radius: var(--radius); background: var(--surface);
}
.dish-day__media {
  position: relative; display: block; flex: 0 0 auto; width: 112px; aspect-ratio: 1;
  overflow: hidden; border-radius: var(--radius-sm); background: #fff;
}
.dish-day__media img, .dish-day__media .img-placeholder { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.dish-day__card:hover .dish-day__media img { transform: scale(1.04); }
.dish-day__media .badges { top: 4px; left: 4px; }
.dish-day__media .badges img { height: 20px; }
.dish-day__body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.dish-day__label {
  padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.dish-day__title { font-size: 18px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.dish-day__text {
  color: #45443f; font-size: 14px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dish-day__weight { color: var(--muted); font-size: 13px; }
.dish-day__footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.dish-day__footer .btn { height: 38px; padding: 0 16px; font-size: 14px; }
.price--lg { font-size: 18px; }
@media (max-width: 379px) {
  .dish-day__media { width: 92px; }
  .dish-day__text { display: none; }
}
@media (min-width: 700px) {
  .dish-day__card { gap: 28px; padding: 16px; }
  .dish-day__media { width: 228px; }
  .dish-day__media .badges { top: 8px; left: 8px; }
  .dish-day__media .badges img { height: 30px; }
  .dish-day__body { gap: 8px; padding-right: 16px; }
  .dish-day__label { padding: 3px 10px; font-size: 12px; }
  .dish-day__title { font-size: 28px; }
  .dish-day__text { font-size: 16px; line-height: 1.5; -webkit-line-clamp: 3; max-width: 640px; }
  .dish-day__weight { font-size: 14px; }
  .dish-day__footer { gap: 16px; margin-top: 6px; }
  .dish-day__footer .btn { height: 46px; padding: 0 24px; font-size: 16px; }
  .price--lg { font-size: 24px; }
}

/* --- Карточки блюд ----------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px 10px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 36px 20px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 44px 24px; } }

.card { display: flex; flex-direction: column; min-width: 0; }
.card__media {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius); background: var(--surface); aspect-ratio: 1;
}
.card__media img, .card__media .img-placeholder { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card__media img { transform: scale(1.04); }
.img-placeholder { background: var(--surface); }
.badges { position: absolute; top: 8px; left: 8px; display: flex; align-items: center; gap: 4px; pointer-events: none; }
.badges img { height: 30px; width: auto; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .18)); }
.card--compact .badges img { height: 24px; }
.product__media { position: relative; }
.product__media .badges { top: 14px; left: 14px; gap: 8px; }
.product__media .badges img { height: 46px; }
@media (min-width: 700px) { .badges img { height: 36px; } .card--compact .badges img { height: 28px; } }
.card__body { display: flex; flex-direction: column; flex: 1; padding: 12px 2px 0; }
.card__title { font-size: 16px; line-height: 1.25; font-weight: 600; }
.card__text {
  margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__weight { margin-top: 4px; color: var(--muted); font-size: 13px; }
.card__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; }
.price { font-size: 17px; font-weight: 700; white-space: nowrap; }
@media (min-width: 700px) { .card__title { font-size: 18px; } .price { font-size: 19px; } }
@media (max-width: 380px) { .card__footer .btn { width: 100%; } }

/* --- Инфо-блоки главной ------------------------------------------------ */
.info-grid { display: grid; gap: 12px; }
.info { padding: 24px; border-radius: var(--radius); background: var(--surface); }
.info--accent { background: var(--accent-soft); }
.info__title { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.info__text { color: #45443f; }
.info__text p + p { margin-top: 8px; }
@media (min-width: 900px) { .info-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } .info { padding: 32px; } }

.about-teaser { max-width: 720px; }
.about-teaser .section__title { margin-bottom: 14px; }
.about-teaser p { color: #45443f; font-size: 17px; }
.link-arrow { display: inline-block; margin-top: 14px; font-weight: 600; color: var(--accent); }

.section--docs { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.docs { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.docs a:hover, .footer a:hover, .crumbs a:hover { color: var(--text); text-decoration: underline; }

/* --- Карточка блюда ---------------------------------------------------- */
.crumbs { display: flex; gap: 8px; margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.product { display: grid; gap: 24px; }
.product__media { border-radius: var(--radius); overflow: hidden; background: var(--surface); aspect-ratio: 1; }
.product__media img, .product__media .img-placeholder { width: 100%; height: 100%; object-fit: cover; }
.product__info { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.product__title { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.01em; }
.product__weight { margin-top: -12px; color: var(--muted); }
.product__block h2, .modifiers legend { font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.prose { font-size: 17px; line-height: 1.6; color: #33322e; }
.prose p + p { margin-top: 12px; }
/* Разметка из Markdown (тексты из админки) */
.prose > * + * { margin-top: 12px; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); line-height: 1.25; font-weight: 700; }
.prose h1 { font-size: 26px; }
.prose h2 { font-size: 22px; }
.prose h3 { font-size: 19px; }
.prose h4 { font-size: 17px; }
.prose > * + h1, .prose > * + h2, .prose > * + h3 { margin-top: 28px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 4px; }
.prose li > ul, .prose li > ol { margin-top: 4px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-hover); }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--line); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.prose code { padding: 1px 5px; border-radius: 6px; background: var(--surface); font-size: .9em; }
.prose pre { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); overflow-x: auto; }
.prose pre code { padding: 0; background: none; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--surface); font-weight: 600; }

.product__note { color: var(--muted); font-size: 14px; }
.nutrition { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nutrition div { display: flex; flex-direction: column-reverse; padding: 12px 10px; border-radius: var(--radius-sm); background: var(--surface); text-align: center; }
.nutrition dd { font-weight: 700; }
.nutrition dd small { font-weight: 400; color: var(--muted); }
.nutrition dt { font-size: 12px; color: var(--muted); }

.modifiers { display: flex; flex-direction: column; gap: 8px; }
.modifiers__hint { font-weight: 400; color: var(--accent); margin-left: 6px; }
.modifier {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background .15s;
}
.modifier:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.modifier input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); flex-shrink: 0; }
.modifier__name { flex: 1; }
.modifier__price { color: var(--muted); white-space: nowrap; }
.modifiers.is-invalid .modifier { border-color: var(--accent); }

.buy {
  display: flex; gap: 10px; position: sticky; bottom: 0; z-index: 5;
  margin: 4px -16px 0; padding: 12px 16px; background: rgba(255, 255, 255, .95); border-top: 1px solid var(--line);
}
.buy__button { flex: 1; padding: 0 16px; }

.stepper { display: inline-flex; align-items: center; height: 54px; border-radius: 999px; background: var(--surface); flex-shrink: 0; }
.stepper button { width: 44px; height: 100%; border: 0; background: none; font-size: 22px; line-height: 1; border-radius: 999px; }
.stepper button[disabled] { opacity: .35; pointer-events: none; }
.stepper input, .stepper span { width: 34px; border: 0; background: none; text-align: center; font-weight: 600; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper--sm { height: 40px; }
.stepper--sm button { width: 36px; font-size: 20px; }
.stepper--sm span { width: 26px; }

@media (min-width: 900px) {
  .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
  .product__media { position: sticky; top: calc(var(--header-h) + var(--nav-h, 0px) + 24px); }
  .product__title { font-size: 40px; }
  .buy { position: static; margin: 4px 0 0; padding: 0; border: 0; background: none; }
  .grid--compact { grid-template-columns: repeat(4, 1fr); }
}

/* --- Корзина ----------------------------------------------------------- */
.cart-line {
  display: grid; grid-template-columns: 72px 1fr auto; grid-template-areas: "media main remove" "media qty total";
  gap: 8px 14px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line);
}
.cart-line__media { grid-area: media; align-self: start; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); aspect-ratio: 1; }
.cart-line__media img, .cart-line__media .img-placeholder { width: 100%; height: 100%; object-fit: cover; }
.cart-line__main { grid-area: main; min-width: 0; }
.cart-line__title { font-weight: 600; line-height: 1.25; }
.cart-line__mods, .cart-line__unit { color: var(--muted); font-size: 14px; margin-top: 2px; }
.cart-line .stepper { grid-area: qty; justify-self: start; }
.cart-line__total { grid-area: total; font-weight: 700; white-space: nowrap; text-align: right; }
.cart-line__remove {
  grid-area: remove; align-self: start; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: none; color: var(--muted); font-size: 22px; line-height: 1;
}
.cart-line__remove:hover { background: var(--surface); color: var(--text); }
@media (min-width: 700px) {
  .cart-line { grid-template-columns: 96px 1fr auto 110px auto; grid-template-areas: "media main qty total remove"; gap: 20px; }
  .cart-line__remove { align-self: center; }
}

.cart-summary { margin-top: 24px; padding: 24px; border-radius: var(--radius); background: var(--surface); }
.cart-summary__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 18px; }
.cart-summary__row strong { font-size: 24px; }
.cart-summary__note { margin: 8px 0 20px; color: var(--muted); font-size: 14px; }
[data-cart-lines].is-loading { opacity: .6; pointer-events: none; }

.empty { color: var(--muted); padding: 24px 0; }
.empty--cart { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }

/* --- Текстовые страницы ------------------------------------------------ */
.page { margin-top: 36px; }
.page__title { font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.01em; margin-bottom: 16px; }
.page__lead { font-size: 19px; color: #45443f; margin-bottom: 28px; }
.page__media { width: 100%; border-radius: var(--radius); margin-bottom: 28px; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface); }
.advantages { display: grid; gap: 12px; margin-top: 36px; }
.advantages li { padding: 22px; border-radius: var(--radius); background: var(--surface); }
.advantages h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.advantages p { color: var(--muted); font-size: 15px; }
.cta { margin-top: 48px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
@media (min-width: 700px) {
  .page { margin-top: 56px; }
  .page__title { font-size: 48px; }
  .advantages { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

/* --- Футер ------------------------------------------------------------- */
.footer { background: var(--surface); padding: 40px 0 24px; color: var(--muted); font-size: 14px; }
.footer__grid { display: grid; gap: 28px; }
.footer__logo { width: 72px; height: auto; margin-bottom: 14px; }
.footer__phone { display: inline-block; font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.footer__links { display: flex; flex-direction: column; gap: 10px; }
.footer__bottom { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
@media (min-width: 700px) { .footer__grid { grid-template-columns: 2fr 1fr 1.4fr; } }

/* --- Уведомление «добавлено» ------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 60; transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 999px;
  background: var(--text); color: #fff; font-size: 15px; text-align: center;
  opacity: 0; transition: opacity .2s, transform .2s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-error { background: var(--accent); }

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

/* --- Оформление заказа ------------------------------------------------- */
.checkout { display: grid; gap: 28px; }
.checkout__main { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.alert--flat { margin-top: 0; }

.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--surface); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; align-items: center; justify-content: center; gap: 6px; height: 46px; border-radius: 999px; font-weight: 600; transition: background .15s, color .15s; }
.segmented b { color: var(--accent); }
.segmented input:checked + span { background: var(--bg); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.segmented input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }

.form-block { display: flex; flex-direction: column; gap: 14px; }
.form-block > legend { font-size: 20px; font-weight: 800; margin-bottom: 14px; padding: 0; }
.form-block > legend label { font: inherit; }
/* Персоны и приборы — одна группа: без отступа между ними (8px — как между кнопками приборов) */
.form-block--tight { gap: 8px; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-size: 14px; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; height: 50px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg); font: inherit; color: inherit; transition: border-color .15s;
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; min-height: 88px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--text); }
.field--short { max-width: 160px; }
.field__error { display: none; color: var(--accent); font-size: 14px; }
.is-invalid > .field__error, .is-invalid .field__error:not(:empty), .field__error--shown { display: block; }
.field__error:empty { display: none !important; }
.field.is-invalid input, .field.is-invalid select, .field.is-invalid textarea { border-color: var(--accent); }
.field__hint { color: var(--muted); font-size: 14px; }
.link { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.field-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 560px) { .field-row { grid-template-columns: repeat(4, 1fr); } .field-row--2 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 559px) { .field-row--2 { grid-template-columns: 1fr; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.check a { text-decoration: underline; text-underline-offset: 3px; }
.check--consent { font-size: 14px; color: #45443f; margin: 16px 0; }
.check.is-invalid span { color: var(--accent); }

.options { display: flex; flex-wrap: wrap; gap: 8px; }
.option { position: relative; cursor: pointer; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span { display: flex; align-items: center; height: 46px; padding: 0 18px; border: 1.5px solid var(--line); border-radius: 999px; font-weight: 500; transition: border-color .15s, background .15s; }
.option input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.option input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
.form-block.is-invalid .option span { border-color: var(--accent); }

.pickup { padding: 20px; border-radius: var(--radius); background: var(--surface); }
.pickup__discount { display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; }
.pickup__address { font-size: 18px; font-weight: 700; }
.pickup__hours { color: var(--muted); margin-top: 2px; }
.field-row.time-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 440px; }
.pickup-packaging { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.pickup-packaging__title { font-weight: 600; }

.map { border-radius: var(--radius); overflow: hidden; background: var(--surface); aspect-ratio: 4 / 3; }
.map iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (min-width: 700px) { .map { aspect-ratio: 16 / 9; } }
.map--home { margin-top: 20px; }

.summary { padding: 24px; border-radius: var(--radius); background: var(--surface); }
.summary__title { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
.summary__items { display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.summary__items li { display: flex; justify-content: space-between; gap: 12px; }
.summary__items li span:last-child { white-space: nowrap; font-weight: 600; }
.summary__items small { display: block; color: var(--muted); font-size: 13px; }
.summary__edit { display: inline-block; margin-top: 10px; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.summary__totals { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.summary__totals div { display: flex; justify-content: space-between; gap: 12px; }
.summary__totals dt { color: var(--muted); }
.summary__total { margin-top: 6px; font-size: 22px; font-weight: 800; }
.summary__total dt { color: var(--text); }
.summary__note { margin-top: 12px; text-align: center; color: var(--muted); font-size: 13px; }

@media (min-width: 960px) {
  .checkout { grid-template-columns: minmax(0, 1fr) 380px; gap: 56px; align-items: start; }
  .checkout__side { position: sticky; top: calc(var(--header-h) + var(--nav-h, 0px) + 24px); }
}

.success { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 24px 0; }
.success__icon { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 28px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
.success .section__title { margin-bottom: 8px; }
.success__text { font-size: 18px; color: #45443f; margin-bottom: 20px; }
.success__details { width: 100%; margin-bottom: 24px; padding: 20px; border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 10px; }
.success__details div { display: flex; justify-content: space-between; gap: 16px; }
.success__details dt { color: var(--muted); flex-shrink: 0; }
.success__details dd { text-align: right; font-weight: 600; }
.success__number { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.success__number dd { font-size: 18px; font-weight: 800; color: var(--accent); }

/* --- Круглые чекбоксы -------------------------------------------------- */
.check input[type="checkbox"], .modifier input[type="checkbox"] {
  -webkit-appearance: none; appearance: none; flex-shrink: 0; cursor: pointer;
  width: 22px; height: 22px; margin: 0; border: 1.5px solid #c9c6bf; border-radius: 50%;
  background: var(--bg) center / 12px 12px no-repeat; transition: background-color .15s, border-color .15s;
}
.check input[type="checkbox"] { margin-top: 1px; }
.check input[type="checkbox"]:checked, .modifier input[type="checkbox"]:checked {
  border-color: var(--accent); background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.4 2.4 4.6-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.check.is-invalid input[type="checkbox"] { border-color: var(--accent); }

.summary__delivery { margin-top: 12px; color: var(--muted); font-size: 14px; }

.page__subtitle { font-size: 24px; font-weight: 800; margin: 36px 0 12px; }
.map--page { margin-top: 28px; }

.field-row--address { grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-row--address { grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); } }
.link--map { align-self: flex-start; }
.field .stepper { align-self: flex-start; height: 50px; }
.field .stepper input { width: 44px; height: auto; padding: 0; border: 0; background: none; }

/* Живой поиск: пока есть запрос, вместо обычного содержимого блока видны результаты */
.is-searching > :not(.section__head):not([data-live-results]):not(.search) { display: none; }
