/* ==========================================================================
   ExtraParts — новый дизайн, шаблон extraparts_v2: компоненты (BEM), mobile-first.
   Собрано из прототипа (C:\Projects\extraparts-redesign). Отличия от прототипа:
   - блоки, совпадавшие со старым /assets/css/style.css, переименованы с префиксом ep-:
     ep-header, ep-footer, ep-logo, ep-container, ep-btn, ep-icon, ep-search, ep-breadcrumbs, ep-field, ep-check, ep-tabs, ep-variant;
   - база действует внутри .ep (см. ниже), чтобы не трогать страницы со старой вёрсткой.
   Контрольные ширины: 375 / 768 / 1024 / 1280+. Цвета — только из tokens.css.
   ========================================================================== */

/* ---------- База ----------
   Страницы в новом дизайне: у <body> класс .ep — база действует на всю страницу.
   Страницы, ещё не перенесённые в новый дизайн, грузят старый /assets/css/style.css: класс .ep там есть
   только у шапки, подвала и окон. База не трогает старое содержимое, а правила старого CSS для тегов
   (a — inline-block с transition: all, шрифт body) внутри .ep перекрыты. */
:where(.ep), :where(.ep) *, :where(.ep) *::before, :where(.ep) *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
html:has(> body.ep) { scroll-behavior: smooth; } /* на старых страницах плавная прокрутка мешает jQuery-анимациям */
/* Закреплённые слои не закрывают элемент с фокусом (WCAG 2.4.11): браузер докручивает к нему с этими отступами.
   Сверху — шапка (на карточке ещё навигация по разделам). Снизу выше всех — кнопка чата:
   отступ = её bottom + 56 px + 16 px. Классы has-* ставит JS на <html> */
html:has(.page-nav) { scroll-padding-top: calc(var(--header-h) + 72px); }
html { scroll-padding-bottom: 88px; }
@media (min-width: 768px) { html { scroll-padding-bottom: 96px; } }
@media (max-width: 1023.98px) { .has-buybar { scroll-padding-bottom: 160px; } }
@media (max-width: 767.98px) {
  .has-cookie { scroll-padding-bottom: 176px; }
  .has-cookie.has-buybar { scroll-padding-bottom: 256px; }
}

.ep {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body.ep { margin: 0; min-width: 320px; background: var(--bg); }

:where(.ep) img, :where(.ep) svg { display: block; max-width: 100%; }
:where(.ep) img { height: auto; }
:where(.ep) a { display: inline; color: inherit; text-decoration: none; transition: none; }
:where(.ep) button, :where(.ep) input, :where(.ep) select, :where(.ep) textarea { font: inherit; color: inherit; margin: 0; }
:where(.ep) button { cursor: pointer; background: none; border: 0; padding: 0; }
:where(.ep) h1, :where(.ep) h2, :where(.ep) h3, :where(.ep) h4, :where(.ep) p,
:where(.ep) figure, :where(.ep) dl, :where(.ep) dd { margin: 0; }
:where(.ep) ul[class], :where(.ep) ol[class] { list-style: none; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  html:has(> body.ep) { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute;
  left: 8px; top: -100px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-2);
}
.skip-link:focus { top: 8px; }

.ep-container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.ep-icon {
  width: 24px; height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ep-icon--sm { width: 18px; height: 18px; }

.tnum { font-variant-numeric: tabular-nums; }

/* Короткие описания: без одинокого слова в последней строке */
.hero__lead, .howto__lead, .consult__lead, .pdp-section__lead, .usp__text,
.howto-step__text, .callout__text, .empty__text, .ep-footer__about { text-wrap: pretty; }

/* ---------- Кнопки ---------- */
.ep-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--btn-radius);
  font-size: var(--fs-base);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .1s ease;
}
.ep-btn .ep-icon { width: 20px; height: 20px; }
.ep-btn:active { transform: scale(0.96); }
.ep-btn--primary { background: var(--brand); color: var(--on-brand); }
.ep-btn--primary:active { background: var(--brand-press); }
.ep-btn--secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.ep-btn--inverse { background: var(--surface-inverse); color: var(--on-inverse); }
@media (hover: hover) {
  .ep-btn--primary:hover { background: var(--brand-hover); }
  .ep-btn--secondary:hover { border-color: var(--ink); }
  .ep-btn--inverse:hover { background: var(--surface-inverse-hover); }
}
.ep-btn--sm { min-height: 40px; padding: 8px 14px; font-size: var(--fs-sm); }
.ep-btn--sm .ep-icon { width: 18px; height: 18px; }
.ep-btn.is-added { background: var(--ok-soft); color: var(--ok); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px; height: 44px;
  flex: none;
  border-radius: 12px;
  color: inherit;
  transition: background-color .15s ease;
}
@media (hover: hover) {
  .icon-btn:hover { background: var(--header-hover); }
}

