/* =========================================================================
   Harp Store — витрина

   Слой токенов ниже совпадает с портальным styles.css символ в символ:
   оба сайта должны выглядеть одной системой. Расхождение проверяется тестом
   test/design.test.js, поэтому править токены нужно в обоих файлах сразу
   (или менять их в портале и переносить сюда).

   Значения контрастности рассчитаны, а не подобраны на глаз: см. тот же тест.
   ========================================================================= */

:root {
  color-scheme: light;

  /* Поверхности и текст */
  --bg: #f3f1ec;
  --surface: #fbfaf7;
  --surface-sunken: #efece5;
  --surface-hover: #f4f2ec;
  /* Три уровня текста подобраны расчётом контрастности, а не на глаз:
     ГОСТ Р 52872-2019 требует 4.5:1, а прежний --text-faint давал 2.6:1
     на заголовках таблиц и метках. Уровни разведены с запасом, чтобы
     иерархия оставалась различимой и не зависела от округления в браузере. */
  --text: #1b201f;
  --text-muted: #4d5451;
  --text-faint: #626967;
  --border: #dcdad1;
  /* Граница интерактивных элементов: единственный признак, по которому
     опознаётся пустое поле ввода, поэтому обязана давать 3:1 (WCAG 1.4.11). */
  --border-strong: #939189;

  /* Акцент и семантика: приглушённые, без пастельной подсветки */
  --accent: #0f5344;
  --accent-hover: #0b4235;
  --accent-on: #ffffff;
  --accent-tint: rgba(15, 83, 68, 0.09);
  --accent-line: rgba(15, 83, 68, 0.22);

  --ok: #1f6b52;
  --ok-tint: rgba(31, 107, 82, 0.1);
  --warn: #7d5810;
  --warn-tint: rgba(170, 126, 34, 0.14);
  --risk: #9a3f2f;
  --risk-tint: rgba(154, 63, 47, 0.11);
  --idle: #626967;
  --idle-tint: rgba(107, 115, 112, 0.1);

  /* Типографика */
  --font-ui: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --fs-label: 0.6875rem;   /* 11 */
  --fs-xs: 0.75rem;        /* 12 */
  --fs-sm: 0.8125rem;      /* 13 */
  --fs-md: 0.875rem;       /* 14 */
  --fs-h2: 1.0625rem;      /* 17 */
  --fs-h1: 1.625rem;       /* 26 */
  --fs-stat: 1.5rem;       /* 24 */

  /* Ритм, форма, глубина */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(20, 25, 23, 0.05);
  --shadow-2: 0 10px 30px -12px rgba(20, 25, 23, 0.22);
  --shadow-3: 0 24px 60px -16px rgba(20, 25, 23, 0.32);
  --sidebar-w: 232px;
  --gutter: clamp(16px, 3vw, 40px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14181a;
    --surface: #1a1f21;
    --surface-sunken: #21272a;
    --surface-hover: #222829;
    --text: #e7eae8;
    --text-muted: #98a19e;
    --text-faint: #8a928f;
    --border: #2b3235;
    --border-strong: #676d71;
    --accent: #45a389;
    --accent-hover: #4bad92;
    --accent-on: #06120f;
    --accent-tint: rgba(63, 157, 131, 0.14);
    --accent-line: rgba(63, 157, 131, 0.3);
    --ok: #57b08f;
    --ok-tint: rgba(87, 176, 143, 0.14);
    --warn: #cfa04a;
    --warn-tint: rgba(207, 160, 74, 0.15);
    --risk: #d17f6c;
    --risk-tint: rgba(209, 127, 108, 0.15);
    --idle: #98a19e;
    --idle-tint: rgba(152, 161, 158, 0.12);
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-2: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
    --shadow-3: 0 24px 60px -16px rgba(0, 0, 0, 0.7);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14181a;
  --surface: #1a1f21;
  --surface-sunken: #21272a;
  --surface-hover: #222829;
  --text: #e7eae8;
  --text-muted: #98a19e;
  --text-faint: #8a928f;
  --border: #2b3235;
  --border-strong: #676d71;
  --accent: #45a389;
  --accent-hover: #4bad92;
  --accent-on: #06120f;
  --accent-tint: rgba(63, 157, 131, 0.14);
  --accent-line: rgba(63, 157, 131, 0.3);
  --ok: #57b08f;
  --ok-tint: rgba(87, 176, 143, 0.14);
  --warn: #cfa04a;
  --warn-tint: rgba(207, 160, 74, 0.15);
  --risk: #d17f6c;
  --risk-tint: rgba(209, 127, 108, 0.15);
  --idle: #98a19e;
  --idle-tint: rgba(152, 161, 158, 0.12);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
  --shadow-3: 0 24px 60px -16px rgba(0, 0, 0, 0.7);
}
/* ---------- Основа ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { max-width: 100%; height: auto; }

a { color: var(--accent); }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 300;
  left: var(--sp-3);
  top: -60px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--text);
  color: var(--bg);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--sp-3); }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.label {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--text-faint);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fine {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* Ограничение по ширине в ch и rem, а не в px: при масштабе 200%
   страница остаётся без горизонтальной прокрутки. */
.store-wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-on);
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.625rem var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-md);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.button:hover { background: var(--surface-hover); border-color: var(--text-faint); text-decoration: none; }
.button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
}
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* ---------- Шапка ---------- */

