/* woff2 вместо ttf — тот же шрифт, ~35% исходного веса (в сумме 4 файла
   раньше весили ~1.7 МБ, теперь ~570 КБ), конвертация fontTools, символы не
   резались (риск случайно обрезать турецкие буквы или символ ₽ в ценах не
   стоил выигрыша ещё в пару раз). font-display: swap — текст сразу
   показывается системным шрифтом, Inter подменяет его без брака "невидимого
   текста" на медленной сети (частая жалоба на встроенный браузер WhatsApp). */
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Фиксация масштаба, часть 2 (часть 1 — templates/_viewport.html, там же
   объяснение целиком). touch-action: manipulation убирает ЗУМ ПО ДВОЙНОМУ
   ТАПУ, оставляя обычные нажатия и прокрутку. text-size-adjust не даёт
   мобильному Safari самому увеличивать шрифты при повороте экрана — иначе
   вёрстка «уезжает» без всякого действия пользователя. */
html {
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root {
  --green: #1aa260;
  --green-dark: #148a51;
  --green-bg: #eaf7f0;
  --green-border: #b7e3c8;
  --logo-green: #00623c;
  --ink: #141414;
  --gray: #86868b;
  --lgray: #b4b4ba;
  --border: #e8e8ed;
  --bg: #fafafa;
  --photobg: #f2f2f4;
  --white: #ffffff;
  --danger: #c0392b;
  /* Текст и значки НА цвете магазина (кнопки, активные чипы, бейджи) — всегда
     белые. Отдельно от --white: в тёмной теме (низ файла) --white — это тёмный
     фон карточек, а надпись на кнопке остаётся белой. */
  --on-accent: #ffffff;

  --r-card: 20px;
  --r-control: 12px;
  --r-btn-lg: 18px;
  --r-pill: 999px;

  --header-h: 168px;
  --z-header: 30;
  --z-overlay-backdrop: 40;
  --z-overlay-panel: 41;
  --z-cart-backdrop: 50;
  --z-cart-panel: 51;

  /* Подъём низа над плавающей панелью Safari 26 на iPhone (12.10.2026,
     скриншот пользователя, iPhone SE): «стеклянная» панель внизу
     (назад / поделиться / обновить) перекрывает ~26 pt нижнего края области,
     к которой прижаты плавающие кнопки, низ корзины и карточки товара;
     env(safe-area-inset-bottom) её не учитывает. Класс html.ios-glass-bar
     ставит _viewport.html — только Safari 26+ на iPhone и не ярлык «Домой».
     Везде остальное — 0, раскладка как была. */
  --ios-bar: 0px;
}
html.ios-glass-bar { --ios-bar: 34px; }

* { box-sizing: border-box; }

/* [hidden] должен побеждать любой display:flex/grid, заданный тем же
   классом ниже (иначе, при равной специфичности, побеждает правило,
   объявленное позже в файле — то есть наше, а не браузерное). */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

/* overflow-anchor: none — встроенный «якорь прокрутки» браузера выключен:
   раздел, дорисованный выше экрана, site.js сам возвращает на место
   (realizeSection). В WebKit (iPhone) встроенного якоря нет, а Chromium
   поправлял бы вторым разом поверх нашего (03.10). */
body {
  margin: 0;
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  padding-bottom: 40px;
  overflow-anchor: none;
}
/* Телефон: низ — под плавающими кнопками корзины и «наверх» (82×98 px): с
   40 px они закрывали половину последней кнопки «В корзину» (20.10.2026). */
@media (max-width: 899px) {
  body { padding-bottom: calc(110px + var(--ios-bar, 0px)); }
}
/* Длинное слово или ссылка в названии растягивали страницу вбок (20.10.2026). */
.card-name, .product-modal-body h2, .product-modal-desc, .cart-item-name { overflow-wrap: anywhere; }

a { color: inherit; }

/* ---------- шапка ---------- */
/* Вся шапка целиком — один неподвижный sticky-блок, всегда полностью
   видимый, без сворачивания при скролле. Несколько попыток заставить
   верхнюю часть (лого/поиск) прятаться при скролле вниз и появляться при
   скролле вверх — сперва через JS-анимацию высоты, потом через
   независимый sticky у одной только .categories-wrap — каждый раз ломали
   что-то более важное на iPhone/Safari (то дёргалась, то переставала
   возвращаться, то меню вообще переставало быть закреплённым и переставала
   работать навигация по разделам). Рабочая надёжная навигация важнее
   лишних пикселей экрана при скролле — возвращена простая схема без
   всякого скролл-зависимого JS. */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--white);
  border-bottom: 1px solid var(--border);
}

.header-top {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px 10px;
}
.logo { height: 52px; width: auto; flex-shrink: 0; }
/* Наш логотип в <picture> (светлый вариант для тёмной темы, 18.10.2026) — обёртка
   не участвует в раскладке, ведёт себя ровно как прежний одиночный <img>. */
.logo-pic { display: contents; }
/* Пустой <source> иначе становится отдельным элементом раскладки шапки и
   получает отступ gap — логотип съезжал на 10px. На выбор картинки не влияет. */
.logo-pic source { display: none; }
.header-info { flex: 1; min-width: 0; }
.tagline { font-weight: 600; font-size: 14px; color: var(--logo-green); line-height: 1.3; }
.orders-link { font-size: 12.5px; font-weight: 600; color: var(--green); text-decoration: none; margin-top: 4px; display: inline-block; }

/* Витрина реселлера без загруженного логотипа — вместо картинки название
   магазина текстом, в габаритах логотипа, чтобы шапка не «прыгала». */
/* Длинное название — в две строки, а не обрезано многоточием (20.10.2026:
   «БАДы и витамины(Турция /Америка)» и подобные). */
.logo-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.15;
  color: var(--green);
  overflow: hidden;
  overflow-wrap: anywhere;
  max-width: 240px;
}
.orders-link:hover { text-decoration: underline; }
/* "Выйти" (по прямому запросу пользователя) — рядом с "История заказов",
   разделитель приглушённый, чтобы не выглядело как два равноценных
   действия. */
.orders-link-sep { font-size: 12.5px; color: var(--lgray); }
/* «Выйти» — единственная ссылка в шапке, которая что-то ЛОМАЕТ: сессия
   стирается, и без PIN обратно не зайти. Красный + отступ слева, чтобы по
   ней не промахивались с соседней «Истории заказов» (репорт пользователя
   2026-09-20). Переспрос — в site.js. */
.orders-link-danger { color: var(--danger); margin-left: 6px; }
/* Мобильный — логотип меньше, а тэглайн ("Оптовый склад с доставкой до
   двери") в одну строку, не в две (по прямому запросу пользователя). Первая
   попытка (40px/13px) на узких экранах текст всё ещё не помещался и
   обрезался многоточием (фидбэк пользователя, скриншот) — логотип и отступы
   уменьшены сильнее, шрифт мельче. overflow/ellipsis остаётся подстраховкой
   на случай совсем узких экранов, не основным приёмом. */
@media (max-width: 899px) {
  .header-top { gap: 10px; padding: 14px 16px 8px; }
  .logo { height: 36px; }
  .tagline { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Витрина с логотипом, но без названия — логотип крупнее (03.10). */
  .logo.logo-solo { height: 48px; }
}
/* Шапка на десктопе — лого и поиск в один ряд, поиск не на всю ширину, а
   разумного размера рядом с лого (по прямому запросу пользователя,
   2026-08-19: "сделай такой же удобный поиск, как в кабинете аналитики
   закупок" — там поле поиска стоит в шапке рядом с лого, здесь раньше
   было отдельной строкой на всю ширину под шапкой). Портирован как есть
   из management/static/style.css — та же вёрстка (.header-top/.searchbar
   — сиблинги внутри .header-collapsible-inner) уже была в разметке этого
   сайта, просто не хватало этого блока для десктопа.

   Отличие от management/ (там этого блока вообще нет — там нет корзины):
   здесь на десктопе есть #cart-toggle, зафиксированный отдельно поверх
   всего (position:fixed; right:24px; top:16px — см. ниже) — если бы поиск
   растягивался до самого края контейнера, он бы залезал под кнопку
   корзины. padding-right у .header-collapsible-inner больше, чем слева —
   резервирует место под неё. Кнопка корзины теперь ВСЕГДА видна на
   десктопе (см. site.js:updateCartBadge и .cart-toggle.cart-empty ниже)
   — по прямому запросу пользователя, чтобы зарезервированное место не
   пустовало без объяснения, когда корзина пуста. */
@media (min-width: 900px) {
  .header-collapsible-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 150px 14px 28px;
  }
  .header-top { padding: 0; flex-shrink: 0; }
  .logo { height: 40px; }
  .logo.logo-solo { height: 54px; }
  .tagline { font-size: 15px; }
  .orders-link { margin-top: 3px; }
  .searchbar { flex: 1; max-width: 420px; margin-left: auto; padding: 0; }
  .categories-wrap { padding: 0 28px 16px; }
  .category-chip { padding: 9px 18px; font-size: 14px; }
}
/* На мобильном корзина и "наверх раздела" стоят одним плавающим стеком в
   правом нижнем углу (column-reverse: первый в DOM — cart-toggle —
   прижимается к стартовому краю, то есть к низу, "наверх" — над ней; когда
   корзины нет, .cart-empty убирает её из потока и "наверх" сама занимает
   освободившееся крайнее место). На десктопе они РАЗЪЕЗЖАЮТСЯ по разным
   углам (по прямому запросу пользователя: "наверх" — всегда в правом
   нижнем, это не связано с тем, где корзина) — .fab-stack превращается в
   display:contents (сам перестаёт быть контейнером позиционирования, обе
   кнопки становятся independent fixed-элементами). Корзина — там же, где
   раньше была "в шапке" (шапка на десктопе не уезжает при скролле, так что
   правый верхний угол визуально воспринимается как часть шапки).

   Раньше пустая корзина пряталась атрибутом [hidden] на ЛЮБОМ экране — по
   прямому запросу пользователя (2026-08-19): на десктопе кнопка теперь
   ВСЕГДА видна (просто "0"), место под неё в шапке зарезервировано
   постоянно (см. .header-collapsible-inner выше), прятать её было бы
   странно. На мобильном (плавающий стек, место в дефиците) прежнее
   поведение — прячем, когда пусто — сохранено, но теперь через CSS-класс
   (site.js больше не трогает атрибут hidden вообще). */
