/* header-polish.css — доводка шапки APUS.
   Что чинит по сравнению со стоковым Kadence:
     1. ссылки меню получают подчёркивание, растущее из центра;
     2. CTA «Get a quote» из блёклого прямоугольника становится фирменной пилюлей со стрелкой;
     3. LinkedIn вынимается из серого квадрата — остаётся только глиф;
     4. между навигацией и блоком действий появляется волосяной разделитель;
     5. у переключателя языков рядом с глобусом виден код текущего языка;
     6. залипшая шапка перестаёт быть плоской серой (#606060) — тёмное стекло с размытием.
   Палитра: оранжевый #FF6005, «чернила» #37000A. */

:root {
  --apus-h-orange: #ff6005;
  --apus-h-orange-2: #ff8a3d;
}

/* ─────────── 1. Ссылки меню ─────────── */
@media (min-width: 1025px) {
  #primary-menu > li.menu-item > a {
    position: relative;
    letter-spacing: .005em;
    transition: color .18s ease;
  }
  /* подчёркивание привязано к тексту (top: 50% + ~строка), а не к низу шапки,
     поэтому не зависит от высоты строки меню */
  #primary-menu > li.menu-item > a::after {
    content: "";
    position: absolute;
    left: 13px;
    right: 13px;
    top: calc(50% + .72em);
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--apus-h-orange), var(--apus-h-orange-2));
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
    pointer-events: none;
  }
  #primary-menu > li.menu-item:hover > a::after,
  #primary-menu > li.menu-item:focus-within > a::after,
  #primary-menu > li.current-menu-item > a::after,
  #primary-menu > li.current-menu-ancestor > a::after,
  #primary-menu > li.menu-item > a.is-current::after,
  #primary-menu > li.is-current-parent > a::after {
    transform: scaleX(1);
  }
  /* текущая страница читается и без наведения — подчёркивание приглушённое,
     у ховера оно на полной яркости */
  #primary-menu > li.menu-item > a.is-current::after,
  #primary-menu > li.is-current-parent > a::after { opacity: .75; }
  #primary-menu > li.menu-item:hover > a::after { opacity: 1; }
  /* у глобуса-переключателя подчёркивание ни к чему */
  #primary-menu > li.apus-lang-switch > a::after { display: none; }

  /* чуть плотнее трекинг у «Services», чтобы каретка не отрывалась */
  .apus-mega > a > span:first-child { letter-spacing: .005em; }

  /* активная услуга внутри выпадашки */
  .apus-mega > .sub-menu a.is-current { background: #fff0e6; }
  .apus-mega > .sub-menu a.is-current::before { transform: scaleY(1); }
  .apus-mega > .sub-menu a.is-current .apus-mi-title { color: var(--apus-h-orange); }
}

/* ─────────── 2. CTA-кнопка ─────────── */
#masthead .header-button-inner-wrap { display: inline-flex; }

#masthead .header-button {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 12px 24px !important;
  background: linear-gradient(135deg, var(--apus-h-orange), var(--apus-h-orange-2)) !important;
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  letter-spacing: .05em;
  line-height: 1.1;
  box-shadow: 0 10px 24px -10px rgba(255, 96, 5, .75),
              inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
#masthead .header-button::after {
  content: "";
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .18s ease;
}
#masthead .header-button:hover,
#masthead .header-button:focus-visible {
  color: #fff !important;
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -10px rgba(255, 96, 5, .85),
              inset 0 1px 0 rgba(255, 255, 255, .34);
  filter: saturate(1.06);
}
#masthead .header-button:hover::after { transform: translateX(3px); }
#masthead .header-button:active { transform: translateY(0); }

/* ─────────── 3. Соцсети: глиф без коробки ─────────── */
/* Kadence красит обёртку соцкнопок в тёмный palette3, поэтому `inherit` даёт
   невидимый глиф на тёмной шапке — задаём белый явно, как у текста меню.
   Иконка контурная (в пару к глобусу переключателя языков), поэтому именно
   stroke, а не fill: заливка превратила бы её обратно в сплошной квадрат. */
