/* ---------- токены ---------- */
:root {
  color-scheme: light;

  --bg: #f7f7f9;
  --surface: #fff;
  --surface-2: #f1f1f4;
  --tile: #fff;
  --border: #e6e6ec;
  --border-strong: #d6d6df;
  --text: #16161a;
  --text-dim: #6c6c78;
  --text-faint: #9a9aa6;
  --accent: #e04328;
  --accent-ink: #fff;
  --accent-soft: rgba(224, 67, 40, .1);

  --radius-sm: 9px;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 16, 26, .04), 0 2px 6px rgba(16, 16, 26, .05);
  --shadow-md: 0 4px 14px rgba(16, 16, 26, .09);
  --shadow-lg: 0 24px 70px rgba(16, 16, 26, .22);

  --topbar-h: 64px;
  /* «Чёлка» и строка состояния iPhone: viewport стоит с viewport-fit=cover,
     поэтому страница заезжает под них, а шапка должна их накрывать. Всё, что
     отсчитывается от низа шапки (липкая галерея, боковой каталог, панели),
     берёт --topbar-off — высоту шапки вместе с этой вставкой. На обычном
     экране вставка нулевая, и обе величины совпадают. */
  --safe-top: env(safe-area-inset-top, 0px);
  --topbar-off: calc(var(--topbar-h) + var(--safe-top));
  --sidebar-w: 258px;
  --gutter: clamp(16px, 3vw, 32px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* у .lightbox/.empty есть свой display — без этого атрибут hidden не сработает */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  /* без этого резиновый оверскролл тачпада утаскивает документ за край,
     и sticky-шапка уезжает вместе с ним */
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }

svg {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: fixed; top: calc(8px + var(--safe-top)); left: 8px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--accent); color: var(--accent-ink);
  text-decoration: none; transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.section__title {
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-off);
  padding-top: var(--safe-top);
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.topbar__inner {
  height: 100%;
  max-width: 1560px; margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex; align-items: center; gap: 12px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  color: inherit; text-decoration: none;
  white-space: nowrap;
}
.brand__mark { font-size: 22px; line-height: 1; }
.brand__text { font-size: 15px; letter-spacing: -.01em; }

.search {
  position: relative;
  flex: 1; max-width: 520px; margin-left: auto;
}
.search__icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-faint); pointer-events: none;
}
.search input {
  width: 100%; height: 40px;
  padding: 0 38px 0 40px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 100px;
  transition: border-color .15s, background .15s;
}
.search input::placeholder { color: var(--text-faint); }
.search input:focus { outline: none; background: var(--surface); border-color: var(--accent); }
.search input::-webkit-search-cancel-button { display: none; }
.search__clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%;
  color: var(--text-faint); cursor: pointer;
}
.search__clear:hover { background: var(--border); color: var(--text); }
.search__clear svg { width: 15px; height: 15px; }

.icon-btn {
  flex: none;
  width: 40px; height: 40px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 10px;
  color: var(--text-dim); cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.is-busy svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar__menu { display: none; }

.cart-btn { position: relative; }
.cart-btn.has-items { color: var(--text); }
.cart-btn__count {
  position: absolute; top: 2px; right: 2px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  border: 2px solid var(--surface); border-radius: 100px;
  font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums;
}

/* ---------- главная ---------- */
.home { padding: 26px 0 64px; }

/* Первый экран без картинок: у каталожного магазина роль главного визуала
   играют сами категории — они и стоят сразу под текстом. Декоративный коллаж
   из товаров тут только мешал: основания на белом фоне выглядят пустой фанерой. */
.hero { padding: clamp(8px, 2vw, 28px) 0 clamp(24px, 3vw, 36px); max-width: 62ch; }
.hero__kicker { font-size: 13px; color: var(--text-faint); margin-bottom: 14px; }
.hero__title {
  font-size: clamp(28px, 4vw, 46px); line-height: 1.08; letter-spacing: -.035em;
  margin-bottom: 16px;
}
.hero__lead { font-size: clamp(15px, 1.3vw, 17px); line-height: 1.6; color: var(--text-dim); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.home-section { padding: clamp(28px, 4vw, 44px) 0 0; }
.home-section--first { padding-top: 0; }
.home-section:empty { display: none; }
.home-section__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px;
}
.home-section__title { font-size: clamp(19px, 2.2vw, 25px); letter-spacing: -.025em; }
/* Заголовок раздела кликабелен, но остаётся заголовком: ни цвета ссылки, ни
   подчёркивания, ни подсветки по наведению — курсор браузер ставит сам.
   Обводка по Tab всё же нужна: без неё ссылку не видно с клавиатуры. */
.home-section__title a { color: inherit; text-decoration: none; }
.home-section__title a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 5px; }
.home-section__note { font-size: 13px; color: var(--text-faint); margin-top: 4px; }
.home-section__more {
  flex: none;
  color: var(--accent); text-decoration: none; font-size: 14px; font-weight: 600;
}
.home-section__more:hover { text-decoration: underline; }