@media (max-width: 899px) {
  .cart-toggle.cart-empty { display: none; }
}
.fab-stack {
  position: fixed;
  right: 16px;
  bottom: calc(16px + var(--ios-bar));
  z-index: var(--z-header);
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 10px;
}
@media (min-width: 900px) {
  .fab-stack { position: static; display: contents; }
  .cart-toggle { position: fixed; top: 16px; bottom: auto; right: 24px; z-index: var(--z-header); }
  .scroll-top-toggle { position: fixed; bottom: calc(16px + var(--ios-bar)); right: 24px; z-index: var(--z-header); }
  .fab-stack .owner-fab { position: fixed; bottom: calc(16px + var(--ios-bar)); right: 24px; z-index: var(--z-header); }
  .owner-fab ~ .scroll-top-toggle { bottom: calc(72px + var(--ios-bar)); }
}
/* Переход «витрина ↔ настройки» у владельца витрины (12.10.2026): на витрине
   «К настройкам» (первой в .fab-stack — на телефоне в самом низу стека), в
   настройках «К витрине» (shop_admin.html: #to-shop) — одна и та же тёмная
   кнопка в правом нижнем углу, туда и обратно палец жмёт в одно место.
   Тёмная, а не цвета магазина: это не покупка, а смена экрана. */
.owner-fab {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 16px 0 14px; box-sizing: border-box;
  border-radius: var(--r-pill); background: var(--ink); color: var(--white);
  font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; text-decoration: none;
  box-shadow: 0 4px 16px rgba(20,20,20,0.22);
  -webkit-tap-highlight-color: transparent;
}
.owner-fab:hover { background: #2b2b2e; }
.owner-fab svg { flex: none; }
.cart-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: var(--green);
  color: var(--on-accent);
  border-radius: var(--r-pill);
  padding: 12px 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(20,20,20,0.2);
  transition: background 0.15s ease;
}
.cart-toggle:hover { background: var(--green-dark); }
.scroll-top-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(20,20,20,0.2);
  transition: background 0.15s ease;
}
.scroll-top-toggle:hover { background: var(--photobg); }
#cart-count {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  font-size: 12.5px;
}

.searchbar { padding: 4px 20px 12px; }
.search-wrap { position: relative; }
#search {
  width: 100%;
  padding: 12px 40px 12px 16px;
  border: 1px solid var(--border);
  background: var(--photobg);
  /* var(--r-btn-lg), не --r-control — по фидбэку пользователя выглядело
     мельче остальных скруглений на сайте (та же правка уже делалась для
     поля PIN на странице входа в кабинет). */
  border-radius: var(--r-btn-lg);
  /* РОВНО 16px и не меньше. iOS Safari сам приближает всю страницу, когда
     фокус попадает в поле со шрифтом меньше 16px, и обратно НЕ отдаляет —
     каталог остаётся сдвинутым, с горизонтальной прокруткой, и клиент
     (живой репорт со скриншотом) не понимает, как это вернуть. Это была
     главная причина «случайно приблизил». Та же причина у .qty-input и
     .cabinet-link-input ниже. */
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
#search:focus { border-color: var(--green); background: var(--white); }
/* Свой крестик очистки (#search-clear, см. site.js) вместо нативного
   ::-webkit-search-cancel-button — по прямому репорту пользователя
   (2026-08-27, мобильный скриншот): нативная кнопка у type="search"
   ненадёжно/еле заметно появляется на телефоне, один явный тап должен
   гарантированно чистить поле на любом мобильном браузере. Прячем
   нативную, чтобы не было двух крестиков разом. Тот же приём, что и в
   management/static/style.css. */
#search::-webkit-search-cancel-button { display: none; -webkit-appearance: none; }
.search-clear-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: var(--gray); font-size: 22px; line-height: 1;
  cursor: pointer; padding: 8px; display: flex; align-items: center; justify-content: center;
}
.search-clear-btn:hover { color: var(--ink); }

/* ---------- карусель категорий ---------- */
.categories-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 12px 20px;
}
.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.categories::-webkit-scrollbar { display: none; }
.category-chip {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.category-chip.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--on-accent);
}
.category-chip.promo-chip:not(.active) { border-color: var(--green-border); color: var(--green-dark); }
.category-chip.reset { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.category-chip.reset:hover { background: #a5311f; border-color: #a5311f; }
/* Невыбранные чипы бренда/подраздела, пока в разделе стоит фильтр — по
   прямому запросу пользователя: видно, что раздел сейчас сужен и эти чипы
   сейчас скрывают часть товаров, но сами чипы остаются кликабельными
   (просто приглушены, не задизейблены). */
.category-chip.muted { opacity: 0.4; }

.categories-expand-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.categories-expand-btn:hover { background: var(--photobg); }

/* ---------- каталог: секции ---------- */
.catalog { padding: 4px 14px 20px; }


.category-section { scroll-margin-top: var(--header-h); padding-top: 22px; }
/* Плейсхолдер раздела (см. site.js: buildPlaceholderSection) — заголовок
   виден сразу, тело подменяется реальными карточками лениво (когда раздел
   приближается к экрану) или по явному переходу. min-height — чтобы
   IntersectionObserver было за что "зацепиться" до полной загрузки фото
   внутри уже построенных разделов выше, и чтобы не было заметного скачка
   высоты при подмене. */
.category-section-placeholder-body { min-height: 160px; }
.category-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.category-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
}

.promo-name-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-link-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: var(--r-control);
  color: var(--gray);
  flex-shrink: 0;
}
.category-link-btn:hover { background: rgba(0,0,0,.06); }
.promo-banner .category-link-btn { color: var(--green-dark); }

.category-section.promo .promo-banner {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: var(--r-control);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 15px;
  color: var(--green-dark);
}
.category-section.promo .promo-banner .promo-tag {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--green);
  color: var(--on-accent);
  padding: 4px 10px;
  border-radius: var(--r-pill);
}

/* Вложенный список брендов внутри раздела дерева (см. site.js:
   buildParentSection) — свёрнут по умолчанию, разворачивается по клику на
   "Бренды". Сами кнопки — те же .category-chip/.category-chip.active, что
   и в верхней карусели разделов (по фидбэку пользователя: раньше были
   зеленоватыми даже невыбранные, должно быть бело/зелено один-в-один с
   основной линией разделов). */
.brand-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--green-dark);
  margin: 0 0 10px; user-select: none;
}
.brand-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.brand-row .category-chip .n { opacity: .65; font-size: 11.5px; }
.brand-row .category-chip.active .n { opacity: .85; }

/* Заголовок подраздела внутри раздела дерева — мельче .category-title,
   несколько подряд в одной секции (см. buildParentSection). Строка (текст +
   кнопка "скопировать ссылку", см. createCategoryLinkButton), не просто
   текст — та же ссылка на подраздел, что уже есть у основного раздела. */
.child-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--gray);
  margin: 18px 0 10px;
  /* Прямой переход из "Все разделы" в конкретный подраздел (см. site.js:
     rebuildCategoriesOverlay) скроллит сюда напрямую — без этого заголовок
     подраздела оказывался под "прилипшей" шапкой. */
  scroll-margin-top: var(--header-h);
}
.child-title span { text-transform: uppercase; letter-spacing: 0.02em; }
.child-title:first-of-type { margin-top: 0; }

/* Акционные товары подраздела — первыми, в рамке (site.js:
   appendInStockGrids, решение владельца 11.10). Рамка выходит в поля
   каталога на столько же, сколько отступ внутри (8px = 1.5 + 6.5), —
   колонки карточек совпадают с сеткой обычных товаров ниже. Ярлык сидит
   на верхней линии рамки. */
.promo-group {
  position: relative;
  margin: 16px -8px 0;
  padding: 24px 6.5px 6.5px;
  border: 1.5px dashed rgba(26, 162, 96, 0.45);
  border-radius: calc(var(--r-card) + 6px);
  background: rgba(26, 162, 96, 0.04);
}
.promo-group-tag {
  position: absolute; top: 0; left: 14px;
  transform: translateY(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px 4px 9px;
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: var(--r-pill);
  color: var(--green-dark);
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
.promo-group-tag svg { width: 15px; height: 15px; flex-shrink: 0; }
.promo-group-tag .n {
  min-width: 18px; padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--green); color: var(--on-accent);
  font-size: 10.5px; letter-spacing: 0; text-align: center;
}
.promo-group-note {
  font-size: 12px; line-height: 1.4; color: var(--green-dark); opacity: 0.8;
  margin: 0 4px 10px;
}
.promo-group .card { border-color: rgba(26, 162, 96, 0.22); box-shadow: 0 1px 3px rgba(20, 98, 60, 0.06); }
/* Рамка уже говорит «акция» — на фото остаётся только срок. */
.promo-group .card-badge-promo { display: none; }
@media (min-width: 620px) {
  .promo-group { margin: 18px -10px 0; padding: 26px 8.5px 8.5px; }
  .promo-group-note { margin-bottom: 12px; }
}

/* «Обычный срок годности» / «Срок годности вышел» — тихая подпись по
   центру между группами, строчными буквами (заголовки подразделов —
   заглавными слева, путать не должно). */
.group-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 12px;
  font-size: 12px; font-weight: 500; color: var(--gray);
  white-space: nowrap;
}
.group-divider::before,
.group-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 480px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 620px) {
  .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(5, 1fr); gap: 20px; }
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(20,20,20,0.03);
}
/* Карточка не в наличии — визуально задизейблена целиком, но остаётся
   кликабельной (по прямому запросу пользователя: раскрывает товар и сразу
   подгружает альтернативы, см. renderCard). Приглушаем фото (img/.no-photo)
   и весь .card-body (название/цену/задизейбленную кнопку "В корзину") ПО
   ОТДЕЛЬНОСТИ, не общим родителем — бейдж "Похожие" (.card-badge-analogs,
   сосед img внутри .card-photo, см. renderCard) должен оставаться ярким и
   заметным. */
.card.out-of-stock .card-photo img,
.card.out-of-stock .card-photo .no-photo,
.card.out-of-stock .card-body { opacity: 0.55; }
.card.promo-card { background: var(--green-bg); border-color: var(--green-border); }
.card { cursor: pointer; }