/* ---------- Чипсы и метки ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--chip-line);
  border-radius: var(--r-pill);
  background: var(--chip-bg);
  color: var(--chip-ink);
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
@media (hover: hover) {
  .chip:hover { border-color: var(--chip-line-hover); color: var(--ink); }
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.tag--accent { background: var(--brand-soft); color: var(--brand-ink); }
.tag--ok { background: var(--ok-soft); color: var(--ok); }

/* ---------- Переключатель ---------- */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative;
  flex: none;
  width: 36px; height: 20px;
  border-radius: var(--r-pill);
  background: var(--control-border);
  transition: background-color .15s ease;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: transform .15s ease;
}
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- Верхняя строка ---------- */
.topbar {
  background: var(--topbar-bg);
  color: var(--topbar-ink);
  border-bottom: 1px solid var(--topbar-line);
  font-size: var(--fs-sm);
}
.topbar__inner { display: flex; align-items: center; gap: 16px; min-height: 44px; }
.topbar__meta { display: none; align-items: center; gap: 16px; }
.topbar__meta-item { display: inline-flex; align-items: center; gap: 6px; }
.topbar__meta-item .ep-icon { width: 16px; height: 16px; opacity: .75; }
.topbar__nav { display: none; gap: 22px; margin-left: auto; }
.topbar__nav a { display: inline-flex; align-items: center; min-height: 44px; }
@media (hover: hover) {
  .topbar__nav a:hover { color: var(--topbar-ink-strong); text-decoration: underline; text-underline-offset: 3px; }
}
.topbar__phone {
  margin-left: auto;
  font-weight: 600;
  color: var(--topbar-ink-strong);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (min-width: 1024px) {
  .topbar__nav { display: flex; }
  .topbar__phone { margin-left: 8px; }
}
@media (min-width: 1280px) {
  .topbar__meta { display: flex; }
}

/* Выбор города */
.city { position: relative; }
.city__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--topbar-ink-strong);
  font-weight: 600;
}
.city__toggle .ep-icon { width: 18px; height: 18px; }
.city__toggle .ep-icon--chev { width: 16px; height: 16px; transition: transform .15s ease; }
.city__toggle[aria-expanded="true"] .ep-icon--chev { transform: rotate(180deg); }
.city__menu {
  position: absolute;
  z-index: 80;
  top: calc(100% + 2px);
  left: -12px;
  width: min(320px, calc(100vw - 24px));
  padding: 6px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--sh-3);
}
.city__menu-title { padding: 8px 12px 6px; font-size: var(--fs-xs); color: var(--muted); }
.city__option {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  color: var(--ink);
}
@media (hover: hover) {
  .city__option:hover { background: var(--surface-3); }
}
.city__option:is([aria-pressed="true"], [aria-current="true"]) { background: var(--brand-soft); }
.city__option-name { display: flex; align-items: center; justify-content: space-between; font-weight: 600; }
.city__option-name .ep-icon { width: 18px; height: 18px; color: var(--brand-ink); visibility: hidden; }
.city__option:is([aria-pressed="true"], [aria-current="true"]) .city__option-name .ep-icon { visibility: visible; }
.city__option-meta { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- Шапка ---------- */
.ep-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  color: var(--header-ink);
  border-bottom: 1px solid var(--header-line);
}
.ep-header__inner { display: flex; align-items: center; gap: 6px; min-height: var(--header-h); }
.ep-header__burger { margin-left: -10px; }
.ep-logo { display: inline-flex; flex: none; border-radius: 6px; }
.ep-logo img { width: auto; height: clamp(24px, 7.5vw, 30px); }
.ep-header__search { display: none; }
.ep-header__actions { display: flex; align-items: center; gap: 2px; margin-left: auto; margin-right: -8px; }
.header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 12px;
  font-size: .9375rem;
  font-weight: 500;
  color: inherit;
  white-space: nowrap;
  transition: background-color .15s ease;
}
@media (hover: hover) {
  .header-action:hover { background: var(--header-hover); }
}
.header-action--login, .header-action__label { display: none; }
.header-action__label { font-variant-numeric: tabular-nums; }
.header-action__icon { position: relative; display: inline-grid; }
.badge {
  position: absolute;
  top: -7px; right: -9px;
  display: grid;
  place-items: center;
  min-width: 19px; height: 19px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: var(--on-brand);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--header-bg);
}
.catalog-btn { display: none; }
.catalog-btn__close { display: none; }
.catalog-btn[aria-expanded="true"] .catalog-btn__open { display: none; }
.catalog-btn[aria-expanded="true"] .catalog-btn__close { display: block; }

@media (min-width: 1024px) {
  .ep-header__inner { gap: 20px; }
  .ep-header__burger, .ep-header__search-btn { display: none; }
  .ep-header__actions { margin-right: -10px; }
  .ep-logo img { height: 40px; }
  .catalog-btn { display: inline-flex; }
  .ep-header__search {
    display: block;
    flex: 1;
    min-width: 0;
    transition: opacity .2s ease, visibility .2s ease, transform .2s ease;
  }
  .header-action--login { display: inline-flex; }
  .header-action__label { display: inline; }
}

/* Главная: поиск в шапке появляется, когда большой поиск ушёл за экран */
.page-home .ep-header:not(.is-search-docked) .ep-header__search {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
}

/* ---------- Поиск ---------- */
.ep-search { position: relative; }
.ep-search__field { position: relative; }
.ep-search__box {
  display: flex;
  align-items: center;
  background: var(--field-bg);
  border: 1.5px solid var(--field-line);
  border-radius: var(--field-radius);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.ep-search__box:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--focus-ring-soft);
  background: var(--surface);
}
.ep-search__icon { width: 22px; height: 22px; margin-left: 14px; color: var(--muted); }
.ep-search__input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--field-ink);
  font-size: var(--fs-base);
}
.ep-search__input:focus-visible { outline: none; }
.ep-search__input::placeholder { color: var(--field-placeholder); opacity: 1; }
.ep-search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
/* Радиус кнопки = радиус поля − рамка 1.5px − отступ 3px (концентрично) */
.ep-search__submit { margin: 3px; min-height: 40px; padding-inline: 18px; border-radius: calc(var(--field-radius) - 4.5px); }
.ep-header__search .ep-search__input { padding-left: 16px; }
.ep-search__submit--icon { width: 40px; height: 40px; min-height: 0; padding: 0; color: var(--ink-2); }

.ep-search--hero .ep-search__box { border-radius: calc(var(--field-radius) + 2px); }
.ep-search--hero .ep-search__input { height: 52px; padding-left: 16px; font-size: 1.0625rem; }
.ep-search--hero .ep-search__icon { display: none; }
.ep-search--hero .ep-search__submit { width: 48px; min-height: 46px; padding: 0; border-radius: calc(var(--field-radius) - 2.5px); }
.ep-search--hero .ep-search__submit-label { display: none; }
@media (min-width: 640px) {
  .ep-search--hero .ep-search__icon { display: block; }
  .ep-search--hero .ep-search__input { height: 60px; padding-left: 12px; font-size: var(--fs-md); }
  .ep-search--hero .ep-search__submit { width: auto; min-height: 52px; padding-inline: 28px; }
  .ep-search--hero .ep-search__submit .ep-icon { display: none; }
  .ep-search--hero .ep-search__submit-label { display: inline; }
}

