/*
 * Витрина «Отборинки» — строго по брендбуку (PDF в проекте):
 *  цвета: Отборный морковный #CA4B20, Натуральный лён #E9E4E3, Небесный голубой #B0D0EF;
 *         графитовая типографика #2E2D2B (макеты «Ценник», «Таблички с УТП»); белый — базовый ценник.
 *  шрифт: Zona Pro. Заголовок — Bold, капс, интерлиньяж 90%, трекинг 25;
 *         подзаголовок — SemiBold 100%/0; текст — Regular 120%/0 (стр. «Фирменные шрифты»).
 *  паттерн: вертикальная голубая полоса на льне (≈47:40).
 *  карточка товара = «Ценник»: белый базовый; плашка НОВИНКА — на голубом, АКЦИЯ — на морковном; цена с копейками надстрочно, «руб/кг».
 *  кнопки = «Сервисные наклейки»: контрастный фирменный цвет + белая типографика.
 *  баннер = «Постеры»; преимущества = «Таблички с УТП»; карта = «Виртуальная карта покупателя».
 */
@font-face { font-family: 'Zona Pro'; src: url('/static/fonts/ZonaPro-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Zona Pro'; src: url('/static/fonts/ZonaPro-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Zona Pro'; src: url('/static/fonts/ZonaPro-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --carrot: #CA4B20;
  --linen: #E9E4E3;
  --sky: #B0D0EF;
  --graphite: #2E2D2B;
  --white: #FFFFFF;
  --font: 'Zona Pro', system-ui, sans-serif;
  --stripes: repeating-linear-gradient(90deg, var(--sky) 0 20px, var(--linen) 20px 37px);
  --stripes-w: repeating-linear-gradient(90deg, var(--sky) 0 20px, var(--white) 20px 37px);
  --track: .025em;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; background: var(--linen); color: var(--graphite); font: 400 16px/1.2 var(--font); min-height: 100dvh; padding-bottom: 96px; }
img { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.h1 { font-weight: 700; text-transform: uppercase; line-height: .9; letter-spacing: var(--track); }
.h2 { font-weight: 600; font-size: 22px; line-height: 1; }
.lbl { font-weight: 600; font-size: 14px; line-height: 1; }
.note { font-size: 14px; line-height: 1.2; }
.center { text-align: center; }
.lead { font-size: 16px; line-height: 1.2; }

/* Шапка: логотип на льне с охранным полем (высота «И» ≈ 1/4 высоты лого) */
.top { position: sticky; top: 0; z-index: 20; background: var(--linen); border-bottom: 1px solid rgba(46,45,43,.12); }
.top-in { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: block; padding: 8px 0; }
.logo img { width: 168px; height: auto; }
.me-btn { font-weight: 700; text-transform: uppercase; letter-spacing: var(--track); line-height: .9; font-size: 14px;
  background: var(--carrot); color: var(--white); padding: 12px 14px 11px; border-radius: 12px; }

/* Кнопки — «Сервисные наклейки» */
.btn { display: block; width: 100%; text-align: center; text-decoration: none; background: var(--carrot); color: var(--white);
  font-weight: 700; text-transform: uppercase; letter-spacing: var(--track); line-height: .9; font-size: 16px;
  padding: 19px 16px 17px; border-radius: 14px; }
.btn:active { filter: brightness(.92); }
.btn[disabled] { opacity: .5; cursor: default; }
.link { display: block; margin: 28px auto 0; text-decoration: underline; font-size: 14px; }

/* Герой — шаблон поста «Больше скидок с нашей картой» */
.hero { margin-top: 16px; background: var(--carrot); color: var(--white); border-radius: 20px; overflow: hidden; position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; min-height: 230px; }
.hero-text { padding: 22px 20px 24px; display: grid; gap: 12px; align-content: center; position: relative; z-index: 1; }
/* Заголовки digital-носителей брендбука — Zona Pro Bold строчными, плотный интерлиньяж */
.hero-h { font-weight: 700; font-size: clamp(28px, 7.4vw, 56px); line-height: .95; letter-spacing: 0; }
.hero-sub { font-size: 14px; line-height: 1.2; max-width: 26em; opacity: .95; }
.btn-light { justify-self: start; background: var(--linen); color: var(--carrot); font-weight: 700; text-transform: uppercase; letter-spacing: var(--track);
  line-height: .9; font-size: 14px; padding: 14px 16px 12px; border-radius: 12px; }
.btn-light:active { filter: brightness(.95); }
.hero-card { position: absolute; inset: 0; pointer-events: none; }
.hero-sub { max-width: 15em; }
.lcard { position: absolute; right: -34px; bottom: -22px; width: 150px; aspect-ratio: 1.58; background: var(--linen); border-radius: 14px;
  transform: rotate(-14deg); box-shadow: 0 12px 26px rgba(46,45,43,.25); overflow: hidden; display: grid; place-items: center; align-content: center; gap: 2px; }
.lcard-band { position: absolute; inset: 0 0 auto 0; height: 26%; background: var(--stripes); }
.lcard img { width: 66%; height: auto; margin-top: 18%; }
.lcard span { color: var(--carrot); font-weight: 600; font-size: 10px; }
@media (min-width: 860px) {
  .hero { min-height: 320px; border-radius: 24px; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .hero-card { position: relative; inset: auto; align-self: stretch; }
  .hero-sub { max-width: 26em; }
  .hero-text { padding: 40px 0 40px 48px; gap: 18px; }
  .hero-sub { font-size: 17px; }
  .btn-light { font-size: 16px; padding: 18px 22px 16px; border-radius: 14px; }
  .lcard { width: 340px; right: 40px; bottom: 32px; border-radius: 22px; transform: rotate(-10deg); }
  .lcard span { font-size: 15px; }
}

/* Плитки преимуществ — как меню сообщества ВК */
.perks { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 4px; }
.perks li { display: grid; justify-items: center; gap: 8px; text-align: center; }
.ico { width: 100%; aspect-ratio: 1.47; border-radius: 12px; display: grid; place-items: center; max-height: 110px; }
.ico svg { width: 40%; max-width: 54px; fill: none; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.ico-linen { background: var(--white); } .ico-linen svg { stroke: var(--carrot); }
.ico-carrot { background: var(--carrot); } .ico-carrot svg { stroke: var(--white); }
.ico-sky { background: var(--sky); } .ico-sky svg { stroke: var(--carrot); }
.pt { font-weight: 600; font-size: 13px; line-height: 1.05; }
@media (min-width: 860px) { .perks { gap: 16px; margin-top: 16px; } .ico { max-height: 88px; } .pt { font-size: 16px; } }

/* Разделы — навигационные таблички: светлая табличка в тонкой рамке */
.toolbar { position: sticky; top: 72px; z-index: 10; background: var(--linen); margin: 0 -16px; padding: 12px 16px 0; display: grid; gap: 10px; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 0 0 12px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: none; text-decoration: none; color: var(--carrot); background: var(--linen); border: 2px solid var(--carrot); border-radius: 3px;
  padding: 9px 12px 8px; font-weight: 700; text-transform: uppercase; letter-spacing: var(--track); font-size: 13px; line-height: .9; }
.cats a.on { background: var(--carrot); border-color: var(--carrot); color: var(--white); }

.cat-title { font-weight: 700; line-height: .95; font-size: 28px; color: var(--carrot); margin: 22px 0 12px; scroll-margin-top: 140px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }

/* Карточка товара = «Ценник» */
.tag { min-width: 0; background: var(--white); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; border-radius: 4px; }
.tag.new { background: var(--sky); }
.tag .ph { aspect-ratio: 4 / 3; background: var(--linen); position: relative; overflow: hidden; }
.tag .ph img { width: 100%; height: 100%; object-fit: cover; }
.tag .ph.empty, .pd-empty { background: var(--white); display: grid; place-items: center; }
.tag .ph.empty::before, .pd-empty::before { content: ''; width: 58%; aspect-ratio: 1; border-radius: 50%; background: var(--stripes-w); box-shadow: inset 0 0 0 3px var(--carrot); }
.tag .ph.empty::after, .pd-empty::after { content: ''; position: absolute; left: 14%; right: 14%; top: 50%; height: 30%; transform: translateY(-50%) rotate(-8deg);
  background: url('/static/logo-script.svg') center / contain no-repeat; }
.tag .in { padding: 12px 12px 4px; display: grid; gap: 4px; align-content: start; }
.tag .name { font-weight: 700; text-transform: uppercase; letter-spacing: var(--track); line-height: .9; font-size: 15px; overflow-wrap: anywhere; }
.tag .sub { font-size: 13px; }
.tag .plaque { justify-self: start; margin-left: -12px; background: var(--graphite); color: var(--white); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track); font-size: 12px; line-height: .9; padding: 6px 10px 5px 12px; }
.tag .foot { display: grid; gap: 10px; padding: 6px 12px 12px; }
.tag .foot .add, .tag .foot .qty { width: 100%; justify-content: space-between; }
.price { font-weight: 700; line-height: .85; font-size: 34px; letter-spacing: 0; white-space: nowrap; }
.price sup { font-size: .45em; vertical-align: top; position: relative; top: .1em; margin-left: 1px; }
.per { font-size: 12px; line-height: 1.1; display: block; margin-top: 4px; }
.add { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--carrot); color: var(--white); font-weight: 700; font-size: 24px; line-height: 1; }
.qty { flex: none; display: flex; align-items: center; background: var(--carrot); color: var(--white); border-radius: 12px; height: 44px; }
.qty button { width: 34px; height: 44px; color: var(--white); font-weight: 700; font-size: 20px; }
.qty span { min-width: 40px; text-align: center; font-weight: 600; font-size: 13px; }

/* Нижняя кнопка корзины */
.cartbar { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 30; max-width: 560px; margin: 0 auto;
  display: flex; justify-content: space-between; background: var(--carrot); color: var(--white); border-radius: 14px; padding: 19px 18px 17px;
  font-weight: 700; text-transform: uppercase; letter-spacing: var(--track); line-height: .9; }

/* Шторки */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(46,45,43,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-in { background: var(--linen); width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-in { border-radius: 22px; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.x { font-size: 30px; line-height: 1; width: 40px; height: 40px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(46,45,43,.12); }
.line .n { font-weight: 600; font-size: 15px; line-height: 1; }
.line .s { font-weight: 700; }
.line .warn { grid-column: 1 / -1; color: var(--carrot); font-size: 13px; }
.checkout { display: grid; gap: 12px; }
.seg { border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg legend { margin-bottom: 8px; }
.seg label span { display: block; text-align: center; padding: 14px 8px 12px; border: 2px solid var(--graphite); border-radius: 12px;
  font-weight: 700; text-transform: uppercase; letter-spacing: var(--track); line-height: .9; font-size: 14px; background: var(--white); }
.seg input { position: absolute; opacity: 0; }
.seg input:checked + span { background: var(--carrot); border-color: var(--carrot); color: var(--white); }
.seg input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }
.fld { display: grid; gap: 6px; }
.fld input { background: var(--white); border: 2px solid transparent; border-radius: 12px; padding: 13px 12px; font-size: 16px; }
.fld input:focus { border-color: var(--sky); outline: none; }
.chk { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.chk input { width: 22px; height: 22px; accent-color: var(--carrot); }
.points { background: var(--sky); border-radius: 12px; padding: 12px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.total b { font-weight: 700; font-size: 24px; }
.err { color: var(--carrot); font-weight: 600; font-size: 14px; }
.actions { display: grid; gap: 10px; }

/* Личный кабинет */
.back { display: inline-block; margin: 16px 0; text-decoration: none; font-weight: 600; }
.vcard { background: var(--carrot); color: var(--white); border-radius: 22px; overflow: hidden; text-align: center; max-width: 420px; margin: 0 auto; }
.vcard-top { padding: 28px 20px 22px; display: flex; justify-content: center; }
.vcard-top img { width: 190px; height: auto; }
.vcard .band { height: 54px; background: var(--stripes); }
.vcard-body { padding: 20px 20px 24px; display: grid; gap: 6px; }
.vcard .owner { font-weight: 700; font-size: 28px; line-height: .9; letter-spacing: var(--track); margin-bottom: 10px; }
.vcard .pts { font-weight: 700; font-size: 56px; line-height: .9; letter-spacing: var(--track); }
.vcard .bc { background: var(--white); color: var(--graphite); border-radius: 16px; padding: 14px 16px 10px; margin-top: 14px; display: grid; justify-items: center; gap: 6px; }
.vcard .bc img { width: 100%; max-width: 280px; height: 80px; object-fit: fill; }
.vcard .num { font-weight: 600; letter-spacing: .1em; font-size: 15px; }
.account-note { margin-top: 10px; }
.sect { margin: 28px 0 10px; }
.list { display: grid; gap: 8px; }
.row { background: var(--white); border-radius: 0 16px 16px 0; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.row .when { font-size: 13px; }
.row .amt { font-weight: 700; align-self: center; grid-row: span 2; }
.row .amt.plus { color: var(--carrot); }
.badge { justify-self: start; background: var(--sky); font-weight: 700; text-transform: uppercase; letter-spacing: var(--track); font-size: 11px; line-height: .9; padding: 5px 8px 4px; border-radius: 6px; }
.badge.bad { background: var(--carrot); color: var(--white); }

.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 50; background: var(--graphite); color: var(--white);
  padding: 12px 16px; border-radius: 12px; font-size: 14px; max-width: calc(100% - 32px); }

.load-err { background: var(--white); border-radius: 0 16px 16px 0; padding: 18px; display: grid; gap: 8px; margin-top: 12px; }
.load-err code { font-size: 12px; opacity: .7; overflow-wrap: anywhere; }

/* Подсказки адреса */
.addr { position: relative; display: grid; gap: 12px; }
.suggest { list-style: none; position: absolute; left: 0; right: 0; top: 76px; z-index: 5; background: var(--white); border-radius: 12px;
  box-shadow: 0 10px 24px rgba(46,45,43,.18); max-height: 280px; overflow-y: auto; }
.suggest li { padding: 12px 14px; font-size: 15px; line-height: 1.2; cursor: pointer; border-bottom: 1px solid var(--linen); }
.suggest li:last-child { border-bottom: 0; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--sky); }

body.sheet-open { overflow: hidden; }
body.sheet-open .cartbar { display: none; }
.sheet-in { overscroll-behavior: contain; }

/* правки по прогону */
.back { color: var(--carrot); }
.qty button[disabled] { opacity: .35; cursor: default; }
.vcard + .note { margin-top: 10px; }
.toast { bottom: calc(100px + env(safe-area-inset-bottom)); }
body.sheet-open .toast { bottom: auto; top: 16px; }
/* Десктоп: текст внутри плиток, пиктограмма слева */
@media (min-width: 860px) {
  .perks li { position: relative; }
  .ico { aspect-ratio: auto; height: 88px; max-height: none; justify-items: start; padding-left: 26px; }
  .ico svg { width: 46px; }
  .pt { position: absolute; left: 92px; top: 50%; transform: translateY(-50%); text-align: left; font-size: 18px; line-height: 1.05; }
  .perks li:nth-child(2) .pt { color: var(--white); }
  .cartbar { left: auto; right: max(16px, calc((100vw - 1080px) / 2 + 16px)); margin: 0; width: 360px; }
}

.repeat { justify-self: end; grid-column: 2; align-self: end; background: var(--carrot); color: var(--white); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--track); font-size: 12px; line-height: .9; padding: 9px 12px 8px; border-radius: 10px; }

.badge.go { background: var(--carrot); color: var(--white); }
.badge.ok { background: var(--linen); color: var(--graphite); }

/* Без зума на телефоне: двойной тап не увеличивает страницу (iOS игнорирует user-scalable, а touch-action — нет) */
html, body, button, a, input, label { touch-action: manipulation; }
input, textarea, select { font-size: 16px; } /* меньше 16 px — iOS зумит при фокусе в поле */

/* Карточка заказа в кабинете: шапка (номер · сумма), состав, низ — статус слева и «Повторить» справа на одной линии */
.row.order { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
.order .o-head { align-self: baseline; }
.order .o-sum { font-weight: 700; align-self: baseline; white-space: nowrap; }
.order .o-what { grid-column: 1 / -1; }
.order .o-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.order .badge, .order .repeat { display: inline-flex; align-items: center; height: 30px; padding: 2px 12px 0; line-height: 1; border-radius: 8px; font-size: 12px; }
.order .repeat { grid-column: auto; justify-self: auto; align-self: auto; }
.order .repeat { background: transparent; color: var(--carrot); box-shadow: inset 0 0 0 2px var(--carrot); }

/* Поиск */
.search { display: flex; align-items: center; gap: 10px; background: var(--white); border-radius: 12px; padding: 0 6px 0 14px; height: 48px; border: 2px solid transparent; }
.search:focus-within { border-color: var(--sky); }
.search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--carrot); stroke-width: 2.4; stroke-linecap: round; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 16px; height: 100%; }
.search input::-webkit-search-cancel-button { display: none; }
.search button { width: 36px; height: 36px; font-size: 24px; line-height: 1; color: var(--graphite); }

/* Главная: раздел = заголовок + горизонтальная лента, «Все N» ведёт на страницу раздела */
.shelf-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.shelf-head .cat-title { margin: 0; }
.all-link { flex: none; font-weight: 700; text-transform: uppercase; letter-spacing: var(--track); font-size: 13px; line-height: .9; color: var(--carrot); text-decoration: none; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100vw - 40px) / 2.2); gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; scroll-padding: 0 16px; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 640px) { .rail { grid-auto-columns: 210px; gap: 12px; margin: 0; padding: 0 0 4px; scroll-padding: 0; } }
.more { display: grid; place-items: center; align-content: center; gap: 10px; background: var(--carrot); color: var(--white); border-radius: 4px; text-decoration: none; text-align: center; padding: 16px;
  font-weight: 700; text-transform: uppercase; letter-spacing: var(--track); line-height: .95; font-size: 16px; }
.more b { font-size: 40px; letter-spacing: 0; }

/* Страница раздела и результаты поиска */
.page-head { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; flex-wrap: wrap; }
.page-head .cat-title { margin: 0; }
.page-head .count { font-size: 14px; }
.back-link { font-weight: 600; color: var(--carrot); text-decoration: none; }
.empty-state { background: var(--white); border-radius: 0 16px 16px 0; padding: 20px; display: grid; gap: 8px; }
mark { background: var(--sky); color: inherit; border-radius: 3px; padding: 0 1px; }

.page-head:first-child, #catalog > .page-head { scroll-margin-top: 200px; }

.per-kg { opacity: .65; margin-top: 2px; }
.tag .pack { font-weight: 600; }

/* Штрихкод: шире в рамке (масштаб только по горизонтали — пропорции полос сохраняются, сканер читает), поля по бокам */
.vcard .bc { width: 100%; border: 0; cursor: pointer; padding: 16px 26px 12px; }
.vcard .bc img { width: 100%; max-width: none; height: 96px; object-fit: fill; display: block; }
.bc-hint { font-size: 12px; opacity: .55; }
.bc-full { position: fixed; inset: 0; z-index: 60; background: var(--white); overflow: hidden; }
.bc-rot { position: absolute; left: 50%; top: 50%; width: 100vh; width: 100dvh; height: 100vw; display: grid; justify-items: center; align-content: center; gap: 14px;
  transform: translate(-50%, -50%) rotate(90deg); padding: 0 7vh; }
.bc-rot img { width: 100%; height: 46vw; display: block; }
.bc-rot span { font-weight: 600; letter-spacing: .12em; font-size: 22px; color: var(--graphite); }
.bc-rot .bc-close { font-weight: 400; letter-spacing: 0; font-size: 14px; opacity: .55; }
@media (min-width: 700px) { .bc-rot { transform: translate(-50%, -50%); width: min(90vw, 760px); height: auto; padding: 0; } .bc-rot img { height: 220px; } }

/* Кнопка профиля: иконка человека + баллы / «Войти» */
.me-btn { display: inline-flex; align-items: center; gap: 8px; }
.me-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; flex: none; margin-top: -2px; }

/* Футер */
.foot-site { margin-top: 48px; background: var(--white); }
.foot-in { display: grid; gap: 22px; padding-top: 28px; padding-bottom: 24px; grid-template-columns: 1fr; }
.foot-site .lbl { display: block; margin-bottom: 6px; color: var(--carrot); }
.f-brand img { width: 170px; height: auto; margin-bottom: 8px; }
.f-time { display: block; font-weight: 700; font-size: 34px; line-height: .95; color: var(--carrot); margin-bottom: 4px; }
.f-contacts { display: grid; gap: 4px; }
.foot-site a { color: var(--graphite); }
.f-bots { display: grid; gap: 8px; align-content: start; }
.f-bot { display: inline-flex; align-items: center; gap: 10px; justify-self: start; background: var(--carrot); color: var(--white) !important; text-decoration: none; font-weight: 700;
  text-transform: uppercase; letter-spacing: var(--track); font-size: 14px; line-height: .9; padding: 12px 16px 10px; border-radius: 12px; }
.f-bot svg { width: 18px; height: 18px; fill: currentColor; margin-top: -2px; }
.foot-site .band { height: 14px; background: var(--stripes-w); }
.f-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; padding-top: 14px; padding-bottom: calc(20px + env(safe-area-inset-bottom)); opacity: .8; }
body.has-cart .f-legal { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 860px) { .foot-in { grid-template-columns: 1.3fr 1fr 1fr 1fr; } .f-legal, body.has-cart .f-legal { padding-bottom: 24px; } }
body { padding-bottom: 0; }

.addr-parts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.addr-parts .lbl { font-size: 12px; white-space: nowrap; }
.addr-parts input { padding: 13px 10px; text-align: center; }
@media (max-width: 380px) { .addr-parts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.addr-private { font-size: 14px; }
/* Шторка не выше видимой области (с клавиатурой — над ней) */
.sheet-in { max-height: min(92dvh, calc(var(--vvh, 100dvh) - 12px)); }
.sheet { padding-bottom: var(--kb, 0px); }
/* Под шторкой при открытой клавиатуре — фон шторки, а не витрина (клавиатура iOS 26 полупрозрачная) */
.sheet::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: var(--kb, 0px); background: var(--linen); }

.addr-parts .fld { min-width: 0; }
.addr-parts input { width: 100%; min-width: 0; }
.sheet-in { overflow-x: hidden; }

body { display: flex; flex-direction: column; min-height: 100dvh; }
body > main { flex: 0 0 auto; }
.foot-site { margin-top: auto; }
body > main#shop, body > main#account { margin-bottom: 48px; }

/* Хэдер прибит к экрану (fixed): во встроенных браузерах Telegram/MAX sticky «плавает» при прокрутке и пружине iOS */
.top { position: fixed; top: 0; left: 0; right: 0; padding-top: env(safe-area-inset-top); }
/* Safari 26 (iOS) красит зону за статус-баром и адресной строкой цветом фиксированной полосы у верхнего края
   (полной ширины, без transform). Хэдер при прокрутке уезжает — поэтому отдельная неподвижная льняная полоса */
.edge-tint { position: fixed; top: 0; left: 0; right: 0; height: max(12px, env(safe-area-inset-top)); background: var(--linen); z-index: 21; pointer-events: none; }
/* Встроенные браузеры (Telegram, MAX, iOS) при прокрутке сдвигают окно — над хэдером проглядывал контент.
   Заливаем всё выше хэдера льном: полоса уходит за верх экрана и не видна, пока не нужна */
.top::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 100vh; background: var(--linen); pointer-events: none; }
html { background: var(--linen); }
body { padding-top: calc(72px + env(safe-area-inset-top)); }
.toolbar { top: calc(72px + env(safe-area-inset-top)); }
/* Телефон, глубокая прокрутка: шапка уезжает вверх, закреплён только поиск с разделами.
   Полоса под статус-баром и заливка выше остаются — контент сверху не проглядывает */
@media (max-width: 699px) {
  .top, .toolbar { transition: top .22s ease; }
  body.deep .top { top: -72px; border-bottom-color: transparent; }
  body.deep .toolbar { top: env(safe-area-inset-top); }
}
html { overflow-x: hidden; }

/* Карточка товара */
.tag[data-open] { cursor: pointer; }
.pd { gap: 10px; position: relative; padding-top: 12px; }
.pd-x { position: absolute; right: 10px; top: 10px; z-index: 2; background: rgba(255,255,255,.85); border-radius: 50%; }
.pd-gallery { position: relative; margin: -30px -16px 0; border-radius: 22px 22px 0 0; overflow: hidden; } /* фото до верхнего края шторки, со скруглением */
.pd-slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 3; background: var(--white); }
.pd-slides::-webkit-scrollbar { display: none; }
.pd-slide { flex: 0 0 100%; scroll-snap-align: start; display: grid; }
.pd-slide img { width: 100%; height: 100%; object-fit: cover; }
.pd-empty { height: 100%; position: relative; }
.pd-empty::before { width: auto; height: 62%; }
.pd-empty::after { left: 22%; right: 22%; }
.pd-dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 6px; }
.pd-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.6); box-shadow: 0 0 0 1px rgba(46,45,43,.2); }
.pd-dots i.on { background: var(--carrot); }
.pd-title { font-weight: 700; font-size: 26px; line-height: 1; margin-top: 6px; }
.pd-pack { font-weight: 600; opacity: .75; }
.pd-buy { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--white); border-radius: 14px; padding: 12px 14px; }
.pd-buy .price { font-size: 36px; }
.pd-buy .per { font-size: 14px; font-weight: 400; }
.pd-ctl { min-width: 150px; }
.pd-ctl .add, .pd-ctl .qty { width: 100%; justify-content: space-between; }
#pdToCart { margin-top: 0; }
.pd-about { font-size: 15px; line-height: 1.35; }
#pdBody { display: grid; gap: 18px; padding-top: 6px; }
.pd-sec h3, .pd-facts dt { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--carrot); margin-bottom: 6px; }
.kbju { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.kbju div { background: var(--white); border-radius: 12px; padding: 10px 6px; text-align: center; display: grid; gap: 2px; }
.kbju b { font-weight: 700; font-size: 20px; }
.kbju span { font-size: 11px; opacity: .7; }
.pd-facts { display: grid; gap: 12px; }
.pd-facts dd { font-size: 15px; line-height: 1.3; }
.pd-facts a { color: var(--carrot); }
.pd-mark { display: flex; gap: 12px; align-items: flex-start; background: var(--sky); border-radius: 12px; padding: 12px; font-size: 14px; line-height: 1.3; }
.pd-mark svg { width: 28px; height: 28px; flex: none; fill: none; stroke: var(--graphite); stroke-width: 1.8; }
.pd-demo { opacity: .55; text-align: center; }
@media (min-width: 700px) { .pd { max-width: 640px; } }

/* Корзина: миниатюры слева */
.line { grid-template-columns: 56px minmax(0, 1fr) auto; }
.line .thumb { grid-row: span 2; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--white); padding: 0; position: relative; }
.line .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.line .thumb.empty { background: var(--stripes-w); }
.line .thumb.empty::after { content: ''; position: absolute; inset: 22% 8%; background: var(--white) url('/static/logo-script.svg') center / 80% auto no-repeat; border-radius: 6px; }
.line .warn { grid-column: 2 / -1; }

