/* ============================================================
   HEADER - Con menú hamburguesa y dropdown funcional
   ============================================================ */

/* ----- HEADER TOP (Barra superior) ----- */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px;
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 0.95rem;
}

.header-top .socials {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-top .socials a {
  margin-right: 0;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.header-top .socials i {
  font-size: 1.2rem;
}

.header-top .phone {
  margin-left: 12px;
  color: var(--muted);
}

.header-top .phone a {
  font-weight: normal;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-actions .btn {
  margin-left: 0;
}

/* ----- NAV MAIN (con logo y menú centrado) ----- */
.nav-main {
  background: #fff;
  box-shadow: 0 2px 10px rgba(2,6,23,0.04);
  position: sticky;
  top: 0;
  z-index: 9999;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* LOGO A LA IZQUIERDA */
.logo {
  flex: 0 0 auto;
}

.logo img {
  height: 48px;
  display: block;
  width: auto;
}

/* BOTÓN HAMBURGUESA (oculto en escritorio) */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s ease;
}

.menu-toggle:hover {
  color: var(--btn);
}

.menu-toggle .fa-bars,
.menu-toggle .fa-times {
  pointer-events: none;
}

/* MENÚ CENTRADO (escritorio) */
.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
  flex: 1 1 auto;
  justify-content: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  padding: 8px 6px;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 3px;
  background: var(--btn);
  transition: width .25s ease;
  border-radius: 3px;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a:hover {
  color: var(--btn);
}

/* PLACEHOLDER (equilibra el espacio para centrar el menú) */
.logo-placeholder {
  flex: 0 0 auto;
  width: 48px;
  height: 1px;
  visibility: hidden;
}

/* ----- DROPDOWN (escritorio) ----- */
.nav-links .dropdown {
  position: relative;
}

.nav-links .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  list-style: none;
  padding: 10px 0;
  margin: 0;
  display: none;
  flex-direction: column;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 6px;
  z-index: 9999;
  border: 1px solid rgba(0,0,0,0.04);
}

.nav-links .dropdown-menu a {
  padding: 10px 20px;
  display: block;
  color: #333;
  text-decoration: none;
  font-weight: 500;
}

.nav-links .dropdown-menu a::after {
  display: none;
}

.nav-links .dropdown-menu a:hover {
  background: #e6eef7;
  color: var(--btn);
}

.nav-links .dropdown:hover .dropdown-menu {
  display: flex;
}

/* ============================================================
   RESPONSIVE - MÓVIL Y TABLET (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  .header-top {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;  /* ← CENTRADO EN MÓVIL */
    padding: 6px 12px;
  }

  .header-top .socials {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* OCULTAR ACCIONES (Español e Inscripciones) EN MÓVIL */
  .header-actions {
    display: none !important;
  }

  .menu-toggle {
    display: block;
    order: 2;
  }

  .nav-inner {
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 8px 12px;
  }

  .logo {
    flex: 0 0 auto;
    order: 1;
  }

  .logo img {
    height: 40px;
  }

  .logo-placeholder {
    display: none;
  }

  .nav-links {
    flex: 1 0 100%;
    flex-direction: column;
    gap: 0;
    display: none;
    order: 3;
    background: #fff;
    padding: 0;
    border-top: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }

  .nav-links.open {
    display: flex;
    max-height: 600px;
    padding: 10px 0;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    padding: 12px 20px;
    display: block;
    border-bottom: 1px solid rgba(0,0,0,0.03);
  }

  .nav-links a::after {
    display: none;
  }

  /* DROPDOWN EN MÓVIL: SIEMPRE VISIBLE */
  .nav-links .dropdown-menu {
    position: static !important;
    box-shadow: none !important;
    background: #f0f4f9 !important;
    min-width: auto !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
    border-radius: 0 !important;
  }

  .nav-links .dropdown-menu a {
    padding: 10px 20px 10px 30px !important;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.95rem;
  }

  .nav-links .dropdown-menu a:hover {
    background: #e6eef7;
  }

  .nav-links .dropdown:hover .dropdown-menu {
    display: block !important;
  }
}

/* ============================================================
   RESPONSIVE - MÓVIL PEQUEÑO (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  .header-top .socials {
    gap: 8px;
  }

  .header-top .phone a {
    font-size: 0.85rem;
  }

  .logo img {
    height: 34px;
  }

  .menu-toggle {
    font-size: 1.5rem;
  }
}
/* ===== ALINEACIÓN PERFECTA DE ICONOS SOCIALES ===== */
.header-top .socials {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-top .socials a {
  display: inline-flex;
  align-items: center;   /* Centra verticalmente el ícono y el texto */
  gap: 6px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  transition: color 0.2s ease;
  line-height: 1;        /* Elimina espacio extra por line-height */
  height: 30px;          /* Altura fija para todos los enlaces */
}

.header-top .socials i {
  font-size: 1.2rem;
  line-height: 1;        /* Elimina espacio extra en el ícono */
  display: inline-flex;
  align-items: center;
}

.header-top .phone-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  white-space: nowrap;
  height: 30px;          /* Misma altura que los demás enlaces */
}

.header-top .phone-link span {
  color: var(--muted);
  line-height: 1;
}
/* ===== QUITAR EFECTOS AZULES EN CLICK/TOUCH ===== */
.header-top .socials a,
.header-top .socials a:focus,
.header-top .socials a:active,
.header-top .socials a:focus-visible,
.header-actions a,
.header-actions a:focus,
.header-actions a:active,
.header-actions a:focus-visible,
.nav-links a,
.nav-links a:focus,
.nav-links a:active,
.nav-links a:focus-visible,
.menu-toggle,
.menu-toggle:focus,
.menu-toggle:active,
.menu-toggle:focus-visible {
  outline: none !important;
  outline-color: transparent !important;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* Ocultar el resaltado azul en Safari/iOS */
.header-top .socials a,
.nav-links a,
.menu-toggle {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* Opcional: quitar el cambio de color en active (si existe) */
.header-top .socials a:active,
.nav-links a:active,
.menu-toggle:active {
  color: var(--btn) !important;  /* o el color que quieras, o inherit */
}