/* 🎓 Header institucional con franja roja superior */
.franja-azul {
  background: linear-gradient(90deg, #001f54, #003f88);
  color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.25);
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: visible;
  z-index: 1000;
  padding-bottom: 0.5rem;
}

/* 🔴 Franja roja superior */
.franja-azul::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 8px;
  background: #e63946;
}

/* 🔹 Topbar */
.topbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 2rem 0.8rem 2rem;
  flex-wrap: wrap;
  position: relative;
  text-align: center;
}

/* 🏫 Nombre de la escuela */
.topbar h1 {
  font-size: clamp(1rem, 4vw, 1.9rem);
  font-weight: 800;
  color: #fff;
  margin: 0;
  text-align: center;
  line-height: 1.3;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.3);
}

/* 🛡️ Logo */
.logo {
  height: 90px;
  width: auto;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  padding: 5px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.logo:hover {
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(255,255,255,0.4);
}

/* ☰ Botón del menú */
.menu-toggle {
  position: absolute;
  right: 1rem;
  top: 1.2rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  display: none;
  z-index: 2000;
  transition: transform 0.3s ease;
}
.menu-toggle:hover {
  transform: scale(1.1);
}

/* 🔗 Menú principal */
nav {
  text-align: center;
  position: relative;
  z-index: 1500;
}

.nav-list {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 0;
  margin: 0;
}

.nav-list li a {
  display: inline-block;
  background: #2e66b6;
  color: #fff;
  text-decoration: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.25);
  transition: background 0.3s, transform 0.2s;
}
.nav-list li a:hover {
  background: #5584d6;
  transform: translateY(-2px);
}
.nav-list a.active {
  background: #e63946;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}

/* 📱 Responsive (móvil) */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    z-index: 1001;
  }

  nav {
    width: 100%;
    position: relative;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    background: rgba(0, 43, 122, 0.97);
    border-radius: 16px;
    padding: 1rem;
    margin: 0.5rem auto;
    width: 85%;
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    animation: fadeOut 0.3s ease-in-out forwards;
  }

  .nav-list.open {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    animation: slideDown 0.3s ease-in-out forwards;
  }

  .nav-list li {
    width: 100%;
  }

  .nav-list li a {
    display: block;
    width: 100%;
    text-align: center;
    border-radius: 10px;
    background: #2e66b6;
  }

  @keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  @keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
  }
}
