/* Navegación compacta: Inicio | Soluciones | Productos | Nosotros | Contacto.
   Solo aplica a elementos con .at-nav / .at-mobile-nav; para revertir, quitar el <link> a este archivo
   y restaurar el bloque de menú desde el respaldo. */

/* ── Escritorio ── */
@media (min-width: 1025px) {
  header nav .nav-links.at-nav { gap: 1.9rem; }
}
@media (min-width: 1025px) and (max-width: 1199px) {
  header nav .nav-links.at-nav { gap: 1.25rem; }
}

.at-nav .nav-dropdown-toggle > span:first-child { pointer-events: none; }

/* Con varios desplegables, el foco que deja un clic no debe mantener uno abierto
   cuando se abre otro; con teclado (:focus-visible) se conserva el comportamiento. */
.at-nav:has(.is-open) .nav-item-has-dropdown:focus-within:not(.is-open):not(:has(:focus-visible)) > .nav-dropdown {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.at-nav:has(.is-open) .nav-item-has-dropdown:focus-within:not(.is-open):not(:has(:focus-visible)) .nav-dropdown-chevron {
  transform: none;
}

.at-nav .nav-dropdown {
  min-width: 14.5rem;
  padding: 0.85rem 0.45rem 0.45rem;
  text-align: left;
}

.at-nav .nav-dropdown a {
  font-size: 0.82rem;
  padding: 0.55rem 0.8rem;
}

.at-nav .nav-dropdown-label {
  list-style: none;
  padding: 0.55rem 0.8rem 0.3rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.at-nav .nav-dropdown-sep {
  list-style: none;
  height: 1px;
  margin: 0.35rem 0.7rem;
  background: var(--border-light);
}

.at-nav .nav-dropdown a.nav-dropdown-more {
  color: var(--blue-accent) !important;
  font-weight: 600;
}

/* Contacto: opción destacada (mismo estilo que el botón de diagnóstico actual) */
header .at-nav .nav-contact > .nav-dropdown-toggle {
  background: var(--blue-accent) !important;
  color: #fff !important;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1.05rem !important;
  border-radius: 8px;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
header .at-nav .nav-contact > .nav-dropdown-toggle:hover,
header .at-nav .nav-contact.is-open > .nav-dropdown-toggle {
  background: #1F56E0 !important;
  box-shadow: 0 0 20px rgba(47, 107, 255, 0.4) !important;
  transform: translateY(-1px);
}
header.scrolled .at-nav .nav-contact > .nav-dropdown-toggle { color: #fff !important; }

.at-nav .nav-contact > .nav-dropdown {
  left: auto !important;
  right: 0;
  transform: none !important;
}

/* ── Móvil ── */
.at-mobile-nav .mobile-nav-group-toggle > span:first-child { pointer-events: none; }

.at-mobile-nav .mobile-nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.2rem;
}

.at-mobile-nav .mobile-nav-submenu a.nav-dropdown-more {
  color: #66C7FF !important;
}

/* ── Idioma con banderas ──
   Se reutiliza el marcado existente (enlaces data-lang-switch): se oculta el botón "ES | EN"
   y se muestran las opciones como banderas. El texto ES/EN queda en el DOM para lectores de pantalla. */
.at-nav .nav-lang-switch > .nav-dropdown-toggle,
.at-mobile-nav .mobile-nav-lang > .mobile-nav-group-toggle { display: none; }

.at-nav .nav-lang-switch > .nav-lang-dropdown {
  position: static !important;
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}
.at-nav .nav-lang-switch > .nav-lang-dropdown::before { display: none; }

.at-mobile-nav .mobile-nav-lang > .mobile-nav-submenu {
  display: flex !important;
  flex-direction: row;
  justify-content: center;
  gap: 1.1rem;
}

.at-nav .nav-lang-dropdown a[data-lang-switch],
.at-mobile-nav .mobile-nav-lang a[data-lang-switch] {
  display: block;
  width: 30px;
  height: 20px;
  padding: 0 !important;
  font-size: 0 !important;
  color: transparent !important;
  border-radius: 4px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.15);
  opacity: 0.55;
  transition: opacity 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}
.at-mobile-nav .mobile-nav-lang a[data-lang-switch] {
  width: 42px;
  height: 28px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.at-nav .nav-lang-dropdown a[data-lang-switch]:hover,
.at-mobile-nav .mobile-nav-lang a[data-lang-switch]:hover { opacity: 0.9; transform: translateY(-1px); }

.at-nav .nav-lang-dropdown a[data-lang-switch].is-active,
.at-mobile-nav .mobile-nav-lang a[data-lang-switch].is-active {
  opacity: 1;
  box-shadow: 0 0 0 2px #F5C518, 0 0 10px rgba(245, 197, 24, 0.45);
}

.at-nav .nav-lang-dropdown a[data-lang-switch="es"],
.at-mobile-nav .mobile-nav-lang a[data-lang-switch="es"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Crect width='10' height='20' fill='%23006847'/%3E%3Crect x='10' width='10' height='20' fill='%23fff'/%3E%3Crect x='20' width='10' height='20' fill='%23ce1126'/%3E%3Cpath d='M12.6 10.6a2.4 2.4 0 0 0 4.8 0' fill='none' stroke='%23006847' stroke-width='.7'/%3E%3Cellipse cx='15' cy='9.4' rx='1.5' ry='1.9' fill='%238c5a2b'/%3E%3C/svg%3E");
}
.at-nav .nav-lang-dropdown a[data-lang-switch="en"],
.at-mobile-nav .mobile-nav-lang a[data-lang-switch="en"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Crect width='30' height='20' fill='%23fff'/%3E%3Cpath d='M15 0v20' stroke='%23b22234' stroke-width='30' stroke-dasharray='1.5385'/%3E%3Crect width='13' height='10.77' fill='%233c3b6e'/%3E%3Cpath d='M1.5 1.6h10M2.5 3.6h9M1.5 5.6h10M2.5 7.6h9M1.5 9.6h10' stroke='%23fff' stroke-width='.8' stroke-linecap='round' stroke-dasharray='0 2'/%3E%3C/svg%3E");
}
