/* ============================================================
   ИнжФлоу — инженерные системы, Екатеринбург
   Дизайн-система: тёплый крем + электрик-синий,
   индустриальная рубленая типографика, строки-каталог
   ============================================================ */

/* --- Примитивы --- */
:root {
  --p-cream: oklch(0.952 0.024 102);
  --p-cream-deep: oklch(0.925 0.03 100);
  --p-blue: #2F6BB0;
  --p-blue-deep: #0A2342;
  --p-sky: #D6E6F5;
  --p-ink: oklch(0.24 0.018 95);
  --p-ink-60: oklch(0.24 0.018 95 / 0.6);
  --p-ink-35: oklch(0.24 0.018 95 / 0.35);
  --p-line: oklch(0.24 0.018 95 / 0.16);
  --p-white-glass: hsla(0, 0%, 100%, 0.62);

  /* --- Семантика --- */
  --c-bg: var(--p-cream);
  --c-bg-alt: var(--p-cream-deep);
  --c-accent: var(--p-blue);
  --c-accent-hover: var(--p-blue-deep);
  --c-text: var(--p-ink);
  --c-text-muted: var(--p-ink-60);
  --c-text-faint: var(--p-ink-35);
  --c-border: var(--p-line);

  /* --- Типографика --- */
  --f-display: "Bebas Neue", "Arial Narrow", sans-serif;
  --f-body: "Golos Text", "Segoe UI", sans-serif;

  /* --- Ритм --- */
  --gutter: clamp(20px, 5vw, 72px);
  --sec-gap: clamp(72px, 11vw, 160px);
  --r-pill: 10rem;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--c-accent); color: var(--c-bg); }

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

.wrap {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  max-width: 1680px;
  margin-inline: auto;
}

/* --- Дисплейная типографика --- */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.88;
  letter-spacing: 0.01em;
  margin: 0;
}

.h-giant { font-size: clamp(40px, 9.6vw, 170px); }
.h-big   { font-size: clamp(48px, 9vw, 150px); }
.h-mid   { font-size: clamp(36px, 5.5vw, 84px); }
.h-giant, .h-big, .h-mid { hyphens: none; overflow-wrap: normal; word-break: keep-all; }
@media (max-width: 480px) {
  .h-giant { font-size: clamp(30px, 10.5vw, 40px); }
  .h-big { font-size: clamp(34px, 10vw, 48px); }
}

.accent { color: var(--c-accent); }

.lead {
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.55;
  max-width: 34ch;
}

.muted { color: var(--c-text-muted); }

.label {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-text-muted);
}

/* --- Пилюля-кнопка (стекло + перекат текста) --- */
.pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  min-height: 48px;
  border-radius: var(--r-pill);
  border: 1px solid var(--c-border);
  background: var(--p-white-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.02em;
  overflow: hidden;
  transition: border-color 0.25s var(--ease-out), background 0.25s var(--ease-out);
  cursor: pointer;
  white-space: nowrap;
}

.pill .pill-label {
  position: relative;
  display: block;
  overflow: hidden;
  height: 1.35em;
}

.pill .pill-label span {
  display: block;
  transition: transform 0.35s var(--ease-out);
}

.pill .pill-label span::after {
  content: attr(data-label);
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
}

.pill:hover .pill-label span,
.pill:focus-visible .pill-label span { transform: translateY(-100%); }

.pill:hover { border-color: var(--c-accent); }

.pill--solid {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-bg);
}
.pill--solid:hover { background: var(--c-accent-hover); border-color: var(--c-accent-hover); }

/* --- Шапка --- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(0.952 0.024 102 / 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border);
}

.site-head .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--f-display);
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.logo .logo-mark { width: 44px; height: 44px; flex: none; align-self: center; }
.logo .logo-word { height: 50px; width: auto; flex: none; align-self: center; display: block; }
.logo em { font-style: normal; color: var(--c-accent); }

.main-nav { display: flex; align-items: center; gap: 6px; }

.main-nav a {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.main-nav a:hover { background: var(--c-text); color: var(--c-bg); }
.main-nav a[aria-current="page"] { color: var(--c-accent); }
.main-nav a[aria-current="page"]:hover { background: var(--c-accent); color: var(--c-bg); }

.head-cta { flex: none; }

/* --- Герой --- */
.hero { padding-top: clamp(48px, 8vw, 120px); position: relative; }

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.hero-kicker::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--c-accent);
}

.hero-title { max-width: 100%; hyphens: none; }
.hero-title .accent { display: block; }

