.child-header-height {
  min-height: 58px;
}

html.theme-scroll-lock,
body.theme-scroll-lock {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.child-header {
  position: relative;
  z-index: 20;
  width: 100%;
  background: var(--surface-surface);
}

.child-header__container {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 12px 60px;
  display: flex;
  justify-content: space-between;
}

.child-header.fixed {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.child-header.fixed.is-entering-fixed {
  animation: child-header-slide-down 0.35s ease both;
}

.admin-bar .child-header.fixed {
  top: 32px;
}

@keyframes child-header-slide-down {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.child-header__logo img {
  width: auto;
  height: 34px;
  object-fit: contain;
}

.child-header__burger {
  display: none;
}

.child-header__content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.child-header__divider {
  width: 1px;
  height: 24px;
  background: var(--divider);
  border: none;
}

.child-header__nav-list {
  display: flex;
  align-items: center;
  gap: 12px;
}

.child-header__nav-list .menu-item {
  position: relative;
  padding: 8px 12px;
  font: var(--text-b2-r);
  color: var(--text-primary);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.child-header__nav-list .menu-item a {
  color: var(--text-primary);
}

.child-header__nav-list .menu-item:hover,
.child-header__nav-list .menu-item:focus {
  background: rgba(255, 255, 255, 0.04);
}

.child-header__nav-list .sub-menu {
  position: absolute;
  top: calc(100% + 16px);
  left: 0;
  z-index: 100;
  min-width: 304px;
  max-height: 280px;
  overflow-y: scroll;
  scrollbar-color: var(--surface-elements) var(--surface-raised);
  scrollbar-width: thin;
  scrollbar-gutter: stable;
  background: var(--surface-surface);
  padding: 12px;
  flex-direction: column;
  border-radius: 12px;
  opacity: 0;
  user-select: none;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.child-header__nav-list .sub-menu::-webkit-scrollbar {
  width: 6px;
}

.child-header__nav-list .sub-menu::-webkit-scrollbar-track {
  background: var(--surface-raised);
  border-radius: 100px;
}

.child-header__nav-list .sub-menu::-webkit-scrollbar-thumb {
  min-height: 64px;
  background: var(--surface-elements);
  border-radius: 100px;
}

.child-header__nav-list .sub-menu::-webkit-scrollbar-thumb:hover {
  background: var(--border-secondary);
}

.child-header__nav-list > .menu-item-has-children::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 16px;
  display: none;
}

.child-header__nav-list .menu-item-has-children > a {
  display: flex;
  align-items: center;
  gap: 4px;
}

.child-header__nav-list .menu-item-has-children > a::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background: currentColor;
  mask: url("../../icons/chevron-down-mini.svg") center / contain no-repeat;
  transform: rotate(0deg);
  transition: transform 0.35s ease;
}

.child-header__submenu-toggle {
  display: none;
}

.child-header__nav-list .menu-item-has-children:hover > a::after,
.child-header__nav-list .menu-item-has-children.is-open > a::after {
  transform: rotate(180deg);
}

.child-header__nav-list .menu-item:hover > .sub-menu,
.child-header__nav-list .menu-item-has-children.is-open > .sub-menu {
  opacity: 1;
  display: flex;
  pointer-events: auto;
}

.child-header__nav-list > .menu-item-has-children:hover::before,
.child-header__nav-list > .menu-item-has-children.is-open::before {
  display: block;
}

.child-header .pll-parent-menu-item {
  display: none;
}

.child-header__lang-switch {
  position: relative;
}

.child-header__lang {
  position: relative;
  color: var(--text-primary);
  font: var(--text-b2-r);
}

.child-header__lang::before {
  content: "";
  position: absolute;
  top: 100%;
  right: 0;
  width: 100%;
  height: 16px;
  display: none;
}

.child-header__lang-current,
.child-header__lang-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  border-radius: 8px;
}

.child-header__lang-current {
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.child-header__lang-label {
  display: none;
}

.child-header__lang--has-dropdown .child-header__lang-current::after {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  background: currentColor;
  mask: url("../../icons/chevron-down-mini.svg") center / contain no-repeat;
  transform: rotate(0deg);
  transition: transform 0.35s ease;
}

.child-header__lang--has-dropdown:hover .child-header__lang-current::after {
  transform: rotate(180deg);
}

.child-header__lang-list {
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  z-index: 100;
  min-width: 112px;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  background: var(--surface-surface);
  border-radius: 12px;
  opacity: 0;
  user-select: none;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.child-header__lang:hover::before {
  display: block;
}

.child-header__lang:hover .child-header__lang-list {
  opacity: 1;
  pointer-events: auto;
}

.child-header__lang-link {
  padding: 8px 12px;
  white-space: nowrap;
  transition: background 0.3s ease;
}

.child-header__lang-link:hover,
.child-header__lang-link:focus {
  background: rgba(255, 255, 255, 0.04);
}

.child-header__lang-item--active .child-header__lang-link {
  color: var(--text-primary);
}

.child-header__lang-flag {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border-radius: 2px;
}

.child-header__lang-flag img {
  display: block;
  width: 16px !important;
  height: 12px !important;
  object-fit: contain;
}

@media (max-width: 1360px) {
  .child-header__container {
    padding: 12px 24px;
  }

  .child-header__nav-list {
    gap: 6px;
  }
}

@media (max-width: 960px) {
  .child-header {
    background: var(--surface-page);
    border-bottom: 1px solid var(--divider);
  }

  .child-header__container {
    align-items: center;
    padding: 12px 16px;
  }

  .child-header-height {
    min-height: 53px;
  }

  .child-header__logo img {
    height: 26px;
  }

  .child-header__burger {
    display: flex;
    width: 24px;
    height: 24px;
    padding: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-primary);
    background: transparent;
    border: 0;
    cursor: pointer;
  }

  .child-header__burger-line {
    width: 18px;
    height: 2px;
    display: block;
    background: currentColor;
    border-radius: 100px;
    transition:
      transform 0.3s ease,
      opacity 0.3s ease;
  }

  .child-header.is-menu-open .child-header__burger-line:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
  }

  .child-header.is-menu-open .child-header__burger-line:nth-child(2) {
    opacity: 0;
  }

  .child-header.is-menu-open .child-header__burger-line:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
  }

  .child-header__content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 999;
    max-height: calc(100vh - 53px);
    height: calc(100dvh - 53px);
    padding: 0 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow-y: auto;
    background: var(--surface-page);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition:
      opacity 0.25s ease,
      transform 0.25s ease;
  }

  .child-header.is-menu-open .child-header__content {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .child-header__divider {
    display: none;
  }

  .child-header__lang-switch {
    order: -1;
    padding: 12px 0 8px;
    border-bottom: 1px solid var(--divider);
  }

  .child-header__lang {
    display: block;
  }

  .child-header__lang::before {
    display: none;
  }

  .child-header__lang-current {
    min-height: 52px;
    padding: 0 20px;
    justify-content: flex-start;
    gap: 12px;
    background: transparent;
    border-radius: 0;
  }

  .child-header__lang-label {
    display: block;
    margin-right: auto;
    color: var(--text-primary);
    font: var(--text-b2-r);
  }

  .child-header__lang-current .child-header__lang-flag {
    order: 2;
  }

  .child-header__lang-current .child-header__lang-code {
    order: 3;
  }

  .child-header__lang-current::after {
    order: 4;
  }

  .child-header__lang--has-dropdown:hover .child-header__lang-current::after {
    transform: rotate(0deg);
  }

  .child-header__lang-list {
    position: static;
    max-height: 0;
    min-width: 0;
    margin: 0;
    padding: 0 24px;
    overflow: hidden;
    background: var(--surface-surface);
    border-radius: 0 0 8px 8px;
    opacity: 1;
    pointer-events: auto;
    transition:
      max-height 0.3s ease,
      padding 0.3s ease;
  }

  .child-header__lang.is-open .child-header__lang-current {
    padding: 0 20px;
    background: var(--surface-raised);
    border-radius: 8px 8px 0 0;
  }

  .child-header__lang.is-open
    .child-header__lang-current
    .child-header__lang-flag,
  .child-header__lang.is-open
    .child-header__lang-current
    .child-header__lang-code {
    display: none;
  }

  .child-header__lang.is-open .child-header__lang-current::after {
    transform: rotate(180deg);
  }

  .child-header__lang.is-open .child-header__lang-list {
    max-height: 320px;
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .child-header__lang-item {
    margin: 0;
  }

  .child-header__lang-link {
    min-height: 44px;
    padding: 0;
    justify-content: space-between;
    flex-direction: row-reverse;
    color: var(--text-secondary);
    border-radius: 0;
  }

  .child-header__lang-link:hover,
  .child-header__lang-link:focus {
    background: transparent;
    color: var(--text-primary);
  }

  .child-header__nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .child-header__nav-list .menu-item {
    padding: 0;
    border-radius: 0;
  }

  .child-header__nav-list .menu-item:hover,
  .child-header__nav-list .menu-item:focus {
    background: transparent;
  }

  .child-header__nav-list .menu-item > a {
    min-height: 52px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 8px;
    color: var(--text-primary);
  }

  .child-header__nav-list .menu-item-has-children.is-open > a {
    background: var(--surface-raised);
    position: relative;
    z-index: 1;
  }

  .child-header__nav-list .menu-item-has-children > a::after {
    margin-left: auto;
  }

  .child-header__nav-list .menu-item-has-children.is-open > a::after {
    transform: rotate(180deg);
  }

  .child-header__nav-list .sub-menu {
    position: static;
    min-width: 0;
    max-height: 0;
    margin: 0;
    padding: 0 20px;
    display: flex;
    overflow: hidden;
    background: var(--surface-surface);
    border-radius: 0 0 8px 8px;
    opacity: 1;
    pointer-events: auto;
    transition:
      max-height 0.3s ease,
      padding 0.3s ease;
  }

  .child-header__nav-list .menu-item:hover > .sub-menu,
  .child-header__nav-list .menu-item:focus-within > .sub-menu {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
  }

  .child-header__nav-list .menu-item-has-children.is-open > .sub-menu {
    max-height: 420px;
    padding-top: 8px;
    padding-bottom: 8px;
    margin-top: -5px;
  }

  .child-header__nav-list .sub-menu .menu-item > a {
    min-height: 44px;
    padding: 0;
    color: var(--text-secondary);
  }
}
