/* NAVBAR UNIVERSAL IERI — mismas proporciones en todas las páginas */
:root {
  --nav-azul: #003B73;
  --nav-celeste: #00AEEF;
  --nav-celeste-claro: #8ee8ff;
}

/* Barra */
header { position: relative; z-index: 5000; }
header .navbar {
  position: fixed; top: 18px; left: 50%; z-index: 5000;
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; width: 94%; max-width: 1600px; min-height: 86px;
  padding: 13px 27px; border: 1px solid rgba(255,255,255,.15);
  border-radius: 65px; background: rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 10px 35px rgba(0,0,0,.08);
  transition: top .4s ease, width .4s ease, background .4s ease,
              border-color .4s ease, box-shadow .4s ease;
}
header .navbar.active {
  top: 10px; background: rgba(255,255,255,.90);
  border-color: rgba(0,59,115,.08);
  box-shadow: 0 14px 40px rgba(0,0,0,.12);
}

/* Logo — dimensiones fijas */
header .navbar .logo {
  display: flex; align-items: center; gap: 14px;
  flex: 0 0 244px; min-width: 0;
  text-decoration: none; transition: transform .35s ease;
}
header .navbar .logo:hover { transform: scale(1.02); }
header .navbar .logo-img {
  display: block; flex: 0 0 56px;
  width: 56px; height: 56px; max-width: 56px;
  margin: 0; object-fit: contain;
}
header .navbar .logo-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
header .navbar .logo-text h2 {
  margin: 0; padding: 0; color: #fff;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 17px; font-weight: 700; line-height: 1.25;
  letter-spacing: 0; transition: color .3s ease;
}
header .navbar.active .logo-text h2 { color: #003B73; }
header .navbar .logo-text span {
  margin-top: 3px; color: #8ee8ff;
  font-size: 13px; font-weight: 500; line-height: 1.3;
}
header .navbar.active .logo-text span { color: #00AEEF; }

/* Enlaces — tipografía y altura unificadas */
header .navbar .nav-links {
  display: flex; align-items: center; justify-content: flex-end;
  flex: 1 1 auto; gap: clamp(8px, .8vw, 16px);
  min-width: 0; margin: 0; padding: 0; list-style: none;
}
header .navbar .nav-links > li {
  position: relative; flex: 0 0 auto; margin: 0; padding: 0; list-style: none;
}
header .navbar .nav-links > li > a {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 0;
  color: #fff; font-family: "Segoe UI", Arial, sans-serif;
  font-size: 17px; font-weight: 650; line-height: 1.25;
  letter-spacing: 0; text-decoration: none; white-space: nowrap;
  transition: color .3s ease;
}
header .navbar .nav-links > li > a:hover,
header .navbar .nav-links > li > a:focus-visible { color: #00AEEF; }
header .navbar .nav-links > li > a i {
  flex: 0 0 auto; font-size: 12px; transition: transform .3s ease;
}
header .navbar .dropdown:hover > a i,
header .navbar .dropdown:focus-within > a i,
header .navbar .dropdown.open > a i { transform: rotate(180deg); }
header .navbar .nav-links > li.active-link > a { color: #8ee8ff; }
header .navbar.active .nav-links > li > a { color: #003B73; }
header .navbar.active .nav-links > li > a:hover,
header .navbar.active .nav-links > li > a:focus-visible,
header .navbar.active .nav-links > li.active-link > a { color: #00AEEF; }

/* Submenús */
header .navbar .dropdown-menu {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 5100;
  display: block; min-width: 245px; margin: 0; padding: 10px 0;
  list-style: none; background: #fff;
  border: 1px solid rgba(0,59,115,.07); border-radius: 20px;
  box-shadow: 0 15px 35px rgba(0,0,0,.12);
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-10px);
  transition: opacity .3s ease, visibility .3s ease, transform .3s ease;
}
header .navbar .dropdown-menu::before {
  position: absolute; top: -12px; left: 0; width: 100%; height: 12px; content: "";
}
header .navbar .dropdown:hover > .dropdown-menu,
header .navbar .dropdown:focus-within > .dropdown-menu,
header .navbar .dropdown.open > .dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
}
header .navbar .dropdown-menu li { width: 100%; margin: 0; padding: 0; list-style: none; }
header .navbar .dropdown-menu li a {
  display: flex; align-items: center; width: 100%; min-height: 48px;
  padding: 11px 22px; color: #003B73;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 16px; font-weight: 600; line-height: 1.35;
  text-decoration: none; white-space: normal;
  transition: color .25s ease, background .25s ease, padding .25s ease;
}
header .navbar .dropdown-menu li a:hover,
header .navbar .dropdown-menu li a:focus-visible {
  padding-left: 27px; color: #0865A8; background: #f5f7fa;
}

/* Botón móvil */
header .navbar .menu-toggle {
  display: none; align-items: center; justify-content: center;
  flex: 0 0 44px; width: 44px; height: 44px; padding: 0;
  color: #fff; background: transparent; border: 0; border-radius: 50%;
  font-size: 25px; line-height: 1; cursor: pointer;
  transition: color .3s ease, background .3s ease;
}
header .navbar.active .menu-toggle { color: #003B73; }
header .navbar .menu-toggle:hover { background: rgba(0,174,239,.13); }

/* Menú compacto: se activa antes de que los enlaces se compriman */
@media (max-width: 1300px) {
  header .navbar, header .navbar.active {
    top: 12px; width: 94%; min-height: 76px;
    padding: 10px 22px; border-radius: 45px;
  }
  header .navbar .logo { flex-basis: auto; }
  header .navbar .menu-toggle {
    display: inline-flex; color: #fff; background: #003B73;
  }
  header .navbar.active .menu-toggle { color: #fff; background: #003B73; }
  header .navbar .nav-links {
    position: absolute; top: calc(100% + 12px); right: 0;
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 3px; width: min(400px, calc(100vw - 30px));
    max-height: min(80vh, 680px); margin: 0; padding: 22px 25px;
    overflow-x: hidden; overflow-y: auto;
    background: #fff; border: 1px solid rgba(0,59,115,.08);
    border-radius: 27px; box-shadow: 0 15px 40px rgba(0,0,0,.15);
    opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-8px);
    transition: opacity .3s ease, visibility .3s ease, transform .3s ease;
  }
  header .navbar .nav-links.active {
    opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
  }
  header .navbar .nav-links > li { width: 100%; }
  header .navbar .nav-links > li > a {
    display: flex; justify-content: space-between; width: 100%;
    min-height: 52px; padding: 14px 4px; color: #003B73;
    font-size: 18px; font-weight: 650; white-space: normal; border-bottom: 1px solid #eee;
  }
  header .navbar.active .nav-links > li > a,
  header .navbar .nav-links > li > a:hover { color: #003B73; }
  header .navbar .nav-links > li.active-link > a { color: #00AEEF; }
  header .navbar .dropdown-menu {
    position: static; display: none; min-width: 0; width: 100%;
    margin: 7px 0 9px; padding: 7px;
    background: #f5f7fa; border: 0; border-radius: 14px; box-shadow: none;
    opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  }
  header .navbar .dropdown.open > .dropdown-menu { display: block; }
  header .navbar .dropdown:hover > .dropdown-menu,
  header .navbar .dropdown:focus-within > .dropdown-menu {
    opacity: 1; visibility: visible; transform: none;
  }
  header .navbar .dropdown-menu::before { display: none; }
  header .navbar .dropdown-menu li a {
    min-height: 48px; padding: 12px 13px; color: #003B73;
    font-size: 17px; border: 0; border-radius: 9px;
  }
  header .navbar .dropdown-menu li a:hover {
    padding-left: 18px; color: #003B73; background: #e8f3fa;
  }
}
@media (max-width: 480px) {
  header .navbar, header .navbar.active {
    top: 9px; width: calc(100% - 20px); min-height: 68px;
    padding: 8px 14px; border-radius: 38px;
  }
  header .navbar .logo { gap: 9px; }
  header .navbar .logo-img {
    flex-basis: 46px; width: 46px; height: 46px; max-width: 46px;
  }
  header .navbar .logo-text h2 { font-size: clamp(13.5px, 3.8vw, 16px); line-height: 1.25; }
  header .navbar .logo-text span { font-size: 12px; }
  header .navbar .menu-toggle {
    flex-basis: 48px; width: 48px; height: 48px; font-size: 26px;
  }
  header .navbar .nav-links {
    right: -2px; width: min(380px, calc(100vw - 20px));
    padding: 16px 20px; border-radius: 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  header .navbar, header .navbar *, header .navbar *::before, header .navbar *::after {
    transition-duration: .01ms !important; animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ========================================
   GIRO PREMIUM DE FLECHAS
======================================== */

.navbar .dropdown > a i {
    display: inline-block;
    transition: transform 0.35s ease;
    transform: rotate(0deg);
}

/* ESCRITORIO */
.navbar .dropdown:hover > a i,
.navbar .dropdown:focus-within > a i,
.navbar .dropdown.open > a i {
    transform: rotate(180deg);
}

/* MÓVIL */
@media (max-width: 1300px) {

    .navbar .dropdown > a i {
        transition: transform 0.35s ease;
    }

    .navbar .dropdown.open > a i {
        transform: rotate(180deg);
    }

}

/* Accesibilidad: resaltar el foco del teclado para navegar sin ratón. */
header .navbar a:focus-visible,
header .navbar .menu-toggle:focus-visible {
  outline: 3px solid #00AEEF;
  outline-offset: 3px;
  border-radius: 8px;
}

/* Color institucional del nombre: también en enlaces visitados. */
header .navbar .logo,
header .navbar .logo:link,
header .navbar .logo:visited,
header .navbar .logo-text,
header .navbar .logo-text h2 { color: #fff !important; text-decoration: none; }
header .navbar.active .logo,
header .navbar.active .logo:link,
header .navbar.active .logo:visited,
header .navbar.active .logo-text,
header .navbar.active .logo-text h2 { color: #003B73 !important; }