/* категории — главный визуальный блок главной, поэтому плитки крупные */
.cat-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: clamp(10px, 1.4vw, 18px);
}
.cat-tile {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: inherit; text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
.cat-tile:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.cat-tile__media {
  aspect-ratio: 1; margin-bottom: 10px;
  display: grid; place-items: center; font-size: 26px;
  background: var(--tile); border-radius: var(--radius-sm); overflow: hidden;
}
.cat-tile__media img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.cat-tile__name { font-size: 16px; font-weight: 600; letter-spacing: -.015em; }
.cat-tile__count { font-size: 12.5px; color: var(--text-faint); }

/* горизонтальные подборки */
/* Верхняя граница колонки — не `1fr`, а число. С `1fr` свободное место делится
   между карточками, и полоса из одной карточки растягивала её на всю ширину
   содержимого: фотография квадратная, поэтому плитка вырастала в человеческий
   рост. Заодно уходил и разнобой — при трёх «похожих» карточки выходили заметно
   шире, чем при двенадцати. Теперь ширина одна всегда, а лишнее место остаётся
   справа, как и положено ленте. */
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(212px, 262px);
  gap: clamp(12px, 1.6vw, 20px);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  /* overflow-x: auto обрезает и по вертикали: карточка при наведении
     поднимается на 3px, и её верх с тенью уходил под край ленты. Поля
     дают место подъёму и тени, отрицательные отступы возвращают ленту
     на прежнее место в сетке страницы. */
  padding: 14px 14px 20px;
  margin: -14px -14px -14px;
  scroll-padding-inline: 14px;
}
.rail > .card { scroll-snap-align: start; }

.brand-wall {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.brand-wall .brand-chip { color: inherit; text-decoration: none; }

.info-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: clamp(10px, 1.4vw, 16px);
}
.info-card {
  display: flex; flex-direction: column; gap: 5px;
  padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: inherit; text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
.info-card:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.info-card__mark { font-size: 24px; margin-bottom: 4px; }
.info-card__title { font-size: 15px; font-weight: 600; }
.info-card__text { font-size: 13px; color: var(--text-faint); line-height: 1.45; }

.shopcard {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  margin-top: clamp(32px, 4vw, 52px);
  padding: clamp(22px, 3vw, 38px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, 22px);
}
.shopcard__hint { font-size: 13.5px; color: var(--text-faint); line-height: 1.6; margin-bottom: 20px; }

.shopcard__map { display: flex; flex-direction: column; gap: 10px; }
.shopcard__map iframe {
  width: 100%; flex: 1; min-height: 260px;
  border: 1px solid var(--border); border-radius: var(--radius);
  /* карта — единственная внешняя врезка на сайте */
  background: var(--surface-2);
}
.shopcard__maplink { align-self: flex-start; font-size: 13.5px; color: var(--accent); text-decoration: none; }
.shopcard__maplink:hover { text-decoration: underline; }
.shopcard__title { font-size: clamp(19px, 2.2vw, 25px); letter-spacing: -.025em; margin-bottom: 6px; }
.shopcard__addr { color: var(--text-dim); margin-bottom: 18px; }
.shopcard__hours { list-style: none; margin: 0 0 22px; padding: 0; max-width: 380px; }
.shopcard__hours li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 7px 0; border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.shopcard__hours span { color: var(--text-dim); }
.shopcard__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- правовые страницы ---------- */
.legal { max-width: 820px; padding: 26px 0 72px; }
.legal__back { color: var(--text-faint); text-decoration: none; font-size: 14px; }
.legal__back:hover { color: var(--accent); }
.legal__title {
  font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.03em;
  margin: 16px 0 22px;
}
.legal__body { color: var(--text); }
.legal__body h2 { font-size: 18px; margin: 1.6em 0 .6em; letter-spacing: -.015em; }
.legal__body h3 { font-size: 15.5px; margin: 1.3em 0 .5em; }

/* ---------- подвал ---------- */
.footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer__inner {
  max-width: 1560px; margin: 0 auto;
  padding: clamp(28px, 4vw, 48px) var(--gutter);
  display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}
.footer__col--brand .brand { margin-bottom: 12px; }
.footer__col--brand .brand__text { display: block; }
.footer__addr { font-size: 13.5px; color: var(--text-faint); line-height: 1.6; }
.footer__addr a { color: var(--text-dim); }
.footer__title {
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 12px;
}
.footer__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer__list a { color: var(--text-dim); text-decoration: none; font-size: 13.5px; }
.footer__list a:hover { color: var(--accent); }
.footer__bottom {
  max-width: 1560px; margin: 0 auto;
  padding: 16px var(--gutter) 28px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-faint);
}
.footer__bottom a { color: var(--text-dim); }

/* ---------- каркас ---------- */
.shell {
  max-width: 1560px; margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 32px;
}
.content { min-width: 0; }

.sidebar {
  position: sticky; top: var(--topbar-off);
  align-self: start;
  height: calc(100dvh - var(--topbar-off));
  padding: 26px 0 24px;
  display: flex; flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sidebar__head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 12px; }
.sidebar__head h2 {
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-faint);
}
.sidebar__close { display: none; }

.cats { display: flex; flex-direction: column; gap: 2px; }

.cat {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  background: none; border: 0; border-radius: 10px;
  color: var(--text-dim); text-align: left; cursor: pointer;
  transition: background .13s, color .13s;
}
.cat:hover { background: var(--surface-2); color: var(--text); }
.cat.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cat__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat__sub { padding-left: 26px; font-size: 13.5px; }
.cat__count { flex: none; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text-faint); }
.cat.is-active .cat__count { color: inherit; }