.hero-sub {
  margin-top: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.hero-sub > .hero-row {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 20px;
}
.hero-row .hero-search { flex: 1 1 auto; min-width: 0; }
.hero-row .hero-actions { flex: none; }
.hero-row .pill { min-height: 68px; padding: 18px 30px; font-size: 16px; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Карточки героя — ступенькой с заходом наверх */
.hero-cards {
  margin-top: clamp(40px, 6vw, 88px);
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: clamp(12px, 2vw, 28px);
  align-items: start;
}
.hero-cards figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}
.hero-cards figure:nth-child(1) { transform: translateY(0); }
.hero-cards figure:nth-child(2) { transform: translateY(-56px); }
.hero-cards figure:nth-child(3) { transform: translateY(-24px); }
.hero-cards img {
  width: 100%;
  height: clamp(260px, 30vw, 480px);
  object-fit: cover;
  transition: transform 0.6s var(--ease-out), filter 0.45s var(--ease-out);
  filter: grayscale(0.35);
}
.hero-cards figure:hover img { transform: scale(1.04); filter: grayscale(0); }
.hero-cards figcaption {
  position: absolute;
  left: 14px; bottom: 14px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--p-white-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Синяя вуаль на фото */
.imgcast { position: relative; }
.imgcast::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--c-accent);
  mix-blend-mode: hard-light;
  opacity: 0.35;
  pointer-events: none;
  transition: opacity 0.45s var(--ease-out);
}
.imgcast:hover::after { opacity: 0.12; }

/* --- Главная: фон-панорама Екатеринбурга --- */
.hero--ekb { position: relative; isolation: isolate; }
.hero--ekb::before {
  content: "";
  position: absolute;
  z-index: -2;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  top: -24px;
  bottom: -32px;
  background: url("../img/ekb.jpg") center 32% / cover no-repeat;
}
.hero--ekb::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  top: -24px;
  bottom: -32px;
  background: linear-gradient(180deg,
    color-mix(in oklab, var(--p-cream) 86%, transparent) 0%,
    color-mix(in oklab, var(--p-cream) 76%, transparent) 45%,
    color-mix(in oklab, var(--p-cream) 97%, transparent) 100%);
}

/* --- Бегущая строка --- */
.marquee {
  margin-top: var(--sec-gap);
  background: var(--p-sky);
  overflow: hidden;
  padding: 18px 0;
}
.marquee span { color: var(--p-blue-deep); }
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}
.marquee span {
  font-family: var(--f-display);
  font-size: clamp(28px, 4vw, 56px);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding-right: 0.6em;
  white-space: nowrap;
}
.marquee span i { font-style: normal; color: var(--p-cream); padding-right: 0.6em; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* --- Секции --- */
.section { margin-top: var(--sec-gap); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.section-head .label { flex: none; }

/* --- Строки-каталог (услуги, цены) --- */
.rows { border-top: 1px solid var(--c-border); }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr auto 40px;
  align-items: center;
  gap: 20px;
  padding: 26px 0;
  border-bottom: 1px solid var(--c-border);
  transition: padding-left 0.3s var(--ease-out);
}
a.row:hover, a.row:focus-visible { padding-left: 14px; }

.row::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--c-accent);
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%) scale(0);
  transition: transform 0.25s var(--ease-out);
}
a.row:hover::before, a.row:focus-visible::before { transform: translateY(-50%) scale(1); }

.row-num {
  font-size: 14px;
  font-weight: 500;
  color: var(--c-text-faint);
  font-variant-numeric: tabular-nums;
}

.row-name {
  font-family: var(--f-display);
  font-size: clamp(26px, 3.4vw, 48px);
  text-transform: uppercase;
  line-height: 1;
  transition: color 0.25s var(--ease-out);
}
a.row:hover .row-name { color: var(--c-accent); }

.row-meta {
  font-size: 15px;
  color: var(--c-text-muted);
  text-align: right;
  white-space: nowrap;
}
.row-meta strong { color: var(--c-text); font-weight: 600; }

.row-arrow {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--c-border);
  border-radius: 50%;
  transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.row-arrow svg { width: 16px; height: 16px; }
a.row:hover .row-arrow {
  background: var(--c-accent);
  border-color: var(--c-accent);
  color: var(--c-bg);
  transform: rotate(45deg);
}

/* Плавающее превью при наведении на строку */
.row-preview {
  position: fixed;
  z-index: 60;
  width: 300px;
  aspect-ratio: 3 / 2;
  border-radius: 14px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.row-preview.on { opacity: 1; transform: scale(1); }
.row-preview img { width: 100%; height: 100%; object-fit: cover; }

/* --- Карточки товаров с фото (компактные: фото слева, текст справа) --- */
.goods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
  gap: clamp(12px, 1.5vw, 20px);
}
.good {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--c-border);
  border-radius: 16px;
  background: #fff;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}
