/* Шапка и мега-меню сайта (v19 по Figma, шрифт сайта Montserrat). Разметка — include/header_new.php,
   поведение — js/header-new.js, состав меню — инфоблок header_menu (itteloHeaderMenu()).
   Перенесено из прототипа docs/figma-prototipy (header-template.html + v19-template.html) 2026-11-26. */
/* styles.css: body,html{overflow-x:hidden} делает body контейнером прокрутки, и sticky перестаёт липнуть.
   clip режет горизонтальный вылет так же, но контейнер прокрутки не создаёт. */
html body { overflow-x: clip; }
/* Шапка + мега-меню v14 по Figma JezckEcPJdpMJkKxOrUEXr (4249:3028, 4249:3029).
   Контейнер = сетка Bootstrap: 1400 / 1140 / 960 / 720 / 540 / 100% с полями 15px.
   Сайт однотемный, поэтому тёмной схемы нет: фон и цвета заданы явно. */
header.nh {
  --ink: #1A2E35;      /* Web/Ink */
  --body: #334C5C;     /* Web/Body */
  --teal: #0093A6;     /* Web/Teal */
  --teal-d: #006B79;   /* Web/Teal Dark */
  --hint: #9CABB6;     /* Web/Hint */
  --line: #E4EBEE;     /* Web/Line */
  --line2: #DBE8F6;    /* рамка поиска и топбара */
  --tint: #F5FBFC;     /* Web/Tint */
  --sbtn: #EDF5F6;     /* фон мобильной кнопки поиска */
  --yellow: #FDD800;   /* Web/Yellow */
  --white: #FFFFFF;
  --star: #FFB900;
  --page: #F3F6F7;
  --f: "Montserrat", "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}

.nh *, .nh *::before, .nh *::after { box-sizing: border-box; }
.nh [hidden] { display: none !important; }
/* глобальные a{font-weight:300} и пр. сайта: сбрасываем с минимальной специфичностью */
:where(.nh) a { font-weight: inherit; }
:where(.nh) p, :where(.nh) ul { margin: 0; font-size: inherit; }

/* Шапка липкая на всех ширинах. На ПК (≥992) при прокрутке схлопываются топбар и строка навигации (.is-scrolled) */
/* header.nh — перебивает старое header{position:fixed;left:50%;transform;height:58px;display:flex} из styles.css */
header.nh { position: sticky; top: env(safe-area-inset-top, 0px); left: auto; transform: none; width: auto; height: auto; display: block;
  z-index: 700; background: var(--white); font-family: var(--f); color: var(--ink); box-shadow: none; transition: box-shadow .2s; }
header.nh.is-scrolled { box-shadow: 0 4px 16px rgba(26,46,54,.08); }
.nh a { color: inherit; text-decoration: none; }
.nh button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
.nh svg { display: block; flex-shrink: 0; }
.nh :focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.nh-c { width: 100%; margin-inline: auto; padding-inline: 15px; }
@media (min-width: 576px)  { .nh-c { max-width: 540px; } }
@media (min-width: 768px)  { .nh-c { max-width: 720px; } }
@media (min-width: 992px)  { .nh-c { max-width: 960px; } }
@media (min-width: 1200px) { .nh-c { max-width: 1140px; } }
@media (min-width: 1440px) { .nh-c { max-width: 1400px; } }
.nh-spacer { flex: 1 1 0; min-width: 0; }


/* ---------- Row 1 ---------- */
.nh-top { border-bottom: 1px solid var(--line); }
.nh-top__in { display: flex; align-items: center; gap: 10px; height: 64px; }

.nh-burger { width: 40px; height: 40px; border-radius: 6px; background: var(--teal) !important; display: flex; align-items: center; justify-content: center; }
.nh-burger__close { display: none !important; }
.nh.is-mob-open .nh-burger { background: var(--teal-d) !important; }
.nh.is-mob-open .nh-burger__open { display: none !important; }
.nh.is-mob-open .nh-burger__close { display: block !important; }

.nh-logo { display: block; }
.nh-logo__l { display: none !important; }

.nh .nh-menu { display: none; width: 120px; height: 36px; border-radius: 8px; background: var(--teal) !important; color: var(--white) !important;
  align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 13px; line-height: 18px; }
.nh-menu[aria-expanded="true"] { background: var(--teal-d) !important; }

.nh-search { position: relative; height: 40px; border: 1px solid var(--line2); border-radius: 8px; background: var(--white); }
.nh-search__ico { position: absolute; left: 13px; top: 10px; pointer-events: none; }
.nh-search input { width: 100%; height: 100%; border: 0; border-radius: 8px; background: transparent; padding: 0 12px 0 39px;
  font: 400 13px/18px var(--f); color: var(--ink); }
.nh .nh-search input::placeholder { color: var(--hint); opacity: 1; font: 400 13px/18px var(--f); }
.nh-search input:focus { outline: none; }
.nh-search:focus-within { border-color: var(--teal); }
.nh-search--top { display: none; flex: 1 1 0; min-width: 0; }

.nh .nh-contacts { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; font-weight: 600; }
.nh .nh-contacts__phone { order: 1; font-size: 14px; line-height: 20px; color: var(--ink); }
.nh .nh-contacts__mail { order: 2; font-size: 12px; line-height: 16px; color: var(--teal) !important; }

.nh-ico { display: none; width: 32px; height: 32px; }
.nh-cta { display: none; flex-shrink: 0; width: 200px; height: 40px; border-radius: 8px; background: var(--yellow); align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; line-height: 20px; color: var(--ink) !important; }
.nh-cta:hover { filter: brightness(.96); }
.nh-cart { display: none; }
.nh-sbtn { width: 40px; height: 40px; border-radius: 10px; background: var(--sbtn) !important; display: flex; align-items: center; justify-content: center; }
.nh-sbtn[aria-expanded="true"] { background: var(--line) !important; }
.nh .nh-sbtn__close { display: none; }
.nh-sbtn[aria-expanded="true"] .nh-sbtn__open { display: none; }
.nh-sbtn[aria-expanded="true"] .nh-sbtn__close { display: block; }

/* Строка поиска: 768–991 всегда, <768 по кнопке */
.nh-srow { display: none; border-bottom: 1px solid var(--line); padding-block: 12px; }
.nh.is-search-open .nh-srow { display: block; }
.nh.is-mob-open .nh-srow { display: none; }

/* Мобильная полоса с CTA (<768). Лежит поверх контента (absolute), прячется transform'ом под шапку —
   высота шапки не меняется, страница не прыгает (важно для iOS: там нет scroll anchoring).
   У верха страницы место под полосу держит .nh-mcta-spacer в потоке. */
.nh-top, .nh-srow { position: relative; z-index: 2; background: var(--white); }
.nh-mcta { position: absolute; left: 0; right: 0; top: 100%; z-index: 1; background: var(--white);
  border-bottom: 1px solid var(--line); box-shadow: 0 4px 12px rgba(26,46,54,.08); padding-block: 4px 12px;
  transition: transform .25s ease, visibility 0s linear 0s; }
.nh-mcta.is-hidden { transform: translateY(-100%); visibility: hidden; box-shadow: none;
  transition: transform .25s ease, visibility 0s linear .25s, box-shadow 0s linear .25s; }
.nh-mcta__btn { display: flex; align-items: center; justify-content: center; height: 48px; border-radius: 8px; background: var(--yellow);
  font-weight: 700; font-size: 15px; line-height: 20px; color: var(--ink) !important; }
.nh-mcta__btn:active { filter: brightness(.95); }
.nh-mcta-spacer { height: 65px; } /* 4 + 48 + 12 + 1px линия */
.nh.is-mob-open .nh-mcta { display: none; }
@media (min-width: 768px) { .nh-mcta, .nh-mcta-spacer { display: none; } }

/* Row 2: навигация (≥992) */
.nh-nav { display: none; border-bottom: 1px solid var(--line); }
.nh-nav__in { display: flex; align-items: center; gap: 24px; height: 56px; }
.nh-nav__link { font-size: 16px; line-height: 24px; white-space: nowrap; color: var(--ink); }
.nh-nav__link.is-accent { color: var(--teal) !important; }
.nh-nav__link:hover { color: var(--teal) !important; }
.nh-rating { display: none; flex-direction: column; gap: 5px; }
.nh-rating__row { display: flex; align-items: center; gap: 6px; }
.nh-rating__row b { font-size: 18px; line-height: 24px; font-weight: 700; color: var(--ink); }
.nh-rating__stars { color: var(--star); font-size: 15px; letter-spacing: 1px; font-family: Arial, sans-serif; }
.nh-rating__cap { font-size: 12px; line-height: 16px; color: var(--body); white-space: nowrap; }

/* <375: 360 и 320 */
@media (max-width: 374.98px) {
  .nh-top__in { gap: 6px; }
  .nh .nh-contacts__phone { font-size: 12px; line-height: 16px; }
  .nh .nh-contacts__mail { font-size: 11px; line-height: 14px; font-weight: 700; }
}
@media (max-width: 359.98px) {
  .nh-logo__s { width: 64px; height: 22.67px; }
}

/* 768–991 */
@media (min-width: 768px) {
  .nh-top__in { gap: 12px; }
  .nh-logo__l { display: block !important; }
  .nh-logo__s { display: none !important; }
  .nh .nh-contacts__phone { font-size: 16px; line-height: 24px; }
  .nh-cta { display: flex; }
  .nh-sbtn { display: none; }
  .nh-srow { display: block; }
  .nh.is-mob-open .nh-cta { display: none; }
  .nh.is-mob-open .nh-srow { display: none; }
}

/* ≥992: десктоп */
@media (min-width: 992px) {
  .nh-top__in { height: 80px; gap: 20px; }
  .nh-burger, .nh-srow { display: none !important; }
  .nh .nh-menu { display: flex; }
  .nh-search--top { display: block; }
  .nh-top__in > .nh-spacer { display: none; }
  .nh .nh-contacts__phone { font-size: 14px; line-height: 20px; }
  .nh-cta { display: none; }
  .nh-cart { display: block; }
  .nh-nav { display: block; }
  .nh-nav { overflow: hidden; transition: max-height .2s ease, border-width .2s ease; }
  .nh-nav { max-height: 57px; }
  .nh.is-scrolled .nh-nav { max-height: 0; border-width: 0; }
}
@media (min-width: 1200px) {
  .nh-cta { display: flex; }
  .nh-nav__in { gap: 32px; }
  .nh-rating { display: flex; }
}
@media (min-width: 1440px) {
  .nh .nh-contacts { flex-direction: row; align-items: baseline; gap: 1.2em; font-size: 15px; }
  .nh .nh-contacts__mail { order: 1; font-size: 15px; line-height: normal; font-weight: 400; }
  .nh .nh-contacts__phone { order: 2; font-size: 15px; line-height: normal; }
  .nh-ico { display: block; }
}

/* ---------- Мега-меню (≥992) ---------- */
.nm { position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-top: 1px solid var(--line);
  box-shadow: 0 16px 32px rgba(26,46,54,.18); overflow-y: auto; overscroll-behavior: contain; }
.nm-row { display: flex; align-items: stretch; }
.nm-side { width: 280px; flex-shrink: 0; background: var(--tint); padding: 24px 20px 28px; display: flex; flex-direction: column; gap: 4px; }
.nm-side > .nm-btn { margin-bottom: 12px; }
.nm-l1s { display: flex; flex-direction: column; gap: 4px; padding-bottom: 4px; border-bottom: 1px solid var(--line); }
.nm-l1 { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 8px; font-weight: 600; font-size: 15px; line-height: 20px; color: var(--ink); }
.nm-l1 span { flex: 1 1 0; min-width: 0; }
.nm-l1.is-active { background: var(--white); color: var(--teal) !important; }
.nm-l1.is-active .nm-chev path { stroke: var(--teal); }
.nm-l1:not([data-panel]):hover { color: var(--teal) !important; }
.nm-plain { display: flex; flex-direction: column; gap: 10px; padding: 12px; font-size: 15px; line-height: 24px; }
.nm-plain a:hover, .nm-link:hover { color: var(--teal) !important; }

.nm-cols { flex: 1 1 0; min-width: 0; display: flex; gap: 32px; padding: 28px 0 0 32px; }
.nm-col { flex: 1 1 0; min-width: 0; }
.nm-g { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-bottom: 24px; }
.nm-eyebrow { font-family: var(--f); font-weight: 600; font-size: 12px; line-height: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.nm-link { font-size: 15px; line-height: 24px; color: var(--ink); }
.nm-more { font-weight: 600; font-size: 14px; line-height: 24px; color: var(--teal) !important; }
.nm-more:hover { text-decoration: underline !important; }

.nm-btn { display: flex; align-items: center; justify-content: center; height: 44px; padding: 0 20px; border-radius: 8px; white-space: nowrap;
  font-weight: 700; font-size: 14px; line-height: 20px; }
.nm-btn--line { border: 1px solid var(--teal); color: var(--teal) !important; }
.nm-btn--line:hover { background: var(--tint); }
.nm-btn--yellow { background: var(--yellow); color: var(--ink) !important; }
.nm-btn--yellow:hover { filter: brightness(.96); }

.nm-contacts { display: none; width: 300px; flex-shrink: 0; border-left: 1px solid var(--line); padding: 28px 0 28px 32px; flex-direction: column; gap: 12px; }
.nm-contacts__phone { font-weight: 700; font-size: 26px; line-height: 32px; white-space: nowrap; }
.nm-contacts__mail, .nm-strip__mail { font-weight: 600; font-size: 15px; line-height: 20px; color: var(--teal) !important; }
.nm-msg { display: flex; align-items: center; gap: 16px; }
.nm-msg a:hover { opacity: .75; }
.nm-msg svg { width: 24px; height: auto; }
.nm-divider { height: 1px; background: var(--line); margin-bottom: 4px; }

.nm-strip { border-top: 1px solid var(--line); }
.nm-strip__in { display: flex; align-items: center; gap: 32px; padding-block: 20px; padding-inline: 35px; }
.nm-strip__contacts { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.nm-strip__phone { font-weight: 700; font-size: 18px; line-height: 24px; }
.nm-strip__mail { font-size: 14px; }
.nm-spacer { flex: 1 1 0; }


@media (min-width: 1200px) {
  .nm-side { width: 300px; }
  .nm-contacts { display: flex; }
  .nm-strip { display: none; }
}
@media (min-width: 1440px) { .nm-contacts { width: 340px; } }
@media (max-width: 991.98px) { .nm { display: none !important; } }

/* ---------- Мобильное меню (<992) ---------- */
.nmm { display: none; }
@media (max-width: 991.98px) {
  .nmm:not([hidden]) { display: block; position: absolute; left: 0; right: 0; top: 100%; background: var(--white);
    max-height: calc(100vh - 64px); max-height: calc(100dvh - 64px); overflow-y: auto; overscroll-behavior: contain;
    border-top: 1px solid var(--line); box-shadow: 0 16px 32px rgba(26,46,54,.18); }
}
.nmm-search { padding-block: 16px 12px; }
.nmm-body { padding-block: 8px 24px; }
.nmm-cfg { padding-bottom: 8px; }
.nmm-cfg .nm-btn { height: 48px; }
.nmm-item { border-bottom: 1px solid var(--line); }
.nmm-l1 { display: flex !important; width: 100%; align-items: center; gap: 12px; padding: 16px 0 !important; text-align: left;
  font-weight: 600 !important; font-size: 16px !important; line-height: 24px !important; }
.nmm-l1 span { flex: 1 1 0; min-width: 0; }
.nmm-chev { transition: transform .2s; }
.nmm-item.is-open .nmm-l1 { color: var(--teal) !important; }
.nmm-item.is-open .nmm-chev { transform: rotate(90deg); }
.nmm-item.is-open .nmm-chev path { stroke: var(--teal); }
.nmm-sub { padding-bottom: 8px; }
.nmm-sub .nm-g { padding-bottom: 20px; }
.nmm-plain { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; line-height: 24px; }
.nmm-contacts { padding-bottom: 32px; }
.nmm-card { background: var(--tint); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.nmm-card__phone { font-weight: 700; font-size: 26px; line-height: 32px; white-space: nowrap; }
.nmm-card__mail { font-weight: 600; font-size: 15px; line-height: 20px; color: var(--teal) !important; }
.nmm-msg { display: flex; align-items: flex-end; gap: 24px; }
.nmm-msg a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--body) !important; }
.nmm-msg svg { width: 26px; height: auto; }
.nmm-cart { display: flex; align-items: center; gap: 10px; padding-top: 4px; font-weight: 600; font-size: 15px; line-height: 20px; }
.nmm-btns { display: flex; flex-direction: column; gap: 10px; width: 100%; padding-top: 6px; }
.nmm-btns .nm-btn { height: 48px; }


@media (prefers-reduced-motion: reduce) { .nmm-chev, .nh, .nh-nav, .nh-mcta { transition: none !important; } }

header.nh { --muted: #6B8290; --chip: #E2ECF2; --line2: #C9D8DE; }

/* ================= Шапка v17 поверх поведения v14 ================= */
/* верхняя строка (вариант с топбаром): прячется при прокрутке вместе с навигацией — механизм v14 */
header.nh .nh-top { border-bottom: 1px solid var(--line); }
header.nh .v-msgs { display: none; gap: 8px; flex-shrink: 0; }
header.nh .v-msg { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 12px; background: var(--chip); }
header.nh .v-msg:hover { background: #D2E3EA; }
header.nh .v-msg svg { width: 48px; height: 48px; }
header.nh .v-msg--wa svg { width: 24px; height: 24px; }
@media (min-width: 992px) {
  header.nh .nh-top__in { height: 88px; gap: 24px; }
  header.nh .nh-menu { width: 128px; height: 48px; border-radius: 12px; gap: 10px; font: 600 15px/20px var(--f); }
  header.nh .nh-search--top { height: 48px; border-radius: 12px; }
  header.nh .nh-search--top .nh-search__ico { left: 16px; top: 14px; }
  header.nh .nh-search--top input { padding-left: 44px; font: 400 15px/20px var(--f); }
  header.nh .nh-search input::placeholder { font: 400 15px/20px var(--f); color: var(--muted); }
  header.nh .nh-cart { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 12px; flex-shrink: 0; }
  header.nh .nh-cart:hover { border-color: var(--teal); }
  header.nh .nh-nav__in { gap: 24px; }
  header.nh .nh-nav__link { font-weight: 500; }
}
@media (min-width: 1200px) {
  header.nh .v-msgs { display: flex; margin-left: 18px; }
  header.nh .nh-cta { width: auto; height: 48px; padding: 0 24px; border-radius: 12px; font: 600 15px/20px var(--f); }
  header.nh .nh-nav__in { gap: 40px; }
  header.nh .nh-rating__cap { font-size: 13px; line-height: 18px; }
  header.nh .nh-contacts { flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; }
  header.nh .nh-contacts .nh-contacts__phone { order: 1; font: 700 17px/22px var(--f); color: var(--ink); }
  header.nh .nh-contacts .nh-contacts__mail { order: 2; font: 400 16px/22px var(--f); color: var(--teal) !important; }
}
@media (min-width: 1200px) and (max-width: 1439.98px) {
  header.nh .v-msgs { margin-left: 0; }
  header.nh .nh-search--top { min-width: 200px; }
  header.nh .v-msg--wa { display: none; }
}

/* ================= Только на сайте ================= */
.nh-logo img { display: block; }
/* счётчик корзины: число ставит PHP, обновляет scripts.js по классу js_header_basket_count */
.nh-cart { position: relative; }
.nh-cart__count { position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--yellow); color: var(--ink); font: 700 12px/20px var(--f); text-align: center; }
.nmm-cart .nh-cart__count { position: static; display: inline-block; }
.nh-search .search-result { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5;
  max-height: 320px; overflow: auto; padding: 6px; background: var(--white); border: 1px solid var(--line2); border-radius: 12px;
  box-shadow: 0 16px 32px rgba(26,46,54,.18); text-align: left; }
.nh-search .search-result.open { display: block; }
.nh-search .search-result a { display: block; padding: 8px 12px; border-radius: 8px; font: 400 14px/20px var(--f); color: var(--ink); }
.nh-search .search-result a:hover { background: var(--tint); color: var(--teal) !important; }