/* Скелетоны в кабинете: блок сразу нужной высоты, без «Загружаем…» и прыжков */
.row.skel { min-height: 64px; background: linear-gradient(90deg, var(--white) 30%, #f4f1f0 50%, var(--white) 70%) 0 0 / 300% 100%; animation: skel 1.2s linear infinite; }
@keyframes skel { to { background-position: -150% 0; } }
@media (prefers-reduced-motion: reduce) { .row.skel { animation: none; } }
/* Штрихкод проявляется, когда загрузился: без значка битой картинки и alt-текста */
.vcard .bc img { opacity: 0; transition: opacity .15s; color: transparent; }
.vcard .bc img.ready { opacity: 1; }

/* Safari 26 (iOS) рисует содержимое документа под адресной строкой, нижней панелью и клавиатурой, а fixed-элементы
   туда не дорисовывает — сверху и снизу проглядывала витрина. Поэтому документ не прокручивается вовсе,
   прокручивается body: за краями видимой области остаётся только фон html (лён). */
html { height: 100%; overflow: hidden; background: var(--linen); }
body { height: 100%; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: none; }
/* Отступ под fixed-хэдер — не padding у body: у прокручиваемого body padding сдвигает и sticky-поиск */
body { padding-top: 0; }
body::before { content: ''; display: block; flex: 0 0 calc(72px + env(safe-area-inset-top)); }

/* ===================== Редизайн 08.11: плотнее, спокойнее, морковный — только действия =====================
   Брендбук «Ценник»: базовый — белый, новинки — голубой, акции — морковный. Значит морковный в интерфейсе
   оставляем для действий (кнопки, «+», активный раздел) и акций; заголовки — графитом. */

/* Промо карты — одна строка с фирменной полосой вместо большого героя */
.promo-strip { margin-top: 12px; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  background: var(--white); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--graphite); padding-right: 14px; min-height: 60px; }
.ps-band { align-self: stretch; background: repeating-linear-gradient(180deg, var(--sky) 0 8px, var(--carrot) 8px 16px); }
.ps-text { display: grid; gap: 3px; padding: 10px 0; min-width: 0; }
.ps-text b { font-weight: 700; font-size: 15px; line-height: 1; }
.ps-text span { font-size: 12px; line-height: 1.15; opacity: .75; }
.ps-cta { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: var(--track); color: var(--carrot); white-space: nowrap; }
@media (min-width: 860px) { .promo-strip { min-height: 68px; } .ps-text b { font-size: 17px; } .ps-text span { font-size: 14px; } .ps-cta { font-size: 14px; } }

/* Разделы: неактивные — белые таблички без рамки, активный — морковный */
.cats a { background: var(--white); border: 0; color: var(--graphite); border-radius: 10px; padding: 10px 12px 9px; font-size: 12px; }
.cats a.on { background: var(--carrot); color: var(--white); }

/* Заголовки — графит, одна ступень вместо двух */
.cat-title { color: var(--graphite); font-size: 22px; line-height: 1; margin: 20px 0 10px; }
.shelf-head { margin: 22px 0 10px; }
.all-link { font-size: 12px; }
.page-head { margin: 14px 0 12px; }

/* Плитки разделов на главной */
.cat-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.cat-tile { position: relative; display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--white); text-decoration: none; color: var(--graphite); }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile .ct-empty { position: absolute; inset: 0; background: var(--stripes-w); opacity: .6; }
.ct-name { position: absolute; left: 6px; right: 6px; bottom: 6px; background: var(--white); border-radius: 8px; padding: 6px 7px 5px;
  font-weight: 600; font-size: 12px; line-height: 1.05; }
