/* ═══════════════════════════════════════════════════════
   TuSocioEnChina — Translate Plugin CSS (v3)
   Selector de idioma: icono de globo que despliega banderas.
   Sustituye al selector anterior (4 banderas siempre visibles),
   que ocupaba espacio fijo en el menú móvil.
═══════════════════════════════════════════════════════ */

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

/* ── Botón globo (igual en ambas variantes, el tamaño cambia por contexto) ── */
.tse-lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #E0E0E6;
  background: #fff;
  cursor: pointer;
  outline: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, border-color .15s;
  color: inherit;
  font-family: inherit;
}
.tse-lang-toggle:hover { background: #F5F5F7; }
.tse-lang-toggle:focus-visible { outline: 2px solid #C8102E; outline-offset: 2px; }
.tse-globe-icon { font-size: 17px; line-height: 1; display: block; }

/* ═══ Variante ESCRITORIO: solo el globo, dropdown flotante ═══
   El botón es un círculo compacto de 34px — no añade apenas ancho
   a la barra de navegación. El panel de banderas está oculto
   (opacity:0 + pointer-events:none) hasta que se abre, así que
   NUNCA ocupa espacio del layout salvo el propio círculo. */
.tse-lang-switcher--desktop .tse-lang-toggle {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
}
.tse-lang-switcher--desktop.open .tse-lang-toggle {
  background: #F5F5F7;
  border-color: #C8C8D0;
}
.tse-lang-switcher--desktop .tse-lang-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  background: #fff;
  border: 1px solid #E0E0E6;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.14);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
  z-index: 10000;
}
.tse-lang-switcher--desktop.open .tse-lang-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ═══ Variante MÓVIL: fila "Idioma" dentro del menú, acordeón ═══
   Cerrado, el panel mide 0 de alto — no ocupa nada del menú móvil.
   Al pulsar el globo, las banderas se despliegan HACIA ABAJO en
   línea (max-height anima de 0 a un valor suficiente), empujando
   el resto del menú sin usar position:absolute — así nunca queda
   cortado por el overflow-y:auto del contenedor del menú móvil. */
.tse-lang-switcher--mobile {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0 24px;
}
.tse-lang-switcher--mobile .tse-lang-toggle {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  justify-content: flex-start;
}
.tse-lang-switcher--mobile .tse-toggle-label {
  flex: 1;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--tse-ink, #0D0D12);
}
.tse-lang-switcher--mobile .tse-chevron {
  font-size: 11px;
  color: var(--tse-soft, #A0A0B0);
  transition: transform .18s ease;
}
.tse-lang-switcher--mobile.open .tse-chevron {
  transform: rotate(180deg);
}
.tse-lang-switcher--mobile .tse-lang-panel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-top: 0;
  transition: max-height .22s ease, opacity .18s ease, margin-top .22s ease;
}
.tse-lang-switcher--mobile.open .tse-lang-panel {
  max-height: 260px;
  opacity: 1;
  margin-top: 6px;
}

/* ── Opciones de idioma dentro del panel (compartidas) ── */
.tse-lang-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--tse-ink, #0D0D12);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.tse-lang-option:hover { background: rgba(0,0,0,.05); }
.tse-lang-option.active { background: #C8102E; color: #fff; }
.tse-lang-option .tse-flag { font-size: 17px; line-height: 1; }
.tse-lang-option .tse-code { font-size: 11px; letter-spacing: .4px; }