.card-photo {
  background: var(--photobg);
  aspect-ratio: 5 / 4;
  overflow: hidden;
  position: relative;
}
.card.promo-card .card-photo { background: #ddf0e4; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-photo img.photo-contain { object-fit: contain; padding: 8px; }
/* Стек бейджей в правом верхнем углу фото — "Похожие" (для товара не в
   наличии) и/или "Акция"/"Срок до .../"Истёк срок" (для товара из папки
   истекающих/истёкших сроков 1С, см. product_taxonomy.expiry_badge) — оба
   независимы друг от друга и могут стоять одновременно, поэтому общий
   flex-контейнер вместо каждого бейджа со своим absolute-позиционированием. */
.card-badges {
  position: absolute; top: 8px; right: 8px; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.card-badge, .card-badge-analogs {
  background: var(--green); color: var(--on-accent);
  border: none; border-radius: var(--r-pill);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(20,20,20,0.2);
}
/* Плашки "Акция"/"Срок до…" — по прямому запросу пользователя (2026-08-23)
   тех же размеров, что и в кабинете аналитики закупок (management/static/
   style.css:.card-badge). ".card-badge-analogs" ("Похожие") сюда не входит
   — не про неё была просьба, и в кабинете аналитики этой плашки больше нет
   вовсе (см. project memory), сравнивать не с чем. */
.card-badge { font-size: 10px; padding: 3px 7px; }
.card-badge-analogs { font-size: 11px; padding: 5px 10px; cursor: pointer; }
.card-badge-analogs:hover { background: var(--green-dark); }
.card-badge.expired { background: var(--danger); }
.no-photo {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--lgray); font-size: 11px; line-height: 1.35;
  text-align: center; padding: 10px;
}
.product-modal-photo .no-photo { font-size: 13px; padding: 24px; }

.card-body { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-size: 13px; font-weight: 500; line-height: 1.35; min-height: 35px; }
.card-article { font-size: 11px; color: var(--gray); }
/* Сноска "почему может подойти" (рельса допродажи в личном кабинете, см.
   site/cabinet.py: cross_sell_items, поле "причина") — коротко и не должно
   раздувать карточку сильнее обычной: до 3 строк, дальше — многоточие. */
.card-reason {
  font-size: 11.5px; line-height: 1.4; color: var(--gray);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
/* В модалке места достаточно — сноска показывается целиком, без обрезки
   (в отличие от .card-reason на карточке в сетке). */
.pm-reason { font-size: 13px; line-height: 1.5; color: var(--gray); margin: 2px 0; }
.stock-badge { font-size: 11px; color: var(--danger); font-weight: 600; }
.card-price { font-size: 16px; font-weight: 700; color: var(--green); margin-top: auto; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price-old { font-size: 13px; font-weight: 400; color: var(--gray); text-decoration: line-through; }
.price-current { font-size: inherit; font-weight: inherit; color: inherit; }
/* Цена крупного опта — при заказе от порога (site.js: priceStar, сноска
   .big-order-note вверху страницы, 29.09). */
.price-star { font-size: 0.72em; font-weight: 700; color: var(--green-dark); margin-left: 1px; }
.pm-big-note { font-size: 12.5px; line-height: 1.45; color: var(--gray); margin: -2px 0 8px; }
.big-order-note {
  margin: 12px 14px 0;
  padding: 9px 12px;
  border-radius: var(--r-control);
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green-dark);
  font-size: 12.5px;
  line-height: 1.45;
}
.big-order-note .price-star { font-size: 1em; margin: 0 2px 0 0; }

/* Персональная витрина клиента (CATALOG.fourPrices). Иерархия как в
   PDF-каталоге: мелкий серый кикер над крупной зелёной ценой, остальные
   уровни и лестница объёма — тихие выровненные в 2 колонки строки. */
.card-price.four { display: block; }
.card-price.four .fp-kicker { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--lgray); line-height: 1.4; }
.card-price.four .fp-main-value { font-size: 19px; font-weight: 700; color: var(--green); line-height: 1.2; margin-bottom: 2px; }
.card-price.four .fp-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--gray); line-height: 1.65; }
.card-price.four .fp-row b { font-weight: 500; color: var(--ink); white-space: nowrap; }
.card-price.four .fp-ladder { margin-top: 5px; padding-top: 4px; border-top: 1px dashed var(--border); }
.product-modal-body .card-price.four .fp-main-value { font-size: 24px; }
.product-modal-body .card-price.four .fp-row { font-size: 13px; }

/* Остаток на складе — бейджем на фото (в один стек с "Акция"/"Похожие"). */
.card-badge-stock {
  background: rgba(20,20,20,0.72); color: var(--on-accent);
  border-radius: var(--r-pill); font-weight: 600;
  font-size: 10px; padding: 3px 7px;
  box-shadow: 0 1px 4px rgba(20,20,20,0.2);
}
.card-badge-stock.zero { background: var(--danger); }

/* Товар не в наличии в персональной витрине — не прячется, просто мягко
   приглушён; кнопка заказа при этом активна (не входит в затемнение). */
.card.oos-soft .card-photo img,
.card.oos-soft .card-photo .no-photo { opacity: 0.45; filter: grayscale(0.35); }
.card.oos-soft .card-name,
.card.oos-soft .card-price { opacity: 0.6; }

/* На карточке в сетке кнопка "В корзину" и степпер количества никогда не
   показываются одновременно: до добавления — только кнопка на всю ширину,
   после клика она заменяется степпером (тоже на всю ширину, по центру) —
   поэтому теснота больше не проблема и степпер может быть крупным. */
.card-controls { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 4px; }

/* ---------- лестница цен по объёму (опт от коробки, только у товаров с
   item.лестница_цен — см. src/tier_pricing.py) ----------
   По фидбэку пользователя первая версия (рамка на каждой строке) выглядела
   тяжело и спорила сама с собой за внимание — теперь рамка/цвет только у
   ОДНОЙ активной строки, остальные различаются едва заметным разделителем
   внутри общей карточки, как в обычных списках выбора (тарифы, доставка),
   а не набором одинаковых кнопок. */
.pm-tiers-label {
  font-size: 12px; font-weight: 600; color: var(--gray);
  margin: 2px 0 8px; text-transform: uppercase; letter-spacing: 0.03em;
}
.pm-tiers-wrap { margin: 4px 0 10px; }
.pm-tiers {
  display: flex; flex-direction: column;
  /* --r-card (20px), не --r-control (12px) — та же логика, что и у самих
     карточек товара: широкому контейнеру нужен радиус покрупнее, иначе на
     ширине во всю модалку 12px читается почти незаметной вмятиной, а не
     тем же скруглением, что у компактных кнопок под ним (фидбэк
     пользователя, скриншот — рамка лестницы выглядела "более квадратной",
     хотя абсолютное значение совпадало с кнопками степпера). */
  border-radius: var(--r-card); overflow: hidden;
  background: var(--photobg);
}
.pm-tier-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left; cursor: pointer;
  border: none; border-bottom: 1px solid rgba(20, 20, 20, 0.07);
  background: transparent; padding: 12px 14px;
  font-family: inherit; transition: background 0.15s ease;
}
.pm-tier-row:last-child { border-bottom: none; }
.pm-tier-row:hover { background: rgba(26, 162, 96, 0.07); }
.pm-tier-row.active { background: var(--white); box-shadow: inset 0 0 0 1.5px var(--green); }
/* Инсет-тень активной строки рисуется по СОБСТВЕННЫМ скруглениям строки —
   у обычной строки их нет (0), поэтому первая/последняя строка (там, где
   видна и рамка контейнера .pm-tiers) должны сами повторить его радиус,
   иначе подсветка активной строки там выглядит квадратной на фоне
   скруглённой карточки вокруг (фидбэк пользователя, скриншот). */
.pm-tier-row:first-child { border-top-left-radius: var(--r-card); border-top-right-radius: var(--r-card); }
.pm-tier-row:last-child { border-bottom-left-radius: var(--r-card); border-bottom-right-radius: var(--r-card); }

.pm-tier-radio {
  position: relative;
  width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0; box-sizing: border-box;
  border: 2px solid var(--lgray);
  transition: border-color 0.15s ease;
}
.pm-tier-row.active .pm-tier-radio { border-color: var(--green); }
/* Точка — абсолютным позиционированием от центра родителя (top/left 50% +
   translate(-50%,-50%)), а не flex-центрированием — так её позиция не
   зависит от округления при делении контейнера на нечётные значения,
   гарантированно ровно посередине независимо от размера точки. */
.pm-tier-radio-dot {
  position: absolute; top: 50%; left: 50%;
  width: 9px; height: 9px; border-radius: 50%; background: var(--green);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease;
}
.pm-tier-row.active .pm-tier-radio-dot { transform: translate(-50%, -50%) scale(1); }

.pm-tier-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-tier-label { font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.pm-tier-row.active .pm-tier-label { font-weight: 600; }

.pm-tier-price { font-size: 15px; font-weight: 700; color: var(--ink); white-space: nowrap; flex-shrink: 0; }
.pm-tier-row.active .pm-tier-price { color: var(--green-dark); }

/* ---------- степпер количества (- / число / +) ---------- */
.qty-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.qty-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-control);
  background: var(--white);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.qty-btn:hover { background: var(--green); border-color: var(--green); color: var(--on-accent); }
