/* Selector de idioma flotante: fijo en la esquina superior derecha de la ventana, siempre visible al hacer scroll. */
.lang-switcher {
  position: fixed;
  top: 8px;
  right: calc(12px + var(--lang-switcher-shift, 0px)); /* --lang-switcher-shift lo ajusta language-switcher.tsx si la página desborda en horizontal (Picasso en móvil) */
  z-index: 100000; /* por encima de la cabecera (999), el menú móvil (100) y el botón de volver arriba (1000) */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .08em;
  /* Sombra tenue para que el texto blanco se lea también sobre fondos claros. */
  text-shadow: 0 0 2px rgba(10, 15, 50, .95), 0 0 4px rgba(10, 15, 50, .7), 0 1px 3px rgba(10, 15, 50, .6);
}
.lang-switcher__link,
.lang-switcher__link:visited {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 8px 0 6px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: #fff;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, opacity .2s ease;
}
.lang-switcher__link:not(.is-current) { opacity: .8; }
.lang-switcher__link:hover { opacity: 1; background: rgba(255, 255, 255, .1); }
.lang-switcher__link.is-current,
.lang-switcher__link.is-current:visited { opacity: 1; background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .7); box-shadow: 0 0 3px rgba(10, 15, 50, .6), inset 0 0 3px rgba(10, 15, 50, .35); cursor: default; }
.lang-switcher__link:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lang-switcher__flag { display: inline-flex; width: 16px; height: 11px; flex: none; border-radius: 2px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 0 3px rgba(10, 15, 50, .5); }
.lang-switcher__flag svg { display: block; width: 100%; height: 100%; }

/* Solo Picasso (cabecera blanca): texto del selector en el color del menú, sin halo oscuro. */
body:has(.picasso-page) .lang-switcher { text-shadow: none; }
body:has(.picasso-page) .lang-switcher__link,
body:has(.picasso-page) .lang-switcher__link:visited { color: #0d0d3f; }
body:has(.picasso-page) .lang-switcher__link:hover { background: rgba(13, 13, 63, .08); }
body:has(.picasso-page) .lang-switcher__link.is-current,
body:has(.picasso-page) .lang-switcher__link.is-current:visited { background: rgba(13, 13, 63, .06); border-color: rgba(13, 13, 63, .45); box-shadow: none; }
body:has(.picasso-page) .lang-switcher__link:focus-visible { outline-color: #0d0d3f; }
body:has(.picasso-page) .lang-switcher__flag { box-shadow: 0 0 0 1px rgba(0, 0, 0, .2); }

/* Móvil: solo las dos banderas. */
@media (max-width: 767px) {
  .lang-switcher { top: 6px; right: calc(8px + var(--lang-switcher-shift, 0px)); gap: 4px; }
  .lang-switcher__link { width: 32px; min-height: 26px; padding: 0; justify-content: center; }
  .lang-switcher__code { display: none; }
}
@media (prefers-reduced-motion: reduce) { .lang-switcher__link { transition: none; } }

/* Hueco reservado en la cabecera para que el selector fijo no tape iconos ni menú. Solo se desplaza el último bloque de cada barra
   (iconos sociales / menú); el bloque de la izquierda conserva su ancho.
   - Escritorio y tablet (>=768 px): ambas barras reservan el hueco (barra azul y barra del menú).
   - Escritorio (>1024 px): el último bloque de la barra azul pasa a ancho automático, para que dirección y correo no se partan en dos líneas.
   - Móvil (<768 px): solo la barra azul (sus iconos quedan a la izquierda del selector); en la barra del menú el botón hamburguesa
     ya queda libre y reservar hueco haría saltar de línea al botón. */
:root { --lang-switcher-reserve: 120px; --lang-switcher-reserve-mobile: 80px; }
@media (min-width: 768px) {
  .header-main-wrapper > .elementor > .e-parent > .e-con-inner > :last-child { margin-right: var(--lang-switcher-reserve); }
}
@media (min-width: 1025px) {
  .header-main-wrapper > .elementor > .e-parent:has(.elementor-widget-social-icons) > .e-con-inner > :last-child { flex: 0 0 auto; width: auto; }
}
@media (max-width: 767px) {
  .header-main-wrapper > .elementor > .e-parent:has(.elementor-widget-social-icons) > .e-con-inner > :last-child { margin-right: var(--lang-switcher-reserve-mobile); justify-content: flex-end; }
}

