/* ════════════════════════════════════════════════════════════════
   QAZTOOL GROUP — design system
   Brand: navy #0F2B5C, yellow #F5C842
   Light theme is default. Dark theme via [data-theme="dark"] on <html>.
   ════════════════════════════════════════════════════════════════ */

:root,
:root[data-theme="light"] {
  --brand-navy: #0F2B5C;
  --brand-navy-2: #1B3D7A;
  --brand-navy-3: #2A55A8;
  --brand-yellow: #F5C842;
  --brand-yellow-2: #E0B12C;
  --brand-yellow-soft: #FFF4D1;

  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #EEF1F6;
  --surface-3: #E2E7EE;

  --border: #E1E5EB;
  --border-strong: #C8CFD8;

  --heading: #0F2B5C;
  --text: #2B3340;
  --text-muted: #6A7280;
  --text-dim: #98A0AB;

  --accent: var(--brand-yellow);
  --accent-strong: var(--brand-yellow-2);
  --accent-dark: var(--brand-yellow-2);    /* alias for legacy templates */
  --accent-light: #FFD75A;                  /* alias for legacy templates */
  --accent-soft: var(--brand-yellow-soft);
  --accent-glow: rgba(245, 200, 66, .35);

  --link: var(--brand-navy-2);
  --link-hover: var(--brand-navy);

  --danger: #E5484D;
  --success: #2FA84F;
  --info: #2F6FED;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(15, 43, 92, .06);
  --shadow: 0 1px 2px rgba(15, 43, 92, .06), 0 6px 22px rgba(15, 43, 92, .07);
  --shadow-lg: 0 12px 48px rgba(15, 43, 92, .14);

  --header-bg: #FFFFFF;
  --topbar-bg: var(--brand-navy);
  --topbar-text: rgba(255, 255, 255, .85);
  --topbar-text-strong: #FFFFFF;
  --topbar-hover: var(--brand-yellow);

  --catbar-bg: var(--brand-navy);
  --catbar-text: rgba(255, 255, 255, .85);
  --catbar-text-active: var(--brand-yellow);
  --catbar-hover-bg: rgba(255, 255, 255, .06);

  --footer-bg: var(--brand-navy);
  --footer-bg-2: #0A1F44;
  --footer-text: #B5BFD4;
  --footer-text-strong: #FFFFFF;
  --footer-text-dim: #6F7B96;
}

:root[data-theme="dark"] {
  --brand-navy: #4F7AD6;
  --brand-navy-2: #6A92E5;
  --brand-navy-3: #87AAF0;
  --brand-yellow: #F5C842;
  --brand-yellow-2: #FFD75A;
  --brand-yellow-soft: rgba(245, 200, 66, .12);
  --accent-dark: var(--brand-yellow-2);
  --accent-light: #FFD75A;

  --bg: #0A1226;
  --surface: #131C36;
  --surface-2: #1B2645;
  --surface-3: #243259;

  --border: #2A3760;
  --border-strong: #3A4A7A;

  --heading: #FFFFFF;
  --text: #D6DCEA;
  --text-muted: #97A1B8;
  --text-dim: #6D7794;

  --accent: var(--brand-yellow);
  --accent-strong: var(--brand-yellow-2);
  --accent-soft: var(--brand-yellow-soft);
  --accent-glow: rgba(245, 200, 66, .28);

  --link: var(--brand-navy-2);
  --link-hover: var(--brand-navy-3);

  --danger: #FF6B6F;
  --success: #4FD672;
  --info: #5A8FFF;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 22px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 48px rgba(0, 0, 0, .55);

  --header-bg: #131C36;
  --topbar-bg: #0A1226;
  --topbar-text: rgba(255, 255, 255, .75);
  --topbar-text-strong: #FFFFFF;
  --topbar-hover: var(--brand-yellow);

  --catbar-bg: #0A1226;
  --catbar-text: rgba(255, 255, 255, .8);
  --catbar-text-active: var(--brand-yellow);
  --catbar-hover-bg: rgba(255, 255, 255, .04);

  --footer-bg: #060B1A;
  --footer-bg-2: #030610;
  --footer-text: #97A1B8;
  --footer-text-strong: #FFFFFF;
  --footer-text-dim: #4D5775;
}

/* respect system preference if no choice persisted (set by inline script) */

/* ═══ RESET & BASE ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}
a { color: inherit; text-decoration: none; transition: color .15s; }
h1, h2, h3, h4 { font-weight: 800; line-height: 1.2; color: var(--heading); }
img { max-width: 100%; height: auto; display: block; }
main { flex: 1; }
main { overflow-x: clip; }

* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
  border: 3px solid var(--surface-2);
}
::-webkit-scrollbar-thumb:hover { background: var(--brand-navy-2); }

.container { max-width: 1400px; margin: 0 auto; padding: 0 32px; }

/* ═══ TOP UTILITY BAR (tssp-style) ═══ */
.topbar {
  background: var(--topbar-bg);
  color: var(--topbar-text);
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  position: relative;
  z-index: 1502;
}
.topbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.topbar a { color: var(--topbar-text); transition: color .15s; }
.topbar a:hover { color: var(--topbar-hover); }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 18px; }
.topbar-right { margin-left: auto; }
.topbar-item { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; white-space: nowrap; }
.topbar-item svg { width: 14px; height: 14px; opacity: .85; }
.topbar-divider { width: 1px; height: 16px; background: rgba(255, 255, 255, .14); }