.store-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.store-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 4rem;
}

.store-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: inherit;
  text-decoration: none;
}
.store-brand:hover { text-decoration: none; }
.brand-text strong { display: block; font-size: var(--fs-md); font-weight: 600; }
.brand-text small { display: block; color: var(--text-faint); font-size: var(--fs-label); }

.store-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
}
.store-nav a {
  color: var(--text-muted);
  font-size: var(--fs-md);
  text-decoration: none;
}
.store-nav a:hover { color: var(--text); text-decoration: underline; }
.store-nav a.button { color: var(--text); }

/* ---------- Первый экран ---------- */

/* Нижний отступ меньше верхнего: ниже уже идёт собственный отступ секции
   каталога, и одинаковые значения давали заметный провал между экранами. */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(1.5rem, 3vw, 2.5rem); }
.hero-inner { max-width: 72rem; }

.hero h1 {
  max-width: 34ch;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.2vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.hero-lead {
  max-width: 60ch;
  margin-top: var(--sp-4);
  color: var(--text-muted);
  font-size: clamp(0.9375rem, 1.4vw, 1.0625rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-6);
  margin-top: var(--sp-8);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.hero-facts li { display: flex; align-items: center; gap: var(--sp-2); }
.hero-facts .icon { color: var(--accent); }

/* ---------- Секции ---------- */

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }

.section h2 {
  max-width: 30ch;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.6vw, 1.875rem);
  font-weight: 400;
  letter-spacing: -0.012em;
  line-height: 1.2;
}

.section-lead {
  max-width: 62ch;
  margin-top: var(--sp-3);
  color: var(--text-muted);
  font-size: var(--fs-md);
}

.section-note {
  margin-top: var(--sp-6);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ---------- Каталог ---------- */

/* auto-fit с минимумом в rem: на узком экране одна колонка, на широком —
   три, без медиазапросов и без ломки при масштабировании. */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-6);
}

