.header-menu-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-menu .header-logo {
  min-width: 0;
  flex: 1 1 auto;
}

.lang-switcher {
  position: relative;
  z-index: 1001;
  flex-shrink: 0;
}

.lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #1c1c1c;
  border-radius: 30px;
  background: #fff;
  color: #1c1c1c;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lang-switcher__btn:hover,
.lang-switcher__btn[aria-expanded="true"] {
  color: #fff;
  border-color: transparent;
  background-image: linear-gradient(#726cf9 27%, #c57cff);
}

.lang-switcher__chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.lang-switcher__btn[aria-expanded="true"] .lang-switcher__chevron {
  transform: rotate(180deg);
}

.lang-switcher__list,
header .lang-switcher__list {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  left: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  width: max-content;
  min-width: 10.5rem;
  max-width: min(16rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 22rem);
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  border: 1px solid rgba(28, 28, 28, 0.12);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 28, 28, 0.12);
}

.lang-switcher__list[hidden],
header .lang-switcher__list[hidden] {
  display: none !important;
}

.lang-switcher__list li,
header .lang-switcher__list li {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  line-height: normal;
  list-style: none;
}

.lang-switcher__link,
header .lang-switcher__list a {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: #1c1c1c;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  text-align: left;
  text-transform: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-switcher__link:hover,
header .lang-switcher__list a:hover {
  background: rgba(114, 108, 249, 0.12);
  color: #1c1c1c;
}

.lang-switcher__item--active,
header .lang-switcher__list a.lang-switcher__item--active {
  background-image: linear-gradient(#726cf9 27%, #c57cff);
  color: #fff;
  font-weight: 600;
  pointer-events: none;
}

.lang-switcher--mobile {
  display: none;
  width: 100%;
  margin: 0 0 12px;
}

.lang-switcher--mobile .lang-switcher__btn {
  width: 100%;
  justify-content: space-between;
}

.lang-switcher--mobile .lang-switcher__list,
header .lang-switcher--mobile .lang-switcher__list {
  position: static;
  margin-top: 0.5rem;
  max-width: none;
  width: 100%;
  box-shadow: none;
}

@media screen and (max-width: 991px) {
  .header-menu-right {
    gap: 8px;
  }

  .header-menu {
    flex-wrap: nowrap;
  }

  .header-menu .logo-desktop {
    max-height: 36px;
    width: auto;
  }

  .lang-switcher__btn {
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
  }

  .lang-switcher--header .lang-switcher__current {
    max-width: 7.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lang-switcher--mobile {
    display: block;
  }

  .header-menu .brand-name {
    font-size: 18px;
  }
}

@media screen and (min-width: 992px) {
  .lang-switcher--mobile {
    display: none !important;
  }
}

@media screen and (max-width: 479px) {
  .header-menu .brand-name {
    font-size: 15px;
  }

  .lang-switcher--header .lang-switcher__btn {
    padding: 0 8px;
  }
}
