/* ---------- HEADER STYLES ---------- */
.header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f99d;
  z-index: 3;
  background-color: #fff;
  transition: background-color 0.3s;

  @media (width <= 992px) {
    z-index: 6;
    &::before {
      content: "";
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
      background: rgba(255, 255, 255, 0.8);
      backdrop-filter: blur(10px);
      z-index: 6;
      pointer-events: none;
    }
  }
}
.header--transparent {
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
}
.header__container {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
/* ---------- HEADER ---------- LOGO */
.header__logo {
  width: 112px;
  height: 40px;
  transition: transform 0.3s ease;
  z-index: 6;
  &:hover {
    transform: scale(1.2);
  }
}
/* ---------- HEADER ---------- NAVIGATION */
.header__nav {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 35px;
  min-height: 0;
  @media (width <= 992px) {
    display: block;
    position: fixed;
    top: 0;
    left: 100%;
    width: 100vw;
    height: 100vh;
    padding: 80px 0 100px 0; /* Верхний отступ под шапку */
    transition: all 0.3s ease;
    overflow-y: auto;
    background: #fff;
    z-index: 5;
    &.active {
      left: 0;
    }
  }
}
.menu__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 40px;
  @media (width <= 992px) {
    flex-direction: column;
    gap: 20px;
    width: 100%;
  }
}
.menu__item {
  position: relative;
}
.menu__link {
  position: relative;
  transition: color 0.3s ease;
  &::before {
    content: "";
    width: 0;
    height: 2px;
    position: absolute;
    bottom: 0;
    left: 0;
    transition: width 0.2s ease;
    background-color: #2563eb;
  }
  &:not(.active-menu-link):hover {
    color: #2563eb;
    &::before {
      width: 100%;
    }
    & svg {
      transform: rotate(180deg);
    }
  }
  &:has(span) {
    display: flex;
    align-items: center;
    & svg {
      width: 24px;
      height: 24px;
      fill: currentColor;
      transition: all 0.3s ease;
    }
  }
}

/* ---------- HEADER ---------- DROPDOWN-MENU */
.menu__item--dropdown {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  &:hover .dropdown-menu {
    margin-top: 0;
    opacity: 1;
    visibility: visible;
  }
  &.open .dropdown-menu {
    max-height: 500px;
    opacity: 1;
    visibility: visible;
    padding: 12px 0;
  }
}

.dropdown-menu {
  min-width: 224px;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  padding: 12px 0;
  opacity: 0;
  text-align: center;
  visibility: hidden;
  transition: all 0.3s ease;
  background-color: #fff;
  @media (width <= 992px) {
    position: static;
    transform: none;
    margin-top: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }
}
.dropdown-menu__item {
  padding: 8px 20px;
}
.dropdown-menu__link {
  transition: all 0.3s ease;
  color: #666;
  &:hover {
    color: #2563eb;
    & svg {
      transform: rotate(180deg);
    }
  }
  &:has(span) {
    display: flex;
    align-items: center;
    & svg {
      width: 24px;
      height: 24px;
      fill: currentColor;
      transition: all 0.3s ease;
    }
  }
}
/* ---------- HEADER ---------- LANGUAGE SWITCHER */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 4px;
  @media (width <= 992px) {
    max-width: fit-content;
    margin: 0 auto;
    margin-bottom: 20px;
  }
}
.lang-switcher__item {
  color: #666;
  border-radius: 4px;
}
.lang-switcher__item--active {
  background-color: #fff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.lang-switcher__link {
  font-size: 14px;
  display: inline-block;
  padding: 6px 12px;
  transition: all 0.2s ease;
  &:hover {
    color: #2563eb;
  }
}
/* ---------- HEADER ---------- BURGER MENU */
.header-burger {
  display: none;
  width: 28px;
  height: 20px;
  position: relative;
  z-index: 6;
  @media (width <= 992px) {
    display: block;
  }
  & span,
  &::before,
  &::after {
    content: "";
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: #2563eb;
    transition: all 0.3s ease;
  }
  & span {
    top: 50%;
    transform: translateY(-50%);
  }
  &::before {
    top: 0;
  }
  &::after {
    bottom: 0;
  }
  &.active {
    & span {
      left: 100%;
      transform: scale(0);
    }
    &::before {
      top: 50%;
      transform: translateY(-50%) rotate(45deg);
    }
    &::after {
      bottom: 50%;
      transform: translateY(50%) rotate(-45deg);
    }
  }
}