@media (min-width: 640px) { .cat-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; } .ct-name { font-size: 14px; left: 8px; right: 8px; bottom: 8px; } }

/* Карточка товара: фото → цена → название (2 строки) → фасовка → кнопка. В 2 раза ниже прежней */
.tag { border-radius: 12px; grid-template-rows: auto 1fr auto; transition: box-shadow .15s; }
.tag.in-cart { box-shadow: inset 0 0 0 2px var(--carrot); }
.tag .ph { aspect-ratio: 1; background: var(--white); }
.tag .ph img { width: 100%; height: 100%; object-fit: cover; }
.tag .in { padding: 8px 8px 0; gap: 3px; }
.price-row { display: flex; align-items: baseline; gap: 2px; }
.tag .price { font-size: 17px; line-height: 1; }
.tag .price sup { font-size: .55em; }
.tag .per { display: inline; margin: 0; font-size: 12px; opacity: .65; }
.tag .name { text-transform: none; letter-spacing: 0; font-weight: 600; font-size: 13px; line-height: 1.15;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tag .pack { font-size: 12px; font-weight: 400; opacity: .65; }
/* «Осталось …» — небесная плашка на фото (голубой в брендбуке — внимание, не тревога) */
.tag .plaque { position: absolute; left: 6px; bottom: 6px; margin: 0; background: var(--sky); color: var(--graphite); border-radius: 6px;
  font-size: 10px; padding: 5px 7px 4px; text-transform: none; letter-spacing: 0; font-weight: 700; }
.tag .foot { padding: 8px; display: block; }
.tag .foot .add, .tag .foot .qty { width: 100%; height: 36px; border-radius: 10px; }
.tag .foot .add { font-size: 20px; }
.tag .foot .qty { display: flex; justify-content: space-between; }
.tag .foot .qty button { width: 32px; height: 36px; font-size: 18px; }
.tag .foot .qty span { min-width: 0; font-size: 12px; white-space: nowrap; }
/* Сетка раздела и поиска: 3 колонки на телефоне */
.grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 10px; }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } }
@media (max-width: 340px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Ленты: на телефоне видно 3 карточки и край четвёртой — понятно, что листается */
.rail { grid-auto-columns: calc((100vw - 44px) / 3.25); gap: 6px; }
@media (min-width: 640px) { .rail { grid-auto-columns: 170px; gap: 10px; } }
.more { border-radius: 12px; font-size: 13px; }
.more b { font-size: 28px; }

/* Корзина: полосатый край шапки (фирменный паттерн точечно), итог и кнопка закреплены снизу */
#cartSheet .sheet-in { padding-top: 0; }
#cartSheet .sheet-head { position: relative; padding-top: 22px; }
#cartSheet .sheet-head::before { content: ''; position: absolute; left: -16px; right: -16px; top: 0; height: 8px; background: var(--stripes); }
.checkout-bar { position: sticky; bottom: calc(-24px - env(safe-area-inset-bottom)); z-index: 3; display: grid; gap: 10px; background: var(--linen);
  margin: 4px -16px calc(-24px - env(safe-area-inset-bottom)); padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 16px -10px rgba(46,45,43,.35); }
/* Клавиатура открыта — итог обычным блоком в конце формы, поверх полей ничего не ложится */
body.kb-open .checkout-bar { position: static; box-shadow: none; }
.toast { display: flex; align-items: center; gap: 14px; }
.toast-act { color: var(--sky); font-weight: 700; text-transform: uppercase; letter-spacing: var(--track); font-size: 13px; padding: 4px 0; white-space: nowrap; }

/* Плитки разделов: на телефоне — две строки с горизонтальной прокруткой (не отодвигают товары вниз), на десктопе — сетка */
@media (max-width: 639px) {
  .cat-tiles { grid-auto-flow: column; grid-template-columns: none; grid-template-rows: repeat(2, auto); grid-auto-columns: calc((100vw - 44px) / 3.4);
    overflow-x: auto; scrollbar-width: none; margin: 14px -16px 0; padding: 0 16px; scroll-padding: 0 16px; scroll-snap-type: x mandatory; }
  .cat-tiles::-webkit-scrollbar { display: none; }
  .cat-tile { scroll-snap-align: start; aspect-ratio: 1.25; }
}
@media (min-width: 640px) { .cat-tiles { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); } .cat-tile { aspect-ratio: 1.15; } }
/* Промо на узком экране: стрелка вместо текста кнопки */
@media (max-width: 559px) { .ps-cta { font-size: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--carrot); display: grid; place-items: center; }
  .ps-cta::after { content: '→'; font-size: 18px; color: var(--white); } .ps-text b { font-size: 15px; } }