.sidebar__stats {
  margin-top: auto; padding: 16px 12px 0;
  border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-faint); line-height: 1.7;
}
.sidebar__stats b { color: var(--text-dim); font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- контент ---------- */
.main { padding: 26px 0 64px; min-width: 0; }

.toolbar {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.toolbar__title { font-size: clamp(21px, 3vw, 27px); letter-spacing: -.02em; }
.toolbar__right { display: flex; align-items: center; gap: 16px; }
.toolbar__count {
  font-size: 13px; color: var(--text-faint);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

.select { display: flex; align-items: center; gap: 8px; }
.select__label { font-size: 13px; color: var(--text-faint); }
.select select {
  height: 34px; padding: 0 30px 0 11px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a96' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 15px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  appearance: none; cursor: pointer;
  font-size: 13.5px;
}
.select select:hover { border-color: var(--border-strong); }

/* ---------- быстрый фильтр по брендам ---------- */
.brandbar {
  margin-bottom: 22px; padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.brandbar__head { margin-bottom: 12px; }
/* плитками, а не строкой со скроллом: в накладках 20 брендов и все должны быть видны */
.brandbar__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
}

.brand-chip {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 11px 8px 9px;
  background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; text-align: center;
  transition: border-color .14s, background .14s;
}
.brand-chip:hover { border-color: var(--border-strong); }
.brand-chip.is-active { border-color: var(--accent); background: var(--accent-soft); }

/* логотипы приходят разной пропорции — от квадратных марок до широких
   надписей, поэтому у знака фиксируется только высота */
.brand-mark {
  height: 26px; width: 100%;
  display: grid; place-items: center;
}
.brand-mark img { max-height: 26px; max-width: 92px; width: auto; object-fit: contain; }

.brand-mark--mono {
  width: 26px; height: 26px;
  border-radius: 50%;
  font-size: 10px; font-weight: 700; letter-spacing: -.02em; color: #fff;
}
.brand-mark--all { color: var(--text-faint); }
.brand-mark--all svg { width: 22px; height: 22px; }

.brand-chip__name {
  font-size: 12.5px; font-weight: 600; line-height: 1.2;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-chip__count { font-size: 10.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.brand-chip.is-active .brand-chip__count { color: var(--accent); }

/* ---------- сетка ---------- */
.grid {
  display: grid;
  /* не больше 4 в ряд — Baymard */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: clamp(12px, 1.6vw, 22px);
}
@media (min-width: 1240px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.card:has(.card__link:focus-visible) { border-color: var(--accent); }

.card__media {
  position: relative;
  aspect-ratio: 1;
  background: var(--tile);
  overflow: hidden;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 12px;
  transition: transform .35s var(--ease);
}
.card:hover .card__media img { transform: scale(1.045); }
.card__media--empty {
  display: grid; place-items: center;
  color: var(--text-faint); font-size: 28px;
  background: var(--surface-2);
}

.card__badges { position: absolute; top: 9px; left: 9px; display: flex; gap: 5px; flex-wrap: wrap; }
.badge {
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 11px; font-weight: 600;
  background: rgba(20, 20, 26, .8); color: #fff;
  /* Размытия под плашкой нет нарочно: она стоит на каждой карточке, и на
     телефоне двести backdrop-filter поверх фотографий превращали прокрутку
     каталога в грелку — каждая плашка становилась слоем, который на всяком
     кадре заново размывает то, что под ним. Чуть плотнее фон читается на
     любом фото и так. */
}
/* остаток тоже тёмной плашкой — на светлых и тёмных фото одинаково читается */
.badge--stock { display: inline-flex; align-items: center; gap: 5px; }
.badge--stock::before {
  content: ""; width: 6px; height: 6px; flex: none;
  border-radius: 50%; background: #4ade80;
}

.card__body {
  padding: 13px 14px 15px;
  display: flex; flex-direction: column; gap: 7px; flex: 1;
}
.card__meta {
  display: flex; align-items: baseline; gap: 7px;
  font-size: 11.5px; min-width: 0;
}
.card__brand { font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.card__cat {
  color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* растянутая на всю карточку кликабельная область — чтобы чипы вариантов
   могли быть отдельными кнопками, а не кнопками внутри кнопки */
.card__link {
  padding: 0; background: none; border: 0;
  font-size: 14.5px; font-weight: 600; line-height: 1.35; letter-spacing: -.005em;
  text-align: left; color: inherit; cursor: pointer;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__link::after { content: ""; position: absolute; inset: 0; }

/* выбор варианта лежит поверх растянутой .card__link — иначе клик по нему
   уходил бы в карточку целиком */
.card__picker { position: relative; z-index: 1; }
.card__picker:empty { display: none; }

.card__chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip {
  max-width: 100%;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  background: var(--surface-2); border: 1px solid transparent; border-radius: 100px;
  font-size: 11px; color: var(--text-dim);
  cursor: pointer; white-space: nowrap;
  overflow: hidden;
  transition: background .13s, color .13s, border-color .13s;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; }
.chip:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip--more { background: none; color: var(--text-faint); }

.chip__dot {
  width: 9px; height: 9px; flex: none;
  border-radius: 50%;
  /* контур держит белый и светлые цвета читаемыми на светлом фоне */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .22);
}

.card__select {
  width: 100%; height: 30px;
  padding: 0 26px 0 9px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a96' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 6px center / 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  appearance: none; cursor: pointer;
  font-size: 12px; color: var(--text-dim);
  text-overflow: ellipsis;
}
.card__select:hover { border-color: var(--accent); color: var(--accent); }

.card__foot {
  margin-top: auto; padding-top: 4px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.card__price { font-size: 16px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.card__variants { font-size: 12px; color: var(--text-faint); }

/* скелетоны */
.skeleton { pointer-events: none; }
.skeleton .card__media,
.skeleton .cat-tile__media,
.skeleton .brand-mark,
.skeleton .sk-line {
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--border) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.25s infinite linear;
  border-radius: 6px;
}
.skeleton .cat-tile__media, .skeleton .card__media { border-radius: var(--radius-sm); }
.skeleton .brand-mark { width: 60%; border-radius: 6px; }
.sk-line { height: 11px; border-radius: 5px; }
.sk-line--sm { width: 45%; }
.sk-line--lg { width: 85%; height: 14px; }
.cat .sk-line--lg { width: 70%; margin: 3px 0; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -20% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton * { animation: none; } }

.sentinel { height: 1px; }

/* ---------- пусто / ошибка ---------- */
.empty {
  padding: 80px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty__mark { font-size: 40px; margin-bottom: 4px; }
.empty__title { font-size: 18px; font-weight: 600; }
.empty__hint { color: var(--text-dim); max-width: 420px; }
.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent); color: var(--accent-ink);
  border: 0; border-radius: var(--radius-sm);
  font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.07); }
.btn--lg { padding: 13px 26px; font-size: 15px; }
.btn--ghost {
  background: var(--surface); color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}
.btn--ghost:hover { filter: none; background: var(--surface-2); }
.empty .btn { margin-top: 12px; }

/* ---------- прайс-лист ---------- */
/* Таблица должна и выглядеть по-магазинному, и копироваться в Excel чистыми
   данными, поэтому всё декоративное живёт вне текста: картинка — фоном кнопки,
   зазоры между группами цифр — пустыми спанами с шириной, ₽ и шт. — в ::after.
   В буфер обмена попадают только название и голые числа. */

/* прайс — документ, а не витрина: на широком экране колонки держит контейнер,
   иначе цена уезжает слишком далеко от названия. Сайдбара на этой странице нет,
   поэтому контейнер центрируется — иначе всё жмётся к левому краю. */
.pricelist { max-width: 980px; margin-inline: auto; }

/* Прайс-лист — обособленная страница: шапка сайта, каталог и подвал скрыты
   целиком (полупустая липкая шапка только просвечивала строками таблицы).
   Обратно в магазин ведёт ссылка над заголовком. */
body.is-price .topbar,
body.is-price .sidebar,
body.is-price .footer { display: none; }
body.is-price .shell { grid-template-columns: minmax(0, 1fr); }

.pl-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.pl-top__actions { display: flex; align-items: center; gap: 2px; }

.pl-home {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--text-dim); text-decoration: none; font-size: 14px;
}
.pl-home:hover { color: var(--accent); }
.pl-home__mark { font-size: 20px; line-height: 1; }

.pl-note {
  max-width: 68ch;
  margin: -6px 0 18px;
  font-size: 13.5px; line-height: 1.55; color: var(--text-dim);
}

.pl-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; }
.pl-btn svg { width: 17px; height: 17px; }
.pl-btn:disabled { opacity: .45; pointer-events: none; }

.pl-filters {
  margin-bottom: 18px; padding: 14px 16px 15px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.pl-filters__group + .pl-filters__group { margin-top: 14px; }
.pl-filters__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}

.pl-search { position: relative; margin-bottom: 14px; }
.pl-search svg {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--text-faint); pointer-events: none;
}
.pl-search input {
  width: 100%; height: 38px;
  padding: 0 36px 0 38px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 100px;
  transition: border-color .15s, background .15s;
}
.pl-search input::placeholder { color: var(--text-faint); }
.pl-search input:focus { outline: none; background: var(--surface); border-color: var(--accent); }
.pl-search input::-webkit-search-cancel-button { display: none; }
.pl-search__clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 50%;
  color: var(--text-faint); cursor: pointer;
}
.pl-search__clear:hover { background: var(--border); color: var(--text); }
.pl-search__clear svg { width: 14px; height: 14px; }
/* место под кнопку занято всегда: появляясь, она сдвигала бы всю панель
   и полосу чипов на пару пикселей — это и читается как «вёрстка скачет» */
.pl-filters__toggle {
  padding: 0; background: none; border: 0;
  font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--accent);
  cursor: pointer; visibility: hidden;
}
.pl-filters__toggle.is-shown { visibility: visible; }
.pl-filters__toggle:hover { text-decoration: underline; }
.pl-filters__list { display: flex; flex-wrap: wrap; gap: 7px; }

/* Чипы, а не чекбоксы: тридцать пустых квадратиков — визуальный шум, который
   ничего не сообщает. Сам чекбокс остаётся в разметке ради клавиатуры
   и скринридеров, но не рисуется: состояние показывают заливка и галочка. */
.pl-cat {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  background: var(--surface-2);
  border: 1px solid transparent; border-radius: 100px;
  font-size: 13px; color: var(--text-dim);
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: background .13s, color .13s, border-color .13s;
}
.pl-cat input {
  position: absolute; width: 1px; height: 1px; margin: 0;
  opacity: 0; pointer-events: none;
}
.pl-cat:hover { background: var(--border); color: var(--text); }
.pl-cat:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Выбор меняет только цвета: жирность и галочка меняли бы ширину чипа,
   и вся полоса перекладывалась бы на каждый клик. */
.pl-cat.is-on {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent);
}
.pl-cat.is-on:hover { background: var(--accent-soft); color: var(--accent); }
/* фильтр, который дал бы ноль строк: гасим, но оставляем на месте —
   так видно, что марка есть, просто не в этой категории */
.pl-cat.is-dead { opacity: .4; cursor: default; }
.pl-cat.is-dead:hover { background: var(--surface-2); color: var(--text-dim); }
.pl-cat:hover { border-color: var(--border-strong); }
.pl-cat.is-on { background: var(--accent-soft); color: var(--text); }
/* ширина под три цифры: без неё «210» и «85» дают разную ширину чипа,
   и соседи по строке разъезжаются при каждом клике */
.pl-cat__count {
  min-width: 3ch; text-align: right;
  font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums;
}
.pl-cat.is-on .pl-cat__count { color: inherit; opacity: .72; }
.pl-cat.skeleton { min-width: 110px; }
.pl-cat.skeleton .sk-line { width: 100%; }

/* «ещё N брендов» — разворачивает свёрнутый хвост списка */
.pl-more {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  background: none;
  border: 1px dashed var(--border-strong); border-radius: 100px;
  font-size: 13px; color: var(--text-dim); cursor: pointer;
  transition: color .13s, border-color .13s;
}
.pl-more:hover { color: var(--accent); border-color: var(--accent); }

.pl-card {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  /* скругляет и шапку таблицы, и подсветку строк; липкость шапки не ломает —
     clip не создаёт скролл-контейнер */
  overflow: clip;
}

.pl-table { width: 100%; border-collapse: collapse; font-size: 14px; }

.pl-table th {
  /* шапки сайта на этой странице нет — заголовок липнет к самому верху */
  position: sticky; top: 0; z-index: 2;
  padding: 11px 16px;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--border);
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-faint); text-align: left;
}