.topbar-social { display: inline-flex; align-items: center; gap: 6px; }
.topbar-social a {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255, 255, 255, .08);
  transition: background .15s, transform .15s, color .15s;
}
.topbar-social a:hover { background: var(--brand-yellow); color: var(--brand-navy); transform: translateY(-1px); }
.topbar-social svg { width: 16px; height: 16px; color: #fff; }
.topbar-social .topbar-social__wa { background: #25D366; }
.topbar-social .topbar-social__wa:hover { background: #1ebe5b; transform: translateY(-1px) scale(1.06); }
.topbar-social .topbar-social__tg { background: #2AABEE; }
.topbar-social .topbar-social__tg:hover { background: #1d96d4; transform: translateY(-1px) scale(1.06); }
.topbar-social a:hover svg { color: #fff; }

/* theme toggle */
.theme-toggle {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .08); border: none; border-radius: 50%;
  color: var(--topbar-text-strong); cursor: pointer;
  transition: background .15s, transform .15s, color .15s;
}
.theme-toggle:hover { background: var(--brand-yellow); color: var(--brand-navy); transform: rotate(-12deg); }
.theme-toggle svg { width: 14px; height: 14px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }

/* ═══ MAIN HEADER ═══ */
.site-header {
  background: var(--header-bg);
  position: sticky; top: 0; z-index: 1503;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(15, 43, 92, .04);
  transition: background-color .25s ease;
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 22px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.brand {
  display: inline-flex; align-items: center; gap: 14px;
  text-decoration: none;
}
.brand__icon {
  height: 62px; width: auto; display: block;
}
/* swap logo by theme: светлая тема — цветной логотип, тёмная — белый */
.brand__icon--light { display: block; }
.brand__icon--dark { display: none; }
:root[data-theme="dark"] .brand__icon--light { display: none; }
:root[data-theme="dark"] .brand__icon--dark { display: block; }
.brand__text {
  display: flex; flex-direction: column; line-height: 1; gap: 3px;
}
.brand__text-main {
  font-family: 'Inter', sans-serif;
  font-size: 24px; font-weight: 800; letter-spacing: 2px;
  color: var(--heading);
}
.brand__text-sub {
  font-size: 12px; font-weight: 700; letter-spacing: 6px;
  color: var(--text-muted);
}

/* search */
.header-search { flex: 1; max-width: 640px; position: relative; }
.header-search form {
  display: flex; background: var(--surface-2);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; transition: border-color .15s, box-shadow .15s;
}
.header-search form:focus-within {
  border-color: var(--brand-navy-2);
  box-shadow: 0 0 0 3px rgba(15, 43, 92, .12);
}
.header-search input {
  flex: 1; min-width: 0; background: transparent; border: none;
  color: var(--text); padding: 16px 20px;
  font-family: 'Inter', sans-serif; font-size: 15px; outline: none;
}
.header-search input::placeholder { color: var(--text-dim); }
.header-search button {
  background: var(--brand-navy); border: none; color: #fff;
  padding: 0 26px; cursor: pointer; font-weight: 700; font-size: 14px;
  font-family: 'Inter', sans-serif; transition: background .15s;
  display: inline-flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: .5px;
}
.header-search button:hover { background: var(--brand-navy-2); }
.header-search button svg { width: 18px; height: 18px; }

/* live-search dropdown */
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  z-index: 1100; display: none;
  overflow: hidden;  /* скругляем углы верхних/нижних элементов */
}
.search-results.open { display: block; }
.sr-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.sr-item:hover { background: var(--surface-2); }
.sr-thumb {
  width: 48px; height: 48px; border-radius: 8px; background: var(--surface-2);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.sr-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sr-info { flex: 1; min-width: 0; }
.sr-name {
  font-size: 13px; color: var(--heading); font-weight: 500; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sr-art { font-size: 11px; color: var(--text-dim); font-family: monospace; margin-top: 2px; }
.sr-price { font-size: 14px; font-weight: 800; color: var(--heading); white-space: nowrap; }
.sr-item--cat { background: var(--surface-2); }
.sr-item--cat .sr-art { color: var(--accent); font-weight: 700; font-family: inherit; }
.sr-goto {
  font-size: 12px; font-weight: 800; white-space: nowrap;
  color: var(--brand-navy); text-transform: uppercase; letter-spacing: .4px;
  padding: 6px 12px; border-radius: 30px; background: var(--accent-soft);
}
:root[data-theme="dark"] .sr-goto { color: var(--brand-yellow); background: rgba(245,200,66,.12); }
.sr-item--cat:hover .sr-goto { background: var(--brand-yellow); color: var(--brand-navy); }
.sr-all { display: block; text-align: center; padding: 13px; font-size: 13px; font-weight: 700; color: var(--link); }
.sr-all:hover { background: var(--surface-2); }
.sr-empty { padding: 20px 16px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* header right actions */
.header-actions { display: flex; align-items: center; gap: 10px; }
.h-action {
  display: inline-flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 12px 16px; border-radius: var(--radius-sm); cursor: pointer;
  background: transparent; border: none; color: var(--text-muted);
  transition: color .15s, background .15s, transform .12s;
  font-family: inherit; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .3px;
  text-decoration: none;
}
.h-action:hover { color: var(--brand-navy); background: var(--surface-2); transform: translateY(-1px); }
.h-action svg { width: 28px; height: 28px; }
.h-action__sum {
  font-size: 13px; font-weight: 800;
  color: var(--brand-navy);
  letter-spacing: .2px;
  text-transform: none;
  white-space: nowrap;
}
:root[data-theme="dark"] .h-action__sum { color: var(--brand-yellow); }
.h-action--cart { min-width: 100px; }
.h-action__icon { position: relative; }
.cart-badge {
  position: absolute; top: -6px; right: -10px;
  background: var(--brand-yellow); color: var(--brand-navy);
  font-size: 10px; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px; border: 2px solid var(--header-bg);
}

/* ═══ CATEGORY BAR (with mega menu trigger) ═══ */
.cat-bar-wrap {
  background: var(--catbar-bg);
  position: relative;
  transition: background-color .25s ease;
  z-index: 1500;
}
.cat-bar {
  max-width: 1400px; margin: 0 auto; padding: 0;
}
.cat-bar-inner { display: flex; align-items: stretch; }

.cat-button {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--brand-yellow); color: var(--brand-navy);
  font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: .5px;
  padding: 0 22px; min-height: 52px;
  border: none; cursor: pointer; font-family: inherit;
  transition: background .15s;
}
.cat-button:hover, .cat-button[aria-expanded="true"] { background: var(--brand-yellow-2); color: var(--brand-navy); }
.cat-button svg { width: 18px; height: 18px; }
.cat-button__chev { transition: transform .2s; }
.cat-button[aria-expanded="true"] .cat-button__chev { transform: rotate(180deg); }

.cat-pill {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--catbar-text); font-size: 13px; font-weight: 600;
  padding: 0 18px; min-height: 52px;
  transition: all .15s; border-bottom: 3px solid transparent;
}
.cat-pill svg { width: 16px; height: 16px; color: var(--brand-yellow); }
.cat-pill:hover { color: var(--catbar-text-active); background: var(--catbar-hover-bg); }

/* ═══ MEGA MENU ═══ */
.megamenu {
  position: absolute; top: 100%; left: 0; right: 0;
  /* Сама обёртка прозрачна и не ловит мышь — видимый бокс это __inner.
     Благодаря этому наведение на боковые пустые зоны = «вне меню» → закрытие. */
  background: transparent;
  z-index: 1500;
  display: none;
  pointer-events: none;
  animation: megaIn .18s ease-out;
}
.megamenu.open { display: block; }
@keyframes megaIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.megamenu__inner {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 300px 1fr;
  /* Чёткая высота — чтобы внутренние колонки скроллились, а не вылезали */
  height: min(76vh, 620px);
  position: relative;
  /* Видимая «коробка» меню — фон, тень, скругление снизу, ловит мышь */
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 18px 36px rgba(15, 43, 92, .16);
  overflow: hidden;
  pointer-events: auto;
  /* Изолируем перерисовку меню от остальной страницы (меньше лагов) */
  contain: layout paint style;
}
.megamenu__cats {
  background: var(--surface-2);
  padding: 14px 0;
  overflow-y: auto;
  min-height: 0;  /* обязательно для скролла внутри grid-ячейки */
  border-right: 1px solid var(--border);
  contain: layout paint style;
}
.megamenu__cat {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 11px 18px 11px 22px;
  color: var(--text); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
  border-left: 3px solid transparent;
  text-decoration: none;
  word-break: break-word;
  line-height: 1.3;
  /* строки вне видимой области не рендерятся (и их фото не декодируются)
     до прокрутки — быстрее первое открытие */
  content-visibility: auto;
  contain-intrinsic-size: auto 46px;
}
.megamenu__cat-name {
  flex: 1; min-width: 0;
}
.megamenu__cat-icon {
  flex: 0 0 26px;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand-navy-2);
  transition: color .15s, transform .2s;
}
:root[data-theme="dark"] .megamenu__cat-icon { color: var(--brand-yellow); }
.megamenu__cat-icon svg { width: 22px; height: 22px; }
.megamenu__cat-icon img { width: 100%; height: 100%; object-fit: contain; }
.megamenu__cat-count {
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  flex-shrink: 0; margin-left: auto;
}
.megamenu__cat:hover .megamenu__cat-count,
.megamenu__cat.active .megamenu__cat-count { color: var(--brand-navy-2); }
:root[data-theme="dark"] .megamenu__cat:hover .megamenu__cat-count,
:root[data-theme="dark"] .megamenu__cat.active .megamenu__cat-count { color: var(--brand-yellow); }
.megamenu__cat-chev { width: 16px; height: 16px; color: var(--text-dim); flex-shrink: 0; }
.megamenu__cat:hover, .megamenu__cat.active {
  background: var(--surface);
  color: var(--brand-navy);
  border-left-color: var(--brand-yellow);
}
:root[data-theme="dark"] .megamenu__cat:hover, :root[data-theme="dark"] .megamenu__cat.active {
  color: var(--brand-yellow);
}
.megamenu__cat:hover .megamenu__cat-chev, .megamenu__cat.active .megamenu__cat-chev { color: var(--brand-yellow); }
.megamenu__cat:hover .megamenu__cat-icon, .megamenu__cat.active .megamenu__cat-icon {
  color: var(--brand-yellow); transform: scale(1.1);
}
.megamenu__empty {
  padding: 20px 22px; color: var(--text-muted); font-size: 13px; font-style: italic;
}
/* ── Правая панель (ecogr-стиль): подкатегории колонками со скроллом ── */
.megamenu__sub {
  padding: 22px 30px 26px;
  overflow-y: auto;
  min-height: 0;  /* обязательно для скролла внутри grid-ячейки */
  contain: layout paint style;
}
.megamenu__sub-panel { display: none; }
.megamenu__sub-panel.active { display: block; }
.megamenu__loading {
  display: flex; align-items: center; justify-content: center;
  min-height: 200px; color: var(--text-muted);
  font-size: 14px; font-weight: 600;
}
/* Плавное раскрытие скрытых подкатегорий по кнопке «+ ещё» */
.megamenu__group-extra {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s ease;
}
.megamenu__group-extra.is-open { grid-template-rows: 1fr; }
.megamenu__group-extra-inner { overflow: hidden; min-height: 0; }
.megamenu__group-more {
  display: block; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 13px; line-height: 1.4;
  padding: 3px 0 3px 12px; margin-top: 2px;
  color: var(--brand-navy-2); font-weight: 700;
  transition: color .12s, padding-left .12s;
}
.megamenu__group-more:hover { padding-left: 16px; }
:root[data-theme="dark"] .megamenu__group-more { color: var(--brand-yellow); }
.megamenu__sub-head {
  margin-bottom: 18px; padding-bottom: 12px;
  border-bottom: 2px solid var(--brand-yellow);
}
.megamenu__sub-all {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--brand-navy); font-size: 14px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px; text-decoration: none;
}
:root[data-theme="dark"] .megamenu__sub-all { color: var(--brand-yellow); }
.megamenu__sub-all:hover { color: var(--brand-navy-2); }
:root[data-theme="dark"] .megamenu__sub-all:hover { color: var(--brand-yellow-2); }

/* CSS-колонки: группы L2 «перетекают» в 3 колонки, как на ecogr */
.megamenu__cols {
  column-count: 3;
  column-gap: 34px;
}
@media(max-width: 1200px) { .megamenu__cols { column-count: 2; } }
.megamenu__group {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 18px;
  /* off-screen группы не считаются/не рисуются — резкое снижение лагов
     при больших разделах (сотни пунктов) */
  content-visibility: auto;
  contain-intrinsic-size: auto 220px;
}
.megamenu__group-title {
  display: block;
  font-size: 14.5px; font-weight: 800; line-height: 1.3;
  color: var(--heading); text-decoration: none;
  margin-bottom: 6px;
  transition: color .12s;
}
.megamenu__group-title:hover { color: var(--brand-navy); }
:root[data-theme="dark"] .megamenu__group-title:hover { color: var(--brand-yellow); }
.megamenu__group-links {
  display: flex; flex-direction: column;
}
.megamenu__group-link {
  display: block;
  padding: 3px 0 3px 12px;
  font-size: 13px; line-height: 1.4;
  color: var(--text-muted); text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .12s, border-color .12s, padding-left .12s;
}
.megamenu__group-link:hover {
  color: var(--brand-navy);
  border-left-color: var(--brand-yellow);
  padding-left: 16px;
}
:root[data-theme="dark"] .megamenu__group-link:hover { color: var(--brand-yellow); }
.megamenu__sub-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 60px 20px; text-align: center;
}
.megamenu__sub-placeholder p { color: var(--text-muted); font-size: 14px; max-width: 320px; }

/* Аккуратные скроллбары внутри мегаменю */
.megamenu__cats::-webkit-scrollbar, .megamenu__sub::-webkit-scrollbar { width: 8px; }
.megamenu__cats::-webkit-scrollbar-thumb, .megamenu__sub::-webkit-scrollbar-thumb {
  background: var(--border-strong); border-radius: 4px;
}
.megamenu__cats::-webkit-scrollbar-thumb:hover, .megamenu__sub::-webkit-scrollbar-thumb:hover {
  background: var(--brand-yellow);
}

.megamenu-backdrop {
  position: fixed; inset: 0; z-index: 1499;
  background: rgba(10, 18, 38, .35);
  opacity: 0;
  /* never intercept clicks — keeps trigger hoverable without flicker */
  pointer-events: none !important;
  transition: opacity .2s ease;
}
.megamenu-backdrop.open { opacity: 1; }

/* ═══ SECTIONS / TYPOGRAPHY ═══ */
.section { padding-top: 64px; padding-bottom: 64px; position: relative; }
section[id], div[id="contacts"] { scroll-margin-top: 130px; }

/* subtle bg effects (apply selectively) */
.section--dots {
  background-image: radial-gradient(circle at 1px 1px, var(--border-strong) 1px, transparent 0);
  background-size: 22px 22px;
  background-position: 0 0;
}
:root[data-theme="dark"] .section--dots {
  background-image: radial-gradient(circle at 1px 1px, rgba(245, 200, 66, .08) 1px, transparent 0);
}
.section--mesh {
  background:
    radial-gradient(900px 400px at 10% 0%, var(--accent-glow), transparent 50%),
    radial-gradient(700px 380px at 90% 100%, rgba(15, 43, 92, .08), transparent 60%),
    var(--bg);
}
:root[data-theme="dark"] .section--mesh {
  background:
    radial-gradient(900px 400px at 10% 0%, rgba(245, 200, 66, .06), transparent 50%),
    radial-gradient(700px 380px at 90% 100%, rgba(79, 122, 214, .12), transparent 60%),
    var(--bg);
}
.section--grid {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  background-position: -1px -1px;
  position: relative;
}
.section--grid::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg) 75%);
  pointer-events: none;
}
.section--grid > * { position: relative; z-index: 1; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent-soft); border-radius: 30px; padding: 7px 16px;
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--brand-navy); margin-bottom: 20px;
}
:root[data-theme="dark"] .eyebrow { color: var(--brand-yellow); }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-yellow); animation: pulseDot 2.2s ease-in-out infinite; }