/* Подсказки */
.ep-search__panel {
  position: absolute;
  z-index: 30; /* ниже шапки (50) и затемнения (40): подсказки не перекрывают меню */
  top: calc(100% + 8px);
  left: 0; right: 0;
  max-height: min(70vh, 560px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--sh-3);
  text-align: left;
}
.suggest__title {
  padding: 10px 10px 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.suggest__chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 8px 10px; }
.suggest__chips .chip { min-height: 36px; }
.suggest__count { color: var(--muted); font-variant-numeric: tabular-nums; }
.suggest__item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  color: var(--ink);
}
.suggest__item.is-active { background: var(--surface-3); }
.suggest__thumb {
  width: 56px; height: 42px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface-media);
  border: 1px solid var(--line);
}
.suggest__name { display: block; font-size: var(--fs-sm); font-weight: 500; line-height: 1.3; }
.suggest__meta { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.suggest__price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.suggest__item mark { padding: 0 1px; border-radius: 3px; background: var(--brand-soft); color: inherit; }
.suggest__all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  margin-top: 6px;
  padding: 10px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  color: var(--link);
}
.suggest__all.is-active { background: var(--surface-3); border-radius: 0 0 10px 10px; }
@media (hover: hover) {
  .suggest__item:hover { background: var(--surface-3); }
  .suggest__all:hover { background: var(--surface-3); border-radius: 0 0 10px 10px; }
}
.suggest__empty { padding: 12px 10px; font-size: var(--fs-sm); color: var(--ink-2); }
.suggest__help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 4px 10px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--link);
}

/* ---------- Мега-меню каталога ---------- */
.mega {
  position: absolute;
  z-index: 45;
  top: 100%;
  left: 0; right: 0;
  max-height: calc(100vh - var(--header-h) - 24px);
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  border-top: 1px solid var(--line);
  box-shadow: var(--sh-menu);
}
.mega__inner { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; padding-block: 20px 28px; }
.mega__cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 12px; align-content: start; }
.mega__link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 500;
  line-height: 1.25;
}
@media (hover: hover) {
  .mega__link:hover { background: var(--surface-3); }
}
.mega__link .ep-icon { color: var(--icon-strong); }
.mega__aside { display: flex; flex-direction: column; gap: 20px; padding-left: 32px; border-left: 1px solid var(--line); }
.mega__title { margin-bottom: 10px; font-weight: 700; }
.brand-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.brand-chips .chip { min-height: 36px; padding: 6px 12px; }
.mega__promo { padding: 18px; border-radius: 16px; background: var(--brand-soft); }
.mega__promo-title { font-weight: 700; }
.mega__promo p:not(.mega__promo-title) { margin: 4px 0 14px; font-size: var(--fs-sm); color: var(--ink-2); }

.overlay { position: fixed; inset: 0; z-index: 40; background: var(--scrim); }

