/*-----HEADER------*/
header {
  font-family: 'Atlan', sans-serif;
  background: linear-gradient(0deg, rgb(40, 4, 84), rgb(66, 3, 142));
  box-shadow: 0 8px 20px -14px rgba(0, 0, 0, 0.4);
  padding: 3px 15px;
  border-radius: 70px;
  width: 90%;
  max-width: 720px;
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999 !important;  /* CAMBIADO: mucho más alto */
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* CORREGIDO: sin espacio entre header y .scrolled */
header.scrolled {
  background: linear-gradient(0deg, rgb(30, 3, 64), rgb(50, 2, 110));
  box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.7);
  padding: 2px 15px;
  max-width: 95%;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 215, 0, 0.2);
}

header .navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  position: relative;
}

header .logo_area {
  margin-left: 5px;
  display: flex;
  align-items: center;
}

header .logo_area img {
  width: 40px;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

header .logo_area:hover img {
  transform: rotate(5deg) scale(1.1);
}

/* ----- MENÚ HAMBURGUESA ----- */
header .menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
  z-index: 10000 !important;  /* CAMBIADO: aún más alto */
  margin-right: 5px;
  position: relative;  /* AGREGADO */
}

header .menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: #F5F5EB;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Animación del botón hamburguesa cuando está activo */
header .menu-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

header .menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

header .menu-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

header .nav_links {
  margin-right: 5px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
}

header .nav_links a {
  font-family: 'Atlan', sans-serif;
  text-decoration: none;
  padding: 8px 15px;
  color: #F5F5EB;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
  border-radius: 30px;
  position: relative;
  overflow: hidden;
}

header .nav_links a::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: -1;
}

header .nav_links a:hover::before {
  width: 150px;
  height: 150px;
}

header .nav_links a:hover {
  color: #FFD700;
  transform: translateY(-2px);
}

header .nav_links a:active {
  transform: translateY(0);
}

/* Indicador de página activa */
header .nav_links a.active {
  background: rgba(255, 215, 0, 0.15);
  color: #FFD700;
}

/* ----- MEDIA QUERIES ----- */
@media screen and (max-width: 1024px) {
  header {
    width: 95%;
    padding: 3px 15px;
  }
  
  header .nav_links a {
    padding: 7px 12px;
    font-size: 0.9rem;
  }
  
  header .logo_area img {
    width: 38px;
  }
}

@media screen and (max-width: 768px) {
  header {
    top: 10px;
    padding: 5px 15px;
    border-radius: 50px;
  }
  
  header .logo_area img {
    width: 35px;
  }
  
  header .nav_links a {
    padding: 6px 10px;
    font-size: 0.85rem;
  }
}

/* ----- MÓVILES (hasta 600px) ----- */
@media screen and (max-width: 600px) {
  header .menu-toggle {
    display: flex !important;  /* FORZADO con !important */
  }
  
  header .nav_links {
    position: fixed;
    top: 70px;  /* Ajustado */
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(0deg, rgb(40, 4, 84), rgb(66, 3, 142));
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
    gap: 10px;
    overflow: hidden;
    transition: height 0.3s ease;
    border-radius: 0 0 30px 30px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    z-index: 9998;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
  }
  
  header .nav_links.active {
    height: auto;
    padding: 15px 0 20px 0;  /* Ajustado */
  }
  
  header .nav_links a {
    width: 90%;  /* Un poco más estrecho */
    text-align: center;
    padding: 8px 0;  /* Más alto para mejor click */
    font-size: 16px;
    border-radius: 40px;
    white-space: normal;
  }
  
  header.scrolled .nav_links {
    top: 60px;
  }
}

@media screen and (max-width: 400px) {
  header {
    padding: 5px 10px;
    border-radius: 40px;
  }
  
  header .logo_area img {
    width: 30px;
  }
  
  header .menu-toggle {
    width: 25px;
    height: 18px;
  }
  
  header .nav_links a {
    font-size: 14px;
    padding: 6px 0;
  }
}

