/* Google Translate — menu custom + moteur Google masqué */

body > .skiptranslate:not(.goog-te-gadget),
body > .skiptranslate:has(iframe.goog-te-banner-frame),
.goog-te-banner-frame,
iframe.goog-te-banner-frame,
#goog-gt-tt,
.goog-te-balloon-frame {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  overflow: hidden !important;
}

body {
  top: 0 !important;
  position: static !important;
}

/* Moteur Google hors écran */
.gt-engine,
#google_translate_element {
  position: fixed !important;
  left: -9999px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Bouton compact navbar */
.gt-switch {
  position: relative;
  flex-shrink: 0;
  z-index: 1001;
}

.gt-switch__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 76px;
  height: 30px;
  padding: 0 8px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-white-muted);
  cursor: pointer;
  transition: border-color var(--duration-fast), color var(--duration-fast);
}

.gt-switch__btn:hover,
.gt-switch.is-open .gt-switch__btn {
  border-color: var(--color-border-green);
  color: var(--color-white);
}

.gt-switch__icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--color-green);
}

.gt-switch__code {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  line-height: 1;
}

.gt-switch__chevron {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  color: var(--color-green);
  opacity: 0.85;
  transition: transform var(--duration-fast);
}

.gt-switch.is-open .gt-switch__chevron {
  transform: rotate(180deg);
}

/* Menu déroulant */
.gt-switch__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  max-width: min(280px, calc(100vw - 24px));
  max-height: min(360px, 60vh);
  overflow: hidden;
  background: rgba(17, 17, 17, 0.98);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.gt-switch__menu[hidden] {
  display: none;
}

.gt-switch__menu-inner {
  max-height: min(360px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 0;
}

.gt-switch__option {
  display: block;
  width: 100%;
  padding: 9px 14px;
  text-align: left;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-white-dim);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background var(--duration-fast), color var(--duration-fast);
}

.gt-switch__option:hover {
  background: var(--color-surface);
  color: var(--color-white);
}

.gt-switch__option.is-active {
  color: var(--color-green);
  background: var(--color-green-subtle);
}

.gt-switch__option.is-active::before {
  content: '✓ ';
  font-size: 0.85em;
}

.gt-switch__loading {
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-white-muted);
}