.toast { width: max-content; max-width: min(92vw, 420px); }

/* Горизонтальные ленты (разделы, плитки, товары): во всю ширину экрана и с мягким затуханием по краям —
   видно, что листается, и ничего не обрубается о край контейнера */
.cats, .rail, .cat-tiles { --fade: 22px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - var(--fade)), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - var(--fade)), transparent 100%); }
.cats { margin: 0 -16px; padding: 0 16px 12px; scroll-padding: 0 16px; }
@media (min-width: 640px) { .cat-tiles { -webkit-mask-image: none; mask-image: none; } .rail { margin: 0 -16px; padding: 0 16px 4px; scroll-padding: 0 16px; } }
/* Название раздела на плитке: перенос по слогам, без вылезания за плашку */
.ct-name { font-size: 11px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
@media (min-width: 640px) { .ct-name { font-size: 13px; } }

/* Плитки разделов v2: фото во всю плитку, снизу графитовое затемнение (цвет типографики брендбука) и белая подпись.
   Все плитки одного размера, подпись — 1–2 строки без переносов по слогам. Лента с прокруткой и затуханием —
   одинаково на телефоне и десктопе */
.cat-tiles { display: grid; grid-auto-flow: column; grid-template-columns: none; grid-template-rows: none;
  grid-auto-columns: calc((100vw - 44px) / 2.5); gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 14px -16px 0; padding: 0 16px; scroll-padding: 0 16px; scroll-snap-type: x mandatory; }
.cat-tiles::-webkit-scrollbar { display: none; }
.cat-tile { aspect-ratio: 1.45; border-radius: 14px; scroll-snap-align: start; background: var(--graphite); }
.cat-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(46,45,43,0) 35%, rgba(46,45,43,.78) 100%); }
.cat-tile .ct-empty { background: var(--stripes-w); opacity: 1; }
.ct-name { left: 10px; right: 10px; bottom: 9px; z-index: 1; background: none; padding: 0; border-radius: 0; color: var(--white);
  font-weight: 700; font-size: 14px; line-height: 1.1; hyphens: manual; -webkit-hyphens: manual; overflow-wrap: normal; word-break: normal;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 1px 2px rgba(46,45,43,.35); }
@media (min-width: 640px) {
  .cat-tiles { grid-template-columns: none; grid-auto-columns: 176px; gap: 10px; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 22px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 22px), transparent 100%); }
  .ct-name { font-size: 15px; left: 12px; right: 12px; bottom: 11px; }
}
/* Телефон: плитки разделов в две строки (13 разделов — не одна длинная лента) */
@media (max-width: 639px) { .cat-tiles { grid-template-rows: repeat(2, auto); grid-auto-columns: calc((100vw - 44px) / 2.4); } .cat-tile { aspect-ratio: 1.7; } }
