/* ========== HEADER (fixed, hidden until block 2) ========== */
.hdr {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}
body.chrome-on .hdr {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.hdr-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 40px;
  padding-top: 8px;
  padding-bottom: 8px;
}
/* компактный хедер — ужимаем самый высокий элемент строки (кнопку) */
.hdr-cta { padding: 7px 16px; }
.logo {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
}
.logo .logo-mark {
  height: 24px;
  width: auto;
  display: block;
}
.nav {
  display: flex;
  gap: 32px;
  font-size: 14px;
  font-weight: 500;
  color: #e8e6e0;
  justify-content: center;
}
.nav a { color: #e8e6e0; transition: color 0.16s var(--ease); }
.nav a:hover { color: #ffffff; }
.hdr-right {
  display: flex;
  gap: 18px;
  align-items: center;
}
.hdr-phone {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}
/* Desktop: number links to Telegram instead of a dead `tel:` — glyph + hover. */
.hdr-phone--tg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color 0.18s var(--ease);
}
.hdr-phone--tg:hover { color: #2aabee; }
.hdr-phone-ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #2aabee;
}
.hdr-vk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--ink-2);
  border-radius: 4px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.hdr-vk:hover {
  color: #0077FF;
  background: rgba(0, 119, 255, 0.08);
}

/* ---- Мессенджеры в шапке (Telegram / WhatsApp / MAX) ----
   Геометрия та же, что у .hdr-vk — отличается только фирменный цвет наведения. */
.hdr-msg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--ink-2);
  border-radius: 4px;
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.hdr-msg-tg:hover  { color: #29A9EB; background: rgba(41, 169, 235, 0.08); }
.hdr-msg-wa:hover  { color: #25D366; background: rgba(37, 211, 102, 0.08); }
.hdr-msg-max:hover { color: #7C4DFF; background: rgba(124, 77, 255, 0.08); }

/* Кнопка звонка — та же геометрия, что у .hdr-msg, но акцентная: это основное
   действие, а не ещё один мессенджер. На широком экране не нужна — там номер
   виден текстом (.hdr-phone), включается ниже вместе с его скрытием. */
.hdr-msg-call {
  display: none;
  color: var(--accent);
}
.hdr-msg-call:hover {
  color: var(--accent);
  background: rgba(0, 0, 0, 0.06);
}

/* На узком десктопе шапка тесная: номер текстом не влезает — заменяем его
   кнопкой звонка, чтобы позвонить можно было прямо с первого экрана,
   а не только из бургера или из футера. */
@media (max-width: 1120px) {
  .hdr-phone { display: none; }
  .hdr-msg-call { display: inline-flex; }
}

/* ---- Мессенджеры в мобильном меню ---- */
.hdr-mobile-msgs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.hdr-mobile-msg {
  flex: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 4px;
  font-size: 12px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}
.hdr-mobile-msg:active { background: rgba(255, 255, 255, 0.04); }
.hdr-mobile-msgs a:nth-child(1) svg { color: #29A9EB; }
.hdr-mobile-msgs a:nth-child(2) svg { color: #25D366; }
.hdr-mobile-msgs a:nth-child(3) svg { color: #7C4DFF; }

.hdr-mobile-vk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
  padding: 10px 0;
  font-size: 14px;
  color: var(--ink-2);
  border-radius: 4px;
}
.hdr-mobile-vk svg { color: #0077FF; }

/* ---- Burger (mobile only — hidden on desktop) ---- */
.hdr-burger {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  cursor: pointer;
}
.hdr-burger span {
  position: absolute;
  left: 50%;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 1px;
  transform: translateX(-50%);
  transition: transform 0.25s ease, opacity 0.18s ease, top 0.25s ease;
}
.hdr-burger span:nth-child(1) { top: 13px; }
.hdr-burger span:nth-child(2) { top: 19px; }
.hdr-burger span:nth-child(3) { top: 25px; }
.hdr-burger[aria-expanded="true"] span:nth-child(1) {
  top: 19px;
  transform: translateX(-50%) rotate(45deg);
}
.hdr-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hdr-burger[aria-expanded="true"] span:nth-child(3) {
  top: 19px;
  transform: translateX(-50%) rotate(-45deg);
}

/* ---- Mobile menu (full-screen overlay) ---- */
.hdr-mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 4000;
  flex-direction: column;
  padding: 10px 20px max(20px, env(safe-area-inset-bottom, 0px)) 20px;
  padding-top: max(10px, env(safe-area-inset-top, 0px));
  background: #0a0a0a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
body.menu-open .hdr-mobile-menu {
  opacity: 1;
  pointer-events: auto;
}

.hdr-mobile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-shrink: 0;
}
.hdr-mobile-top .logo {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.hdr-mobile-close {
  position: relative;
  width: 38px;
  height: 38px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  cursor: pointer;
}
.hdr-mobile-close span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 1.5px;
  background: var(--ink);
  border-radius: 1px;
  transform-origin: center;
}
.hdr-mobile-close span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.hdr-mobile-close span:nth-child(2) { transform: translate(-50%, -50%) rotate(-45deg); }

.hdr-mobile-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex-shrink: 0;
}
.hdr-mobile-list a {
  padding: 16px 0;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.hdr-mobile-list a:last-child { border-bottom: none; }

.hdr-mobile-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.hdr-mobile-phone,
.hdr-mobile-phone:link,
.hdr-mobile-phone:visited {
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink) !important;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.hdr-mobile-phone:hover { color: #c4a47a !important; }
.hdr-mobile-cta { padding: 14px 18px; font-size: 14px; }

body.menu-open { overflow: hidden; }


/* ===== Шапка-«бровка» (13.10.2026, Дима утвердил): тёмная полупрозрачная плашка с отступом от боков,
   висит от верхнего края — верхние углы прямые, скруглены только нижние («сверху два угла не скругляй»). ===== */
html .hdr {
  top: 0;
  left: 16px;
  right: 16px;
  max-width: 1320px;
  margin: 0 auto;
  border-radius: 0 0 18px 18px;
  background: rgba(12, 11, 9, 0.8);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 0;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.45);
}
html .hdr-row {
  max-width: none;
  gap: 24px;
  padding: 7px 8px 7px 24px;
}
html .hdr-right { gap: 14px; }
html .hdr-cta { border-radius: 999px; padding: 8px 18px; }
html .hdr-burger { border-radius: 999px; }
/* в бровке на 32 px теснее: номер текстом прячем раньше (≤1200) */
@media (max-width: 1200px) {
  html .hdr-phone, html .hdr-vk { display: none !important; }
  html .hdr-msg-call { display: inline-flex; }
  html .hdr-row { gap: 16px; }
}
@media (max-width: 980px) {
  html .hdr { left: 8px; right: 8px; border-radius: 0 0 14px 14px; }
  html .hdr-row { padding: 6px 6px 6px 18px; }
}
