/* Desplegable de idiomas móvil: más fino y animado, sin cambiar colores */
@media (max-width: 768px) {
  html body header .nav-container > .language-switcher-mobile .language-current {
    transition: transform .2s ease !important;
  }
  html body header .nav-container > .language-switcher-mobile .language-current:active {
    transform: scale(.93);
  }

  html body header .nav-container > .language-switcher-mobile .language-menu {
    width: auto !important;
    min-width: 150px !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 6px !important;
    gap: 2px !important;
    border-radius: 16px !important;
    border: 1px solid rgba(15, 23, 42, .08) !important;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .16), 0 2px 8px rgba(15, 23, 42, .06) !important;
    transform-origin: top right;
    animation: mmLangPanel .3s cubic-bezier(.22, 1, .36, 1) both;
  }

  html body header .nav-container > .language-switcher-mobile .language-menu a {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    line-height: 1.25 !important;
    border-radius: 11px !important;
    transition: background-color .22s ease !important;
    animation: mmLangItem .38s cubic-bezier(.22, 1, .36, 1) both;
  }
  html body header .nav-container > .language-switcher-mobile .language-menu a:nth-child(1) { animation-delay: .04s; }
  html body header .nav-container > .language-switcher-mobile .language-menu a:nth-child(2) { animation-delay: .09s; }
  html body header .nav-container > .language-switcher-mobile .language-menu a:nth-child(3) { animation-delay: .14s; }

  html body header .nav-container > .language-switcher-mobile .language-menu a:hover,
  html body header .nav-container > .language-switcher-mobile .language-menu a:active {
    background-color: color-mix(in srgb, currentColor 7%, transparent) !important;
  }
  html body header .nav-container > .language-switcher-mobile .language-menu a.active {
    background-color: color-mix(in srgb, currentColor 9%, transparent) !important;
    font-weight: 600 !important;
  }

  html body header .nav-container > .language-switcher-mobile .language-menu .language-flag-img {
    border-radius: 4px !important;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .12);
  }
}

@keyframes mmLangPanel {
  from { transform: translateY(-8px) scale(.94); }
  to   { transform: none; }
}
@keyframes mmLangItem {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  header .language-menu,
  header .language-menu a {
    animation: none !important;
    transition: none !important;
  }
}

/* Restaurar colores originales del desplegable */
@media (max-width: 768px) {
  html body header .nav-container > .language-switcher-mobile .language-menu {
    border-color: #dce2e8 !important;
  }
  html body header .nav-container > .language-switcher-mobile .language-menu a:hover,
  html body header .nav-container > .language-switcher-mobile .language-menu a:active,
  html body header .nav-container > .language-switcher-mobile .language-menu a.active {
    background-color: #edf5fa !important;
    color: #0d5a8c !important;
  }
}

/* Compactar al máximo el desplegable de idiomas */
@media (max-width: 768px) {
  html body header .nav-container > .language-switcher-mobile .language-menu {
    width: max-content !important;
    min-width: 0 !important;
    max-width: 90vw !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    bottom: auto !important;
    padding: 4px !important;
    gap: 0 !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    align-content: flex-start !important;
  }
  html body header .nav-container > .language-switcher-mobile .language-menu a {
    width: auto !important;
    flex: 0 0 auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 8px 12px 8px 10px !important;
    gap: 9px !important;
    line-height: 1.2 !important;
  }
  html body header .nav-container > .language-switcher-mobile .language-menu .language-label {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
  }
}

/* Idiomas sin recuadros: lista limpia con separadores azules */
@media (max-width: 768px) {
  html body header .nav-container > .language-switcher-mobile .language-menu {
    padding: 2px 0 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
  }

  html body header .nav-container > .language-switcher-mobile .language-menu a {
    background: transparent !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 11px 18px 11px 14px !important;
    border-bottom: 1px solid rgba(13, 90, 140, .18) !important;
    transition: color .22s ease !important;
  }
  html body header .nav-container > .language-switcher-mobile .language-menu a:last-child {
    border-bottom: 0 !important;
  }

  html body header .nav-container > .language-switcher-mobile .language-menu a:hover,
  html body header .nav-container > .language-switcher-mobile .language-menu a:active {
    background: transparent !important;
    background-color: transparent !important;
    color: #0d5a8c !important;
  }
  html body header .nav-container > .language-switcher-mobile .language-menu a.active {
    background: transparent !important;
    background-color: transparent !important;
    color: #0d5a8c !important;
    font-weight: 700 !important;
  }

  /* Nombre completo, sin recortes */
  html body header .nav-container > .language-switcher-mobile .language-menu .language-label {
    display: inline !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

/* Separadores más sutiles y fondo azulado en el idioma activo */
@media (max-width: 768px) {
  html body header .nav-container > .language-switcher-mobile .language-menu a {
    border-bottom: 1px solid rgba(13, 90, 140, .07) !important;
  }
  html body header .nav-container > .language-switcher-mobile .language-menu a:last-child {
    border-bottom: 0 !important;
  }
  html body header .nav-container > .language-switcher-mobile .language-menu a.active {
    background: #edf5fa !important;
    background-color: #edf5fa !important;
    color: #0d5a8c !important;
    font-weight: 700 !important;
  }
}

/* Separadores hairline, muy sutiles y con degradado */
@media (max-width: 768px) {
  html body header .nav-container > .language-switcher-mobile .language-menu a {
    position: relative !important;
    border-bottom: 0 !important;
  }
  html body header .nav-container > .language-switcher-mobile .language-menu a:not(:last-child)::after {
    content: "" !important;
    position: absolute !important;
    left: 14px !important;
    right: 14px !important;
    bottom: 0 !important;
    height: 1px !important;
    background: linear-gradient(90deg, transparent, rgba(13, 90, 140, .13) 50%, transparent) !important;
    transform: scaleY(.5) !important;
    transform-origin: bottom !important;
    pointer-events: none !important;
  }
}

/* Una sola línea muy fina entre idiomas */
@media (max-width: 768px) {
  html body header .nav-container > .language-switcher-mobile .language-menu a::after,
  html body header .nav-container > .language-switcher-mobile .language-menu a::before {
    content: none !important;
    display: none !important;
  }
  html body header .nav-container > .language-switcher-mobile .language-menu a {
    border-top: 0 !important;
    border-bottom: 0 !important;
  }
  html body header .nav-container > .language-switcher-mobile .language-menu a + a {
    border-top: 1px solid rgba(13, 90, 140, .09) !important;
  }
}
