/* ===== Reset y tipografía ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Barlow', sans-serif;
  background-color: #f9f9f9;
}

/* ===== Contenedor ===== */
.header .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* ===== Header ===== */
.header {
  background-color: #ffffff;
  border-bottom: 2px solid #e0e0e0;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  padding: 15px 0;
  border-radius: 10px;
}

/* ===== Logo ===== */
.logo img {
  height: 55px;
  transition: all 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

/* ===== Menú Desktop ===== */
.nav-list {
  display: flex;
  list-style: none;
  gap: 35px;
}

.nav-list li {
  position: relative;
}

.nav-list a {
  text-decoration: none;
  color: #333333;
  font-weight: 500;
  padding: 12px 8px;
  border-radius: 15px;
  transition: all 0.3s ease;
}

.nav-list a:hover {
  color: #ffffff;
  background-color: #050b57;
}

/* Submenú Desktop */
.has-submenu .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  list-style: none;
  border: 1px solid #ddd;
  min-width: 300px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  border-radius: 15px;
  z-index: 100;
  padding-top: 5px;
  transition: all 0.3s ease;
}

.has-submenu:hover .submenu {
  display: block;
}

.submenu li a {
  padding: 5px 15px;
  display: block;
  color: #333333;
  font-weight: 400;
  border-radius: 15px;
  margin: 10px;
  transition: all 0.3s ease;
}

.submenu li a:hover {
  background-color: #a2d45e;
  color: #ffffff;
}

/* Submenú "Programas" */
.nav-list li:nth-child(3) .submenu li a {
  padding: 6px 15px;
}

/* Estilos base del enlace "Donar" */
li.donate a {
  display: inline-block;
  padding: 10px 20px;
  background-color: #050b57;
  color: #fff;
  text-decoration: none;
  transition: background-color 0.3s ease;
  background-attachment: fixed; 
}

li.donate a:hover {
  background-color: #a1007d;
}

/* ===== Hamburguesa ===== */
.hamburger {
  display: none; /* se activará en media query */
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 22px;
  background: none;
  border: none;
  cursor: pointer;

  /* FIX: posición segura para móviles/tablets */
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
}

.hamburger span {
  display: block;
  height: 3px;
  width: 30px;
  background: #050b57;
  border-radius: 3px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ===== Menú móvil / tablet ===== */
@media (max-width: 992px) {

  /* Logo centrado */
  .logo {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .logo img {
    height: 40px;
  }

  /* Mostrar hamburguesa */
  .hamburger {
    display: flex !important;
  }
  
  /* Navegación móvil */
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100%;
    background: #ffffff;
    flex-direction: column;
    padding: 70px 25px;
    transition: right 0.35s ease;
    z-index: 1500;
    box-shadow: -4px 0 15px rgba(0,0,0,0.1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav.active {
    right: 0;
  }

  /* Ajuste de nav-list */
  .nav-list {
    flex-direction: column;
    gap: 0;
    padding-bottom: 20px;
  }

  .nav-list li {
    margin-bottom: 20px;
  }

  /* Submenús móviles tipo acordeón */
  .has-submenu .submenu {
    position: static;
    border: none;
    display: none;
    box-shadow: none;
    padding-left: 10px;
    margin-top: 10px;
  }

  /* Mostrar submenú al hacer click (requiere JS) */
  .has-submenu.active .submenu {
    display: block;
  }

}
