/* Google Translate — custom language switcher */

body {
  top: 0 !important;
}

iframe.goog-te-banner-frame,
.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-te-spinner-pos,
.goog-tooltip,
.goog-tooltip:hover {
  display: none !important;
  visibility: hidden !important;
}

body > .skiptranslate,
.goog-te-gadget-icon {
  display: none !important;
}

#google_translate_element {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.lang-switcher__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  height: 36px;
  padding: 0 0.75rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-on-dark);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.lang-switcher__toggle:hover,
.lang-switcher__toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
}

.lang-switcher__toggle svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.9;
}

.lang-switcher__chevron {
  width: 10px;
  height: 10px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

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

.lang-switcher__menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 1100;
  min-width: 168px;
  max-height: 280px;
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.lang-switcher__menu[hidden] {
  display: none;
}

.lang-switcher__menu li {
  margin: 0;
}

.lang-switcher__option {
  display: block;
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  color: var(--color-text);
  background: transparent;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-switcher__option:hover,
.lang-switcher__option.is-active {
  background: var(--color-accent-muted);
  color: var(--color-primary);
}

@media (max-width: 992px) {
  .nav-panel.is-open .lang-switcher {
    width: 100%;
  }

  .nav-panel.is-open .lang-switcher__toggle {
    width: 100%;
    justify-content: center;
  }

  .nav-panel.is-open .lang-switcher__menu {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 0.5rem;
    box-shadow: none;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
  }

  .nav-panel.is-open .lang-switcher__option {
    color: var(--color-text-on-dark);
  }

  .nav-panel.is-open .lang-switcher__option:hover,
  .nav-panel.is-open .lang-switcher__option.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }
}