/* ---------- Мобильное меню ---------- */
.drawer {
  width: min(90vw, 400px);
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0 auto 0 0;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  overflow: hidden;
}
.drawer[open] { display: flex; flex-direction: column; animation: drawer-in .22s ease-out; }
.drawer::backdrop { background: var(--scrim); }
@keyframes drawer-in { from { transform: translateX(-100%); } }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 8px 10px 16px;
  border-bottom: 1px solid var(--line);
}
.drawer .ep-logo img { height: 28px; }
.drawer__body { flex: 1; overflow: auto; padding: 8px 16px 32px; }
.drawer__section { padding-top: 16px; }
.drawer__title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.drawer .mega__cats { grid-template-columns: 1fr; }
.drawer .mega__link { min-height: 44px; padding: 6px 8px; margin-inline: -8px; }
.drawer__cities { display: grid; gap: 2px; margin-inline: -12px; }
.drawer__links a { display: flex; align-items: center; min-height: 44px; font-weight: 500; }
.drawer__contacts { display: grid; gap: 4px; }
.drawer__phone { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Поиск на весь экран (телефон) ---------- */
.search-dialog {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  --field-radius: 12px;
}
.search-dialog[open] { display: block; }
.search-dialog::backdrop { background: var(--scrim); }
.ep-search--dialog { display: flex; flex-direction: column; height: 100%; }
.search-dialog__head { display: flex; align-items: center; gap: 4px; padding: 10px 12px 10px 4px; border-bottom: 1px solid var(--line); }
.search-dialog__head .ep-search__field { flex: 1; }
.search-dialog .ep-search__submit { width: 44px; min-height: 40px; padding: 0; }
.search-dialog .ep-search__panel {
  position: static;
  flex: 1;
  max-height: none;
  padding: 8px 8px 24px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* ---------- Первый экран ---------- */
.hero { padding-top: 12px; }
.hero__card {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* колонка может сжиматься: без переполнения на 320px */
  gap: 28px;
  padding: 28px 20px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand-ink);
}
.hero__eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--brand);
}
.hero__title {
  margin-top: 12px;
  font-size: clamp(1.875rem, 1.3rem + 2.5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.02em;
  text-wrap: balance;
}
.hero__lead {
  max-width: 58ch;
  margin-top: 14px;
  font-size: clamp(1rem, .96rem + .25vw, 1.125rem);
  color: var(--ink-2);
}
.hero__search { margin-top: 24px; }
.hero__below {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 14px;
}
.hero__hints { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero__hints-label { font-size: var(--fs-sm); color: var(--ink-2); }
.hero__visual { display: none; }

@media (min-width: 768px) {
  .hero { padding-top: 20px; }
  .hero__card { padding: 40px; border-radius: var(--r-xl); }
}
@media (min-width: 1024px) {
  .hero__card {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    align-items: center;
    gap: 48px;
    padding: 48px 56px;
  }
  .hero__visual { display: block; }
}

/* Плитки популярных разделов с фото товаров */
.bento { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bento__tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  background: var(--surface-sunken);
  transition: background-color .2s ease;
}
.bento__tile img {
  width: 100%; height: 100%;
  padding: 8px 8px 30px;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform .3s ease;
}
@media (hover: hover) {
  .bento__tile:hover { background: var(--surface-sunken-hover); }
  .bento__tile:hover img { transform: scale(1.04); }
}
.bento__label {
  position: absolute;
  left: 10px; bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 12px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--sh-1);
}
.bento__label .ep-icon { width: 16px; height: 16px; color: var(--brand-ink); }

/* ---------- Преимущества ---------- */
.usp { padding-top: 12px; }
.usp__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.usp__item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.usp__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.usp__icon .ep-icon { width: 22px; height: 22px; }
.usp__title { font-size: .9375rem; font-weight: 700; line-height: 1.25; }
.usp__text { margin-top: 3px; font-size: var(--fs-xs); line-height: 1.4; color: var(--muted); }
@media (min-width: 768px) {
  .usp { padding-top: 16px; }
  .usp__grid { gap: 12px; }
  .usp__item { flex-direction: row; align-items: flex-start; gap: 14px; padding: 18px; }
  .usp__title { font-size: var(--fs-base); }
  .usp__text { font-size: var(--fs-sm); }
}
@media (min-width: 1024px) {
  .usp__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Секции ---------- */
.section { padding-block: var(--section-y) 0; }
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px 24px;
  margin-bottom: 20px;
}
.section__eyebrow { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.section__title {
  margin-top: 4px;
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.125rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.section__title--sm { font-size: clamp(1.375rem, 1.2rem + .6vw, 1.625rem); }
.section__note { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.section__note .ep-icon { width: 18px; height: 18px; color: var(--brand-ink); }
.section__tools { display: flex; align-items: center; gap: 16px; }
.link-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-weight: 600;
  color: var(--link);
  white-space: nowrap;
}
.link-more .ep-icon { width: 18px; height: 18px; transition: transform .15s ease; }
@media (hover: hover) {
  .link-more:hover .ep-icon { transform: translateX(3px); }
}

/* ---------- Категории ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cat-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  min-height: 64px;
  padding: 10px 12px 10px 10px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: transform .15s ease, box-shadow .15s ease;
}
@media (hover: hover) {
  .cat-tile:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
}
.cat-tile__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--icon-strong);
  transition: background-color .15s ease, color .15s ease;
}
@media (hover: hover) {
  .cat-tile:hover .cat-tile__icon { background: var(--brand-soft); color: var(--brand-ink); }
}
.cat-tile__name { font-size: var(--fs-sm); font-weight: 600; line-height: 1.25; }
.cat-tile--all { border: 1.5px dashed var(--line-strong); background: transparent; box-shadow: none; color: var(--link); }
.cat-tile--all .cat-tile__icon { background: transparent; color: var(--link); }

@media (min-width: 640px) {
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .cat-tile {
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    min-height: 136px;
    padding: 18px;
  }
  .cat-tile__icon { width: 52px; height: 52px; border-radius: 14px; }
  .cat-tile__icon .ep-icon { width: 28px; height: 28px; }
  .cat-tile__name { font-size: var(--fs-base); }
}
@media (min-width: 1200px) {
  .cat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* ---------- Бренды ---------- */
.brand-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.brand-tile {
  display: grid;
  place-items: center;
  min-height: 52px;
  padding: 8px 4px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-1);
  color: var(--ink-2);
  font-size: .9375rem;
  font-weight: 700;
  letter-spacing: .01em;
  transition: color .15s ease, box-shadow .15s ease, transform .15s ease;
}
@media (hover: hover) {
  .brand-tile:hover { color: var(--ink); box-shadow: var(--sh-2); transform: translateY(-2px); }
}
@media (min-width: 768px) {
  .brand-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
  .brand-tile { min-height: 64px; font-size: var(--fs-base); }
}

/* ---------- Карточка товара ---------- */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: box-shadow .15s ease, transform .15s ease;
}
@media (hover: hover) {
  .product-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
  .product-card:hover .product-card__link { color: var(--link); }
}
.product-card:has(.product-card__link:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.product-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  padding: 12px;
  background: var(--surface-media);
  border-bottom: 1px solid var(--line);
}
.product-card__media img { width: 100%; height: 100%; object-fit: contain; }
.product-card__tags { position: absolute; top: 10px; left: 10px; display: flex; flex-wrap: wrap; gap: 4px; }
.product-card__body { display: flex; flex: 1; flex-direction: column; gap: 14px; padding: 14px 16px 16px; }
.product-card__title {
  display: -webkit-box;
  overflow: hidden;
  font-size: .9375rem;
  font-weight: 500;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.product-card__link:focus-visible { outline: none; }
.product-card__link::after { content: ""; position: absolute; inset: 0; }
.product-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: auto; }
.product-card__price { font-size: var(--fs-lg); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.product-card__buy { position: relative; z-index: 1; flex: 1 0 auto; }

/* ---------- Карусель (CSS scroll-snap вместо Owl/Slick) ---------- */
.carousel__track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72%;
  gap: 12px;
  margin: -6px calc(-1 * var(--gutter));
  padding: 6px var(--gutter) 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__track > * { scroll-snap-align: start; }
.carousel__nav { display: none; gap: 8px; }
.carousel__btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-1);
  transition: box-shadow .15s ease, opacity .15s ease;
}
@media (hover: hover) {
  .carousel__btn:hover { box-shadow: var(--sh-2); }
}
.carousel__btn:disabled { opacity: .4; cursor: default; box-shadow: none; }
@media (min-width: 640px) {
  .carousel__track { grid-auto-columns: calc((100% - 2 * 16px) / 3); gap: 16px; }
}
@media (min-width: 1024px) {
  .carousel__track {
    grid-auto-columns: calc((100% - 3 * 16px) / 4);
    margin: -6px -6px;
    padding: 6px 6px 10px;
    scroll-padding-inline: 6px;
  }
  .carousel__nav { display: flex; }
}

