/* Header */
.header {
  position: relative;
  z-index: 100;
  background: var(--surface);
  border-bottom: var(--border);
}

.header__mobile { display: none; }

.header__info {
  color: var(--text-muted);
  font-size: 13px;
  background: var(--surface-light);
  border-bottom: var(--border);
}

.header__info-inner,
.header__info-contacts,
.header__socials,
.header__actions,
.header__mobile-inner,
.header__mobile-actions {
  display: flex;
  align-items: center;
}

.header__info-inner {
  min-height: 38px;
  justify-content: space-between;
  gap: 24px;
}

.header-info-nav__list,
.header-nav__list,
.header-nav .sub-menu,
.header-mobile-nav__list,
.header-mobile-nav .sub-menu,
.header-mobile-info {
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-info-nav__list { display: flex; gap: 20px; }
.header-info-nav a,
.header__info-link { color: inherit; text-decoration: none; }
.header-info-nav a:hover,
.header__info-link:hover { color: var(--accent-color); }

.header__info-contacts { gap: 18px; margin-left: auto; }
.header__info-link { --size: 14px; }
.header__socials { gap: 10px; }
.header__social { --size: 16px; color: var(--text-muted); }
.header__social:hover { color: var(--accent-color); }

.header__main { position: relative; }
.header__main-inner {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 3vw, 44px);
}

.header__logo { display: inline-flex; color: var(--text-color); text-decoration: none; }
.header__logo-img { display: block; width: auto; max-width: 190px; height: 38px; object-fit: contain; }
.header__logo-text { font-size: 24px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

.header-nav__list { display: flex; align-items: center; gap: clamp(18px, 2vw, 30px); }
.header-nav__list > li,
.header-nav .sub-menu li { position: relative; }

.header-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-block: 30px;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.header-nav a:hover,
.header-nav .current-menu-item > a,
.header-nav .current-menu-ancestor > a { color: var(--accent-color); }

.header-nav .menu-item-has-children > a::after {
  content: "";
  width: 11px;
  height: 11px;
  background: currentColor;
  -webkit-mask: var(--chevron-down-icon) center / contain no-repeat;
  mask: var(--chevron-down-icon) center / contain no-repeat;
}

.header-nav .sub-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% - 10px);
  left: -14px;
  min-width: 230px;
  padding: 8px;
  visibility: hidden;
  opacity: 0;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--br-l);
  box-shadow: 0 18px 44px rgb(0 0 0 / 10%);
  transform: translateY(6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.header-nav li:hover > .sub-menu,
.header-nav li:focus-within > .sub-menu { visibility: visible; opacity: 1; transform: none; }
.header-nav .sub-menu a { justify-content: space-between; padding: 10px 12px; white-space: normal; border-radius: var(--br-s); }
.header-nav .sub-menu a:hover { background: var(--surface-light); }
.header-nav .sub-menu .menu-item-has-children > a::after { transform: rotate(-90deg); }
.header-nav .sub-menu .sub-menu { top: -9px; left: calc(100% + 8px); }

.header__actions { justify-content: flex-end; gap: 10px; }
.header__search-btn { --size: 20px; width: 42px; height: 42px; justify-content: center; border: var(--border); border-radius: var(--br-round); }
.header__actions .burger-menu-trigger { display: none; }

.header-search {
  position: absolute;
  z-index: 30;
  top: 100%;
  right: 0;
  left: 0;
  visibility: hidden;
  opacity: 0;
  background: var(--surface);
  border-block: var(--border);
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.header-search.is-open { visibility: visible; opacity: 1; transform: none; }
.header-search__inner { min-height: 84px; display: flex; align-items: center; gap: 12px; }
.search-form { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.search-form__input { width: 100%; min-height: 48px; padding: 10px 16px; font: inherit; border: var(--input-border); border-radius: var(--input-br); outline: none; }
.search-form__input:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-light-color); }
.search-form__submit { --size: 20px; width: 48px; min-width: 48px; }
.header-search__close { --size: 18px; width: 42px; height: 42px; justify-content: center; }
.header-search--mobile { display: none; }

.header-mobile-nav__list > li { position: relative; border-bottom: var(--border); }
.header-mobile-nav__list > li > a { min-height: 52px; display: flex; align-items: center; padding: 12px 46px 12px 0; color: var(--text-color); font-weight: 600; text-decoration: none; }
.header-mobile-nav .sub-menu { display: none; padding: 0 0 12px 16px; }
.header-mobile-nav .is-open > .sub-menu { display: block; }
.header-mobile-nav .sub-menu a { display: block; padding: 8px 10px; color: var(--text-muted); text-decoration: none; }
.header-mobile-nav__toggle { --size: 16px; position: absolute; top: 7px; right: 0; width: 38px; height: 38px; justify-content: center; background: transparent; border: 0; cursor: pointer; }
.header-mobile-nav__toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
.header-mobile-info { display: grid; gap: 8px; }
.header-mobile-info a { color: var(--text-muted); text-decoration: none; }

@media (max-width: 1180px) {
  .header-nav__list { gap: 16px; }
  .header-nav a { font-size: 13px; }
  .header__callback { display: none; }
}

@media (max-width: 1024px) {
  .header__desktop { display: none; }
  .header__mobile { display: block; }
  .header__mobile-inner { min-height: 66px; justify-content: space-between; gap: 16px; }
  .header__mobile-actions { gap: 8px; }
  .header__logo-img { max-width: 145px; height: 34px; }
  .header-search--mobile { display: block; position: fixed; top: 66px; }
}

@media (min-width: 1025px) {
  #main-menu,
  [data-js-modal-backdrop="main-menu"] { display: none; }
}

/* Library burger-menu integration */
.burger-menu--below-header {
  top: calc(var(--burger-menu-offset-top, 0px) + var(--modal-mob-offset, 8px));
}

.burger-menu__backdrop {
  top: var(--burger-menu-offset-top, 0px);
}
