/* ═══════════════════════════════════════════════════════════════
   Единый хедер Аквент — все страницы
   Зависит от CSS-переменных основного stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ── Шапка ─────────────────────────────────────────────────────── */
#hdr {
  position: sticky; top: 0; z-index: 900;
  background: #fff;
  border-bottom: 1px solid #E8EDF3;
  height: 60px;
  transition: box-shadow .2s;
}
#hdr.scrolled { box-shadow: 0 2px 16px rgba(0,0,0,.08); }

.hdr-in {
  max-width: 1280px; margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex; align-items: center; gap: 0;
}

/* ── Логотип ──────────────────────────────────────────────────── */
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; margin-right: 32px; }
.logo-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  background: conic-gradient(from 200deg, #38A3E8 0%, #1E72CC 35%, #081629 70%, #38A3E8 100%);
  border-radius: 50%;
  position: relative; overflow: hidden;
}
.logo-icon::after {
  content: ''; position: absolute; inset: 5px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid rgba(30,114,204,.25);
}
.logo-txt { font-family: var(--fh,'Montserrat',sans-serif); font-weight: 900; font-size: 19px; color: #1B3A6B; letter-spacing: -.3px; }
.logo-txt em { font-style: normal; color: #E65100; }

/* ── Навигация ────────────────────────────────────────────────── */
.hdr-nav { display: flex; align-items: center; flex: 1; gap: 0; }

.nav-link {
  font-family: var(--fh,'Montserrat',sans-serif);
  font-size: 13px; font-weight: 600;
  color: #4A5568;
  text-decoration: none;
  padding: 0 14px; height: 60px;
  display: flex; align-items: center; gap: 4px;
  cursor: pointer; border: none; background: none;
  white-space: nowrap;
  transition: color .15s;
  position: relative;
}
.nav-link:hover, .nav-link.cur { color: #1B3A6B; }
.nav-link.nav-soon { color: #8A94A6; }
.nav-link.nav-soon:hover { color: #4A5568; }

.nav-chev { flex-shrink: 0; transition: transform .2s; }
.nav-item:hover .nav-chev, .nav-item.open .nav-chev { transform: rotate(180deg); }

/* ── Dropdown ─────────────────────────────────────────────────── */
.nav-item { position: relative; }

.dropdown {
  display: none;
  position: absolute; top: calc(100% + 1px); left: 0;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  z-index: 200;
  animation: ddIn .15s ease;
}
@keyframes ddIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav-item:hover .dropdown,
.nav-item.open .dropdown { display: block; }

/* Мегаменю — плитка 3×2 */
.dd-mega { left: 50%; transform: translateX(-50%); }

.dd-inner {
  display: flex; gap: 0;
  padding: 20px 24px;
  min-width: 720px;
}

/* 3 вертикальные колонки */
.dd-col {
  flex: 1;
  display: flex; flex-direction: column;
  padding: 0 20px;
  border-right: 1px solid #F0F4FA;
}
.dd-col:first-child { padding-left: 0; }
.dd-col:last-child  { border-right: none; }

/* Каждая секция внутри колонки (верхняя и нижняя) */
.dd-sec {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #F0F4FA;
}
.dd-sec:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }

.dd-col-hd {
  display: flex !important; align-items: center; justify-content: space-between;
  font-family: var(--fh,'Montserrat',sans-serif);
  font-size: 13px; font-weight: 800;
  color: #111827;
  letter-spacing: 0; text-transform: none;
  margin-bottom: 10px; padding-bottom: 9px;
  border-bottom: 2px solid #E2EAF8;
  text-decoration: none;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  height: auto !important;
}
a.dd-col-hd::after {
  content: '→';
  font-size: 13px; font-weight: 500;
  color: #CBD5E0;
  transition: color .15s, transform .15s;
  margin-left: 6px; flex-shrink: 0;
}
a.dd-col-hd:hover { color: #2563EB; border-bottom-color: #2563EB; }
a.dd-col-hd:hover::after { color: #2563EB; transform: translateX(3px); }

/* ── Сброс page-CSS конфликтов ──────────────────────────────────
   Разные страницы имеют .hdr-nav a с color:white / height:58px и т.п.
   Эти правила бьют по dropdown ссылкам. Перекрываем !important.
   ─────────────────────────────────────────────────────────────── */
.hdr-nav .dropdown {
  background: #fff !important;
}
.hdr-nav .dd-link,
.hdr-nav a.dd-link {
  color: #2D3748 !important;
  background: none !important;
  height: auto !important;
  display: block !important;
  padding: 5px 0 !important;
  border-radius: 0 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
}
.hdr-nav .dd-link:hover,
.hdr-nav a.dd-link:hover {
  color: #2563EB !important;
  background: none !important;
  padding-left: 4px !important;
}
.hdr-nav .dd-col-hd,
.hdr-nav a.dd-col-hd {
  color: #111827 !important;
  background: none !important;
  height: auto !important;
  display: flex !important;
  padding: 0 0 9px !important;
  border-radius: 0 !important;
}
.hdr-nav a.dd-col-hd:hover {
  color: #2563EB !important;
  background: none !important;
}

.dd-link {
  display: block !important;
  font-family: var(--fb,'Inter',sans-serif);
  font-size: 13px; font-weight: 500;
  color: #2D3748;
  text-decoration: none;
  padding: 5px 0;
  line-height: 1.35;
  transition: color .12s, padding-left .12s;
}
.dd-link:hover { color: #2563EB; padding-left: 4px; }
.dd-link strong { font-weight: 700; color: inherit; }

/* ── Правая часть ─────────────────────────────────────────────── */
.hdr-r {
  display: flex; align-items: center; gap: 16px;
  margin-left: auto; flex-shrink: 0;
}
.hdr-contacts { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.hdr-phone {
  font-family: var(--fh,'Montserrat',sans-serif);
  font-size: 14px; font-weight: 700;
  color: #1B3A6B; text-decoration: none;
  transition: color .15s;
}
.hdr-phone:hover { color: #2563EB; }
.hdr-email {
  font-family: var(--fb,'Inter',sans-serif);
  font-size: 11px; font-weight: 400;
  color: #8A94A6; text-decoration: none;
  transition: color .15s;
}
.hdr-email:hover { color: #2563EB; }

.hdr-cta {
  background: #1B3A6B;
  color: #fff;
  font-family: var(--fh,'Montserrat',sans-serif);
  font-size: 12.5px; font-weight: 700;
  padding: 9px 18px;
  border-radius: 8px; border: none;
  cursor: pointer;
  transition: background .15s, transform .1s;
  white-space: nowrap;
  text-decoration: none;
}
.hdr-cta:hover { background: #0F2240; transform: translateY(-1px); }
.hdr-cta:active { transform: translateY(0); }

/* ── Гамбургер (мобильный) ────────────────────────────────────── */
.hdr-burger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  gap: 5px;
  width: 40px; height: 40px;
  border: none; background: none; cursor: pointer;
  padding: 8px; margin-left: 8px; flex-shrink: 0;
}
.hdr-burger span {
  display: block; width: 22px; height: 2px;
  background: #1B3A6B; border-radius: 2px;
  transition: all .2s;
}
.hdr-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hdr-burger.open span:nth-child(2) { opacity: 0; }
.hdr-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Toast "Скоро" ────────────────────────────────────────────── */
.hdr-toast {
  position: fixed;
  top: 72px; left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #1B3A6B;
  color: #fff;
  font-family: var(--fb,'Inter',sans-serif);
  font-size: 14px; font-weight: 500;
  padding: 12px 24px;
  border-radius: 10px;
  box-shadow: 0 4px 24px rgba(27,58,107,.3);
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  text-align: center;
}
.hdr-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Мобильная версия ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .hdr-contacts { display: none; }
  .hdr-cta { display: none; }
}

@media (max-width: 768px) {
  .hdr-in { padding: 0 16px; }
  .logo { margin-right: auto; }
  .hdr-burger { display: flex; }

  .hdr-nav {
    display: none;
    position: fixed;
    top: 60px; left: 0; right: 0; bottom: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    padding: 16px 0 40px;
    z-index: 800;
    border-top: 1px solid #E8EDF3;
  }
  .hdr-nav.open { display: flex; }

  .nav-link {
    height: auto; padding: 14px 20px;
    font-size: 15px;
    border-bottom: 1px solid #F7F9FC;
    justify-content: space-between;
  }
  .nav-link.nav-soon { opacity: .6; }

  .nav-item { position: static; }
  .dropdown {
    position: static;
    box-shadow: none; border: none; border-radius: 0;
    background: #F7F9FC;
    animation: none;
    padding: 0;
  }
  .dd-mega { left: 0; transform: none; }

  .dd-inner {
    flex-direction: column; gap: 0;
    padding: 4px 20px 12px;
    min-width: 0;
  }
  .dd-col {
    border-right: none; border-bottom: 1px solid #F0F4FA;
    padding: 0; max-width: 100%;
  }
  .dd-col:last-child { border-bottom: none; }
  .dd-sec { padding-bottom: 12px; margin-bottom: 12px; }
  .dd-col-hd { margin-bottom: 6px; }

  .hdr-r { display: none; }
}
