/* ===== HEADER ===== */
header {
  background: var(--primary);
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 1000;
  font-family: inherit;
  line-height: 1;
}

/* Contenedor principal */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
  min-height: 100px;
  flex-wrap: wrap;
}

/* ===== LOGO ===== */
h1.logo {
  display: flex;
  align-items: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff !important;   /* blanco */
  margin: 0;
  line-height: 1.2;
}

h1.logo img,
h1.logo .logo-img {
  width: 60px; 
  height: 60px; 
  object-fit: contain;
  margin-right: 15px;
  flex-shrink: 0;
  display: block;
}


/* ===== MENÚ ===== */
nav ul {
  display: flex;
  gap: 2rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding-inline-start: 0;
}

nav ul li {
  position: relative;
}

nav ul li a {
  color: #fff;
  font-weight: 400;
  transition: color 0.3s;
  font-size: 1.2rem;
  padding: 2.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
}

nav ul li a:hover {
  color: var(--secondary);
}

nav ul li a.campus-link {
  background: var(--secondary);
  color: #fff;
  padding: 0.4rem 0.8rem;
  font-weight: 700;
  font-size: 1.1rem;
  border-radius: 6px;
  transition: background 0.3s ease, transform 0.2s ease;
}

nav ul li a.campus-link:hover {
  background: #005fa3;
  transform: scale(1.05);
}

/* ===== SUBMENÚ ===== */
.submenu-parent { position: relative; }

.submenu {
  display: none;
  flex-direction: column;
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-radius: 6px;
  padding: 0.5rem;
  min-width: 180px;
  z-index: 999;
}

.submenu li { padding: 0.3rem 1rem; }

.submenu li a {
  color: var(--dark);
  font-size: 1rem;
  text-align: left;
  display: block;
  padding: 0.4rem 0.5rem;
}

.submenu li a:hover { color: var(--secondary); }

@media (min-width: 769px) {
  .submenu-parent:hover .submenu {
    display: flex;
  }
}

.submenu-parent.open .submenu {
  display: flex;
  position: static;
  background: var(--primary);
}

.submenu-parent.open .submenu li a { color: #fff; }

/* ===== MENU HAMBURGUESA ===== */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 30px;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}
/* ===== RESPONSIVE LOGO ===== */
@media (max-width: 768px) {
  h1.logo {
    font-size: 1.5rem;   /* texto más pequeño en móvil */
  }
  h1.logo img {
    width: 30px;         /* logo más pequeño en móvil */
    height: 30px;
    margin-right: 10px;
  }
}

@media (max-width: 480px) {
  h1.logo {
    font-size: 1.4rem;   /* aún más pequeño en móviles muy chicos */
  }
  h1.logo img {
    width: 32px;
    height: 32px;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {

  nav ul.nav-links {
    position: absolute;
    top: 100px;
    right: 0;
    background: var(--primary);
    flex-direction: column;
    gap: 2rem;
    width: 240px;
    padding: 1.2rem;
    display: none;
    border-radius: 0 0 0 10px;
  }
  nav ul.nav-links.show {
    display: flex;
  }
  nav ul li a {
    font-size: 1.3rem;
    padding: 1rem;
  }
  .menu-toggle { display: flex; }
}