/* ---------- Как подобрать деталь ---------- */
.howto {
  display: grid;
  gap: 24px;
  padding: 24px 20px;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.howto__lead { max-width: 44ch; margin-top: 10px; color: var(--ink-2); }
.howto__intro .ep-btn { margin-top: 20px; }
.howto__steps { display: grid; gap: 12px; }
.howto-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 18px 18px 64px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}
.howto-step__num {
  position: absolute;
  left: 18px; top: 18px;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}
.howto-step__title { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.howto-step__text { font-size: var(--fs-sm); color: var(--ink-2); }
.howto-step__link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  min-height: 40px;
  margin-top: auto;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--link);
}
.howto-step__link .ep-icon { width: 16px; height: 16px; }
@media (min-width: 1024px) {
  .howto { grid-template-columns: minmax(0, .8fr) minmax(0, 2fr); align-items: center; gap: 40px; padding: 40px; }
  .howto__steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .howto-step { height: 100%; padding: 68px 20px 12px; }
  .howto-step__num { left: 20px; top: 20px; }
}

/* ---------- Пункты самовывоза ---------- */
.pickup-grid { display: grid; gap: 12px; }
.pickup-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 20px;
  border: 2px solid transparent;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: border-color .2s ease;
}
.pickup-card.is-current { border-color: var(--brand); }
.pickup-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 28px; }
.pickup-card__city { font-size: var(--fs-lg); font-weight: 700; }
.pickup-card__mine { display: none; }
.pickup-card.is-current .pickup-card__mine { display: inline-flex; }
.pickup-card__addr { color: var(--ink-2); }
.pickup-card__meta { display: grid; gap: 8px; font-size: var(--fs-sm); }
.pickup-card__meta div { display: flex; align-items: flex-start; gap: 8px; }
.pickup-card__meta .ep-icon { width: 18px; height: 18px; margin-top: 1px; color: var(--muted); }
.pickup-card__meta a { font-weight: 600; font-variant-numeric: tabular-nums; }
.pickup-card .link-more { margin-top: auto; }
@media (min-width: 768px) {
  .pickup-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

/* ---------- Новости и статьи ---------- */
.blog { display: grid; gap: 32px; }
.news-list { display: grid; gap: 8px; }
.news-item {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: box-shadow .15s ease;
}
@media (hover: hover) {
  .news-item:hover { box-shadow: var(--sh-2); }
}
.news-item__title { font-weight: 600; line-height: 1.35; }
.article-grid { display: grid; gap: 12px; }
.article-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 20px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: box-shadow .15s ease, transform .15s ease;
}
@media (hover: hover) {
  .article-card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
}
.article-card__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.article-card__icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--icon-strong);
}
.article-card__title { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.article-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--link);
}
.article-card__more .ep-icon { width: 16px; height: 16px; }
@media (min-width: 640px) {
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .blog { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; }
}

/* ---------- О магазине (SEO-текст) ---------- */
.about { max-width: 900px; }
.about__text { position: relative; display: grid; gap: 12px; max-width: 38rem; margin-top: 16px; color: var(--ink-2); }
.about__text.is-collapsed { max-height: 6.2em; overflow: hidden; }
.about__text.is-collapsed::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3em;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.about__text a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.about__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-top: 4px;
  font-weight: 600;
  color: var(--link);
}
.about__toggle .ep-icon { width: 18px; height: 18px; transition: transform .15s ease; }
.about__toggle[aria-expanded="true"] .ep-icon { transform: rotate(180deg); }

/* ---------- Консультация и формы ---------- */
.consult {
  display: grid;
  gap: 28px;
  padding: 28px 20px;
  border-radius: var(--r-xl);
  background: var(--brand-soft);
}
.consult__lead { max-width: 46ch; margin-top: 10px; color: var(--ink-2); }
.consult__contacts { display: grid; gap: 4px; margin-top: 20px; }
.consult__contacts a { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; }
@media (hover: hover) {
  .consult__contacts a:hover { color: var(--link); }
}
.consult__contacts .ep-icon { color: var(--brand-ink); }
@media (min-width: 1024px) {
  .consult { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; gap: 48px; padding: 48px; }
}

.form { display: grid; gap: 14px; padding: 20px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.form__row { display: grid; gap: 14px; }
.ep-field { display: grid; gap: 6px; }
.ep-field__label { font-size: var(--fs-sm); font-weight: 600; }
.ep-field__req { color: var(--ink-2); }
.form__hint { font-size: var(--fs-xs); color: var(--muted); }
.ep-field__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1.5px solid var(--field-line);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
@media (hover: hover) {
  .ep-field__input:hover { border-color: var(--muted); }
}
.ep-field__input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px var(--focus-ring-soft); background: var(--surface); }
.ep-field__input::placeholder { color: var(--field-placeholder); opacity: 1; }
.ep-field__input[aria-invalid="true"] { border-color: var(--danger); }
textarea.ep-field__input { min-height: 112px; resize: vertical; }
.ep-field__error { font-size: var(--fs-xs); color: var(--danger); }
.ep-check { display: flex; align-items: flex-start; gap: 10px; font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; }
.ep-check input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--brand-press); }
.ep-check a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
@media (min-width: 768px) {
  .form { padding: 28px; }
  .form__row { grid-template-columns: 1fr 1fr; }
}