#masthead .header-social-wrap .social-button,
#masthead .header-social-wrap .social-button svg {
  color: #fff !important;
}
#masthead .header-social-wrap .social-button svg,
#masthead .header-social-wrap .social-button svg * {
  fill: none !important;
  stroke: currentColor !important;
  vector-effect: non-scaling-stroke;
}
#masthead .header-social-wrap .social-button {
  width: 38px;
  height: 38px;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: .6;
  transition: opacity .18s ease, background .18s ease, transform .18s ease;
}
#masthead .header-social-wrap .social-button:hover,
#masthead .header-social-wrap .social-button:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, .13) !important;
  transform: translateY(-1px);
}
#masthead .header-social-wrap .social-button svg { width: 19px; height: 19px; }

/* ─────────── 4. Разделитель перед блоком действий ─────────── */
@media (min-width: 1025px) {
  #masthead .site-header-main-section-right .site-header-item[data-section="kadence_customizer_header_social"] {
    position: relative;
    margin-left: 4px;
    padding-left: 15px;
  }
  /* currentColor здесь тёмный (Kadence красит обёртку в palette3) — задаём белый явно */
  #masthead .site-header-main-section-right .site-header-item[data-section="kadence_customizer_header_social"]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 20px;
    background: #fff;
    opacity: .18;
  }
  #masthead .site-header-item[data-section="kadence_customizer_header_button"] { margin-left: 6px; }
}

/* ─────────── 5. Переключатель языков ─────────── */
.apus-lang-switch > a {
  border-radius: 999px;
  padding: 8px 13px !important;
  transition: background .18s ease;
}
.apus-lang-switch:hover > a,
.apus-lang-switch:focus-within > a { background: rgba(255, 255, 255, .11); }

.apus-lang-current {
  display: inline-block;
  margin-left: 7px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .09em;
  line-height: 1;
  opacity: .82;
}
.apus-lang-switch:hover .apus-lang-current { opacity: 1; }

/* ─────────── 6. Залипшая шапка: тёмное стекло вместо плоского серого ─────────── */
#masthead .kadence-sticky-header.item-is-fixed:not(.item-at-start):not(.site-header-row-container):not(.site-main-header-wrap),
#masthead .kadence-sticky-header.item-is-fixed:not(.item-at-start) > .site-header-row-container-inner,
#masthead .kadence-sticky-header.item-is-fixed:not(.item-at-start):not(.item-hidden-above):not(.site-header-row-container):not(.site-main-header-wrap),
#masthead .kadence-sticky-header.item-is-fixed:not(.item-at-start):not(.item-hidden-above) > .site-header-row-container-inner {
  background: rgba(30, 4, 9, .84) !important;
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
          backdrop-filter: saturate(1.5) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 14px 34px -22px rgba(0, 0, 0, .9);
}
/* у браузеров без backdrop-filter фон должен быть плотнее, иначе текст поплывёт */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #masthead .kadence-sticky-header.item-is-fixed:not(.item-at-start) > .site-header-row-container-inner {
    background: #1e0409 !important;
  }
}

/* ─────────── 7. Мобильная шапка ─────────── */
@media (max-width: 1024px) {
  #mobile-toggle {
    border-radius: 12px;
    padding: 7px 8px;
    transition: background .18s ease;
  }
  #mobile-toggle:hover,
  #mobile-toggle:focus-visible { background: rgba(255, 255, 255, .13); }

  #masthead .header-button { padding: 11px 20px !important; font-size: 13px !important; }
}

/* ─────────── 8. Доступность ─────────── */
#masthead a:focus-visible,
#masthead button:focus-visible {
  outline: 2px solid var(--apus-h-orange);
  outline-offset: 3px;
  border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  #primary-menu > li.menu-item > a::after,
  #masthead .header-button,
  #masthead .header-button::after,
  #masthead .header-social-wrap .social-button { transition: none; }
}
