/* ==========================================================================
   proit365.ru — премиальная шапка (только дочерняя тема)
   ========================================================================== */

:root {
  --header-bg: #101827;
  --header-secondary: #172438;
  --header-text: #FFFFFF;
  --header-muted: #A8B5C8;
  --header-accent: #0F6FD0;
  --header-border: #26354A;
}

/* ---------- основа ---------- */
#masthead.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg) !important;
  border-bottom: 1px solid var(--header-border);
  transition: background-color .25s ease, box-shadow .25s ease;
}
#masthead.pr-header-stuck {
  background: var(--header-secondary) !important;
  box-shadow: 0 10px 30px rgba(2, 6, 23, .35);
}
#masthead .ast-primary-header-bar,
#masthead .main-header-bar {
  background: transparent !important;
  border: 0;
  padding: 0;
}
#masthead .site-primary-header-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
#masthead .ast-builder-grid-row {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 80px;
  flex-wrap: nowrap;
}

/* ---------- логотип: один образ + подпись ---------- */
/* Astra задаёт padding 17px — на десктопе это раздувает строку до 89px. */
@media (min-width: 922px) {
  #masthead [data-section="title_tagline"] .site-branding {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }
}
#masthead .ast-site-title-wrap { display: none !important; }
#masthead [data-section="title_tagline"],
#masthead .site-branding {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}
#masthead .site-logo-img { padding-right: 0 !important; }
#masthead .custom-logo {
  display: block;
  width: 200px;
  max-width: none;
  height: auto;
  max-height: none;
  object-fit: contain;
}
#masthead .custom-logo-link { display: block; }
#masthead .site-logo-img { max-width: none; }
.pr-header-tagline {
  display: block;
  margin-top: 3px;
  color: var(--header-muted);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .06em;
  line-height: 1.25;
  white-space: nowrap;
}

/* ---------- меню ---------- */
#masthead .site-header-primary-section-right {
  position: static;
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  min-width: 0;
}
#masthead #ast-hf-menu-1 {
  position: static;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 26px;
  width: 100%;
  margin: 0;
  padding: 0 180px 0 0;
  list-style: none;
}
#masthead .main-header-menu .menu-link {
  color: var(--header-text);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.2;
  padding: 8px 0;
  background: transparent;
  white-space: nowrap;
  transition: color .2s ease;
}
#masthead .main-header-menu > .menu-item > .menu-link:hover,
#masthead .main-header-menu > .menu-item.current-menu-item > .menu-link,
#masthead .main-header-menu > .menu-item.current-menu-ancestor > .menu-link {
  color: #FFFFFF;
}
#masthead .main-header-menu > .menu-item.current-menu-item > .menu-link {
  box-shadow: inset 0 -2px 0 var(--header-accent);
}

/* ---------- CTA ---------- */
#masthead #ast-hf-menu-1 > li.pr-nav-cta {
  position: absolute;
  right: 0;
  top: 50%;
  margin: 0;
  transform: translateY(-50%);
}
#masthead li.pr-nav-cta > .menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 22px !important;
  margin: 0 !important;
  border-radius: 8px;
  background: var(--header-accent);
  color: #FFFFFF !important;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(22, 133, 237, .28);
  transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
#masthead li.pr-nav-cta > .menu-link::after { content: " \2192"; }
#masthead li.pr-nav-cta > .menu-link:hover {
  background: #0F6FD0;
  color: #FFFFFF !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(22, 133, 237, .38);
}

/* ---------- вторая строка (десктоп) ---------- */
.pr-header-strip {
  display: none;
  align-items: center;
  height: 34px;
  background: var(--header-secondary);
  border-top: 1px solid var(--header-border);
  overflow: hidden;
}
.pr-header-strip__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--header-muted);
  line-height: 1;
}
.pr-header-strip__dot { color: #5B6E88; }
@media (min-width: 1025px) {
  .pr-header-strip { display: flex; }
}

/* ---------- доступность ---------- */
#masthead a:focus-visible,
#masthead button:focus-visible {
  outline: 2px solid #7CC4FF;
  outline-offset: 3px;
  border-radius: 4px;
}
body { overflow-x: clip; }

/* ---------- планшет ---------- */
@media (min-width: 922px) and (max-width: 1200px) {
  #masthead .site-primary-header-wrap { padding-left: 18px; padding-right: 18px; }
  #masthead #ast-hf-menu-1 { gap: 16px; padding-right: 158px; }
  #masthead .custom-logo { width: 170px; }
  #masthead .main-header-menu .menu-link { font-size: 14.5px; }
  #masthead li.pr-nav-cta > .menu-link { padding: 0 16px !important; font-size: 14.5px; }
}

/* ---------- мобильная шапка ---------- */
@media (max-width: 921px) {
  #masthead.site-header { position: sticky; }
  #masthead .ast-builder-grid-row { min-height: 68px; }
  #masthead .site-primary-header-wrap { padding-left: 16px; padding-right: 16px; }
  #masthead .custom-logo { width: 140px; }
  .pr-header-tagline { font-size: 10.5px; margin-top: 2px; }

  #masthead .ast-mobile-header-wrap .site-header-primary-section-right {
    position: static;
    flex: 0 0 auto;
  }
  #masthead .menu-toggle.main-header-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--header-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    color: #FFFFFF !important;
    transition: background-color .2s ease;
  }
  #masthead .menu-toggle.main-header-menu-toggle:hover { background: rgba(255, 255, 255, .14); }
  #masthead .main-header-menu-toggle .mobile-menu-toggle-icon span { background-color: #FFFFFF !important; }

  #masthead .ast-mobile-header-content {
    background: var(--header-bg);
    border-top: 1px solid var(--header-border);
  }
  #masthead .ast-mobile-header-content .main-header-menu .menu-link {
    color: #E6EDF7;
    font-size: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
  }
  #masthead .ast-mobile-header-content .main-header-menu > .menu-item.current-menu-item > .menu-link {
    color: #FFFFFF;
    box-shadow: inset 3px 0 0 var(--header-accent);
  }
  #masthead .ast-mobile-header-content li.pr-nav-cta > .menu-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: calc(100% - 40px) !important;
    height: 44px;
    margin: 14px 20px 20px !important;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 0 !important;
    border-radius: 8px;
    background: var(--header-accent);
    color: #FFFFFF !important;
    font-size: 15px;
    font-weight: 600;
    box-shadow: none;
    transform: none !important;
  }
}

@media (max-width: 480px) {
  #masthead .site-primary-header-wrap { padding-left: 14px; padding-right: 14px; }
  #masthead .custom-logo { width: 125px; }
  .pr-header-tagline { font-size: 10px; }
}

/* ---------- уважение prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  #masthead,
  #masthead *,
  #masthead *::before,
  #masthead *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
