/* EN / DE language switcher */
.header__top-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  flex: 1 1 auto;
  min-width: 0;
}

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

.lang-switcher__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--header-br, rgba(255, 255, 255, 0.28));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lang-switcher__toggle:hover,
.lang-switcher.is-open .lang-switcher__toggle {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.45);
}

.header-2 .lang-switcher__toggle {
  border-color: rgba(0, 0, 0, 0.14);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text-dark, #151515);
}

.header-2 .lang-switcher__toggle:hover,
.header-2 .lang-switcher.is-open .lang-switcher__toggle {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.22);
}

.lang-switcher__flag {
  display: block;
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.lang-switcher__current {
  letter-spacing: 0.04em;
}

.lang-switcher__chev {
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.lang-switcher.is-open .lang-switcher__chev {
  transform: rotate(180deg);
}

.lang-switcher__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.lang-switcher.is-open .lang-switcher__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-switcher__option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #151515;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

a.lang-switcher__option:hover {
  color: #151515;
  text-decoration: none;
}

.lang-switcher__option:hover,
.lang-switcher__option.is-active {
  background: rgba(0, 0, 0, 0.05);
}

.lang-switcher__option.is-active {
  font-weight: 600;
}

.lang-switcher__option-label {
  flex: 1 1 auto;
}

.lang-switcher__option-code {
  opacity: 0.55;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* Mobile drawer */
.mobile-nav__lang {
  padding: 0 0 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-nav__lang .lang-switcher {
  width: 100%;
}

.mobile-nav__lang .lang-switcher__toggle {
  width: 100%;
  justify-content: flex-start;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.mobile-nav__lang .lang-switcher__menu {
  position: static;
  opacity: 1;
  visibility: visible;
  transform: none;
  display: none;
  margin-top: 8px;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.mobile-nav__lang .lang-switcher.is-open .lang-switcher__menu {
  display: block;
}

.mobile-nav__lang .lang-switcher__option {
  color: #fff;
}

.mobile-nav__lang .lang-switcher__option:hover,
.mobile-nav__lang .lang-switcher__option.is-active {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 1100px) {
  .header__top .lang-switcher:not(.lang-switcher--mobile) {
    display: none;
  }
}

@media (min-width: 1101px) {
  .header__row .lang-switcher--mobile {
    display: none;
  }
}

@media (max-width: 1100px) {
  .header__row {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .header__row .lang-switcher--mobile {
    display: block;
    margin-right: 0;
  }

  /* Match hamburger button size (40×38) */
  .header__row .lang-switcher--mobile .lang-switcher__toggle {
    box-sizing: border-box;
    width: 40px;
    height: 38px;
    min-width: 40px;
    min-height: 38px;
    padding: 0;
    justify-content: center;
    gap: 0;
    border-radius: 6px;
    border: 1px solid var(--link-color, #e02424);
    background: transparent;
    color: var(--text-color, #151515);
  }

  .header__row .lang-switcher--mobile .lang-switcher__toggle:hover,
  .header__row .lang-switcher--mobile.is-open .lang-switcher__toggle {
    background: rgba(224, 36, 36, 0.06);
    border-color: var(--link-color, #e02424);
  }

  .header__row .lang-switcher--mobile .lang-switcher__flag {
    width: 20px;
    height: 14px;
  }

  .header__row .lang-switcher--mobile .lang-switcher__current,
  .header__row .lang-switcher--mobile .lang-switcher__chev {
    display: none;
  }
}

@media (max-width: 768px) {
  .header__row .lang-switcher--mobile .lang-switcher__toggle,
  .mobile-nav-btn {
    width: 40px;
    height: 38px;
  }
}