.product {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.section-alt .product { background: var(--bg); }
.section:not(.section-alt) .product { background: var(--surface); }

.product h3 {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.006em;
}

.product-note {
  margin-top: var(--sp-2);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.product-list {
  display: grid;
  gap: var(--sp-2);
  padding-top: var(--sp-1);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}
.product-list li {
  display: grid;
  grid-template-columns: 1rem 1fr;
  gap: var(--sp-2);
}
.product-list li::before {
  content: "";
  width: 0.3125rem;
  height: 0.3125rem;
  margin: 0.5rem 0 0 0.34rem;
  border-radius: var(--r-pill);
  background: var(--accent);
}

.product-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: auto;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
}

.product-price { display: flex; align-items: baseline; gap: var(--sp-2); }
.product-price strong { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.015em; }
.product-price span { color: var(--text-faint); font-size: var(--fs-xs); }

/* ---------- Шаги ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: var(--sp-5);
  margin-top: var(--sp-6);
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-bottom: var(--sp-3);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-pill);
  background: var(--accent-tint);
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.steps h3 { font-size: var(--fs-md); font-weight: 600; }
.steps p { margin-top: var(--sp-2); color: var(--text-muted); font-size: var(--fs-sm); }

/* ---------- Контакты и предупреждение ---------- */

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  margin-top: var(--sp-8);
  padding: var(--sp-5);
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-lg);
}
.contact-card h3 { font-size: 1.0625rem; font-weight: 600; }
.contact-card .fine { margin-top: var(--sp-2); max-width: 48ch; }
.contact-links { display: flex; flex-wrap: wrap; gap: var(--sp-3); }

.warn-strip {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
  padding: var(--sp-4);
  background: var(--warn-tint);
  border-radius: var(--r-md);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.warn-strip .icon { margin-top: 0.2rem; color: var(--warn); font-size: 1.125rem; }

/* ---------- Вопросы ---------- */

.faq {
  display: grid;
  gap: 0;
  margin-top: var(--sp-6);
  max-width: 60rem;
  border-top: 1px solid var(--border);
}

.faq details { border-bottom: 1px solid var(--border); }

/* details/summary раскрывается без JavaScript и доступен с клавиатуры. */
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  cursor: pointer;
  font-size: var(--fs-md);
  font-weight: 600;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq details > p {
  max-width: 68ch;
  padding-bottom: var(--sp-4);
  color: var(--text-muted);
  font-size: var(--fs-md);
}

/* ---------- Подвал ---------- */

.store-foot {
  padding-top: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.store-foot-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--sp-6);
  padding-bottom: var(--sp-8);
}

.foot-col { display: grid; gap: var(--sp-2); align-content: start; }
.foot-col h2 {
  color: var(--text-faint);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.foot-col a {
  color: var(--text-muted);
  font-size: var(--fs-sm);
  text-decoration: none;
  width: fit-content;
}
.foot-col a:hover { color: var(--text); text-decoration: underline; }
.foot-col .brand-mark { margin-bottom: var(--sp-2); }

.foot-bottom {
  padding: var(--sp-4) var(--gutter);
  border-top: 1px solid var(--border);
}

/* ---------- Правовые страницы ---------- */

.legal { padding: clamp(2rem, 5vw, 3.5rem) 0 clamp(3rem, 6vw, 5rem); }
.legal-inner { max-width: 48rem; }
.legal h1 {
  font-family: var(--font-display);
  font-size: clamp(1.625rem, 3.4vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.legal .updated { margin-top: var(--sp-3); color: var(--text-faint); font-size: var(--fs-sm); }
.legal h2 {
  margin-top: var(--sp-8);
  font-size: 1.125rem;
  font-weight: 600;
}
.legal p, .legal li { margin-top: var(--sp-3); color: var(--text-muted); font-size: var(--fs-md); }
.legal ul { padding-left: var(--sp-5); list-style: disc; }
.legal ul li { display: list-item; }
.legal .back { display: inline-flex; gap: var(--sp-2); margin-top: var(--sp-8); font-size: var(--fs-md); }

/* Незаполненные места видны сразу, а не теряются в тексте. */
.legal mark {
  padding: 0.1em 0.3em;
  border-radius: 3px;
  background: var(--warn-tint);
  color: var(--text);
  font-weight: 600;
}

/* ---------- Адаптация и печать ---------- */

@media (max-width: 40rem) {
  .store-head-inner { flex-wrap: wrap; padding-block: var(--sp-3); }
  .store-nav { gap: var(--sp-4); font-size: var(--fs-sm); }
  .hero-actions .button { width: 100%; }
  .contact-links .button { width: 100%; }
}

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

@media print {
  .store-head, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .product, .contact-card { break-inside: avoid; }
}
