/* =========================================================
   Метрика — версия 4
   Слайдшоу Broggini (5 кадров, fade 1 с / 5 с, без управления)
   Тема Polypreen: белый, серый #f0f0f0, акцент #e3421f.
   Без JS, без Bootstrap, без карты и кнопок.
   ========================================================= */

/* ---------- Шрифт: Source Sans 3 (variable, cyrillic + latin) ---------- */

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/sourcesans3-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('../fonts/sourcesans3-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Основа ---------- */

:root {
  --accent: #e3421f;
  --accent-soft: #fbe9e4;
  --accent-ink: #c0390f;
  --ink: #3c3b3b;
  --ink-strong: #26272a;
  --muted: #6d6e70;
  --paper: #ffffff;
  --soft: #f0f0f0;
  --soft-2: #f7f6f5;
  --line: #e6e4e1;
  --max: 1320px;
  --pad: clamp(1rem, 2.4vw, 1.5rem);
}

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

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: 'Source Sans 3', 'PT Sans', 'Segoe UI', Arial, sans-serif;
  font-size: clamp(16px, 0.9vw, 17px);
  font-weight: 400;
  line-height: 1.47;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1,
h2,
p,
ul,
ol,
address {
  margin-top: 0;
}

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
  height: auto;
}

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

::selection {
  color: #fff;
  background: var(--accent);
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding-right: var(--pad);
  padding-left: var(--pad);
}

/* ---------- Шапка со слайдшоу ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: clamp(290px, 21vw, 340px);
  overflow: hidden;
  background: var(--ink-strong);
}

.hero-slides {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: hero-fade 25s infinite;
}

.hero-slide:nth-child(1) { animation-delay: 0s; }
.hero-slide:nth-child(2) { animation-delay: 5s; }
.hero-slide:nth-child(3) { animation-delay: 10s; }
.hero-slide:nth-child(4) { animation-delay: 15s; }
.hero-slide:nth-child(5) { animation-delay: 20s; }

@keyframes hero-fade {
  0%   { opacity: 0; }
  4%   { opacity: 1; }
  20%  { opacity: 1; }
  24%  { opacity: 0; }
  100% { opacity: 0; }
}

/* Лёгкое затемнение слева: фото видно целиком, белый текст читается */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg,
      rgba(10, 12, 16, 0.8) 0%,
      rgba(10, 12, 16, 0.64) 38%,
      rgba(10, 12, 16, 0.26) 68%,
      rgba(10, 12, 16, 0) 88%),
    linear-gradient(180deg,
      rgba(10, 12, 16, 0.16) 0%,
      rgba(10, 12, 16, 0) 45%,
      rgba(10, 12, 16, 0.3) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: clamp(1.2rem, 2.2vw, 1.9rem) var(--pad);
}

.hero-copy {
  max-width: min(100%, 34rem);
  color: #fff;
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.85),
    0 0 6px rgba(0, 0, 0, 0.65),
    0 2px 18px rgba(0, 0, 0, 0.5);
}