/* ---------- Подвал ---------- */
.ep-footer {
  margin-top: var(--section-y);
  background: var(--surface-inverse);
  color: var(--on-inverse-muted);
  font-size: var(--fs-sm);
}
@media (hover: hover) {
  .ep-footer a:hover { color: var(--on-inverse); }
  .ep-footer__social a:hover { border-color: var(--on-inverse-muted); }
}
.ep-footer__top { display: grid; gap: 32px; padding-block: 40px; }
.ep-footer .ep-logo img { height: 28px; filter: brightness(0) invert(1); }
.ep-footer__about { max-width: 34ch; margin-top: 14px; }
.ep-footer__social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ep-footer__social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--inverse-line);
  border-radius: 10px;
  color: var(--on-inverse);
  font-weight: 600;
}
.ep-footer__social .ep-icon { width: 18px; height: 18px; }
.ep-footer__title { margin-bottom: 10px; color: var(--on-inverse); font-size: var(--fs-base); font-weight: 700; }
.ep-footer__links a { display: inline-flex; align-items: center; min-height: 34px; }
.ep-footer__phones { display: grid; gap: 12px; }
.ep-footer__phone-city { display: block; font-size: 12px; }
.ep-footer__phone { color: var(--on-inverse); font-size: var(--fs-base); font-weight: 700; font-variant-numeric: tabular-nums; }
.ep-footer__mail { display: inline-flex; min-height: 34px; align-items: center; color: var(--on-inverse); font-weight: 600; }
.ep-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 20px 28px;
  border-top: 1px solid var(--inverse-line);
  font-size: 12px;
}
.ep-footer__bottom a { text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 767.98px) {
  .ep-footer__bottom { padding-bottom: 88px; } /* место под кнопку чата */
}
@media (max-width: 1023.98px) {
  .has-cookie .ep-footer__bottom { padding-bottom: 176px; } /* и под плашку cookie со стопкой панелей над ней */
}
@media (min-width: 768px) {
  .ep-footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ep-footer__bottom { padding-right: 80px; } /* место под кнопку чата */
}
@media (min-width: 1024px) {
  .ep-footer__top { grid-template-columns: 1.3fr repeat(2, minmax(0, 1fr)) 1.1fr; gap: 32px; padding-block: 56px 48px; }
}

/* ---------- Cookie, чат, тост ---------- */
.cookie {
  position: fixed;
  z-index: 150;
  left: 12px; right: 12px; bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--sh-3);
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.cookie a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.cookie .ep-btn { flex: none; }
@media (min-width: 768px) {
  .cookie { left: 24px; right: auto; bottom: 24px; max-width: 460px; }
}

.chat-fab {
  position: fixed;
  z-index: 140;
  right: 16px; bottom: 16px;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--surface-inverse);
  color: var(--on-inverse);
  box-shadow: var(--sh-3);
  transition: transform .15s ease, bottom .2s ease;
}
@media (hover: hover) {
  .chat-fab:hover { transform: scale(1.05); }
}
@media (max-width: 767.98px) {
  .has-cookie .chat-fab { bottom: 104px; }
}
@media (min-width: 768px) {
  .chat-fab { right: 24px; bottom: 24px; }
}

.toast {
  position: fixed;
  z-index: 300;
  left: 50%; bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  padding: 12px 16px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  border-radius: 12px;
  background: var(--surface-inverse);
  color: var(--on-inverse);
  font-size: var(--fs-sm);
  box-shadow: var(--sh-3);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.toast.is-persistent { pointer-events: auto; }
.toast__close {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 32px; height: 32px;
  margin: -6px -8px -6px 0;
  border-radius: 8px;
  color: inherit;
}
@media (hover: hover) {
  .toast__close:hover { background: var(--inverse-hover); }
}

/* ==========================================================================
   Страница товара
   ========================================================================== */
.ep-breadcrumbs { padding-top: 12px; font-size: var(--fs-sm); color: var(--muted); }
.ep-breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin: 0; padding: 0; list-style: none; }
.ep-breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.ep-breadcrumbs li + li::before { content: "/"; color: var(--line-strong); }
.ep-breadcrumbs a { display: inline-flex; align-items: center; min-height: 36px; color: var(--ink-2); }
@media (hover: hover) {
  .ep-breadcrumbs a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
}

.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "head" "gallery" "info" "buy"; /* порядок = порядку в DOM, фокус идёт сверху вниз */
  gap: 16px;
  padding-top: 4px;
}
.pdp__head { grid-area: head; }
.pdp__gallery { grid-area: gallery; }
.pdp__info { grid-area: info; }
.pdp__buy { grid-area: buy; }
@media (min-width: 768px) {
  .pdp {
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas: "head head" "gallery buy" "info buy";
    align-items: start;
    gap: 20px 24px;
  }
}
@media (min-width: 1280px) {
  .pdp {
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) 340px;
    grid-template-areas: "head head head" "gallery info buy";
    gap: 20px 32px;
  }
}

.pdp__title {
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.pdp__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 10px;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.pdp__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sku { display: inline-flex; align-items: center; gap: 6px; }
.sku__code { font-family: var(--font-mono); font-weight: 600; color: var(--ink); }
.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  color: var(--muted);
  transition: background-color .15s ease, color .15s ease;
}
@media (hover: hover) {
  .copy-btn:hover { background: var(--surface-3); color: var(--ink); }
}
.copy-btn .ep-icon { width: 18px; height: 18px; }
.pdp__reviews-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: 500; color: var(--link); }
.pdp__reviews-link .ep-icon { width: 18px; height: 18px; color: var(--muted); }

/* Галерея */
.gallery__main {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 16px;
  border-radius: 20px;
  background: var(--surface-media);
  box-shadow: var(--sh-1);
  cursor: zoom-in;
}
.gallery__main img { width: 100%; height: 100%; object-fit: contain; }
.gallery__zoom {
  position: absolute;
  right: 12px; bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  background: var(--scrim-strong);
  color: var(--on-inverse);
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}
.gallery__zoom .ep-icon { width: 16px; height: 16px; }