.good:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(10, 35, 66, 0.12);
  border-color: var(--c-accent);
}
.good-img {
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  border-radius: 12px;
  background: #f5f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.good-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
  transition: transform 0.45s var(--ease-out);
}
.good:hover .good-img img { transform: scale(1.06); }
.good-body { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.good-name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.good-desc { font-size: 12.5px; line-height: 1.45; color: var(--c-text-muted); }
@media (max-width: 640px) { .good-img { width: 84px; height: 84px; } }

/* Строки-перечисление без ссылки — три колонки вместо четырёх */
.row:not(a) { grid-template-columns: 64px 1fr auto; }

/* --- Плашки-преимущества --- */
.points {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}
.point h3, .point p { overflow-wrap: break-word; }
.point { border-top: 1px solid var(--c-border); padding-top: 20px; }
.point .point-num {
  font-family: var(--f-display);
  font-size: 40px;
  color: var(--c-accent);
  line-height: 1;
}
.point h3 { margin: 14px 0 8px; font-size: 18px; font-weight: 600; }
.point p { margin: 0; font-size: 15px; color: var(--c-text-muted); }

/* --- Шаги --- */
.steps { counter-reset: step; }
.step {
  display: grid;
  grid-template-columns: 96px 1fr 1.2fr;
  gap: 24px;
  padding: 30px 0;
  border-bottom: 1px solid var(--c-border);
  align-items: baseline;
}
.step::before {
  counter-increment: step;
  content: "0" counter(step);
  font-family: var(--f-display);
  font-size: clamp(36px, 4vw, 60px);
  color: var(--c-accent);
  line-height: 1;
}
.step h3 { margin: 0; font-size: 19px; font-weight: 600; }
.step p { margin: 0; color: var(--c-text-muted); font-size: 16px; }

/* --- Текстовые колонки --- */
.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 72px);
  align-items: start;
}
.cols-2 p { margin: 0 0 1em; }
.cols-2 p:last-child { margin-bottom: 0; }

/* --- Большое фото секции --- */
.wide-photo { overflow: hidden; border-radius: 20px; }
.wide-photo img {
  width: 100%;
  height: clamp(320px, 48vw, 720px);
  object-fit: cover;
  filter: grayscale(0.35);
  transition: filter 0.45s var(--ease-out);
}
.wide-photo:hover img { filter: grayscale(0); }

/* --- Форма / CTA --- */
.cta {
  margin-top: var(--sec-gap);
  border-top: 1px solid var(--c-border);
  padding-top: clamp(48px, 6vw, 88px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 96px);
  align-items: start;
}

.form { display: grid; gap: 18px; }
.form-field { display: grid; gap: 8px; }
.form-field label { font-size: 14px; font-weight: 500; color: var(--c-text-muted); }
.form-field input,
.form-field textarea {
  font: inherit;
  font-size: 16px;
  padding: 16px 20px;
  border: 1px solid var(--c-border);
  border-radius: 16px;
  background: transparent;
  color: var(--c-text);
  transition: border-color 0.25s var(--ease-out);
  width: 100%;
}
.form-field textarea { min-height: 110px; resize: vertical; }
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--c-accent);
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--c-text-faint); }
.form-field .err { display: none; font-size: 13px; color: oklch(0.55 0.2 25); }
.form-field.bad input, .form-field.bad textarea { border-color: oklch(0.55 0.2 25); }
.form-field.bad .err { display: block; }

.form-note { font-size: 13px; color: var(--c-text-faint); }

.form-ok {
  display: none;
  padding: 24px;
  border: 1px solid var(--c-accent);
  border-radius: 20px;
  font-weight: 500;
}
.form-ok.on { display: block; }

/* --- Подвал --- */
.site-foot {
  margin-top: var(--sec-gap);
  border-top: 1px solid var(--c-border);
  padding: clamp(40px, 5vw, 72px) 0 0;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.4fr;
  gap: clamp(24px, 3vw, 56px);
}
.foot-grid h4 {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--c-text-muted);
}
.foot-grid ul { display: grid; gap: 10px; }
.foot-grid a { font-size: 15px; }
.foot-grid a:hover { color: var(--c-accent); }
.foot-tel {
  font-family: var(--f-display);
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1;
  display: inline-block;
  margin-bottom: 10px;
}
.foot-word { margin-top: clamp(40px, 5vw, 64px); text-align: center; user-select: none; }
.foot-word img { width: min(88vw, 980px); height: auto; }
.foot-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 0 28px;
  font-size: 13px;
  color: var(--c-text-faint);
}