.pl-table td { padding: 8px 16px; border-top: 1px solid var(--border); line-height: 1.4; }
.pl-table tbody tr:first-child td { border-top: 0; }
.pl-table tbody tr:hover td { background: var(--bg); }

.pl-table .pl-name { padding-left: 68px; }
/* anywhere — чтобы длинное слово в названии не распирало колонку на телефоне:
   без этого таблица становится шире экрана и правый край обрезается */
td.pl-name { position: relative; height: 54px; overflow-wrap: anywhere; }

.pl-thumb {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; padding: 0;
  /* cover: фото заполняет квадрат целиком, края обрезаются */
  background: var(--tile) center / cover no-repeat;
  border: 1px solid var(--border); border-radius: 9px;
  cursor: pointer;
  user-select: none; -webkit-user-select: none;
  transition: border-color .13s, box-shadow .13s;
}
.pl-thumb:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
.pl-thumb--empty { display: grid; place-items: center; background-color: var(--surface-2); }
.pl-thumb--empty::before { content: "🏓"; font-size: 15px; opacity: .75; }

.pl-dot { display: inline-block; width: 10px; height: 10px; margin-right: 7px; vertical-align: -1px; }

.pl-table .pl-stock, .pl-table .pl-price {
  width: 1%;
  text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
td.pl-stock { color: var(--text-dim); }
td.pl-price { font-weight: 600; letter-spacing: -.01em; }
.pl-gap { display: inline-block; width: .22em; }
td.pl-stock::after {
  content: "шт."; margin-left: .35em;
  font-size: 12px; font-weight: 400; color: var(--text-faint);
}
td.pl-price::after {
  content: "₽"; margin-left: .3em;
  font-weight: 400; color: var(--text-faint);
}

.pl-row.skeleton td::after { content: none; }
.pl-row.skeleton .pl-thumb {
  border: 0;
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--border) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.25s infinite linear;
}
.pl-row .sk-line { display: inline-block; vertical-align: middle; }
.pl-row .pl-name .sk-line { width: min(340px, 60%); }
.pl-row .pl-stock .sk-line, .pl-row .pl-price .sk-line { width: 46px; }