.hero-title {
  margin-bottom: 0.6rem;
  color: #fff;
  font-size: clamp(1.85rem, 3.3vw, 2.95rem);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.hero-title span {
  display: block;
  margin-top: 0.45em;
  color: #ffc2b0;
  font-size: clamp(0.78rem, 1vw, 0.95rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.16em;
}

.hero-tagline {
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.94);
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  font-weight: 500;
  line-height: 1.3;
}

.hero-address {
  margin-bottom: 0.65rem;
  color: rgba(255, 255, 255, 0.96);
  font-size: clamp(0.98rem, 1.15vw, 1.15rem);
  font-style: normal;
  line-height: 1.45;
}

.hero-phone {
  margin-bottom: 0.35rem;
  color: #fff;
  font-size: clamp(1.05rem, 1.5vw, 1.45rem);
  font-weight: 600;
  line-height: 1.3;
}

.hero-label {
  margin-right: 0.2em;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.68em;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.hero-phone a {
  color: #ffc2b0;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 194, 176, 0.5);
  transition: border-color 150ms ease;
}

.hero-phone a:hover {
  border-bottom-color: #ffc2b0;
}

.hero-phone a + a {
  margin-left: 0.45em;
}

.hero-hours {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(0.82rem, 0.95vw, 0.95rem);
  font-weight: 300;
}

/* ---------- Белый блок с текстом ---------- */

.content {
  padding-top: clamp(1.6rem, 2.6vw, 2.3rem);
  padding-bottom: clamp(1.5rem, 2.4vw, 2.1rem);
}

.section-title {
  margin-bottom: 0.85rem;
  color: var(--accent);
  font-size: clamp(1.4rem, 2vw, 1.85rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.005em;
}

.section-title::after {
  display: block;
  width: 45px;
  height: 3px;
  margin-top: 0.4rem;
  background: var(--accent);
  content: "";
}

.section-title:not(:first-child) {
  margin-top: clamp(1.3rem, 2.1vw, 1.8rem);
}

.products {
  margin-bottom: 0;
  padding: 0;
  list-style: none;
  counter-reset: product;
}

.products > li {
  position: relative;
  margin-bottom: clamp(0.7rem, 1.2vw, 0.95rem);
  padding-left: 1.9rem;
  counter-increment: product;
}

.products > li:last-child {
  margin-bottom: 0;
}

.products > li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--accent);
  font-weight: 600;
  content: counter(product) ".";
}

.lead {
  margin-bottom: 0;
  color: var(--ink-strong);
  font-size: 1.04em;
  line-height: 1.38;
}

.lead strong {
  font-weight: 600;
}

.detail {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.9em;
  font-weight: 400;
  line-height: 1.45;
}

.notes {
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}

.notes li {
  position: relative;
  margin-bottom: 0.32rem;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.9em;
  line-height: 1.42;
}

.notes li:last-child {
  margin-bottom: 0;
}

.notes li::before {
  position: absolute;
  left: 0;
  color: var(--accent);
  content: "–";
}

.rule {
  margin-top: clamp(1rem, 1.7vw, 1.4rem);
  margin-bottom: 0;
  color: var(--ink-strong);
  font-size: 1.02em;
  line-height: 1.45;
}

.rule strong {
  font-weight: 600;
}

.advice {
  margin-top: clamp(1.3rem, 2.1vw, 1.8rem);
  padding: clamp(1rem, 1.9vw, 1.5rem) clamp(1rem, 1.8vw, 1.5rem);
  background: var(--soft-2);
  border-radius: 3px;
}

.advice .section-title {
  margin-top: 0;
}

.advice p {
  margin-bottom: 0.55rem;
  font-size: 0.98em;
}

.advice p:last-child {
  margin-bottom: 0;
}

.formula {
  margin-top: 0.7rem;
  margin-bottom: 0.8rem;
  padding: 0.75rem 1rem;
  background: var(--paper);
  border-left: 4px solid var(--accent);
  color: var(--ink-strong);
  font-size: 1.05em;
  font-weight: 600;
  line-height: 1.35;
}

/* ---------- Нижний блок: маршрут ---------- */

.route {
  padding-top: clamp(1.5rem, 2.4vw, 2.1rem);
  padding-bottom: clamp(1.5rem, 2.4vw, 2.1rem);
  background: var(--soft);
  border-top: 3px solid var(--accent);
}

.route .section-title {
  margin-top: 0;
}

.route p {
  max-width: none;
  margin-bottom: 0.55rem;
  color: #55565a;
  font-size: 0.94em;
  line-height: 1.5;
}

.route p:last-child {
  margin-bottom: 0;
}

.footer-requisites {
  margin-top: 1.4rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82em;
  line-height: 1.4;
}

.footer-note {
  margin-top: 0.45rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82em;
  line-height: 1.4;
}

/* ---------- Служебное ---------- */

.ym-noscript {
  position: absolute;
  left: -9999px;
}

/* ---------- Страница 404 ---------- */

.error-page {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: clamp(1.5rem, 4vw, 2.5rem) var(--pad);
}

.error-inner {
  max-width: 36rem;
  margin: 0 auto;
}

.error-code {
  margin-bottom: 0.2rem;
  color: var(--accent);
  font-size: clamp(3.5rem, 9vw, 6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.03em;
}

.error-title {
  margin-bottom: 0.6rem;
  color: var(--ink-strong);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 600;
  line-height: 1.2;
}

.error-text {
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.error-page a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.error-note {
  margin-top: 1.6rem;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.85em;
}

/* ---------- Документная страница (политика) ---------- */

.doc {
  max-width: 78ch;
}

.doc h1 {
  margin-bottom: 0.35rem;
  color: var(--accent);
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
}

.doc h2 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--ink-strong);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

.doc p,
.doc li {
  color: #55565a;
  font-size: 0.98rem;
  line-height: 1.55;
}

.doc p {
  margin-bottom: 0.6rem;
}

.doc ul {
  margin-bottom: 0.8rem;
  padding-left: 1.2rem;
}

.doc li {
  margin-bottom: 0.3rem;
}

.doc-updated {
  margin-bottom: 1.4rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.doc a {
  color: var(--accent-ink);
}

/* ---------- Адаптив ---------- */

@media (max-width: 1024px) {
  .hero-slide {
    object-position: center;
  }

  .hero-scrim {
    background: linear-gradient(180deg,
      rgba(10, 12, 16, 0.6) 0%,
      rgba(10, 12, 16, 0.58) 50%,
      rgba(10, 12, 16, 0.76) 100%);
  }

  .hero-inner {
    padding: 1.2rem var(--pad) 1.4rem;
  }

  .hero-copy {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: clamp(1.9rem, 8.5vw, 2.6rem);
  }

  .hero-address {
    font-size: 1rem;
  }

  .hero-phone {
    font-size: 1.12rem;
  }

  .hero-phone a {
    white-space: nowrap;
  }

  .products > li {
    padding-left: 1.6rem;
  }

  .detail,
  .notes li {
    font-size: 0.92em;
  }

  .formula {
    font-size: 0.98em;
  }
}

/* ---------- Меньше движения ---------- */

/* Смена кадров — только прозрачность, без сдвигов и масштабирования,
   поэтому слайдшоу оставляем и при prefers-reduced-motion. */

/* ---------- Печать ---------- */

@media print {
  @page {
    margin: 15mm;
  }

  html,
  body {
    background: #fff;
    color: #000;
  }

  .hero {
    min-height: 0;
    padding-bottom: 6mm;
    border-bottom: 2px solid #000;
    background: #fff;
  }

  .hero-slides,
  .hero-scrim,
  .ym-noscript {
    display: none;
  }

  .hero-inner {
    padding: 0;
  }

  .hero-copy {
    max-width: none;
    color: #000;
    text-shadow: none;
  }

  .hero-title,
  .hero-address,
  .hero-phone,
  .hero-hours,
  .hero-tagline,
  .hero-title span {
    color: #000;
    text-shadow: none;
  }

  .hero-phone a {
    color: #000;
    border-bottom: 0;
  }

  .content,
  .route {
    padding: 4mm 0 0;
    background: #fff;
    border-top: 0;
  }

  .section-title,
  .doc h1 {
    color: #000;
  }

  .section-title::after {
    background: #000;
  }

  .lead,
  .detail,
  .notes li,
  .rule,
  .route p,
  .footer-requisites,
  .footer-note,
  .doc p,
  .doc li {
    color: #000;
  }

  .advice {
    background: #fff;
    border: 1px solid #999;
  }

  .formula {
    background: #fff;
    border: 1px solid #999;
    border-left: 4px solid #000;
  }

  .products > li,
  .advice,
  .route,
  .notes-block,
  .doc h2 {
    break-inside: avoid;
  }

  .section-title,
  .doc h1,
  .doc h2 {
    break-after: avoid;
  }

  a {
    color: #000;
    text-decoration: none;
  }

  .footer-note a::after {
    content: " (" attr(href) ")";
    font-size: 0.9em;
  }
}
