/* ============================================================
   gss-lang — Selector de idioma nativo de WPML con el aspecto
   del antiguo switcher custom (botón globo + desplegable blanco).

   Réplica 1:1 del diseño original (several.css → .custom-lang-switcher).
   Único cambio: al pasar por encima de un idioma, el TEXTO se pone en
   Neon Blue de marca (#5078FF).

   Se aplica SÓLO cuando el widget de WPML va envuelto en .gss-lang.
   El [wpml_language_selector_widget] del footer (sin .gss-lang)
   conserva su diseño nativo actual.

   Uso:  <div class="gss-lang">[wpml_language_selector_widget]</div>
   Fondo oscuro:  <div class="gss-lang gss-lang--light">…</div>

   WPML → Idiomas → Selectores de idioma: tipo "Menú desplegable"
   (legacy dropdown → genera .wpml-ls-legacy-dropdown).
   ============================================================ */

/* --- Contenedor (= .custom-lang-switcher) --- */
.gss-lang .wpml-ls-legacy-dropdown {
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

/* Reset del markup de WPML para que no asomen estilos por defecto */
.gss-lang .wpml-ls,
.gss-lang .wpml-ls ul,
.gss-lang .wpml-ls li {
  list-style: none;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}

/* Oculta el texto del idioma actual ("ES"); solo queda el globo.
   El <a> conserva su aria-label, así sigue siendo accesible. */
.gss-lang .wpml-ls-item-toggle .wpml-ls-native {
  display: none;
}
.gss-lang .wpml-ls-item-toggle::after {
  content: none !important;
  display: none !important;
}

/* --- Toggle = botón globo 27x27 (= .lang-toggle) --- */
.gss-lang .wpml-ls-item-toggle {
  display: block;
  width: 27px;
  height: 27px;
  border: none;
  background: transparent;
  position: relative;
  cursor: pointer;
  font-size: 0;
  line-height: 0;
}

.gss-lang .wpml-ls-item-toggle::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 80%;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='19' height='20' viewBox='0 0 19 20' fill='none'><path d='M1 10C1 14.6946 4.80545 18.5 9.5 18.5C14.1946 18.5 18 14.6946 18 10C18 5.30545 14.1946 1.5 9.5 1.5C4.80545 1.5 1 5.30545 1 10Z' stroke='black' stroke-width='1.13333' stroke-linecap='round' stroke-linejoin='round'/><path d='M10.3501 1.5426C10.3501 1.5426 12.9001 4.9001 12.9001 10.0001C12.9001 15.1001 10.3501 18.4576 10.3501 18.4576M8.65014 18.4576C8.65014 18.4576 6.10014 15.1001 6.10014 10.0001C6.10014 4.9001 8.65014 1.5426 8.65014 1.5426M1.53564 12.9751H17.4646M1.53564 7.0251H17.4646' stroke='black' stroke-width='1.13333' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

/* --- Desplegable (= .lang-dropdown), idéntico al original --- */
.gss-lang .wpml-ls-sub-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 99%;
  left: 0;
  list-style: none;
  background: #fff;
  padding: 8px 0;
  margin: 0;
  border: 1px solid #ddd;
  border-radius: 4px;
  min-width: 63px;
  z-index: 20;
  transform: translateX(-18px);
}

.gss-lang .wpml-ls-sub-menu li {
  text-align: center;
}

.gss-lang .wpml-ls-sub-menu a {
  display: block;
  padding: 5px 10px;
  color: #000;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

/* Hover como antes (fondo gris) + el TEXTO en Neon Blue de marca */
.gss-lang .wpml-ls-sub-menu a:hover {
  background: #eee;
  color: #5078FF;
}

/* Abrir en hover (= .custom-lang-switcher:hover .lang-dropdown) */
.gss-lang .wpml-ls-legacy-dropdown:hover .wpml-ls-sub-menu,
.gss-lang .wpml-ls-legacy-dropdown:focus-within .wpml-ls-sub-menu {
  display: block;
}

/* --- Fondo oscuro: globo en blanco (regla de marca) --- */
.gss-lang.gss-lang--light .wpml-ls-item-toggle::before {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='19' height='20' viewBox='0 0 19 20' fill='none'><path d='M1 10C1 14.6946 4.80545 18.5 9.5 18.5C14.1946 18.5 18 14.6946 18 10C18 5.30545 14.1946 1.5 9.5 1.5C4.80545 1.5 1 5.30545 1 10Z' stroke='white' stroke-width='1.13333' stroke-linecap='round' stroke-linejoin='round'/><path d='M10.3501 1.5426C10.3501 1.5426 12.9001 4.9001 12.9001 10.0001C12.9001 15.1001 10.3501 18.4576 10.3501 18.4576M8.65014 18.4576C8.65014 18.4576 6.10014 15.1001 6.10014 10.0001C6.10014 4.9001 8.65014 1.5426 8.65014 1.5426M1.53564 12.9751H17.4646M1.53564 7.0251H17.4646' stroke='white' stroke-width='1.13333' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