@media (max-width: 620px) {
  /* «Скопировать» и «Скачать XLSX» — пара действий, поэтому стоят рядом
     одной строкой; счётчик — своей строкой над ними */
  .pricelist .toolbar__right { flex-wrap: wrap; gap: 10px; }
  .pricelist .toolbar__count { width: 100%; }
  .pricelist .pl-btn { flex: 1; justify-content: center; }
  .pl-table { font-size: 13px; }
  .pl-table th, .pl-table td { padding-left: 8px; padding-right: 8px; }
  .pl-table .pl-name { padding-left: 50px; }
  td.pl-name { height: 48px; }
  .pl-thumb { left: 8px; width: 34px; height: 34px; }
  td.pl-stock::after { content: none; }
  .pl-filters { padding: 12px; }
  .pl-note { margin-top: 0; }
}

/* ---------- карточка товара ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet__backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 10, 14, .5);
  backdrop-filter: blur(3px);
  animation: fade .2s var(--ease);
}
.sheet__panel {
  position: absolute; inset: 0 0 0 auto;
  width: min(1080px, 100%);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow-y: auto; overscroll-behavior: contain;
  animation: slide-in .28s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes slide-in { from { transform: translateX(28px); opacity: 0; } }
@keyframes slide-up { from { transform: translateY(26px); opacity: 0; } }

.sheet__close {
  position: sticky; top: 14px; float: right; right: 14px; z-index: 2;
  margin: 14px 14px 0 0;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.sheet__body { padding: clamp(18px, 3vw, 40px); }

.pdp { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 44px); }

/* галерея */
.gallery { position: sticky; top: 20px; align-self: start; }
.gallery__stage {
  position: relative;
  aspect-ratio: 1;
  background: var(--tile);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
/* Лента — обычный прокручиваемый контейнер со scroll-snap: свайп, колёсико и
   тачпад работают без скрипта, слайд всегда останавливается целиком. Скрипт
   (wireGallery в shop.js) двигает её только через scrollTo — стрелками,
   миниатюрами и клавишами — и никаких transform к ней не применяет: сдвиг
   transform'ом поверх собственной прокрутки контейнера уводил слайды за край
   сцены. Полоса прокрутки спрятана: положение показывают точки и счётчик. */
.gallery__track {
  display: flex; height: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
/* Лента в фокусе — её листают стрелками; рамка внутрь, чтобы не резалась
   скруглением сцены. */
.gallery__track:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.gallery__slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; }
.gallery__slide img {
  width: 100%; height: 100%;
  object-fit: contain; padding: 18px;
  cursor: zoom-in; -webkit-user-drag: none;
}
/* Фото меньше окна галереи не растягиваем: у части товаров в МойСкладе лежат
   оригиналы по 200–300 px, и на всю ширину карточки они превращались в мыло.
   Маленькое честное фото с воздухом выглядит лучше большого размытого.
   Класс вешает скрипт по фактическому naturalWidth после загрузки. */
.gallery__slide img.is-small {
  width: auto; height: auto;
  max-width: min(100%, var(--natural-w, 100%));
  max-height: 100%;
  margin: auto;
  image-rendering: auto;
}
.gallery__slide { display: flex; align-items: center; justify-content: center; }
/* Фото не доехало и после повтора: alt на витрине прозрачный, и без этого
   класса сломанный слайд выглядел бы просто белым квадратом. */
.gallery__slide img.is-broken { color: var(--text-faint); font-size: 13px; }
.gallery__dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: none; gap: 6px;
  padding: 5px 8px; border-radius: 100px;
  background: rgba(20, 20, 26, .35);
}
.gallery__dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, .55);
  transition: background .15s, transform .15s;
}
.gallery__dot.is-active { background: #fff; transform: scale(1.25); }
.gallery__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); color: #16161a;
  border: 1px solid rgba(0, 0, 0, .08); border-radius: 50%;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: opacity .15s;
}
.gallery__nav--prev { left: 10px; }
.gallery__nav--next { right: 10px; }
.gallery__nav[disabled] { opacity: .35; cursor: default; }
.gallery__counter {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  padding: 3px 10px; border-radius: 100px;
  background: rgba(20, 20, 26, .72); color: #fff;
  font-size: 11.5px; font-variant-numeric: tabular-nums;
}

