/* Переключатель языка: стили как в landing.css для страниц без landing.css */

.header .container {
  max-width: 1776px;
}

/* Header Language Switch */
.header-language-switch {
  position: relative;
  flex-shrink: 0;
}

.header-language-switch__summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
}

.header-language-switch__current {
  min-width: 62px;
  height: 40px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  background: transparent;
}

.header-language-switch__flag {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.header-language-switch__flag-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.header-language-switch__label {
  font-size: 14px;
  font-weight: 600;
  color: #f5f7ff;
  letter-spacing: 0.02em;
}

.header-language-switch__toggle {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d7dcff;
  font-size: 10px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.2s ease !important;
  will-change: transform;
}

.header-language-switch.is-open .header-language-switch__toggle {
  transform: rotate(180deg);
}

.header-language-switch__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: 10px;
  border: none;
  background: #403e4c;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35);
  z-index: 1004;
  transform-origin: top right;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.98);
  transition: opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0.38s !important;
  will-change: opacity, transform;
}

.header-language-switch > .header-language-switch__dropdown {
  display: block;
}

.header-language-switch.is-open > .header-language-switch__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.38s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0s linear 0s !important;
  transition-delay: 0.08s, 0.08s, 0s !important;
}

.header-language-switch:not(.is-open) > .header-language-switch__dropdown {
  transition: opacity 0.28s cubic-bezier(0.4, 0, 1, 1),
    transform 0.28s cubic-bezier(0.4, 0, 1, 1),
    visibility 0s linear 0s !important;
}

.header-language-switch__option {
  width: 100%;
  min-height: 38px;
  border: none;
  background: transparent;
  color: #e7ebff;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  text-align: left;
}

.header-language-switch__option:hover {
  background: rgba(255, 255, 255, 0.08);
}

.header-language-switch__option--active {
  color: #ffffff;
  font-weight: 700;
}

.header-language-switch__option--disabled,
.header-language-switch__option[disabled],
.header-language-switch__option[aria-disabled="true"] {
  color: rgba(231, 235, 255, 0.38);
  cursor: not-allowed;
  opacity: 0.78;
  pointer-events: none;
}

.header-language-switch__option--disabled:hover,
.header-language-switch__option[disabled]:hover,
.header-language-switch__option[aria-disabled="true"]:hover {
  background: transparent;
}

.header-language-switch__option--disabled .header-language-switch__option-label,
.header-language-switch__option[disabled] .header-language-switch__option-label {
  color: rgba(231, 235, 255, 0.42);
}

.header-language-switch__option-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  position: relative;
  top: 0;
  padding: 1px 5px;
  background: var(--accent-orange, #ff8a3d);
  color: #000;
  font-size: 9px;
  font-weight: 800;
  border-radius: 3px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: rotate(-8deg);
  transform-origin: center center;
  flex-shrink: 0;
}

.header-language-switch__option-badge--beta {
  background: var(--accent-orange, #ff8a3d);
  color: #000;
}

.header-language-switch__option-badge--soon {
  background: var(--accent-orange, #ff8a3d);
  color: #000;
}

.header-language-switch__option-label {
  font-size: 16px;
  font-weight: inherit;
  line-height: 1.2;
}

.header-language-switch__summary:focus-visible,
.header-language-switch__option:focus-visible {
  outline: 2px solid rgba(142, 165, 255, 0.8);
  outline-offset: 2px;
}

[data-theme="light"] .header-language-switch__current {
  border-color: transparent;
  background: transparent;
}

[data-theme="light"] .header-language-switch__label {
  color: #2a315a;
}

[data-theme="light"] .header-language-switch__toggle {
  border-color: transparent;
  background: transparent;
  color: #2a315a;
}

[data-theme="light"] .header-language-switch__dropdown {
  border: none;
  background: #403e4c;
  box-shadow: 0 14px 32px rgba(17, 28, 63, 0.18);
}

[data-theme="light"] .header-language-switch__option {
  color: #2d3562;
}

[data-theme="light"] .header-language-switch__option:hover {
  background: rgba(32, 54, 117, 0.08);
}

/* Футер: размеры и выпадение вверх */
.footer-language-switch .header-language-switch__current {
  min-width: 74px;
  height: 38px;
}

.footer-language-switch .header-language-switch__label {
  color: #e7ebff;
}

[data-theme="light"] .footer-language-switch .header-language-switch__label {
  color: #2a315a;
}

.header-language-switch--dropup .header-language-switch__dropdown {
  top: auto;
  bottom: calc(100% + 8px);
  transform-origin: bottom right;
  transform: translateY(8px) scale(0.98);
}

.header-language-switch--dropup.is-open > .header-language-switch__dropdown {
  transform: translateY(0) scale(1);
}

.footer-language-switch .header-language-switch__dropdown {
  left: 0;
  right: auto;
  transform-origin: bottom left;
}