.section-title {
  font-family: 'Inter', sans-serif; font-weight: 800;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -.5px; color: var(--heading);
  line-height: 1.1; margin-bottom: 10px;
}
.section-title span { color: var(--accent-strong); }
:root[data-theme="dark"] .section-title span { color: var(--brand-yellow); }
.section-sub { color: var(--text-muted); font-size: 16px; margin-bottom: 36px; max-width: 720px; }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 24px; font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 700; letter-spacing: .3px;
  border: 1.5px solid transparent; cursor: pointer; transition: all .18s;
  border-radius: var(--radius-sm); white-space: nowrap;
  will-change: transform;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--brand-navy); color: white; border-color: var(--brand-navy); }
.btn-primary:hover { background: var(--brand-navy-2); border-color: var(--brand-navy-2); color: white; transform: translateY(-1px); box-shadow: 0 10px 26px rgba(15, 43, 92, .25); }
.btn-accent { background: var(--brand-yellow); color: var(--brand-navy); border-color: var(--brand-yellow); }
.btn-accent:hover { background: var(--brand-yellow-2); border-color: var(--brand-yellow-2); color: var(--brand-navy); transform: translateY(-1px); box-shadow: 0 10px 26px var(--accent-glow); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--heading); }
.btn-outline:hover { border-color: var(--brand-navy); color: var(--brand-navy); }
.btn-ghost { background: var(--surface-2); border-color: var(--surface-2); color: var(--heading); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: white; }
.btn-danger:hover { filter: brightness(.92); color: white; }
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-lg { padding: 16px 34px; font-size: 15px; border-radius: var(--radius); }