.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb {
  width: 62px; height: 62px; padding: 4px;
  background: var(--tile);
  border: 2px solid var(--border); border-radius: 10px;
  cursor: pointer; overflow: hidden;
  transition: border-color .15s;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb:hover { border-color: var(--border-strong); }
.thumb.is-active { border-color: var(--accent); }

/* инфо */
.pdp__info { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pdp__tags { display: flex; gap: 8px; flex-wrap: wrap; }
.pdp__tag {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 12px 4px 4px; border-radius: 100px;
  background: var(--surface-2); color: var(--text-dim);
  font-size: 12px;
}
.pdp__tag--plain { padding: 4px 12px; }
.pdp__tag .brand-mark { width: auto; height: 20px; }
.pdp__tag .brand-mark img { max-height: 20px; max-width: 64px; }
.pdp__tag .brand-mark--mono { width: 20px; height: 20px; font-size: 9px; }

.pdp__title { font-size: clamp(22px, 3.2vw, 30px); line-height: 1.2; letter-spacing: -.025em; }
.pdp__price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pdp__price { font-size: 27px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.pdp__price-note { font-size: 13px; color: var(--text-faint); }

.section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin-bottom: 10px;
}

/* варианты — кнопками, а не селектом */
.variants { display: flex; flex-wrap: wrap; gap: 8px; }
.variant {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 13px;
  background: var(--surface); color: var(--text);
  border: 1.5px solid var(--border); border-radius: 11px;
  cursor: pointer; text-align: left;
  transition: border-color .14s, background .14s;
}
.variant:hover { border-color: var(--border-strong); }
.variant.is-active { border-color: var(--accent); background: var(--accent-soft); }
.variant__name { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.variant__meta { font-size: 11.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.variant.is-active .variant__meta { color: var(--accent); }

.desc { color: var(--text-dim); line-height: 1.65; overflow-wrap: anywhere; }
.desc > :first-child { margin-top: 0; }
.desc p, .desc ul, .desc ol { margin: 0 0 .8em; }
.desc ul, .desc ol { padding-left: 1.25em; }
.desc img { border-radius: var(--radius-sm); margin: .5em 0; }
/* в текстах Insales попадаются <a> с относительными ссылками — sanitize срезает
   href, и красить такие «ссылки» как кликабельные нельзя */
.desc a[href] { color: var(--accent); }
.desc a:not([href]) { color: inherit; text-decoration: none; }
.desc table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.desc td, .desc th { border: 1px solid var(--border); padding: 6px 9px; }
.desc--empty { color: var(--text-faint); font-style: italic; }

.meta {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px;
  padding-top: 16px; border-top: 1px solid var(--border);
  font-size: 12.5px;
}
.meta dt { color: var(--text-faint); }
.meta dd {
  margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  overflow-wrap: anywhere;
}

/* ---------- корзина ---------- */
.sheet--cart { z-index: 55; }
.cart__panel {
  width: min(520px, 100%);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.cart__head {
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 3vw, 24px);
  border-bottom: 1px solid var(--border);
}
.cart__title { font-size: 20px; letter-spacing: -.02em; }
.cart__body {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 8px clamp(16px, 3vw, 24px);
}
.cart__empty { padding: 64px 12px; text-align: center; }
.cart__empty .empty__mark { font-size: 38px; margin-bottom: 8px; }

.cart-row {
  display: grid; grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.cart-row:last-child { border-bottom: 0; }
.cart-row__media {
  width: 68px; height: 68px; padding: 6px;
  display: grid; place-items: center;
  background: var(--tile);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; overflow: hidden;
}
.cart-row__media img { width: 100%; height: 100%; object-fit: contain; }
.cart-row__info { min-width: 0; }
.cart-row__title { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.cart-row__variant { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.cart-row__price { font-size: 12.5px; color: var(--text-faint); margin-top: 4px; font-variant-numeric: tabular-nums; }

.cart-row__controls {
  grid-column: 2;
  display: flex; align-items: center; gap: 12px;
  margin-top: 10px;
}
.stepper {
  display: flex; align-items: center;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden;
}
.stepper__btn {
  width: 30px; height: 30px; padding: 0;
  background: none; border: 0;
  color: var(--text-dim); font-size: 15px; cursor: pointer;
}
.stepper__btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.stepper__btn:disabled { color: var(--border-strong); cursor: default; }
.stepper__value {
  min-width: 26px; text-align: center;
  font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.cart-row__sum {
  margin-left: auto;
  font-size: 14.5px; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.cart-row__remove {
  flex: none; width: 28px; height: 28px; padding: 0;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 8px;
  color: var(--text-faint); cursor: pointer;
}
.cart-row__remove:hover { background: var(--surface-2); color: var(--accent); }
.cart-row__remove svg { width: 15px; height: 15px; }

.cart__foot {
  flex: none;
  padding: 16px clamp(16px, 3vw, 24px) 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.cart__total {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 14px;
}
.cart__total span { color: var(--text-dim); }
.cart__total b { font-size: 23px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cart__checkout { width: 100%; }
.cart__clear {
  display: block; width: 100%; margin-top: 10px; padding: 8px;
  background: none; border: 0;
  color: var(--text-faint); font-size: 13px; cursor: pointer;
}
.cart__clear:hover { color: var(--accent); }

/* кнопка покупки в карточке товара */
.pdp__buy { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* на десктопе кнопка идёт первой, цена уже есть в шапке карточки */
.pdp__buy-btn { order: -1; }
.pdp__buy-btn:disabled { background: var(--surface-2); color: var(--text-faint); cursor: default; filter: none; }
.pdp__buy-info { display: flex; flex-direction: column; min-width: 0; }
.pdp__buy-price { display: none; }
.pdp__buy-note { font-size: 13px; color: var(--text-faint); }

/* мобильная карточка: фото во всю ширину, свайп вместо стрелок,
   крестик в углу экрана, липкая панель покупки снизу */
@media (max-width: 880px) {
  .sheet__panel { animation: slide-up .28s var(--ease); }

  .sheet__close {
    position: fixed; float: none; margin: 0;
    top: calc(10px + env(safe-area-inset-top, 0px)); right: 12px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255, 255, 255, .82);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    color: #16161a;
  }

  .sheet__body {
    padding: calc(56px + env(safe-area-inset-top, 0px)) 16px
             calc(92px + env(safe-area-inset-bottom, 0px));
  }

  .pdp { grid-template-columns: 1fr; gap: 16px; }

  /* в одну колонку липкая галерея наезжала бы на текст */
  .gallery { position: static; margin: 0 -16px; }
  .gallery__stage { border-radius: 0; border-left: 0; border-right: 0; }
  .gallery__nav { display: none; }
  .gallery__counter { display: none; }
  .gallery__dots { display: flex; }
  .thumbs { display: none; }

  .pdp__buy {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
    gap: 12px; flex-wrap: nowrap;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(16, 16, 26, .08);
  }
  .pdp__buy-btn { order: 0; flex: 1; margin-left: auto; }
  .pdp__buy-price {
    display: block;
    font-size: 19px; font-weight: 700; letter-spacing: -.02em;
    font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .pdp__buy-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) {
  .sheet__panel, .sheet__backdrop { animation: none; }
  .card { transition: none; }
}

/* ---------- оформление и кабинет ---------- */
.checkout, .account { max-width: 940px; padding: 26px 0 72px; }
.checkout__grid {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px); align-items: start;
}

.field-group {
  margin: 0 0 24px; padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.field-group legend {
  padding: 0 8px; margin-left: -8px;
  font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-faint);
}
.field { display: block; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field__label { display: block; margin-bottom: 6px; font-size: 13.5px; color: var(--text-dim); }
.field__label em { font-style: normal; color: var(--text-faint); }
.field input, .field textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.field__hint { margin-top: 6px; font-size: 12.5px; color: var(--text-faint); }

.radio-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-bottom: 16px; }
.radio-card { position: relative; cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-card__body {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 15px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  transition: border-color .14s, background .14s;
}
.radio-card__body small { color: var(--text-faint); font-size: 12.5px; }
.radio-card input:checked + .radio-card__body { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input:focus-visible + .radio-card__body { outline: 2px solid var(--accent); outline-offset: 2px; }

.address { position: relative; }
.address__suggest {
  position: absolute; left: 0; right: 0; z-index: 5;
  margin-top: -8px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.address__option {
  display: block; width: 100%; padding: 10px 12px;
  background: none; border: 0;
  text-align: left; font-size: 13.5px; cursor: pointer;
}
.address__option:hover { background: var(--accent-soft); color: var(--accent); }
.address__map { margin: 12px 0 4px; }
.address__map iframe {
  width: 100%; height: 220px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.checkout__error {
  margin-bottom: 12px; padding: 11px 14px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius-sm); font-size: 13.5px;
}
.checkout__submit { width: 100%; }
.checkout__submit:disabled { background: var(--surface-2); color: var(--text-faint); cursor: default; filter: none; }
.checkout__legal { margin-top: 12px; font-size: 12.5px; color: var(--text-faint); line-height: 1.5; }
.checkout__legal a { color: var(--text-dim); }

.checkout__summary {
  position: sticky; top: calc(var(--topbar-off) + 20px);
  padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.summary__title { font-size: 16px; margin-bottom: 14px; letter-spacing: -.015em; }
.summary__list { display: flex; flex-direction: column; gap: 10px; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.summary__row small { color: var(--text-faint); }
.summary__sum { white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary__total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.summary__total b { font-size: 20px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

.order-done { text-align: center; padding: 60px 20px; }
.order-done .empty__mark { font-size: 44px; }
.order-done__actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* кабинет */
.account__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.auth {
  max-width: 380px; margin-top: 24px; padding: 22px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.auth__tabs { display: flex; gap: 4px; margin-bottom: 18px; padding: 3px; background: var(--surface-2); border-radius: var(--radius-sm); }
.auth__tab {
  flex: 1; padding: 8px; border: 0; border-radius: 7px;
  background: none; color: var(--text-dim); font-size: 13.5px; cursor: pointer;
}
.auth__tab.is-active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-sm); }
.auth .btn { width: 100%; margin-top: 6px; }

.orders { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.order { padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.order__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.order__number { font-size: 15px; }
.order__status {
  padding: 3px 9px; border-radius: 100px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11.5px; font-weight: 600;
}
.order__date { margin-left: auto; font-size: 12.5px; color: var(--text-faint); }
.order__lines { display: flex; flex-direction: column; gap: 6px; }
.order__line { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--text-dim); }
.order__meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-top: 12px; font-size: 12.5px; color: var(--text-faint);
}
.order__contact { color: var(--text-dim); font-weight: 600; }
.order__foot {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.order__foot b { font-size: 17px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

@media (max-width: 860px) {
  .checkout__grid { grid-template-columns: 1fr; }
  .checkout__summary { position: static; order: -1; }
}

/* ---------- лайтбокс ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: 4vmin;
  background: rgba(8, 8, 12, .92);
  animation: fade .18s var(--ease);
}
.lightbox img { max-width: 100%; max-height: 92dvh; object-fit: contain; border-radius: 8px; }
.lightbox__close {
  position: absolute; top: 16px; right: 16px;
  color: #fff; background: rgba(255, 255, 255, .12);
}
.lightbox__close:hover { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- адаптив ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 34;
  background: rgba(10, 10, 14, .45);
  animation: fade .2s var(--ease);
}

@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; }
  .shopcard { grid-template-columns: 1fr; }
  .shopcard__map iframe { min-height: 220px; }
  .footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; gap: 0; padding: 0 var(--gutter); }
  .topbar__menu { display: grid; }
  .brand__text { display: none; }
  .footer__col--brand .brand__text { display: block; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 35;
    /* Высота — от верха до низа окна (inset), а не 100dvh: на iPhone 100dvh
       кончается выше зоны под плавающей панелью Safari, и там оставалась
       полоса затемнения без панели поверх — «всё серое под адресной строкой». */
    width: min(310px, 86vw); height: auto;
    /* align-self: start из базового правила для фиксированного бокса с
       top и bottom означает «по содержимому», а не «во всю высоту» —
       шторка получалась в половину экрана. Растяжку задаём явно. */
    align-self: stretch;
    /* Шторка во весь экран, и её верх уходит под «чёлку» — заголовок и
       крестик держим ниже неё; снизу то же самое ради скругления экрана. */
    padding: calc(18px + var(--safe-top)) 18px calc(18px + env(safe-area-inset-bottom, 0px));
    background: var(--surface);
    border-right: 1px solid var(--border);
    transform: translateX(-102%);
    /* Тени у шторки нет нарочно. От страницы её отделяет затемнение, а тень в
       70 px размытия на iPhone ложилась серой полосой в зону под панелью
       Safari и оставалась там после закрытия. Закрытая шторка ещё и невидима
       (visibility) — с задержкой на время выезда, чтобы за краем экрана не
       висел полноэкранный слой. Без скрипта шторку открывает :target
       (shop.css), поэтому оба состояния перечислены и здесь. */
    visibility: hidden;
    transition: transform .26s var(--ease), visibility 0s .26s;
  }
  .sidebar.is-open, .sidebar:target { visibility: visible; transition-delay: 0s; }
  .sidebar.is-open { transform: none; }
  .sidebar__close { display: grid; }
  .search { max-width: none; }
}

@media (max-width: 620px) {
  :root { --topbar-h: 58px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card__body { padding: 10px 11px 12px; }
  .card__link { font-size: 13px; }
  .card__price { font-size: 14.5px; }
  .topbar .brand { display: none; }
  .brandbar { padding: 14px; margin-bottom: 16px; }
  .toolbar__right { width: 100%; justify-content: space-between; }
  .thumb { width: 52px; height: 52px; }
  .cat-tiles { grid-template-columns: repeat(2, 1fr); }
  .rail { grid-auto-columns: 62vw; }
  .footer__inner { grid-template-columns: 1fr; }
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
}