/* Информация: варианты, характеристики, совместимость */
.pdp-info {
  display: grid;
  padding: 4px 20px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.pdp-info__block { padding-block: 18px; }
.pdp-info__block + .pdp-info__block { border-top: 1px solid var(--line); }
.pdp-info__title { margin-bottom: 12px; font-size: var(--fs-base); font-weight: 700; }
.pdp-info__sub { margin: 12px 0 8px; font-size: var(--fs-xs); color: var(--muted); }
.pdp-info .link-more { min-height: 40px; margin-top: 4px; font-size: var(--fs-sm); }

.variants { display: grid; gap: 8px; }
.ep-variant {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: border-color .15s ease, background-color .15s ease;
}
@media (hover: hover) {
  .ep-variant:hover { border-color: var(--ink); }
}
.ep-variant[aria-current="page"] { border-color: var(--brand); background: var(--brand-soft); }
.ep-variant__price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

.spec-list div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: var(--fs-sm);
}
.spec-list div:last-child { border-bottom: 0; }
.spec-list dt { color: var(--muted); }
.spec-list dd { font-weight: 600; text-align: right; }

.fits-model { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.fits-model .ep-icon { color: var(--icon-strong); }
.pn-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font: 500 13px/1 var(--font-mono);
  transition: border-color .15s ease, background-color .15s ease;
}
@media (hover: hover) {
  .pn:hover { border-color: var(--ink); background: var(--surface); }
}
.pn .ep-icon { width: 16px; height: 16px; color: var(--muted); }
.pn.is-match { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }

/* Блок покупки */
.buybox {
  padding: 20px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--sh-2);
}
@media (min-width: 768px) {
  .buybox { position: sticky; top: calc(var(--header-h) + 16px); }
}
.buybox__price { font-size: 2rem; font-weight: 800; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.buybox__stock { margin-top: 18px; }
.buybox__label { margin-bottom: 4px; font-size: var(--fs-sm); font-weight: 600; }
.stock-list { display: grid; gap: 2px; }
.stock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-inline: -10px;
  padding: 7px 10px;
  border-radius: 10px;
  font-size: var(--fs-sm);
}
.stock-row.is-current { background: var(--surface-2); font-weight: 600; }
.stock-row__mine { display: none; margin-left: 6px; font-size: 12px; font-weight: 500; color: var(--muted); }
.stock-row.is-current .stock-row__mine { display: inline; }
.stock { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.stock--ok { color: var(--ok); }
.stock--low { color: var(--warn); }
.stock--none { color: var(--muted); }
.stock__bars { display: inline-flex; align-items: flex-end; gap: 2px; }
.stock__bars i { width: 4px; border-radius: 1px; background: currentColor; opacity: .22; }
.stock__bars i:nth-child(1) { height: 6px; }
.stock__bars i:nth-child(2) { height: 9px; }
.stock__bars i:nth-child(3) { height: 12px; }
.stock--ok .stock__bars i, .stock--low .stock__bars i:first-child { opacity: 1; }
.buybox__fresh { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.buybox__fresh .ep-icon { width: 16px; height: 16px; color: var(--ok); }
.buybox__actions { display: grid; gap: 10px; margin-top: 18px; }
.buybox__row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.buybox__row .ep-btn { min-width: 0; padding-inline: 12px; } /* помещается рядом со счётчиком даже на 320px */

.qty {
  display: inline-flex;
  align-items: center;
  height: 48px;
  border: 1.5px solid var(--field-line);
  border-radius: var(--btn-radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.qty:focus-within { border-color: var(--focus); box-shadow: 0 0 0 4px var(--focus-ring-soft); }
.qty button { display: grid; place-items: center; width: 36px; height: 100%; color: var(--ink-2); }
@media (hover: hover) {
  .qty button:hover { color: var(--ink); }
}
.qty button:disabled { color: var(--line-strong); cursor: default; }
.qty button .ep-icon { width: 18px; height: 18px; }
.qty input {
  width: 32px;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.qty input:focus-visible { outline: none; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.service-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
}
.service-list li { display: flex; align-items: flex-start; gap: 10px; }
.service-list .ep-icon { width: 20px; height: 20px; margin-top: 1px; color: var(--brand-ink); }
.service-list b { display: block; font-weight: 600; color: var(--ink); }
.service-list span { color: var(--muted); }

/* Навигация по разделам */
.page-nav {
  position: sticky;
  top: calc(var(--header-h) + 1px);
  z-index: 20;
  margin-top: 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.page-nav__list { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.page-nav__list::-webkit-scrollbar { display: none; }
.page-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 14px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
@media (hover: hover) {
  .page-nav a:hover { color: var(--ink); }
}
.page-nav a.is-active { color: var(--ink); }
.page-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--brand);
}

/* Разделы и боковая панель покупки */
.pdp-layout { display: grid; gap: 16px; padding-top: 20px; }
.pdp-sections { display: grid; gap: 16px; }
.pdp-section {
  padding: 24px 20px;
  border-radius: var(--card-radius);
  background: var(--surface);
  box-shadow: var(--sh-1);
}
.pdp-section__title { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); font-weight: 700; line-height: 1.2; }
.pdp-section__lead { max-width: 38rem; margin-top: 6px; color: var(--ink-2); }
.mini-buy { display: none; }
@media (min-width: 768px) {
  .pdp-section { padding: 32px; }
}
@media (min-width: 1024px) {
  .pdp-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; gap: 24px; }
  .mini-buy {
    position: sticky;
    top: calc(var(--header-h) + 72px);
    display: grid;
    gap: 12px;
    padding: 16px;
    border-radius: var(--card-radius);
    background: var(--surface);
    box-shadow: var(--sh-2);
  }
}
.mini-buy__top { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 12px; }
.mini-buy__top img { width: 64px; height: 48px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-media); }
.mini-buy__name { font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; }
.mini-buy__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.mini-buy__price { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-buy .stock, .buybar .stock { font-size: 13px; }

/* Совместимость */
.compat-check {
  display: grid;
  gap: 10px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.compat-check__label { font-weight: 600; }
.compat-check__row { display: flex; gap: 8px; }
.compat-check__row .ep-field__input { flex: 1; min-width: 0; background: var(--surface); }
.compat-result {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: var(--fs-sm);
}
.compat-result .ep-icon { width: 20px; height: 20px; margin-top: 1px; }
.compat-result--ok { background: var(--ok-soft); color: var(--ok); }
.compat-result--warn { background: var(--warn-soft); color: var(--warn); }
.compat-result a, .compat-result button { color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.compat-grid { display: grid; gap: 20px; margin-top: 24px; }
.compat-list__title { margin-bottom: 10px; font-size: var(--fs-sm); font-weight: 700; }
.model-list { display: grid; gap: 6px; }
.model-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--surface-2);
  font-weight: 600;
}
.model-list .ep-icon { color: var(--icon-strong); }
.model-list li.is-match { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.model-list li.is-match .ep-icon { color: var(--ok); }
.compat-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
  padding: 16px;
  border-radius: 14px;
  background: var(--brand-soft);
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.compat-note > .ep-icon { color: var(--brand-ink); }
.compat-note__body { display: grid; justify-items: start; gap: 12px; }
.compat-note__body p { max-width: 38em; } /* em: шрифт здесь мельче, строка тоже ~70 знаков */
@media (min-width: 768px) {
  .compat-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

/* Описание, характеристики, условия */
.callout {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--brand-soft);
}
.callout__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--brand-ink);
}
.callout__title { font-weight: 700; }
.callout__text { font-size: var(--fs-sm); color: var(--ink-2); }
.prose { display: grid; gap: 12px; max-width: 38rem; margin-top: 16px; color: var(--ink-2); } /* ~70 знаков в строке */

.spec-table { display: grid; margin-top: 12px; }
.spec-table div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.spec-table dt { color: var(--muted); }
.spec-table dd { font-weight: 600; text-align: right; }
@media (min-width: 768px) {
  .spec-table { grid-template-columns: 1fr 1fr; column-gap: 32px; }
}

.info-grid { display: grid; gap: 12px; margin-top: 16px; }
.info-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.info-card__head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.info-card__head .ep-icon { color: var(--brand-ink); }
.info-card__note { font-size: 12px; color: var(--muted); }
.info-card .link-more { min-height: 36px; margin-top: auto; font-size: var(--fs-sm); }
.bullets { display: grid; gap: 8px; font-size: var(--fs-sm); color: var(--ink-2); }
.bullets li { position: relative; padding-left: 18px; }
.bullets li::before {
  content: "";
  position: absolute;
  left: 4px; top: .6em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
.bullets b { font-weight: 600; color: var(--ink); }
@media (min-width: 768px) {
  .info-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
}

.empty {
  display: grid;
  justify-items: start;
  gap: 10px;
  margin-top: 16px;
  padding: 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: 14px;
}
/* служебное div.empty {width:1px; height:1px; overflow:hidden} из CSS ядра (pubstyles.css, его получают администраторы) сжимало блок в квадрат */
.ep .empty { width: auto; height: auto; overflow: visible; }
.empty__stars { display: flex; gap: 4px; color: var(--line-strong); }
.empty__stars .ep-icon { width: 22px; height: 22px; }
.empty__title { font-weight: 700; }
.empty__text { font-size: var(--fs-sm); color: var(--ink-2); }

/* Вкладки похожих товаров */
.ep-tabs {
  display: flex;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 4px;
  overflow-x: auto;
  border-radius: 14px;
  background: var(--surface-3);
}
.ep-tabs__btn {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  color: var(--ink-2);
  white-space: nowrap;
}
@media (hover: hover) {
  .ep-tabs__btn:hover { color: var(--ink); }
}
.ep-tabs__btn[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.ep-tabs__panel { margin-top: 20px; }
.product-card__status { font-size: 13px; font-weight: 600; color: var(--muted); }

/* Панель покупки внизу экрана (телефон и планшет) */
.buybar {
  position: fixed;
  z-index: 120;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: var(--sh-bar);
  transform: translateY(110%);
  transition: transform .2s ease;
}
.buybar.is-visible { transform: none; }
.buybar__price { font-size: var(--fs-lg); font-weight: 800; font-variant-numeric: tabular-nums; }
.buybar .ep-btn { flex: none; min-width: 150px; }
@media (min-width: 1024px) {
  .buybar { display: none; }
}
@media (max-width: 1023.98px) {
  .page-product { padding-bottom: 72px; } /* панель не закрывает конец подвала */
  .has-buybar .chat-fab { bottom: 88px; }
  .has-buybar .cookie { bottom: 84px; }
}
@media (max-width: 767.98px) {
  .has-buybar.has-cookie .chat-fab { bottom: 184px; }
}

/* Окна: увеличенное фото и консультация */
.lightbox {
  width: min(96vw, 1100px);
  max-width: none;
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--surface-media);
  overflow: hidden;
}
.lightbox::backdrop { background: var(--scrim-strong); }
.lightbox img { width: 100%; max-height: 92vh; object-fit: contain; }
.lightbox__close { position: absolute; top: 8px; right: 8px; background: var(--surface); box-shadow: var(--sh-1); }

.modal {
  width: min(92vw, 520px);
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--sh-3);
}
.modal::backdrop { background: var(--scrim); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 12px 0 24px; }
.modal__title { font-size: var(--fs-lg); font-weight: 700; }
.modal__text { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-2); }
.modal .form { padding: 16px 24px 24px; box-shadow: none; }

/* Низкий экран (телефон горизонтально, увеличение 200%): шапка и навигация
   по разделам не закрепляются, чтобы не занимать до 40% высоты */
@media (max-height: 560px) {
  html, html:has(.page-nav) { scroll-padding-top: 16px; }
  .ep-header, .page-nav { position: static; }
  .buybox, .mini-buy { top: 16px; }
}