/* ═══ MESSAGES (toasts) ═══ */
.messages {
  list-style: none; position: fixed; top: 120px; right: 20px; z-index: 3000;
  width: auto; max-width: 370px; display: flex; flex-direction: column; gap: 10px;
}
.messages li {
  padding: 13px 18px; font-size: 14px; font-weight: 500;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  animation: toastIn .35s ease;
}
.messages li.hide { animation: toastOut .4s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(28px); } }
.messages .success { background: #E9F8ED; border: 1px solid #B9E6C5; color: #1D7A38; }
.messages .error   { background: #FDEAEA; border: 1px solid #F3C0C2; color: #C0292E; }
.messages .warning { background: var(--accent-soft); border: 1px solid #F3D784; color: #8A6210; }
:root[data-theme="dark"] .messages .success { background: #143420; border-color: #2A6A40; color: #82DDA0; }
:root[data-theme="dark"] .messages .error   { background: #3A1518; border-color: #6A2E33; color: #FFA5A8; }
:root[data-theme="dark"] .messages .warning { background: rgba(245, 200, 66, .12); border-color: rgba(245, 200, 66, .35); color: #F5C842; }
@media (max-width: 560px) { .messages { left: 14px; right: 14px; max-width: none; } }

/* ═══ PRODUCT CARD ═══ */
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .18s, box-shadow .18s, transform .18s;
  display: flex; flex-direction: column; overflow: hidden;
}
.product-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.product-card__img {
  width: 100%; aspect-ratio: 1/1; overflow: hidden;
  background: #ffffff;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.product-card__img img {
  width: 100%; height: 100%; object-fit: contain; padding: 14px;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
.product-card:hover .product-card__img img { transform: scale(1.04); }
.product-card__img .no-img { color: var(--text-dim); }
.product-card__img .no-img svg { width: 54px; height: 54px; }
.product-card__body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.product-card__brand { font-size: 10px; font-weight: 800; text-transform: uppercase; color: var(--brand-navy-2); letter-spacing: 1.4px; margin-bottom: 6px; }
:root[data-theme="dark"] .product-card__brand { color: var(--brand-yellow); }
.product-card__name {
  font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 12px; flex: 1; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.product-card__price { font-size: 22px; font-weight: 800; color: var(--heading); }
.product-card__price .cur { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.product-card__footer { padding: 12px 16px 16px; display: flex; gap: 8px; }
.product-card__footer .btn { flex: 1; justify-content: center; padding: 10px; font-size: 12px; }

/* Цена со скидкой / акцией */
.product-card__price-old, .recent-card__price-old, .compare-card__price-old {
  display: inline-block;
  color: var(--text-dim);
  font-size: 13px; font-weight: 600;
  text-decoration: line-through;
  margin-right: 8px;
}
.product-card__price--sale, .recent-card__price--sale, .compare-card__price--sale {
  color: #d92e2e !important;
}
:root[data-theme="dark"] .product-card__price--sale,
:root[data-theme="dark"] .recent-card__price--sale,
:root[data-theme="dark"] .compare-card__price--sale {
  color: #ff6b6b !important;
}
.sale-badge {
  position: absolute; top: 10px; left: 10px;
  background: #d92e2e; color: #fff;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
  padding: 5px 10px; border-radius: 20px;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(217, 46, 46, .35);
}
.new-badge {
  position: absolute; top: 10px; left: 10px;
  background: #1e9d4a; color: #fff;
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
  padding: 5px 10px; border-radius: 20px;
  z-index: 2;
}
.sale-badge + .new-badge, .stock-badge + .new-badge, .sale-badge + .stock-badge { top: 42px; }

/* Точки-индикаторы для multi-image hover.
   По умолчанию скрыты — появляются только при наведении на фото-обёртку. */
.media-dots {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; justify-content: center; gap: 5px;
  pointer-events: none; z-index: 2;
  opacity: 0;
  transition: opacity .15s ease;
}
.product-card__img:hover .media-dots,
.recent-card__img:hover .media-dots,
[data-images]:hover .media-dots { opacity: 1; }
.media-dot {
  width: 6px; height: 6px; border-radius: 50%;
  transition: background .15s, transform .15s;
}
.media-dot.is-active { transform: scale(1.4); }

/* В каталоге (.product-card) — всегда тёмные точки на белом фото фоне. */
.product-card .media-dot          { background: rgba(15, 43, 92, .25); }
.product-card .media-dot.is-active{ background: var(--brand-navy); }

/* В «недавно просмотренных» (.recent-card) — адаптивно:
   светлая тема → тёмные точки светлые (контраст к белому фото)
   тёмная тема → точки тёмные/тёплые (на тёмном UI всё-таки белый фон фото). */
.recent-card .media-dot           { background: rgba(15, 43, 92, .25); }
.recent-card .media-dot.is-active { background: var(--brand-navy); }
:root[data-theme="dark"] .recent-card .media-dot           { background: rgba(255, 255, 255, .40); }
:root[data-theme="dark"] .recent-card .media-dot.is-active { background: var(--brand-yellow); }

/* Fallback на любые другие контейнеры */
:root[data-theme="dark"] .media-dot           { background: rgba(255, 255, 255, .25); }
:root[data-theme="dark"] .media-dot.is-active { background: var(--brand-yellow); }

.stock-badge {
  position: absolute; top: 10px; left: 10px;
  background: var(--brand-yellow); color: var(--brand-navy);
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
  padding: 5px 10px; border-radius: 20px;
  z-index: 2;
}
.discount-badge {
  position: absolute; top: 10px; right: 10px;
  background: #E5484D; color: #fff;
  font-size: 12px; font-weight: 800;
  padding: 5px 10px; border-radius: 6px;
  z-index: 2;
}

/* ─── PRODUCT CARD extras (article+copy, characteristics, fav, multi-img) ─── */
.product-card__fav {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all .15s;
  z-index: 3;
}
.product-card__cmp {
  position: absolute; top: 10px; right: 50px;
  width: 32px; height: 32px;
  background: rgba(255,255,255,.92);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all .15s;
  z-index: 3;
}
.product-card__cmp svg { width: 14px; height: 14px; }
.product-card__cmp:hover { color: var(--brand-navy); transform: scale(1.1); }
.product-card__cmp.is-active { background: var(--brand-yellow); color: var(--brand-navy); border-color: var(--brand-yellow); }
.product-card__fav:hover { color: #E5484D; transform: scale(1.1); }
.product-card__fav.is-active { color: #E5484D; background: #fff; border-color: #E5484D; }
.product-card__fav.is-active svg { fill: currentColor; }
.product-card__fav svg { width: 16px; height: 16px; }

.product-card__zones {
  position: absolute; inset: 0; display: flex; z-index: 1;
}
.product-card__zones span { flex: 1; }
.product-card__art {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.product-card__art-label { font-weight: 700; }
.product-card__art code {
  font-family: monospace;
  font-size: 12px;
  color: var(--text);
}
.product-card__copy {
  width: 22px; height: 22px;
  background: var(--surface-2);
  border: none; border-radius: 5px;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.product-card__copy:hover { background: var(--brand-yellow); color: var(--brand-navy); }
.product-card__copy svg { width: 12px; height: 12px; }
.product-card__copy.is-copied { background: #2FA84F; color: #fff; }

.product-card__stock {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700;
  color: #2FA84F;
  margin-bottom: 8px;
}
.product-card__stock svg { width: 12px; height: 12px; }

.product-card__chars {
  list-style: none; padding: 0; margin: 6px 0 0;
  display: flex; flex-direction: column; gap: 3px;
  font-size: 11.5px;
  border-top: 1px dashed var(--border);
  padding-top: 8px;
}
.product-card__chars li {
  display: flex; justify-content: space-between; gap: 6px;
  color: var(--text-muted);
}
/* Ключ может ужиматься с многоточием — длинные названия характеристик
   (напр. «Число оборотов холостого хода») не ломают ширину карточки. */
.product-card__chars li span {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex: 1 1 auto;
}
.product-card__chars li b {
  color: var(--text); font-weight: 600;
  text-align: right;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 0 0 auto; max-width: 60%;
}

/* ═══ QUICK ORDER MODAL ═══ */
.qo-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(10,18,38,.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
}
.qo-overlay.open { display: flex; animation: qoFade .2s ease; }
@keyframes qoFade { from { opacity: 0; } to { opacity: 1; } }
.qo-modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 460px;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  animation: qoSlide .3s cubic-bezier(.2,.7,.2,1);
}
@keyframes qoSlide { from { transform: translateY(20px); opacity:0; } to { transform: none; opacity:1; } }
.qo-modal__close {
  float: right;
  width: 32px; height: 32px;
  background: var(--surface-2); border: none; border-radius: 50%;
  font-size: 20px; line-height: 1; color: var(--text-muted);
  cursor: pointer;
}
.qo-modal__close:hover { background: var(--accent-soft); color: var(--brand-navy); }
.qo-modal h3 {
  font-size: 22px; font-weight: 800; color: var(--heading);
  margin-bottom: 8px; padding-right: 40px;
}
.qo-modal__sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.qo-modal__row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.qo-modal__row b { color: var(--heading); font-weight: 700; }
.qo-modal__qty {
  display: flex; align-items: center; gap: 8px;
  margin: 18px 0 22px;
}
.qo-modal__qty button {
  width: 36px; height: 36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 18px; font-weight: 700;
  color: var(--brand-navy);
  cursor: pointer;
}
.qo-modal__qty button:hover { background: var(--accent-soft); }
:root[data-theme="dark"] .qo-modal__qty button { color: var(--brand-yellow); }
.qo-modal__qty input {
  flex: 1;
  text-align: center;
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 16px; font-weight: 700;
  color: var(--heading);
}
.qo-modal__send {
  width: 100%;
  padding: 14px;
  background: #25D366;
  color: #fff;
  border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 800;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .15s;
  font-family: inherit;
  text-transform: uppercase; letter-spacing: .5px;
}
.qo-modal__send:hover { background: #1ebe5b; }
.qo-modal__send svg { width: 20px; height: 20px; }

/* ═══ WHATSAPP CHOOSER MODAL ═══ */
.wa-overlay {
  position: fixed; inset: 0; z-index: 2100;
  background: rgba(10,18,38,.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.wa-overlay.open { display: flex; animation: qoFade .2s ease; }
.wa-modal {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 380px;
  padding: 28px 24px 24px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: qoSlide .3s cubic-bezier(.2,.7,.2,1);
}
.wa-modal__close {
  position: absolute; top: 12px; right: 14px;
  width: 32px; height: 32px;
  background: var(--surface-2); border: none; border-radius: 50%;
  font-size: 20px; line-height: 1; color: var(--text-muted); cursor: pointer;
}
.wa-modal__close:hover { background: var(--accent-soft); color: var(--brand-navy); }
.wa-modal__head h3 { font-size: 20px; font-weight: 800; color: var(--heading); margin: 10px 0 4px; }
.wa-modal__head p { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; }
.wa-modal__list { display: flex; flex-direction: column; gap: 10px; }
.wa-modal__btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px; border-radius: var(--radius-sm);
  background: #25D366; color: #fff;
  font-size: 16px; font-weight: 800; letter-spacing: .3px;
  text-decoration: none; transition: background .15s, transform .12s;
}
.wa-modal__btn:hover { background: #1ebe5b; color: #fff; transform: translateY(-1px); }
.email-box {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 14px;
}
.email-box__addr {
  flex: 1; font-size: 16px; font-weight: 700; color: var(--heading);
  word-break: break-all; text-align: left;
}
.email-box__copy {
  flex-shrink: 0; width: 34px; height: 34px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.email-box__copy svg { width: 16px; height: 16px; }
.email-box__copy:hover { background: var(--brand-yellow); color: var(--brand-navy); border-color: var(--brand-yellow); }
.email-box__copy.is-copied { background: #2FA84F; color: #fff; border-color: #2FA84F; }

/* ═══ PRODUCT DETAIL: tabs, chars table, video, reviews ═══ */
.pd-tabs { border-top: 1px solid var(--border); padding-top: 22px; }
.pd-tabs__head {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 2px solid var(--border);
  margin-bottom: 22px;
}
.pd-tab {
  background: transparent; border: none;
  padding: 12px 18px;
  font-size: 14px; font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  transition: color .15s, border-color .15s;
}
.pd-tab:hover { color: var(--brand-navy); }
:root[data-theme="dark"] .pd-tab:hover { color: var(--brand-yellow); }
.pd-tab.active { color: var(--brand-navy); border-bottom-color: var(--brand-yellow); }
:root[data-theme="dark"] .pd-tab.active { color: var(--brand-yellow); }
.pd-tab-body { display: none; animation: fadeUp .25s ease backwards; }
.pd-tab-body.active { display: block; }

.pd-chars {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.pd-chars tr { border-bottom: 1px solid var(--border); }
.pd-chars tr:last-child { border-bottom: none; }
.pd-chars tr:nth-child(even) { background: var(--surface-2); }
.pd-chars th, .pd-chars td {
  padding: 10px 14px;
  text-align: left;
  font-size: 13.5px;
  vertical-align: top;
}
.pd-chars th {
  color: var(--text-muted); font-weight: 500;
  width: 45%;
}
.pd-chars td { color: var(--heading); font-weight: 600; }
.pd-warranty {
  margin-top: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
}
.pd-warranty summary {
  cursor: pointer; font-weight: 700;
  color: var(--brand-navy);
  list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.pd-warranty summary::-webkit-details-marker { display: none; }
/* стрелка, плавно поворачивается при открытии */
.pd-warranty summary::before {
  content: '';
  width: 0; height: 0;
  border-style: solid;
  border-width: 5px 0 5px 7px;
  border-color: transparent transparent transparent currentColor;
  transition: transform .22s ease;
}
.pd-warranty[open] summary::before { transform: rotate(90deg); }
:root[data-theme="dark"] .pd-warranty summary { color: var(--brand-yellow); }
.pd-warranty p {
  color: var(--text-muted); line-height: 1.7; margin-top: 8px;
}
/* плавное появление содержимого */
.pd-warranty[open] p { animation: pdWarrantyOpen .22s ease; }
@keyframes pdWarrantyOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.pd-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.pd-video iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none;
}

/* gallery thumbs */
.pd-thumb {
  width: 70px; height: 70px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumb:hover { border-color: var(--brand-navy-2); transform: translateY(-2px); }
.pd-thumb.active { border-color: var(--brand-yellow); }

/* Compare floating tray */
.cmp-tray {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--brand-navy);
  color: #fff;
  padding: 12px 18px;
  border-radius: 40px;
  display: none;
  align-items: center; gap: 12px;
  box-shadow: 0 14px 38px rgba(15, 43, 92, .35);
  z-index: 1800;
  font-size: 14px; font-weight: 700;
  text-decoration: none;
}
.cmp-tray.is-active { display: inline-flex; }
.cmp-tray:hover { color: #fff; transform: translateY(-2px); }
.cmp-tray svg { width: 18px; height: 18px; }
.cmp-tray__count {
  background: var(--brand-yellow);
  color: var(--brand-navy);
  border-radius: 50%;
  min-width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}

/* ═══ REVIEWS / STARS ═══ */
.stars-input {
  display: inline-flex; gap: 4px;
  direction: rtl; /* so hover from right-to-left works for highlight chain */
}
.stars-input input { display: none; }
.stars-input label {
  cursor: pointer;
  font-size: 26px;
  color: var(--border-strong);
  transition: color .15s;
}
.stars-input label:hover,
.stars-input label:hover ~ label,
.stars-input input:checked ~ label { color: #F5C842; }

.stars-display {
  display: inline-flex; gap: 2px;
  color: #F5C842;
  font-size: 14px;
  line-height: 1;
}
.stars-display .empty { color: var(--border-strong); }

.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.review-card__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.review-card__author {
  font-weight: 700; color: var(--heading);
}
.review-card__date {
  font-size: 12px; color: var(--text-muted);
}
.review-card__text {
  color: var(--text); font-size: 14px; line-height: 1.65;
  white-space: pre-line;
}
.review-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}
.review-form textarea {
  width: 100%; min-height: 96px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  outline: none; resize: vertical;
  margin: 10px 0 12px;
}
.review-form textarea:focus { border-color: var(--brand-navy); }

/* ═══ Recently viewed strip ═══ */
.recently-wrap {
  position: relative;
  /* Скрываем края ленты по бокам — там стрелки */
  padding: 0 44px;
}
.recently-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 8px 4px;
  /* Скрываем горизонтальный скроллбар */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.recently-strip::-webkit-scrollbar { display: none; }
.recently-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 6px 14px rgba(15, 43, 92, .14);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--brand-navy-2);
  transition: background .15s, color .15s, transform .15s;
  z-index: 3;
}
:root[data-theme="dark"] .recently-arrow { background: var(--surface-2); color: var(--brand-yellow); }
.recently-arrow:hover { background: var(--brand-yellow); color: var(--brand-navy); transform: translateY(-50%) scale(1.08); }
.recently-arrow svg { width: 18px; height: 18px; }
.recently-arrow--prev { left: 4px; }
.recently-arrow--next { right: 4px; }
.recently-arrow.is-hidden { opacity: 0; pointer-events: none; }
@media(max-width: 700px) {
  .recently-wrap { padding: 0; }
  .recently-arrow { display: none; }
}
.recently-strip .recent-card {
  flex: 0 0 200px;
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.recent-card:hover { border-color: var(--brand-yellow); transform: translateY(-3px); }
.recent-card__img {
  position: relative;          /* чтобы бейдж «-Акция» всегда был у своей карточки */
  aspect-ratio: 1/1;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.recent-card__img img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 8px; }
.recent-card__body { padding: 10px 12px; }
.recent-card__name {
  font-size: 12px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 4px;
}
.recent-card__price { font-size: 14px; font-weight: 800; color: var(--heading); }
.recent-card__brand {
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 4px;
}
.recently-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 4px 8px;
}
.recently-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px; letter-spacing: 1px;
  color: var(--heading); margin: 0;
}
.recently-clear {
  background: transparent; border: none; cursor: pointer;
  font-size: 12px; color: var(--text-muted); padding: 4px 8px;
  border-radius: var(--radius-sm); transition: color .15s, background .15s;
}
.recently-clear:hover { color: var(--accent); background: var(--surface-2); }
.recent-card--skeleton { padding: 8px; }
.recent-card--skeleton .skeleton-img { aspect-ratio: 1/1; }
.recent-card--skeleton .skeleton-line { height: 12px; margin-top: 8px; }
.recent-card--skeleton .skeleton-line.short { width: 55%; }
#recentlyViewed { margin: 36px 0 24px; }

/* ═══ SKELETON LOADERS ═══ */
.skeleton {
  background: linear-gradient(90deg,
    var(--surface-2) 0%,
    var(--surface-3) 50%,
    var(--surface-2) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s infinite linear;
  border-radius: var(--radius-sm);
  color: transparent !important;
  user-select: none; pointer-events: none;
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.skeleton-card .skeleton-img { aspect-ratio: 1/1; }
.skeleton-card .skeleton-line { height: 14px; }
.skeleton-card .skeleton-line.l { width: 92%; }
.skeleton-card .skeleton-line.m { width: 60%; }
.skeleton-card .skeleton-line.s { width: 40%; }

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--text-muted); margin-bottom: 8px; }
.form-control {
  width: 100%; background: var(--surface); border: 1.5px solid var(--border-strong);
  color: var(--text); padding: 12px 16px;
  font-family: 'Inter', sans-serif; font-size: 15px;
  outline: none; transition: border-color .15s, box-shadow .15s; border-radius: var(--radius-sm);
}
.form-control:hover { border-color: var(--brand-navy-2); }
.form-control:focus { border-color: var(--brand-navy); box-shadow: 0 0 0 3px rgba(15, 43, 92, .14); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control option { background: var(--surface); }
textarea.form-control { resize: none; }

/* ═══ FOOTER ═══ */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 56px 0 0;
  margin-top: auto;
  transition: background-color .25s ease;
}
.footer-grid {
  max-width: 1400px; margin: 0 auto; padding: 0 32px 38px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 44px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.footer-brand-icon { height: 56px; width: auto; margin-bottom: 14px; }
.footer-tagline { color: var(--footer-text); font-size: 14px; line-height: 1.7; margin-bottom: 18px; max-width: 320px; }
.footer-phone { font-size: 22px; font-weight: 800; color: var(--footer-text-strong); display: inline-block; }
.footer-phone:hover { color: var(--brand-yellow); }
.footer-col-title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; color: var(--footer-text-dim); margin-bottom: 18px; }
.footer-col a, .footer-col p { display: block; color: var(--footer-text); font-size: 14px; margin-bottom: 12px; transition: color .15s, transform .15s; }
.footer-col a:hover { color: var(--brand-yellow); transform: translateX(4px); }
.footer-bottom {
  background: var(--footer-bg-2);
  color: var(--footer-text-dim);
  padding: 18px 0;
  margin-top: 0;
}
.footer-bottom-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 32px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; flex-wrap: wrap; gap: 10px;
}

/* ═══ ANIMATIONS ═══ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes pulseDot { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.55); opacity: .45; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.reveal { opacity: 0; }
.reveal.in { opacity: 1; animation: fadeUp .22s cubic-bezier(.22,.7,.25,1) backwards; }

/* ═══ BURGER & DRAWER ═══ */
.burger {
  display: none; width: 42px; height: 42px; border: none; cursor: pointer;
  background: var(--surface-2); border-radius: 50%;
  align-items: center; justify-content: center; flex-direction: column; gap: 4px;
  transition: background .18s, transform .15s;
}
.burger:hover { background: var(--accent-soft); }
.burger:active { transform: scale(.92); }
.burger span {
  display: block; width: 18px; height: 2px; background: var(--heading);
  border-radius: 2px; transition: transform .28s ease, opacity .2s ease;
}
.burger.active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.drawer-overlay {
  position: fixed; inset: 0; z-index: 1590;
  background: rgba(10, 18, 38, .55);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
  opacity: 0; pointer-events: none; transition: opacity .28s ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1595;
  width: 308px; max-width: 86vw; background: var(--surface);
  box-shadow: -16px 0 50px rgba(10, 18, 38, .35);
  transform: translateX(100%);
  transition: transform .32s cubic-bezier(.3,.85,.3,1);
  display: flex; flex-direction: column; overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface); z-index: 2;
}
.drawer__logo img { height: 36px; }
.drawer__close {
  width: 36px; height: 36px; border: none; background: var(--surface-2);
  border-radius: 50%; font-size: 22px; line-height: 1; color: var(--text-muted);
  cursor: pointer; transition: background .15s, color .15s, transform .15s;
}
.drawer__close:hover { background: var(--accent-soft); color: var(--brand-navy); }
.drawer__nav { padding: 8px 0; }
.drawer__nav a {
  display: flex; align-items: center; gap: 13px; padding: 13px 22px;
  font-size: 15px; font-weight: 600; color: var(--text);
  transition: background .15s, color .15s, padding-left .15s;
}
.drawer__nav a:hover { background: var(--accent-soft); color: var(--brand-navy); padding-left: 28px; }
.drawer__nav a svg { width: 19px; height: 19px; flex-shrink: 0; }
.drawer__cart-count {
  margin-left: auto; background: var(--brand-yellow); color: var(--brand-navy);
  font-size: 11px; font-weight: 800; min-width: 20px; height: 20px;
  border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
.drawer__divider { height: 1px; background: var(--border); margin: 8px 18px; }
.drawer__foot { margin-top: auto; padding: 18px 22px 24px; border-top: 1px solid var(--border); }
.drawer__phone { font-size: 20px; font-weight: 800; color: var(--heading); display: block; margin-bottom: 12px; }

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
  .header-search { max-width: none; }
}
@media (max-width: 900px) {
  .topbar-left .hide-md { display: none; }
  .topbar-divider.hide-md { display: none; }
  .header-search { display: none; }
  .h-action.hide-md { display: none; }
  .burger { display: flex; }
  /* Лого слева — корзина и бургер прижаты к правому краю. */
  .header-actions { margin-left: auto; }
  /* Верхняя строка на мобиле минимальна: убираем график работы и адрес,
     оставляем соцсети + телефон (всё в одну строку, без переноса). */
  .topbar-left { display: none; }
  /* Десктопная панель категорий + мегаменю не для тача:
     на мобиле навигация — бургер-меню + нижнее меню. */
  .cat-bar-wrap { display: none; }
  .header-inner { padding: 12px 18px; gap: 14px; }
  .brand__icon { height: 40px; }
  .brand__text-main { font-size: 18px; letter-spacing: 1.5px; }
  .brand__text-sub { font-size: 9px; letter-spacing: 4px; }
  .cat-bar { padding: 0 44px; }
  .section { padding-top: 48px; padding-bottom: 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  .topbar-inner { padding: 0 18px; gap: 12px; font-size: 12px; }
  .topbar-left .topbar-item:not(:first-child) { display: none; }
  .container, .footer-grid, .footer-bottom-inner { padding-left: 18px; padding-right: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .section { padding-top: 36px; padding-bottom: 36px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 11px; }
  .product-card__body { padding: 12px; }
  .product-card__name { -webkit-line-clamp: 2; margin-bottom: 8px; }
  .product-card__price { font-size: 18px; }
  .product-card__footer { padding: 0 12px 12px; flex-direction: column; gap: 7px; }
  .product-card__footer .btn { width: 100%; padding: 11px; }
  .brand__text { display: none; }
  .h-action span:not(.cart-badge) { display: none; }
}

/* ═══════════ FAST MICRO-INTERACTIONS ═══════════
   Анимации везде, но короткие (.1–.25s) и на transform/opacity,
   чтобы было красиво и без задержек. */

/* Кнопки: подъём при наведении + «нажатие» при клике */
.btn { transition: background-color .14s, border-color .14s, color .14s, transform .1s ease, box-shadow .16s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.96); }
.btn svg { transition: transform .12s ease; }

/* Любой интерактив — мгновенная обратная связь по клику + плавный ховер */
button, .chip, .quick-chip, .pd-tab, .cat-link, .cat-tree__link, .filter-brand-item,
.product-card__fav, .product-card__cmp, .h-action, .pagination a, .recently-clear,
.megamenu__group-more, .cat-more, .megamenu__cat, .qty-btn, .theme-toggle,
.brand-tile, .cat-grid-item, .footer a {
  transition: background-color .14s, color .14s, border-color .14s,
              transform .1s ease, box-shadow .16s, opacity .14s;
}
button:active, .chip:active, .quick-chip:active, .cat-link:active, .pd-tab:active,
.product-card__fav:active, .product-card__cmp:active, .pagination a:active,
.media-dot:active, .qty-btn:active, .cat-grid-item:active { transform: scale(.94); }

/* Иконки-кнопки в шапке — лёгкий подъём */
.h-action:hover, .theme-toggle:hover { transform: translateY(-2px); }

/* Поля ввода — плавный фокус */
input, textarea, select { transition: border-color .15s, box-shadow .15s, background-color .15s; }

/* Появление карточек (только прозрачность — не ломает hover-подъём) */
@keyframes qzFade { from { opacity: 0; } to { opacity: 1; } }
/* .product-card отдаём reveal-on-scroll (см. app.js) — без двойной анимации */
.recent-card, .cat-grid-item { animation: qzFade .22s ease both; }

/* Всплывающие окна — мягко и быстро */
@keyframes qzPop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.wa-modal, .email-box, .qo-modal, .modal__box { animation: qzPop .17s cubic-bezier(.2,.6,.2,1); }

/* Счётчик корзины — лёгкий «поп» при наведении */
.cart-badge { transition: transform .12s ease; }
.h-action:hover .cart-badge { transform: scale(1.12); }

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

/* ── Footer: популярные SEO-запросы (перелинковка) ── */
.footer-tags{max-width:1280px;margin:0 auto;padding:22px 24px 4px;border-top:1px solid rgba(255,255,255,.08);}
.footer-tags__title{font-size:12px;text-transform:uppercase;letter-spacing:1px;color:rgba(255,255,255,.5);margin-bottom:12px;font-weight:700;}
.footer-tags__list{display:flex;flex-wrap:wrap;gap:8px;}
.footer-tags__list a{font-size:12.5px;color:rgba(255,255,255,.62);background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);padding:5px 12px;border-radius:999px;transition:color .15s,background .15s,border-color .15s;}
.footer-tags__list a:hover{color:#fff;background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.25);}

/* ── Мобильное нижнее меню + поиск ── */
.mobnav { display: none; }
.msearch {
  position: fixed; inset: 0; z-index: 1600; background: var(--bg);
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.msearch.open { opacity: 1; visibility: visible; transform: none; }
.msearch__bar {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--header-bg);
}
.msearch__bar form { flex: 1; }
.msearch__bar input {
  width: 100%; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--heading); padding: 11px 14px; font-size: 15px;
}
.msearch__bar input::placeholder { color: var(--text-dim); }
.msearch__back {
  flex: none; width: 40px; height: 40px; border: 0; background: var(--surface-2);
  border-radius: 50%; color: var(--heading); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.msearch__back svg { width: 22px; height: 22px; }
.msearch .search-results { left: 14px; right: 14px; max-height: calc(100vh - 90px); overflow-y: auto; }

@media (max-width: 900px) {
  .mobnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1400;
    background: var(--header-bg); border-top: 1px solid var(--border);
    box-shadow: 0 -2px 14px rgba(15, 43, 92, .08);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around; align-items: stretch;
  }
  .mobnav__item {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 4px 2px; border: 0; background: none; cursor: pointer; font: inherit;
    font-size: 10.5px; font-weight: 600; color: var(--text-muted);
    text-decoration: none; -webkit-tap-highlight-color: transparent;
    transition: color .15s, transform .1s;
  }
  .mobnav__item svg { width: 24px; height: 24px; }
  .mobnav__item.is-active { color: var(--brand-navy); }
  :root[data-theme="dark"] .mobnav__item.is-active { color: var(--brand-yellow); }
  .mobnav__item:active { transform: scale(.92); }
  .mobnav__ico { position: relative; display: inline-flex; }
  .mobnav__ico .cart-badge { position: absolute; top: -6px; right: -9px; }
  body { padding-bottom: 66px; }
}