.qty-btn:disabled { color: var(--lgray); cursor: not-allowed; background: var(--white); border-color: var(--border); }
.qty-input {
  /* Оптовые количества — пять цифр, включая весь объём 77000 шт. */
  width: 56px;
  border: none;
  background: none;
  text-align: center;
  font-family: inherit;
  /* 16px — против автозума iOS при фокусе, см. #search выше. */
  font-size: 16px;
  font-weight: 600;
  padding: 0;
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.add-btn {
  flex: 1;
  border: none;
  background: var(--photobg);
  color: var(--ink);
  /* Крупнее, чем общий --r-control (12px) — по фидбэку пользователя кнопки
     "В корзину"/"Показать альтернативы" должны скругляться заметнее, ближе
     к тому, как выглядят кнопки в iOS. Меняем радиус только у этого класса,
     не сам --r-control — та же переменная используется у степпера
     количества, поиска, промо-баннера, и трогать их не просили. Настоящий
     "сквирк" (непрерывная iOS-кривая, не дуга окружности) в CSS
     border-radius нельзя — свойство corner-shape для него пока не
     поддерживается браузерами достаточно широко; увеличенный радиус —
     обычная веб-аппроксимация того же ощущения. */
  border-radius: 16px;
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.add-btn:hover, .add-btn:active, .add-btn.in-cart { background: var(--green); color: var(--on-accent); }
.add-btn:disabled { background: var(--photobg); color: var(--lgray); cursor: not-allowed; }
/* На акционном (зелёном) фоне серая кнопка теряется — делаем её белой. */
.promo-card .add-btn { background: var(--white); }
.promo-card .add-btn:hover, .promo-card .add-btn:active, .promo-card .add-btn.in-cart { background: var(--green); color: var(--on-accent); }

/* Кнопка "Показать альтернативы" — и на карточке в сетке (там она .add-btn,
   flex:1 растягивает её в общем ряду .card-controls), и в полной карточке
   товара (там .card-controls нет — явный width:100%, чтобы не зависеть от
   родителя). Сплошная заливка вместо обводки — по фидбэку пользователя,
   бледная обводка терялась на приглушённом фоне карточки. */
.analogs-btn { background: var(--green); color: var(--on-accent); border: none; width: 100%; }
.analogs-btn:hover, .analogs-btn:active { background: var(--green-dark); }
/* .promo-card .add-btn (выше) красит фон белым — та же специфичность
   (два класса), что и здесь, но объявлена раньше, поэтому без этого
   переопределения побеждала бы она: белый текст на белом фоне, кнопку не
   было видно на карточках из промо-категорий вроде "Выходящие сроки"
   (репорт пользователя со скриншотом). */
.promo-card .analogs-btn { background: var(--green); color: var(--on-accent); }
.promo-card .analogs-btn:hover, .promo-card .analogs-btn:active { background: var(--green-dark); }
.promo-card .add-btn:disabled { background: var(--white); color: var(--lgray); }

/* ---------- нет в наличии: сворачивание ---------- */
.oos-wrap { margin-top: 16px; }
.oos-label { font-size: 12px; font-weight: 600; color: var(--gray); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.03em; }
/* 90px — то же самое, что и FADE_HEIGHT в site.js (buildItemsBlock):
   запасное значение на случай, если JS ещё не успел проверить, есть ли
   вторая строка (там же переопределяет max-height инлайн-стилем — или
   этим же 90px, или "none", если строка всего одна). */
.oos-collapse { position: relative; overflow: hidden; max-height: 90px; }
.oos-collapse.expanded { max-height: none; }
.oos-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 90px;
  background: linear-gradient(to bottom, rgba(250,250,250,0), var(--bg));
  pointer-events: none;
}
.oos-collapse.expanded .oos-fade { display: none; }
.oos-toggle {
  margin-top: 10px;
  background: none;
  border: none;
  color: var(--green);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}

.empty-state { text-align: center; color: var(--gray); padding: 60px 20px; }

/* Подпись над ослабленной выдачей поиска: точных совпадений не нашлось,
   показываем ближайшее, но честно предупреждаем — иначе клиент решит, что
   это и есть то, что он искал. */
.search-partial-note {
  margin: 4px 2px 10px;
  color: var(--gray);
  font-size: 14px;
}

/* ---------- оверлей "все разделы" ---------- */
.categories-overlay {
  position: fixed; inset: 0; z-index: var(--z-overlay-backdrop);
  background: rgba(0,0,0,0.4);
  display: flex; align-items: flex-end;
}
.categories-overlay-panel {
  background: var(--white);
  width: 100%;
  max-height: 75vh;
  border-radius: 20px 20px 0 0;
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
}
@media (min-width: 640px) {
  .categories-overlay { align-items: center; justify-content: center; }
  .categories-overlay-panel { max-width: 420px; border-radius: 20px; max-height: 70vh; }
}
.categories-overlay-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.categories-overlay-header h2 { font-size: 16px; margin: 0; }

/* Переключатель "старая/расширенная сортировка" — только в личном кабинете
   клиента (см. site.js: setupSortModeToggle). */
.seg-toggle-row { display: flex; background: var(--photobg); border-radius: var(--r-pill); padding: 3px; gap: 2px; margin-bottom: 14px; }
.seg-toggle-btn {
  flex: 1; border: none; background: none; color: var(--gray); padding: 8px 10px;
  border-radius: var(--r-pill); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg-toggle-btn.active { background: var(--green); color: var(--on-accent); }

.categories-overlay-list { overflow-y: auto; display: flex; flex-direction: column; }

/* Аккордеон дерева разделов внутри оверлея "Все разделы": раздел ->
   подразделы (+ вложенный список брендов). Раскрытие — справа в каждой
   строке (по фидбэку пользователя: на телефоне удобнее нажимать правой
   частью экрана), разделы раскрыты сразу, свёрнуты только "Бренды". */
.overlay-parent-head {
  width: 100%; border: none; background: none; text-align: left; cursor: pointer;
  display: flex; align-items: center; gap: 9px;
  padding: 12px 4px; font-size: 14.5px; font-weight: 700; color: var(--ink);
  border-bottom: 1px solid var(--border);
}
.overlay-parent-head .pname { flex: 1; }
.overlay-parent-head .right { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.overlay-parent-head .cnt { font-size: 12px; color: var(--gray); font-weight: 500; }
.overlay-parent-head .chev { font-size: 11px; color: var(--gray); width: 12px; text-align: center; flex-shrink: 0; }
/* "Все бренды" — заголовок группы там div, не button (нечего сворачивать). */
.overlay-parent-head:not(button) { cursor: default; }
.overlay-children { padding: 2px 4px 8px 14px; display: flex; flex-direction: column; }
.overlay-child {
  width: 100%; border: none; background: none; text-align: left; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 8px; font-size: 13.5px; color: var(--ink); border-radius: var(--r-control);
}
.overlay-child:hover { background: var(--photobg); }
.overlay-child .cnt { color: var(--gray); font-size: 12px; }
.overlay-brand-block { margin-bottom: 4px; padding-bottom: 6px; border-bottom: 1px dashed var(--border); }
.overlay-brand-toggle {
  width: 100%; border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px 4px;
  font-size: 12.5px; font-weight: 700; color: var(--green-dark);
}
.overlay-brand-toggle .chev { font-size: 10px; }
.overlay-brand-list { display: flex; flex-direction: column; padding-left: 6px; border-left: 2px solid var(--green-border); margin-left: 2px; }
.overlay-brand .cnt { color: var(--green-dark); }

/* ---------- товар: полная карточка ---------- */
.product-modal {
  position: fixed; inset: 0; z-index: var(--z-overlay-panel);
  background: rgba(0,0,0,0.4);
  display: flex; align-items: flex-end;
}
.product-modal-panel {
  background: var(--white);
  width: 100%;
  /* vh в мобильном Safari считается от МАКСИМАЛЬНОЙ высоты экрана (когда
     адресная строка скрыта) — если она видна (как обычно сразу после
     перехода по ссылке), реальная видимая область меньше, и панель на
     90vh вылезала выше неё, утаскивая крестик, который сидел в её верхней
     части, за пределы экрана (фидбэк пользователя — "крестик где-то там
     под доменом"). svh — высота именно видимой (small) области, без этого
     рассинхрона; там, где svh не поддерживается, используется vh (строка
     выше, обычный CSS-фоллбек — на новых экран не хуже, на старых работает
     как раньше). Сам крестик теперь всё равно не зависит от высоты панели
     (см. ниже, position: fixed), но и остальной контент не должен вылезать
     за реально видимую область. */
  max-height: 90vh;
  max-height: 90svh;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
/* Прокручивается ТОЛЬКО эта внутренняя обёртка, не вся панель — крестик
   (product-modal-close) сидит вне неё, в самой панели, поэтому при скролле
   длинного списка альтернатив остаётся на месте, а не уезжает с контентом
   и не пропадает из виду (было — см. историю правки). min-height: 0
   обязателен: без него flex-элемент не сжимается до max-height родителя и
   вместо внутреннего скролла просто раздувает панель на весь контент. */
.product-modal-scroll { overflow-y: auto; overflow-x: hidden; flex: 1; min-height: 0; padding: 0 0 calc(20px + var(--ios-bar)); }
@media (min-width: 640px) {
  .product-modal { align-items: center; justify-content: center; }
  .product-modal-panel { max-width: 480px; border-radius: 20px; max-height: 85vh; max-height: 85svh; }
}
/* .icon-btn.product-modal-close (два класса), не просто .product-modal-close
   (один класс) — общий .icon-btn (используется ещё у крестиков корзины и
   списка категорий) задаёт background: none той же специфичностью, что и
   один класс, и, стоя ниже в файле, побеждал бы: кнопка была фактически
   прозрачной (репорт пользователя — "не прозрачной, а полностью белой"). */
.icon-btn.product-modal-close {
  /* absolute внутри .product-modal-panel (у неё уже position: relative), не
     fixed относительно экрана — раньше было fixed именно потому, что
     панель на 90vh могла вылезать выше реально видимой области (мобильный
     Safari с показанной адресной строкой) и утаскивала кнопку-соседа за
     собой; тот баг закрыт переходом на svh у max-height панели (см. ниже),
     после чего fixed стал не нужен и создал НОВУЮ проблему — панель снизу
     (align-items: flex-end) может начинаться намного ниже верха экрана
     (когда под карточкой не видно строки браузера, свободного места
     сверху больше), а кнопка, зафиксированная у самого верха экрана,
     оказывалась далеко от самой карточки (фидбэк пользователя). Кнопка —
     сосед .product-modal-scroll, не её потомок, поэтому при скролле
     длинного списка альтернатив всё равно остаётся на месте, а не уезжает
     с контентом. */
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: calc(var(--z-overlay-panel) + 1);
  background: var(--white); color: var(--ink); border-radius: 50%; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(0,0,0,0.15);
  font-size: 18px;
}
.pm-close-glyph-desktop { display: none; }
@media (min-width: 640px) {
  /* На десктопе панель — центрированный диалог, а не полноэкранный лист;
     крестик вместо стрелочки — на десктопе слева уже нет смысла в "назад",
     это обычный диалог, который принято закрывать крестиком в правом
     верхнем углу. */
  .icon-btn.product-modal-close {
    left: auto;
    right: 12px;
  }
  .pm-close-glyph-mobile { display: none; }
  .pm-close-glyph-desktop { display: block; }
}
.product-modal-photo { background: var(--photobg); aspect-ratio: 4 / 3; overflow: hidden; position: relative; }
.product-modal-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-modal-photo img.photo-contain { object-fit: contain; padding: 16px; }

/* Галерея сторон упаковки: главное студийное фото первым, за ним снимки
   сторон коробки со склада (см. src/telegram_bot.py: альбом в чате выгрузки
   фото). Листается пальцем — обычный горизонтальный скролл со snap, без
   библиотек и без стрелок: на телефоне это привычнее, а на десктопе
   работает колесо с Shift и точки-индикаторы. */
.pm-photo-track {
  display: flex; height: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.pm-photo-track::-webkit-scrollbar { display: none; }
.pm-photo-track > figure { flex: 0 0 100%; height: 100%; margin: 0; scroll-snap-align: center; }
.pm-photo-dots {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; justify-content: center; gap: 6px; pointer-events: none;
}
.pm-photo-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.55); box-shadow: 0 0 2px rgba(0,0,0,.35);
  transition: background .15s;
}
.pm-photo-dots span.on { background: #fff; }

/* Стрелки листания — только там, где есть курсор: пальцем лента листается
   сама, а на десктопе горизонтальный скролл мышью не работал вовсе. */
.pm-photo-arrow {
  position: absolute; top: 0; bottom: 0; width: 56px;
  border: none; cursor: pointer; color: #fff; font-size: 20px; line-height: 1;
  display: none; align-items: center; opacity: 0; transition: opacity .15s;
}
.pm-photo-arrow-prev { left: 0; justify-content: flex-start; padding-left: 10px;
  background: linear-gradient(to right, rgba(0,0,0,.45), rgba(0,0,0,0)); }
.pm-photo-arrow-next { right: 0; justify-content: flex-end; padding-right: 10px;
  background: linear-gradient(to left, rgba(0,0,0,.45), rgba(0,0,0,0)); }
.pm-photo-arrow:disabled { opacity: 0 !important; pointer-events: none; }
@media (hover: hover) and (pointer: fine) {
  .pm-photo-arrow { display: flex; }
  .product-modal-photo:hover .pm-photo-arrow { opacity: 1; }
}

/* Увеличение фото. Масштаб страницы на сайте зафиксирован
   (templates/_viewport.html), системного «растянуть пальцами» нет —
   поэтому своё: колесо, щипок, двойной тап, перетаскивание. */
.photo-zoom {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; touch-action: none;
}
/* Сцена двигается трансформацией, а САМА картинка меняет ширину в пикселях
   при увеличении — иначе браузер растягивает уже отрисованный кадр и мелкий
   шрифт мылит (в Telegram тот же снимок читался, у нас нет). */
/* По центру — флексом самого окна (.photo-zoom уже центрирует), без
   position:absolute и без отдельного свойства translate: так надёжнее на
   старых Safari, а трансформация остаётся полностью за JS. */
.photo-zoom-stage {
  flex: 0 0 auto;
  transform-origin: center center;
  will-change: transform;
}
.photo-zoom img {
  display: block; height: auto; max-width: none;
  cursor: zoom-in; user-select: none; -webkit-user-drag: none;
}
/* Курсор-лупа только там, где увеличение вообще есть, — на снимках
   упаковки. Заглавные фото не увеличиваются (они прогнаны через ИИ, и при
   увеличении на них виден сгенерированный текст). */
.product-modal-photo img { cursor: default; }
.product-modal-photo img.pm-photo-zoomable { cursor: zoom-in; }
.photo-zoom.zoomed img { cursor: grab; }
/* padding: 0 и flex-центровка обязательны: iOS даёт <button> свои
   боковые отступы в 1em, и при 26px кнопка раздувалась из круга в овал,
   вылезающий за правый край (скриншот 2026-09-14). */
.photo-zoom-close {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  width: 40px; height: 40px; padding: 0; margin: 0; border: none; border-radius: 50%;
  -webkit-appearance: none; appearance: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.14); color: #fff; font-size: 26px; line-height: 1;
  font-family: inherit; cursor: pointer; z-index: 1;
}

/* ---------- правка фото товара из кабинета (24.10.2026, site/photo_editor.py) ----------
   Кнопка в карточке — только редактору; окно — плитки как в админке витрины:
   первое фото главное, «Главным» у остальных, «×», «+ Добавить фото». */
.pm-photo-edit {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 7px;
  background: var(--green-bg); color: var(--green-dark); border: none; border-radius: var(--r-pill);
  padding: 8px 14px; font-family: inherit; font-size: 13.5px; font-weight: 600; line-height: 1; cursor: pointer;
}
.pm-photo-edit[hidden] { display: none; }
.pe-overlay {
  position: fixed; inset: 0; z-index: 2500; background: rgba(0, 0, 0, .45);
  display: flex; align-items: flex-end;
}
.pe-overlay[hidden] { display: none; }
.pe-panel {
  background: var(--white); color: var(--ink); width: 100%;
  max-height: 94vh; max-height: 94svh; border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column; overflow: hidden; position: relative;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, .12);
}
@media (min-width: 640px) {
  .pe-overlay { align-items: center; justify-content: center; }
  .pe-panel { max-width: 560px; border-radius: 20px; max-height: 88vh; max-height: 88svh; }
}
.pe-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 4px; }
.pe-title { flex: 1; min-width: 0; }
.pe-h { font-size: 17px; font-weight: 600; line-height: 1.3; }
.pe-sub { font-size: 13px; color: var(--gray); margin-top: 3px; line-height: 1.35; overflow-wrap: anywhere; }
.pe-x {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: none; padding: 0;
  background: var(--photobg); color: var(--ink); font-size: 20px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pe-body { overflow-y: auto; padding: 12px 20px 6px; flex: 1; min-height: 0; }
.pe-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 440px) { .pe-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pe-ph, .pe-add { aspect-ratio: 4 / 5; border-radius: 14px; box-sizing: border-box; }
.pe-ph {
  position: relative; overflow: hidden;
  background: var(--photo-tile, var(--photobg)); box-shadow: inset 0 0 0 1px var(--border);
}
.pe-ph img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pe-ph.main { box-shadow: inset 0 0 0 2px var(--green); }
.pe-badge, .pe-main {
  position: absolute; left: 6px; right: 6px; bottom: 6px; border-radius: 10px; padding: 7px 0;
  text-align: center; font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1;
}
.pe-badge { background: var(--green); color: var(--on-accent); }
.pe-main {
  border: none; background: rgba(255, 255, 255, .94); color: #148a51; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
/* padding: 0 и флекс — иначе iOS раздувает круглую кнопку в овал. */
.pe-del {
  position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border-radius: 50%;
  border: none; padding: 0; background: rgba(17, 20, 24, .62); color: #fff; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.pe-state {
  position: absolute; inset: 0; border: none; margin: 0; padding: 6px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: rgba(255, 255, 255, .74); color: #141414; font-family: inherit;
  font-size: 12px; font-weight: 600; line-height: 1.3; text-align: center;
}
.pe-ph.is-err .pe-state { background: rgba(255, 238, 236, .92); color: #b3261e; cursor: pointer; }
.pe-spin {
  width: 22px; height: 22px; border-radius: 50%; box-sizing: border-box;
  border: 2.5px solid rgba(20, 20, 20, .15); border-top-color: var(--green); animation: pe-spin .8s linear infinite;
}
@keyframes pe-spin { to { transform: rotate(360deg); } }
.pe-add {
  border: 1.5px dashed var(--lgray); color: var(--green-dark); padding: 0 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 12.5px; font-weight: 600; line-height: 1.3; text-align: center;
}
.pe-add b { font-size: 26px; font-weight: 400; line-height: 1; }
.pe-add span { display: block; max-width: 100%; overflow-wrap: anywhere; }
.pe-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pe-hint { font-size: 12.5px; color: var(--gray); line-height: 1.5; margin: 12px 0 0; }
.pe-status { font-size: 13px; line-height: 1.45; margin: 8px 0 0; }
.pe-status:empty { display: none; }
.pe-status.err { color: var(--danger); }
.pe-foot { display: flex; gap: 10px; padding: 12px 20px calc(14px + env(safe-area-inset-bottom, 0px)); }
.pe-foot .btn { flex: 1; }
/* Перетаскивание (24.10.2026): зажать фото и тянуть. Долгое нажатие — без меню
   «Сохранить картинку», выделения текста и родного перетаскивания картинки. */
.pe-grid { -webkit-user-select: none; user-select: none; }
.pe-ph { -webkit-touch-callout: none; cursor: grab; }
.pe-ph img { pointer-events: none; -webkit-user-drag: none; }
.pe-ph.is-press { transform: scale(.96); transition: transform .15s ease .1s; }
.pe-ph.is-placeholder { opacity: .35; }
.pe-dragging, .pe-dragging .pe-ph { cursor: grabbing; }
/* Пока тянут: кнопки на плитках спрятаны, зелёная рамка — у того, что встанет первым. */
.pe-dragging .pe-ph { box-shadow: inset 0 0 0 1px var(--border); }
.pe-dragging .pe-grid > .pe-ph:first-child { box-shadow: inset 0 0 0 2px var(--green); }
.pe-dragging .pe-ph .pe-badge, .pe-dragging .pe-ph .pe-main,
.pe-dragging .pe-ph .pe-del, .pe-dragging .pe-ph .pe-state { visibility: hidden; }
.pe-dragging .pe-grid > .pe-ph:first-child:not(.is-placeholder)::after,
.pe-ghost.is-first::after {
  content: "Главное"; position: absolute; left: 6px; right: 6px; bottom: 6px; border-radius: 10px;
  padding: 7px 0; background: var(--green); color: var(--on-accent); text-align: center;
  font-size: 12px; font-weight: 600; line-height: 1;
}
.pe-ghost {
  position: fixed; z-index: 2600; margin: 0; pointer-events: none; aspect-ratio: auto;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .3), inset 0 0 0 1px var(--border); will-change: transform;
}
.pe-ghost.is-first { box-shadow: 0 14px 34px rgba(0, 0, 0, .3), inset 0 0 0 2px var(--green); }
.pe-ghost .pe-badge, .pe-ghost .pe-main, .pe-ghost .pe-del, .pe-ghost .pe-state { display: none; }
.pe-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 3100; background: rgba(20, 20, 20, .9); color: #fff; padding: 11px 16px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.4; max-width: calc(100vw - 32px); box-sizing: border-box; text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}

.pm-article-row { display: flex; align-items: center; gap: 4px; }
.pm-link-btn {
  background: none; border: none; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 3px 5px;
  border-radius: var(--r-control); color: var(--gray); flex-shrink: 0;
}
.pm-link-btn:hover { background: rgba(0,0,0,.06); }
.product-modal-body { padding: 18px 20px 4px; display: flex; flex-direction: column; gap: 8px; }
.product-modal-body h2 { font-size: 18px; margin: 0; line-height: 1.3; }
/* Блок покупки прямо под названием (см. catalog.html). .card-price по
   умолчанию имеет margin-top:auto — это для карточки в сетке, где цена
   прижата к низу; в модалке это, наоборот, отрывало цену от названия. */
.product-modal-body .card-price { margin-top: 4px; font-size: 21px; }
.product-modal-body .card-controls { margin-top: 4px; }
/* Блок под ценой и кнопкой: вводный абзац → таблица характеристик → состав
   → мелкий дисклеймер. Весь блок вторичным цветом (var(--gray)); чёрные —
   только ключи характеристик (Форма/Дозировка/…), тем же шрифтом и
   размером, без жирного. Смысловые границы (абзац | характеристики |
   состав) отбиты тонкой линией var(--border). */
.product-modal-desc {
  font-size: 13.5px; color: var(--gray); line-height: 1.55;
  margin: 6px 0 0; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 14px;
}
.product-modal-desc .pm-desc-lead { margin: 0; }
/* Абзацы одного описания (у своих товаров реселлера) — ближе друг к другу,
   чем смысловые блоки (gap 14px). */
.product-modal-desc .pm-desc-lead + .pm-desc-lead { margin-top: -6px; }
.product-modal-desc .pm-desc-specs {
  margin: 0; padding-top: 14px; border-top: 1px solid var(--border);
  /* Не max-content: длинный ключ («Дозировка на порцию (3 таблетки)») не
     переносился, а длинное слово в значении не рвалось — сетка
     становилась шире экрана и карточка ездила вбок (скриншот 2026-09-14). */
  display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr); gap: 8px 16px;
}
.product-modal-desc .pm-desc-specs dt,
.product-modal-desc .pm-desc-specs dd { min-width: 0; overflow-wrap: break-word; word-break: break-word; }
.product-modal-desc .pm-desc-specs dt { color: var(--ink); font-weight: 400; }
.product-modal-desc .pm-desc-specs dt::after { content: ":"; }
.product-modal-desc .pm-desc-specs dd { margin: 0; }
.product-modal-desc .pm-desc-sostav {
  margin: 0; padding-top: 14px; border-top: 1px solid var(--border);
}
/* «Состав:» — чёрный, как и ключи характеристик; сам текст состава серый. */
.product-modal-desc .pm-desc-sostav b { color: var(--ink); font-weight: 400; }
/* Примечания по конкретному товару (беременность, взаимодействия, «не длительно»,
   аллергены) — отдельный блок перед общим дисклеймером. Одна иконка по центру
   слева, тексты — колонкой справа. */
.product-modal-desc .pm-desc-notes {
  margin: 0; padding: 14px 16px;
  display: flex; align-items: center; gap: 13px;
  background: #faf4ea; border-radius: 14px;
}
.product-modal-desc .pm-desc-notes-ic {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid #cfa16f; color: #b47636;
  font-size: 12px; font-weight: 600; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.product-modal-desc .pm-desc-notes-list {
  min-width: 0; display: flex; flex-direction: column; gap: 6px;
}
.product-modal-desc .pm-desc-notes-list p {
  margin: 0; font-size: 12px; color: #7a5326; line-height: 1.5;
}
.product-modal-desc .pm-desc-disc { margin: 2px 0 0; font-size: 11.5px; color: var(--lgray); line-height: 1.45; }

/* ---------- товар с характеристиками (например, диффузоры разных
   ароматов) — лента вариантов под главным фото ---------- */
.pm-variants {
  display: flex; gap: 8px; overflow-x: auto; padding: 10px 20px;
  -webkit-overflow-scrolling: touch; background: var(--white);
}
.pm-variant-chip {
  flex: 0 0 auto; width: 60px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; border: none; background: none; padding: 0;
}
.pm-variant-thumb {
  width: 52px; height: 52px; border-radius: var(--r-control); overflow: hidden;
  border: 2px solid transparent; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  background: var(--photobg); color: var(--lgray); font-size: 18px;
}
.pm-variant-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-variant-chip.active .pm-variant-thumb { border-color: var(--green); }
.pm-variant-chip.out-of-stock .pm-variant-thumb { opacity: 0.45; }
.pm-variant-name {
  font-size: 10px; text-align: center; line-height: 1.2; color: var(--gray);
  max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-variant-chip.active .pm-variant-name { color: var(--green-dark); font-weight: 600; }

.pm-analogs { margin-top: 10px; }
.pm-analogs-status { text-align: center; font-size: 13px; color: var(--gray); padding: 8px 0; }
.pm-analogs-status.error { color: var(--danger); }
.pm-analogs-list {
  display: grid;
  /* Фиксированные 2 колонки, не переиспользуем .grid — та подстраивается под
     ширину ОКНА (до 5 колонок на широком экране), а модалка карточки товара
     ограничена ~480px независимо от экрана, поэтому колонок больше двух там
     не поместится без обрезки карточек. */
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
/* Подпись-разделитель между точными заменами и подобранными по смыслу
   (см. loadAnalogs в site.js) — во всю ширину сетки, иначе встала бы
   в колонку как ещё одна карточка. */
.pm-analogs-note {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--gray);
  padding: 4px 0 0;
}

/* ---------- корзина ---------- */
.cart-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: var(--z-cart-backdrop); }
.cart-panel {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(380px, 100%);
  background: var(--white); z-index: var(--z-cart-panel); box-shadow: -4px 0 24px rgba(0,0,0,.15);
  display: flex; flex-direction: column; padding: 18px;
  /* Кнопки заказа внизу корзины — над плавающей панелью Safari 26 (--ios-bar). */
  padding-bottom: calc(18px + var(--ios-bar));
}
/* Мобильный крестик закрытия корзины путают с "очистить корзину" — стрелка
   назад слева от заголовка, заголовок по центру, "Очистить корзину" — в
   правом верхнем углу, подальше от стрелки (по фидбэку пользователя: рядом
   с ней легко задеть случайно, когда тянешься закрыть корзину). Grid, не
   flex+order — на десктопе раскладка меняется на две строки (заголовок+
   крестик сверху, "Очистить корзину" отдельной строкой под ними, как было
   до этой правки), а flex-order не умеет переносить элемент в другую
   визуальную строку. */
.cart-panel-header {
  display: grid;
  /* Крайние колонки — равные 1fr, а не auto: если считать ширину "по
     содержимому", то стрелка (узкая) и "Очистить корзину" (текст пошире)
     занимают разную ширину, и заголовок в средней колонке съезжает от
     истинного центра панели в сторону более узкой из них. С 1fr/1fr сама
     колонка заголовка всегда точно посередине, а стрелка/кнопка просто
     прижаты каждая к своему краю ВНУТРИ своей половины (justify-self). */
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "close title clear";
  align-items: center;
  gap: 8px;
}
.cart-panel-header h2 { grid-area: title; font-size: 16px; margin: 0; text-align: center; }
.icon-btn { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--gray); }
#cart-close { grid-area: close; justify-self: start; }
.cart-close-glyph-desktop { display: none; }
/* Область нажатия «Очистить корзину» и «Удалить» — 40 px (было 15 px —
   промахивались, 20.10.2026); видимый текст тот же. */
.clear-cart-btn {
  grid-area: clear;
  border: none; background: none; color: var(--gray);
  font-size: 11.5px; font-weight: 600; cursor: pointer;
  padding: 12px 0 12px 12px; margin: -12px 0; white-space: nowrap; justify-self: end;
}
@media (min-width: 640px) {
  .cart-close-glyph-mobile { display: none; }
  .cart-close-glyph-desktop { display: block; }
  .cart-panel-header {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title close"
      "clear clear";
  }
  .cart-panel-header h2 { text-align: left; }
  .clear-cart-btn { font-size: 12.5px; margin: 2px 0 0; justify-self: start; }
}
.clear-cart-btn:hover { color: var(--danger); }
.cart-scroll { flex: 1; overflow-y: auto; margin: 4px 0 12px; min-height: 0; }
.cart-items { display: flex; flex-direction: column; gap: 12px; }
.cart-item { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
/* Последний товар — без своей нижней линии: у блока "Вы обычно берёте"
   (.cart-nudge) сразу под ним уже есть собственная верхняя граница, вместе
   получались две линии почти вплотную (фидбэк пользователя — "лишняя
   линия"). Если нижней рельсы нет — .cart-nudge скрыт, а граница у
   последнего товара всё равно не нужна: ниже сразу "Итого". */
.cart-item:last-child { border-bottom: none; padding-bottom: 0; }
.cart-item-thumb {
  width: 44px; height: 44px; border-radius: var(--r-control);
  overflow: hidden; background: var(--photobg); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item-name { flex: 1; font-size: 13px; min-width: 0; padding-top: 2px; }
.cart-item-name .article { color: var(--gray); font-size: 11px; display: block; }
/* Пометка "цена по суммарному объёму" (диффузоры/товары с несколькими
   ароматами и лестницей цен на весь артикул) — по прямому запросу
   пользователя (2026-08-20). */
.cart-item-group-note { color: var(--green-dark); font-size: 11px; display: block; margin-top: 2px; }
.cart-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.remove-btn {
  border: none; background: none; color: var(--gray);
  font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0;
  padding: 12px 0 12px 12px; margin: -12px 0 -8px; white-space: nowrap;
}
.remove-btn:hover { color: var(--danger); }
/* ---------- корзина: "Вы обычно берёте — не забыли?" (личный кабинет) ---------- */
.cart-nudge { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 10px; padding-bottom: 6px; }
.cart-nudge-title { font-size: 12.5px; font-weight: 600; color: var(--gray); margin-bottom: 8px; }
.cart-nudge-list { display: flex; flex-direction: column; gap: 8px; }
.cart-nudge-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cart-nudge-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cart-nudge-name { font-size: 13px; line-height: 1.3; }
/* Причина допродажи ("С этим часто берут", см. site.js: renderCartTogether) —
   короткая подпись, почему именно этот товар предложен. Ту же роль для
   "Вы обычно берёте" играть не должна — там название и так самоочевидно. */
.cart-nudge-reason { font-size: 11px; line-height: 1.35; color: var(--gray); }
.cart-nudge-add {
  border: 1px solid var(--green); background: none; color: var(--green);
  border-radius: var(--r-control); padding: 6px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; flex-shrink: 0; white-space: nowrap;
}
.cart-nudge-add:hover { background: var(--green-bg); }

.cart-total { font-weight: 700; font-size: 16px; padding: 8px 0; }

/* Скидки витрины реселлера в корзине (site.js: renderShopDiscount). Живут в
   нижней неподвижной части панели, над «Итого»: поле кода должно быть под
   рукой, а не в конце прокручиваемого списка товаров. */
/* minmax(0, 1fr): без него колонка раздувалась по строке промокода, и на
   Android 360 px «Применить» и суммы скидки обрезались краем (20.10.2026). */
.cart-discount { padding-top: 8px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.cart-promo { display: flex; gap: 8px; min-width: 0; }
/* 16px — иначе iOS увеличивает страницу при фокусе на поле. */
.cart-promo input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--r-btn-lg); background: var(--white);
  text-transform: uppercase; -webkit-appearance: none; appearance: none; }
.cart-promo input::placeholder { text-transform: none; }
.cart-promo input:focus { outline: none; border-color: var(--green); }
.cart-promo button { flex: none; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 14px;
  border: none; border-radius: var(--r-btn-lg); color: var(--green); cursor: pointer;
  /* Не --green-bg: он всегда зелёный, а у витрины акцент свой (розовый
     текст на зелёной подложке). Нейтральный серый — запасной вариант для
     старых браузеров без color-mix. */
  background: #eff0f3; background: color-mix(in srgb, var(--green) 12%, #fff); }
.cart-promo-status { font-size: 12.5px; color: var(--green); }
.cart-promo-status.error { color: var(--danger); }
.cart-discount-next { font-size: 12.5px; color: var(--gray); }
.cart-discount-lines { display: grid; gap: 2px; font-size: 14px; }
.cart-discount-row { display: flex; justify-content: space-between; gap: 12px; }
.cart-discount-row span:last-child { white-space: nowrap; }
.cart-discount-amount { color: var(--green); font-weight: 600; }
.cart-discount-note { font-size: 12px; color: var(--gray); }
.cart-actions { display: flex; flex-direction: column; gap: 8px; }

/* Порог крупного опта в корзине (site.js: renderBigProgress, 29.09): не
   набран — серый блок с полосой «сколько ещё», набран — зелёная плашка. */
.cart-big { margin-top: 8px; padding: 10px 12px; border-radius: var(--r-control);
  background: #f4f4f6; display: grid; gap: 6px; }
.cart-big-title { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.cart-big-sub { font-size: 12px; line-height: 1.4; color: var(--gray); }
.cart-big-bar { height: 6px; border-radius: var(--r-pill); background: var(--border); overflow: hidden; }
.cart-big-bar span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.cart-big.on { background: var(--green-bg); }
.cart-big.on .cart-big-title { color: var(--green-dark); }

/* Переключатель уровня цены в корзине — персональная витрина клиента
   (CATALOG.fourPrices). */
.cart-price-mode { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px; padding: 8px 0 2px; }
.cart-price-mode-label { font-size: 12px; color: var(--gray); flex-shrink: 0; }
.cart-price-mode button { font: inherit; font-size: 12px; line-height: 1; padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--white); color: var(--ink); cursor: pointer; flex: 1 1 auto; white-space: nowrap; }
.cart-price-mode button.active { background: var(--green); border-color: var(--green); color: var(--on-accent); font-weight: 600; }
.whatsapp-buttons { display: flex; flex-direction: column; gap: 8px; }
/* box-sizing/display/text-align/text-decoration — чтобы .btn одинаково
   выглядела и на <button> (корзина), и на <a> (страница "Личный кабинет"
   ниже), где по умолчанию у ссылки был бы inline-текст без фона на всю
   ширину. */
.btn { box-sizing: border-box; display: block; text-align: center; text-decoration: none; border: none; border-radius: var(--r-btn-lg); padding: 13px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s ease; }
.btn-primary { background: var(--green); color: var(--on-accent); }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: var(--photobg); color: var(--ink); border: 1px solid var(--border); }
.btn:disabled { background: var(--photobg); color: var(--lgray); cursor: not-allowed; }
.copy-feedback { text-align: center; color: var(--green); font-size: 13px; margin-top: 6px; }
/* Что делать после «Отправить заказ в WhatsApp» / у продавца без WhatsApp
   (site.js: showSendHint, 20.10.2026). */
.send-hint { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-control); background: var(--photobg);
  color: var(--ink); font-size: 13px; line-height: 1.45; }
.send-hint-btn { display: block; width: 100%; margin-top: 8px; min-height: 40px; border: 1px solid var(--border);
  border-radius: var(--r-btn-lg); background: var(--white); color: var(--ink); font: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; }
/* Пустой поиск на витрине — «Спросить у продавца» (site.js: fillEmptyState). */
.empty-ask { display: inline-block; margin-top: 14px; padding: 12px 18px; }
/* Срок годности словами и «спросить продавца» в карточке товара. */
.pm-expiry { font-size: 13px; line-height: 1.4; color: var(--gray); margin: 6px 0 4px; }
.pm-expiry.expired { color: var(--danger); font-weight: 600; }
.pm-ask { display: inline-block; font-size: 13.5px; font-weight: 600; color: var(--green-dark);
  margin: 6px 0 4px; padding: 6px 0; }
/* Длинный ряд чипов «Бренды»/«Подразделы» на витрине — две строки и «Все …»
   (site.js: collapsibleChips, 20.10.2026: первый товар был на 2,5 экрана ниже). */
.brand-row.chips-collapsed { max-height: 75px; overflow: hidden; }
.chips-more { display: block; margin: -8px 0 12px; padding: 8px 0; min-height: 36px; border: none; background: none;
  color: var(--green-dark); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.cart-refresh-status { text-align: center; font-size: 13px; margin-bottom: 8px; color: var(--gray); }
.cart-refresh-status.error { color: var(--danger); }
.retry-btn { margin-left: 6px; text-decoration: underline; background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 0; }

/* ---------- каталог: загрузка/ошибка ---------- */
.catalog-loading { text-align: center; color: var(--gray); padding: 60px 16px; font-size: 14px; }
.catalog-error { text-align: center; color: var(--danger); padding: 60px 16px; font-size: 14px; }

/* ---------- личный кабинет: вход по PIN ---------- */
.cabinet-login-body { background: var(--bg); margin: 0; font-family: "Inter", system-ui, sans-serif; }
.cabinet-login-page {
  max-width: 360px; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.cabinet-login-logo { height: 48px; width: auto; margin-bottom: 20px; }
.cabinet-login-title { font-size: 20px; margin: 0 0 6px; color: var(--ink); }
.cabinet-login-sub { font-size: 14px; color: var(--gray); margin: 0 0 24px; }
.cabinet-login-form { width: 100%; display: flex; flex-direction: column; gap: 14px; }
.cabinet-login-input {
  width: 100%; border: 1px solid var(--border); background: var(--photobg);
  /* var(--r-btn-lg), не --r-control — консистентно со скруглением кнопки
     "Войти" сразу под полем (по фидбэку пользователя, было заметно мельче). */
  border-radius: var(--r-btn-lg); padding: 16px; text-align: center;
  font-family: inherit; font-size: 24px; font-weight: 700; letter-spacing: 0.3em;
}
.cabinet-login-input:focus { outline: none; border-color: var(--green); background: var(--white); }
.cabinet-login-error { color: var(--danger); font-size: 13.5px; }
.cabinet-login-submit { width: 100%; }
/* «Не помню код — написать менеджеру» и подсказка про код (20.10.2026). */
.cabinet-login-help { width: 100%; margin-top: 12px; }
.cabinet-login-hint { font-size: 13px; color: var(--gray); line-height: 1.45; margin: 14px 0 0; }
/* "Вернуться в общий каталог" — по прямому запросу пользователя, чтобы
   потерянная сессия (см. cabinet_login.html) не была тупиком. */
.cabinet-login-back {
  display: block; text-align: center; margin-top: 18px;
  font-size: 13.5px; color: var(--logo-green); text-decoration: underline;
}

/* ---------- страница "Личный кабинет" в шапке основного сайта
   (cabinet_info.html) — не путать с cabinet-login выше: это не форма
   входа, а объяснение + кнопки написать менеджеру. Переиспользует только
   .cabinet-login-body/-logo (логотип по центру — этого по прямому запросу
   пользователя достаточно, остальное — заголовок и текст — слева, не по
   центру). */
.cabinet-info-back {
  /* fixed, не в потоке страницы — здесь нет общего "шапка+назад" ряда, как
     в cabinet_orders.html, страница начинается сразу с логотипа. Тот же
     визуальный стиль, что и .orders-back, но своим классом — .orders-back
     завязан на позиционирование внутри .orders-header, здесь его нет. */
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  z-index: 1;
  background: var(--white); color: var(--ink); border-radius: 50%; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
  font-size: 18px;
}
.cabinet-info-page {
  max-width: 420px; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 32px 24px; text-align: center;
}
.cabinet-info-title { font-size: 28px; color: var(--logo-green); text-align: left; width: 100%; margin: 4px 0 20px; }
.cabinet-info-text { font-size: 14.5px; color: var(--logo-green); line-height: 1.6; text-align: left; margin: 0 0 16px; }

/* Форма привязки Telegram-аккаунта к личному кабинету (Telegram Mini App,
   см. план) — видна и активна ТОЛЬКО внутри Mini App (см. cabinet_info.html:
   скрыта по умолчанию атрибутом hidden, снимается скриптом при наличии
   Telegram.WebApp.initData). Обычный текст выше (написать менеджеру)
   остаётся видимым и вне Mini App — эта форма ему не замена, а
   дополнительный способ входа. */
.cabinet-link-form { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.cabinet-link-input {
  width: 100%; border: 1px solid var(--border); background: var(--photobg);
  border-radius: var(--r-control); padding: 12px 14px;
  /* 16px — против автозума iOS при фокусе, см. #search выше. */
  font-family: inherit; font-size: 16px; box-sizing: border-box;
}
.cabinet-link-input:focus { outline: none; border-color: var(--green); background: var(--white); }
/* Само поле PIN — те же крупные разрежённые цифры, что и на обычном входе. */
.cabinet-link-form .cabinet-login-input { font-size: 20px; padding: 12px; }
.cabinet-info-actions { width: 100%; margin-top: 8px; }

/* ---------- личный кабинет: история заказов (cabinet_orders.html) ----------
   Отдельная лёгкая страница, без site.js — список заказов не участвует ни
   в поиске, ни в категориях, ни в корзине. */
.orders-body { background: var(--bg); margin: 0; font-family: "Inter", system-ui, sans-serif; color: var(--ink); }
.orders-page { max-width: 640px; margin: 0 auto; padding: 16px 16px 40px; }
/* sticky, не просто в потоке — чтобы выйти из истории заказов, не нужно
   прокручивать список вверх до конца (по фидбэку пользователя). Фон и
   отступы по бокам — чтобы карточки заказов не просвечивали под шапкой
   при скролле. */
.orders-header {
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 5;
  background: var(--bg); margin: 0 -16px 18px; padding: 16px 16px 10px;
}
.orders-back {
  background: var(--white); border-radius: 50%; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1); text-decoration: none;
}
.orders-title { font-size: 19px; margin: 0; }
.orders-empty { color: var(--gray); font-size: 14px; }
.orders-note { color: var(--gray); font-size: 12.5px; text-align: center; margin: 14px 0 0; }

.orders-list { display: flex; flex-direction: column; gap: 14px; }
.order-card { background: var(--white); border-radius: var(--r-card); padding: 16px; border: 1px solid var(--border); }
.order-card-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; gap: 10px; }
.order-date { font-weight: 700; font-size: 14px; }
.order-number { color: var(--gray); font-size: 12.5px; }
.order-lines { display: flex; flex-direction: column; gap: 8px; }
/* align-items: center, не baseline, — по прямому запросу пользователя
   (2026-08-27, добавлена миниатюра): у <img> нет полезного текстового
   бейзлайна, center ровняет и картинку, и текстовые элементы по середине
   строки. */
.order-line { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
/* Миниатюра — по прямому запросу пользователя (2026-08-27), тот же
   /photos/thumb/, что и везде на сайте. Без фото — просто пустой квадрат
   того же фонового цвета (не общий класс .no-photo с текстом заглушки —
   тот рассчитан на position:absolute;inset:0 внутри крупного
   position:relative фото-контейнера, здесь миниатюра слишком маленькая
   для читаемого текста заглушки, см. докстринг в cabinet_orders.html). */
.order-line-thumb {
  /* border-radius: 10px — по прямому репорту пользователя (2026-08-27):
     между 8px (мелковато) и var(--r-control) 12px (крупновато) на такой
     маленькой 32px миниатюре. */
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px;
  object-fit: cover; background: var(--photobg); display: block;
}
/* max-width — по прямому репорту пользователя (2026-08-27, "странная
   короткая пунктирная линия у некоторых товаров"): без ограничения
   длинное название почти целиком заполняло строку, пунктиру (flex-grow:1
   ниже) оставалось на 12px (min-width) — едва заметный обрывок вместо
   честного чекового пунктира. Ограничение заставляет длинные названия
   переноситься на 2-3 строки раньше, но гарантированно оставляет пунктиру
   заметное место в любой строке. */
.order-line-name { flex-shrink: 1; min-width: 0; max-width: 62%; }
/* Не border-bottom:dotted (частые, плотные точки — "не как в чеке", по
   прямому репорту пользователя) — управляемый градиент-паттерн задаёт
   ровно тот интервал между точками, что и на настоящем чеке, а не то, что
   выберет браузер сам. height:1em — короткая строка по центру ряда (не на
   всю высоту 32px миниатюры), фон рисуется у её нижнего края — там же,
   где сидел бы текстовый бейзлайн. */
.order-line-dots {
  flex: 1 1 12px; min-width: 12px; height: 1em;
  background-image: linear-gradient(to right, var(--lgray) 30%, rgba(0, 0, 0, 0) 0%);
  background-position: bottom;
  background-size: 5px 1px;
  background-repeat: repeat-x;
}
.order-line-qty { flex-shrink: 0; color: var(--gray); font-size: 12.5px; }

/* ---------- блок о дозволенности схемы (админка витрины) ---------- */
/* Живёт в `templates/shop_admin.html`, первым блоком. Стили здесь, а не в
   самой админке: та тоже грузит этот файл, а токены (--border, --photobg,
   --r-card) объявлены тут. Свёрнут по умолчанию: это обязательство, которое
   реселлер принимает, продолжая пользоваться сайтом, а не баннер. Нативный
   <details>: во встроенном браузере WhatsApp сворачивание работает и без JS. */
.halal-note {
  margin: 0 0 14px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  overflow: hidden;
}
.halal-note-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; cursor: pointer;
  font-size: 14px; font-weight: 600; line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}
/* Родная стрелка-треугольник убирается ДВУМЯ правилами: WebKit слушает
   только ::-webkit-details-marker, остальные — list-style у summary. */
.halal-note-head { list-style: none; }
.halal-note-head::-webkit-details-marker { display: none; }
.halal-note-title { flex: 1; }
/* Шеврон из двух границ: одна деталь без SVG и без лишнего запроса. */
.halal-note-chev {
  flex: none; width: 9px; height: 9px; margin-right: 2px;
  border-right: 2px solid var(--gray); border-bottom: 2px solid var(--gray);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform .18s;
}
.halal-note[open] .halal-note-chev { transform: rotate(225deg) translate(-2px, -2px); }
.halal-note-body { padding: 0 16px 16px; font-size: 13.5px; line-height: 1.55; }
.halal-note-body p { margin: 0 0 10px; }
.halal-note-body p:last-child { margin-bottom: 0; }

/* Арабский набор: своя гарнитура (системные насхи — Geeza Pro на iOS,
   Noto Naskh на Android), крупнее и с большим интерлиньяжем. Огласовки
   висят над и под строкой, при обычном line-height они наезжают друг на
   друга и текст выглядит грязным. */
.halal-ar {
  font-family: "Geeza Pro", "Al Bayan", "Noto Naskh Arabic", "Noto Sans Arabic",
               "Traditional Arabic", "Amiri", "Times New Roman", serif;
  font-size: 20px; line-height: 2.05; text-align: right;
  color: var(--ink);
  background: var(--photobg);
  border-radius: var(--r-control);
  padding: 14px 16px;
  margin: 2px 0 12px !important;
}
.halal-ru { color: var(--ink); }
.halal-src { font-size: 12px; color: var(--gray); }
.halal-src a { color: var(--green); text-decoration: none; }
.halal-rule { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

/* ---------- тёмная тема — как в системе телефона (18.10.2026) ----------
   Решение пользователя: на всех наших сайтах тема та же, что в системе
   телефона/компьютера, без ручного выбора (утром 18.10 был переключатель в
   настройках витрины — убран). Каталог, кабинеты, витрины, настройки витрин:
   всё, что подключает этот файл, плюс в <head> каждой страницы
   templates/_viewport.html (color-scheme и тёмный фон до загрузки стилей).
   screen — печать остаётся светлой. html:root — специфичность как у прежнего
   html.theme-dark: выше инлайнового :root{--green…} витрины в catalog.html.
   Почти всё перекрашивают переменные; ниже — места, где цвет задан напрямую.
   Текст на цвете магазина — var(--on-accent), НЕ var(--white): здесь --white —
   тёмный фон карточек. Плитки под фото товаров остаются светлыми: снимки — на
   белом фоне, на тёмной подложке они выглядели бы вырезанными прямоугольниками. */
@media screen and (prefers-color-scheme: dark) {
  html:root {
    color-scheme: dark;
    --ink: #f2f2f4;
    --gray: #a1a1a8;
    --lgray: #6e6e75;
    --border: #323236;
    --bg: #0f0f11;
    --white: #1c1c1f;
    --photobg: #2a2a2e;
    --photo-tile: #f2f2f4;
    --danger: #e5534b;
    /* Запасные для браузеров без color-mix (iOS до 16.2). */
    --green-bg: #1b2a23;
    --green-border: #2c4a3b;
    --green-dark: var(--green);
    --logo-green: var(--green);
  }
  html:root .cart-promo button { background: var(--photobg); }
  /* Цвет магазина (у нашего каталога — зелёный) как ТЕКСТ — светлее на треть:
     тёмно-синий или бордовый на почти чёрном фоне не читается. Как ФОН кнопок
     цвет остаётся ровно тем, что выбрал магазин (--green не трогаем). */
  @supports (color: color-mix(in srgb, red 50%, blue)) {
    html:root {
      --green-bg: color-mix(in srgb, var(--green) 16%, #1c1c1f);
      --green-border: color-mix(in srgb, var(--green) 45%, #1c1c1f);
      --green-dark: color-mix(in srgb, var(--green) 65%, #ffffff);
      --logo-green: color-mix(in srgb, var(--green) 65%, #ffffff);
      --accent-text: color-mix(in srgb, var(--green) 65%, #ffffff);
    }
    html:root .cart-promo button { background: color-mix(in srgb, var(--green) 22%, #1c1c1f); }
  }
  html:root .orders-link,
  html:root .logo-text,
  html:root .card-price,
  html:root .card-price.four .fp-main-value,
  html:root .oos-toggle,
  html:root .cart-nudge-add,
  html:root .cart-promo button,
  html:root .cart-promo-status:not(.error),
  html:root .cart-discount-amount,
  html:root .copy-feedback,
  html:root .halal-src a { color: var(--accent-text, var(--green)); }
  html:root .cart-nudge-add { border-color: var(--accent-text, var(--green)); }
  /* --green-dark здесь — светлый цвет ТЕКСТА; фон кнопок при наведении остаётся
     цветом магазина, иначе белая надпись бледнеет. */
  html:root .cart-toggle:hover,
  html:root .btn-primary:hover,
  html:root .card-badge-analogs:hover,
  html:root .analogs-btn:hover, html:root .analogs-btn:active,
  html:root .promo-card .analogs-btn:hover,
  html:root .promo-card .analogs-btn:active { background: var(--green); }

  /* Логотип витрины — JPEG с фоном (кадратор админки): скруглённый, он читается
     как значок, а не как белый прямоугольник. Наш логотип прозрачный — для тёмной
     темы у него светлый вариант (/static/logo-dark.png через <picture>). */
  html:root .site-header img.logo,
  html:root .cabinet-login-logo { border-radius: 10px; }

  html:root .card-photo,
  html:root .card.promo-card .card-photo,
  html:root .product-modal-photo,
  html:root .cart-item-thumb,
  html:root .pm-variant-thumb,
  html:root .order-line-thumb { background: var(--photo-tile); }

  html:root #search,
  html:root .qty-input,
  html:root .cart-promo input,
  html:root .cabinet-login-input,
  html:root .cabinet-link-input { color: var(--ink); }
  html:root #search::placeholder,
  html:root .cart-promo input::placeholder { color: var(--gray); }

  html:root .owner-fab:hover { background: #dcdce0; }
  /* «Наверх» висит поверх тёмных карточек — светлее их и с обводкой, иначе сливается. */
  html:root .scroll-top-toggle { background: #2e2e33; box-shadow: 0 4px 16px rgba(0, 0, 0, .6), inset 0 0 0 1px #45454b; }
  html:root .scroll-top-toggle:hover { background: #38383e; }
  html:root .category-link-btn:hover,
  html:root .pm-link-btn:hover { background: rgba(255, 255, 255, .08); }
  html:root .pm-tier-row { border-bottom-color: rgba(255, 255, 255, .07); }
  html:root .promo-group { border-color: var(--green-border); background: transparent; }
  html:root .promo-group .card { border-color: var(--green-border); }
  html:root .oos-fade { background: linear-gradient(to bottom, rgba(15, 15, 17, 0), var(--bg)); }
  html:root .categories-overlay,
  html:root .product-modal { background: rgba(0, 0, 0, .6); }
  html:root .cart-backdrop { background: rgba(0, 0, 0, .55); }
  html:root .cart-big { background: var(--photobg); }
  html:root .product-modal-desc .pm-desc-notes { background: #2a2318; }
  html:root .product-modal-desc .pm-desc-notes-ic { border-color: #a9824f; color: #d9a766; }
  html:root .product-modal-desc .pm-desc-notes-list p { color: #e2c9a3; }
  /* Круглые «назад» кабинета и истории заказов — на тёмном фоне с обводкой. */
  html:root .cabinet-info-back,
  html:root .orders-back { box-shadow: inset 0 0 0 1px #3a3a3f; }
  /* Редактор фото: плитки под фото светлые, как карточки каталога. */
  html:root .pe-overlay { background: rgba(0, 0, 0, .6); }
  html:root .pe-x { background: #2a2a2e; }
  html:root .pm-photo-edit,
  html:root .pe-add { color: var(--accent-text, var(--green)); }
}