/* --- Хлебные крошки / шапка внутренней страницы --- */
.page-head { padding-top: clamp(40px, 6vw, 88px); }
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--c-text-muted);
  margin-bottom: 24px;
}
.crumbs a:hover { color: var(--c-accent); }
.crumbs li + li::before { content: "—"; margin-right: 8px; color: var(--c-text-faint); }

/* --- Мобильное меню --- */
.burger {
  display: none;
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 80;
  padding: 14px 28px;
  min-height: 52px;
  border-radius: var(--r-pill);
  background: var(--c-text);
  color: var(--c-bg);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 12px 32px oklch(0.24 0.018 95 / 0.3);
  align-items: center;
  gap: 10px;
}
.burger svg { width: 18px; height: 18px; transition: transform 0.3s var(--ease-out); }
.burger[aria-expanded="true"] svg { transform: rotate(135deg); }

.mnav {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--c-bg);
  display: grid;
  align-content: center;
  padding: var(--gutter);
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transition: opacity 0.3s var(--ease-out), visibility 0.3s;
}
.mnav.on { opacity: 1; visibility: visible; }
.mnav ul { display: grid; gap: 6px; }
.mnav a {
  font-family: var(--f-display);
  font-size: clamp(32px, 8.8vw, 88px);
  line-height: 1.02;
  text-transform: uppercase;
  overflow-wrap: break-word;
  transition: color 0.2s var(--ease-out);
}
.mnav a:hover { color: var(--c-accent); }
.mnav .mnav-foot {
  margin-top: 40px;
  display: grid;
  gap: 8px;
  font-size: 15px;
  color: var(--c-text-muted);
}
.mnav .mnav-foot a {
  font-family: var(--f-body);
  text-transform: none;
  font-size: 16px;
  line-height: 1.5;
}

/* --- Появление при скролле (маска) --- */
.js .rv { overflow: hidden; }
.js .rv > .rv-i {
  display: block;
  transform: translateY(110%);
  transition: transform 0.9s var(--ease-out);
  transition-delay: var(--d, 0s);
}
.js .rv.in > .rv-i { transform: translateY(0); }

.js .fade { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); transition-delay: var(--d, 0s); }
.js .fade.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marquee-track { animation: none; }
  .js .rv > .rv-i, .js .fade { transform: none; opacity: 1; transition: none; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* --- Адаптив --- */
@media (max-width: 1024px) {
  .points { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .step { grid-template-columns: 64px 1fr; }
  .step p { grid-column: 2; }
}

@media (max-width: 1150px) {
  .main-nav, .head-cta { display: none; }
  .burger { display: inline-flex; }
  body { padding-bottom: 92px; }
}

/* Строки-позиции: пояснение справа может переноситься на узких экранах */
@media (max-width: 1150px) {
  .row-meta { white-space: normal; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .main-nav, .head-cta { display: none; }
  .burger { display: inline-flex; }
  body { padding-bottom: 92px; }

  .hero-cards { grid-template-columns: 1fr; }
  .hero-cards figure:nth-child(n) { transform: none; }
  .hero-cards img { height: 240px; }

  .row { grid-template-columns: 40px 1fr 32px; row-gap: 4px; }
  .row:not(a) { grid-template-columns: 40px 1fr; }
  .row-name { min-width: 0; overflow-wrap: break-word; font-size: clamp(24px, 7vw, 32px); }
  .row-meta { min-width: 0; }
  .row-meta { grid-column: 2; text-align: left; white-space: normal; }
  .row-arrow { grid-row: 1; grid-column: 3; width: 32px; height: 32px; }
  .row-preview { display: none; }

  .cols-2 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .logo .logo-mark { width: 32px; height: 32px; }
  .logo .logo-word { height: 36px; }
}

/* --- Креатив: плавающие капли в герое --- */
.hero-drops { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.hero-drops i {
  position: absolute; bottom: -60px;
  width: var(--s, 26px); height: var(--s, 26px);
  background: linear-gradient(160deg, #7FB2E0, #2F6BB0 60%, #0A2342);
  border-radius: 50% 50% 50% 0;
  transform: rotate(45deg);
  opacity: 0;
  animation: drop-rise var(--t, 14s) linear infinite;
  animation-delay: var(--dl, 0s);
  filter: drop-shadow(0 4px 10px rgba(10,35,66,.18));
}
@keyframes drop-rise {
  0%   { transform: translate(0, 0) rotate(45deg) scale(.7); opacity: 0; }
  8%   { opacity: var(--o, .5); }
  50%  { transform: translate(var(--x, 30px), -46vh) rotate(45deg) scale(1); }
  92%  { opacity: var(--o, .5); }
  100% { transform: translate(calc(var(--x, 30px) * -0.6), -92vh) rotate(45deg) scale(.85); opacity: 0; }
}

/* --- Креатив: волна-разделитель под героем --- */
.hero-wave { position: absolute; left: 50%; transform: translateX(-50%); width: 100vw; bottom: -2px; z-index: 1; height: 74px; overflow: hidden; pointer-events: none; }
.hero-wave svg { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; animation: wave-drift 16s linear infinite; }
.hero-wave svg.w2 { animation-duration: 27s; animation-direction: reverse; opacity: .55; }
@keyframes wave-drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --- Креатив: акцентное слово переливается --- */
.hero-title .accent {
  display: inline-block;
  background: linear-gradient(100deg, #2F6BB0 20%, #7FB2E0 40%, #0A2342 60%, #2F6BB0 80%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: accent-flow 7s ease-in-out infinite;
}
@keyframes accent-flow { 0%,100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }

/* --- Креатив: карточки героя приподнимаются --- */
.hero-cards .imgcast { transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out); }
.hero-cards .imgcast:hover { transform: translateY(-8px) rotate(-.4deg); box-shadow: 0 24px 48px -18px rgba(10,35,66,.35); }

/* --- Креатив: пульс у главной CTA --- */
.hero-actions .pill--solid { animation: cta-pulse 3.2s ease-in-out infinite; }
@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(47,107,176,.45); }
  55%      { box-shadow: 0 0 0 14px rgba(47,107,176,0); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-drops i, .hero-wave svg, .hero-title .accent, .hero-actions .pill--solid { animation: none !important; }
}

/* --- Бренды: двойная лента --- */
.brands { margin-top: var(--sec-gap); }
.brands-belt { margin-top: clamp(24px, 4vw, 44px); display: grid; gap: 14px; overflow: hidden; }
.brands-row { overflow: hidden; }
.brands-track {
  display: flex; gap: 14px; width: max-content;
  animation: marquee 46s linear infinite;
}
.brands-row--rev .brands-track { animation-direction: reverse; animation-duration: 54s; }
.brands-track b {
  font-family: var(--f-display); font-weight: 400;
  font-size: clamp(20px, 2.4vw, 30px); text-transform: uppercase; letter-spacing: .04em;
  color: var(--p-blue-deep);
  border: 1.5px solid color-mix(in oklab, var(--p-blue) 45%, transparent);
  border-radius: var(--r-pill);
  padding: 10px 26px;
  white-space: nowrap;
  background: var(--p-white-glass, rgba(255,255,255,.5));
  transition: background .3s var(--ease-out), color .3s var(--ease-out), transform .3s var(--ease-out);
}
.brands-track b:hover { background: var(--p-blue); color: var(--p-cream); transform: translateY(-3px); }
.brands-row:hover .brands-track { animation-play-state: paused; }
.brands-track b.bl { background: #fff; padding: 9px 22px; display: inline-flex; align-items: center; }
.brands-track b.bl img { height: 30px; width: auto; display: block; }
@media (prefers-reduced-motion: reduce) { .brands-track { animation: none; } }

/* --- Поиск по каталогу на главной --- */
.hero-search { position: relative; flex: 1 1 380px; min-width: 0; }
.hs-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 28px;
  background: #fff;
  border: 2px solid rgba(47,107,176,.45);
  border-radius: 999px;
  box-shadow: 0 10px 34px rgba(10,35,66,.12), inset 0 0 0 1px rgba(255,255,255,.6);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.hs-box:focus-within {
  border-color: var(--p-blue, #2F6BB0);
  box-shadow: 0 14px 44px rgba(47,107,176,.22), 0 0 0 4px rgba(47,107,176,.14);
  transform: translateY(-1px);
}
.hs-ico { width: 26px; height: 26px; flex: none; color: var(--p-blue, #2F6BB0); }
.hs-box input {
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  font-size: 19px;
  font-weight: 500;
  color: var(--c-text, #0A2342);
  min-width: 0;
}
.hs-box input::placeholder { color: var(--c-text-faint, #9aa7b5); }
.hs-box input::-webkit-search-cancel-button { display: none; }
.hs-clear {
  flex: none;
  width: 32px; height: 32px;
  border: 0; border-radius: 50%;
  background: var(--p-cream, #f2eee5);
  color: var(--c-text, #0A2342);
  font-size: 18px; line-height: 1;
  cursor: pointer;
}
.hs-drop {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #fff;
  border: 1.5px solid rgba(10,35,66,.12);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(10,35,66,.18);
  padding: 8px;
  max-height: min(62vh, 480px);
  overflow: auto;
}
.hs-group {
  padding: 10px 14px 4px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-text-faint, #9aa7b5);
}
.hs-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  color: var(--c-text, #0A2342);
  text-decoration: none;
}
.hs-item:hover, .hs-item.on { background: var(--p-cream, #f2eee5); }
.hs-logo {
  flex: none;
  width: 56px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border: 1px solid rgba(10,35,66,.10);
  border-radius: 9px;
  overflow: hidden;
}
.hs-logo img { max-width: 48px; max-height: 24px; width: auto; height: auto; display: block; }
.hs-logo--txt { font-weight: 700; color: var(--p-blue, #2F6BB0); font-size: 18px; }
.hs-main { flex: 1; min-width: 0; }
.hs-name { display: block; font-size: 15px; font-weight: 600; }
.hs-name mark { background: rgba(47,107,176,.16); color: inherit; border-radius: 3px; padding: 0 1px; }
.hs-sub {
  display: block;
  font-size: 12.5px;
  color: var(--c-text-faint, #9aa7b5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hs-arrow { flex: none; color: var(--p-blue, #2F6BB0); }
.hs-empty { padding: 18px 16px; font-size: 14.5px; color: var(--c-text, #0A2342); }
.hs-wa {
  display: block;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(37,211,102,.10);
  color: #128C4B;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.hs-wa:hover { background: rgba(37,211,102,.18); }
.hs-wa--foot { margin: 6px 8px 4px; }
@media (max-width: 1100px) and (min-width: 901px) {
  .hero-row .pill { min-height: 60px; padding: 15px 22px; font-size: 15px; }
}
@media (max-width: 900px) {
  .hero-sub > .hero-row { flex-wrap: wrap; gap: 14px; }
  .hero-row .hero-search { flex-basis: 100%; }
  .hero-row .hero-actions { flex-basis: 100%; }
  .hero-row .pill { min-height: 52px; padding: 14px 24px; font-size: 15px; }
}
@media (max-width: 640px) {
  .hero-row .hero-actions .pill { flex: 1 1 0; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
  .hs-box { padding: 16px 20px; gap: 10px; }
  .hs-ico { width: 22px; height: 22px; }
  .hs-box input { font-size: 16px; }
  .hs-drop { border-radius: 16px; }
}

/* --- Мобильные заголовки: снимаем десктопный лимит 12ch --- */
@media (max-width: 640px) {
  .hero-title { max-width: 100%; }
}

/* --- Длинные слова в H1: влезают целиком, без переносов --- */
.h-long { font-size: clamp(24px, 8.2vw, 110px); }

/* --- Карточки товаров как ссылки --- */
a.good { text-decoration: none; color: inherit; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
a.good:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(10,35,66,.12); border-color: color-mix(in srgb, var(--c-accent) 45%, transparent); }
a.good:hover .good-name { color: var(--c-accent); }

/* --- Страница товара --- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 34px; font-size: 13.5px; color: var(--c-text-faint); }
.crumbs a { color: var(--c-text-muted); text-decoration: none; border-bottom: 1px dotted currentColor; }
.crumbs a:hover { color: var(--c-accent); }
.prod-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.prod-img { background: #fff; border: 1px solid var(--c-border); border-radius: 28px; padding: clamp(24px, 4vw, 48px); display: flex; align-items: center; justify-content: center; }
.prod-img img { max-width: 100%; max-height: 460px; object-fit: contain; }
.prod-title { font-size: clamp(26px, 7vw, 60px); line-height: 1.02; margin: 12px 0 20px; hyphens: none; }
.prod-feats { list-style: none; margin: 24px 0 30px; padding: 0; display: grid; gap: 10px; }
.prod-feats li { position: relative; padding-left: 26px; font-size: 15.5px; line-height: 1.45; }
.prod-feats li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--c-accent); }
.prod-cta { display: flex; flex-wrap: wrap; gap: 14px; }
.prod-specs { margin-top: clamp(48px, 7vw, 84px); }
.spec-table { width: 100%; border-collapse: collapse; margin-top: 22px; font-size: 15px; }
.spec-table td { padding: 13px 18px; border-bottom: 1px solid var(--c-border); vertical-align: top; line-height: 1.4; }
.spec-table tr td:first-child { color: var(--c-text-muted); width: 42%; }
.spec-table tbody tr:nth-child(odd) { background: rgba(255,255,255,.55); border-radius: 8px; }
.prod-note { margin-top: 16px; font-size: 13.5px; color: var(--c-text-faint); max-width: 72ch; }
.prod-desc { margin-top: clamp(40px, 6vw, 72px); max-width: 80ch; }
.prod-desc h2 { margin-bottom: 20px; }
.prod-desc p { margin: 0 0 16px; font-size: 16px; line-height: 1.65; }
@media (max-width: 900px) {
  .prod-grid { grid-template-columns: minmax(0, 1fr); }
  .prod-img img { max-height: 320px; }
  .spec-table td { padding: 11px 12px; font-size: 14px; }
  .spec-table tr td:first-child { width: 46%; }
}

/* --- Согласие на обработку данных и уведомление о cookies --- */
.form-consent { margin-bottom: 18px; }
.form-consent .consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--c-text-muted); cursor: pointer; }
.form-consent input[type="checkbox"] { width: 18px; height: 18px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--c-accent); cursor: pointer; }
.form-consent a, .form-note a { color: var(--c-accent); }
.cookie-bar { position: fixed; left: 50%; bottom: 18px; transform: translate(-50%, 24px); z-index: 1200; width: min(920px, calc(100% - 24px)); display: flex; gap: 18px; align-items: center; background: #0A2342; color: #EAF1F8; padding: 16px 20px; border-radius: 18px; box-shadow: 0 14px 44px rgba(10,35,66,.4); opacity: 0; pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
.cookie-bar.on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.cookie-bar p { margin: 0; font-size: 14px; line-height: 1.5; flex: 1 1 auto; }
.cookie-bar a { color: #9CC3EC; }
.cookie-ok { flex: 0 0 auto; background: #2F6BB0; color: #fff; border: 0; border-radius: 999px; padding: 12px 24px; font: inherit; font-weight: 600; cursor: pointer; transition: background .2s, color .2s; }
.cookie-ok:hover { background: #7FB2E0; color: #0A2342; }
@media (max-width: 640px) {
  .cookie-bar { flex-direction: column; align-items: stretch; gap: 12px; bottom: 12px; }
  .cookie-ok { width: 100%; }
}
.h-xlong { font-size: clamp(20px, 6.2vw, 84px); }

/* --- Цветовые темы разделов --- */
.theme-kotly { --c-accent: #BE4B22; --c-accent-hover: #8A3011; }
.theme-kotly .hero-title .accent { background-image: linear-gradient(100deg, #BE4B22 20%, #E8986C 40%, #6E2408 60%, #BE4B22 80%); }
.theme-radiatory { --c-accent: #C77E1B; --c-accent-hover: #8F5A0E; }
.theme-radiatory .hero-title .accent { background-image: linear-gradient(100deg, #C77E1B 20%, #F0B35E 40%, #7A4A08 60%, #C77E1B 80%); }
.theme-nasosy { --c-accent: #0E7C86; --c-accent-hover: #085A61; }
.theme-nasosy .hero-title .accent { background-image: linear-gradient(100deg, #0E7C86 20%, #5BC0C9 40%, #063F45 60%, #0E7C86 80%); }
.theme-vodonagrevateli { --c-accent: #9A7B12; --c-accent-hover: #6E570A; }
.theme-vodonagrevateli .hero-title .accent { background-image: linear-gradient(100deg, #9A7B12 20%, #D9BC5A 40%, #5C4907 60%, #9A7B12 80%); }
.theme-truby { --c-accent: #3F7D46; --c-accent-hover: #2C5831; }
.theme-truby .hero-title .accent { background-image: linear-gradient(100deg, #3F7D46 20%, #7FBF88 40%, #1E4A25 60%, #3F7D46 80%); }
.theme-kollektory { --c-accent: #B33A5B; --c-accent-hover: #83263F; }
.theme-kollektory .hero-title .accent { background-image: linear-gradient(100deg, #B33A5B 20%, #E58AA5 40%, #6B1D34 60%, #B33A5B 80%); }
.theme-armatura { --c-accent: #55606C; --c-accent-hover: #3E4750; }
.theme-armatura .hero-title .accent { background-image: linear-gradient(100deg, #55606C 20%, #9AA6B2 40%, #2A323B 60%, #55606C 80%); }
.theme-santekhnika { --c-accent: #7B4E8E; --c-accent-hover: #5A3869; }
.theme-santekhnika .hero-title .accent { background-image: linear-gradient(100deg, #7B4E8E 20%, #B894CC 40%, #472A56 60%, #7B4E8E 80%); }
.theme-vanny { --c-accent: #20647E; --c-accent-hover: #144659; }
.theme-vanny .hero-title .accent { background-image: linear-gradient(100deg, #20647E 20%, #6AA8BE 40%, #0E3546 60%, #20647E 80%); }

/* --- Калькуляторы подбора --- */
.calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  border: 1px solid var(--c-border);
  border-radius: 28px;
  padding: clamp(24px, 4vw, 48px);
  background: var(--c-bg-alt);
}
.calc-form { display: grid; gap: 18px; align-content: start; }
.calc-field { display: grid; gap: 8px; }
.calc-field label { font-size: 14px; font-weight: 500; color: var(--c-text-muted); }
.calc-field input,
.calc-field select {
  font: inherit;
  font-size: 16px;
  padding: 14px 18px;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  background: var(--c-bg);
  color: var(--c-text);
  width: 100%;
  transition: border-color .25s var(--ease-out);
}
.calc-field input:focus,
.calc-field select:focus { outline: none; border-color: var(--c-accent); }
.calc-result {
  display: grid;
  gap: 14px;
  align-content: center;
  justify-items: start;
  border-left: 1px solid var(--c-border);
  padding-left: clamp(24px, 4vw, 56px);
}
.calc-big { margin: 0; font-family: var(--f-display); font-size: clamp(64px, 9vw, 120px); line-height: .95; color: var(--c-accent); }
.calc-big small { font-size: .32em; letter-spacing: .06em; color: var(--c-text-muted); }
.calc-note { margin: 0; font-size: 14px; line-height: 1.55; color: var(--c-text-muted); max-width: 42ch; }
@media (max-width: 860px) {
  .calc { grid-template-columns: 1fr; }
  .calc-result { border-left: 0; padding-left: 0; border-top: 1px solid var(--c-border); padding-top: 24px; }
}

/* --- Квиз «Подобрать решение» --- */
.quiz {
  border: 1px solid var(--c-border);
  border-radius: 28px;
  padding: clamp(24px, 4vw, 48px);
  background: var(--c-bg-alt);
}
.quiz-dots { display: flex; gap: 8px; margin-bottom: 26px; }
.quiz-dots i { width: 30px; height: 4px; border-radius: 4px; background: var(--c-border); transition: background .3s; }
.quiz-dots i.on { background: var(--c-accent); }
.quiz-step { display: none; }
.quiz-step.on { display: block; animation: quiz-in .35s var(--ease-out); }
@keyframes quiz-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.quiz-q { margin: 0 0 20px; font-size: clamp(20px, 2.6vw, 28px); font-weight: 600; }
.quiz-opts { display: grid; gap: 12px; }
.quiz-opt {
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 16px 20px;
  border: 1px solid var(--c-border);
  border-radius: 16px;
  background: var(--c-bg);
  color: var(--c-text);
  transition: border-color .2s, transform .2s;
}
.quiz-opt:hover { border-color: var(--c-accent); transform: translateY(-2px); }
.quiz-back { margin-top: 20px; background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--c-text-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.quiz-back:hover { color: var(--c-accent); }
.quiz-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 26px; }
.quiz-links a { display: inline-block; padding: 10px 18px; border: 1px solid var(--c-accent); border-radius: 999px; color: var(--c-accent); text-decoration: none; font-weight: 500; transition: background .2s, color .2s; }
.quiz-links a:hover { background: var(--c-accent); color: var(--c-bg); }
.quiz-done { margin: 0 0 8px; font-size: 15px; color: var(--c-text-muted); }

/* --- Анимированные схемы --- */
.scheme {
  border: 1px solid var(--c-border);
  border-radius: 28px;
  padding: clamp(20px, 3vw, 40px);
  background: var(--c-bg-alt);
}
.scheme svg { display: block; width: 100%; height: auto; }
.scheme-note { margin: 16px 0 0; font-size: 14px; line-height: 1.55; color: var(--c-text-muted); }
.scheme .flow { stroke-dasharray: 2 12; stroke-linecap: round; animation: scheme-flow 1s linear infinite; }
@keyframes scheme-flow { to { stroke-dashoffset: -14; } }
.scheme .heat path { opacity: 0; animation: scheme-heat 2.4s ease-in-out infinite; }
.scheme .heat path:nth-child(2) { animation-delay: .6s; }
.scheme .heat path:nth-child(3) { animation-delay: 1.2s; }
.scheme .heat path:nth-child(4) { animation-delay: 1.8s; }
@keyframes scheme-heat {
  0% { opacity: 0; transform: translateY(8px); }
  35% { opacity: .85; }
  100% { opacity: 0; transform: translateY(-16px); }
}
@media (prefers-reduced-motion: reduce) {
  .scheme .flow,
  .scheme .heat path { animation: none; }
  .scheme .heat path { opacity: .5; }
}
