/* ===================== RESET ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #222;
  background-color: #f9f9f9;
}

/* ===================== HEADER ===================== */
.header {
  background-color: #364dcc;
  color: #fff;
  padding: 10px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.header__container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* LOGO */
.logo img {
  height: 60px;
}

/* Ajustar el logo */
.logo-container {
  display: flex;
  align-items: center;
}

/* NAV */
.nav__list {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 20px;
}

.nav__list li a {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  padding: 8px 12px;
  transition: background 0.3s ease, color 0.3s ease;
  border-radius: 4px;
}

.nav__list li a:hover {
  background-color: #80cef8;
  color: #000;
}

/* SUBMENU DESKTOP */
.nav__list li.has-submenu {
  position: relative;
}

.nav__list li.has-submenu .submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #4c8bd9;
  list-style: none;
  padding: 5px 0;
  border-radius: 8px;
  min-width: 200px;
}

.nav__list li.has-submenu:hover .submenu {
  display: block;
}

.nav__list li.has-submenu .submenu li a {
  display: block;
  padding: 10px 20px;
  color: #fff;
}

.nav__list li.has-submenu .submenu li a:hover {
  background-color: #80cef8;
  color: #000;
}

/* ICONOS SOCIALES HEADER */
.nav__list li.social-icons {
  display: flex;
  gap: 10px;
}

.nav__list li.social-icons a {
  color: #fff;
  font-size: 18px;
  transition: color 0.3s ease;
}

.nav__list li.social-icons a:hover {
  color: #80cef8;
}

/* ===================== FOOTER ===================== */
footer {
  background-color: #364dcc;
  color: #fff;
  padding: 20px 10px;
}

.footer__links {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.footer__links a {
  color: #fff;
  text-decoration: none;
  margin-right: 15px;
  font-weight: 500;
  transition: color 0.3s ease;
}

.footer__links a:hover {
  color: #80cef8;
}

.footer__links .social-icons {
  display: flex;
  gap: 10px;
}

.footer__links .social-icons a {
  color: #fff;
  font-size: 18px;
}

footer p {
  text-align: center;
  margin-top: 10px;
  font-size: 14px;
}

/* ===================== HAMBURGUESA CORREGIDA ===================== */

/* Checkbox oculto */
.menu-toggle {
  display: none;
}

/* Icono hamburguesa */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px;
  z-index: 9999;
  margin-left: 10px;
}

.hamburger span {
  display: block;
  width: 28px;
  height: 4px;
  background: #fff;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Animación de X cuando el checkbox está activo */
.menu-toggle:checked + .hamburger span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle:checked + .hamburger span:nth-child(2) {
  opacity: 0;
}
.menu-toggle:checked + .hamburger span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Ocultar el menú hamburguesa en escritorio */
@media (min-width: 901px) {
  .hamburger {
    display: none;
  }
  /* Ocultar flecha en escritorio */
  .nav__list .has-submenu > .submenu-toggle {
    display: none;
  }
}

/* Mostrar el menú hamburguesa en móvil */
@media (max-width: 900px) {
  .hamburger {
    display: flex;
  }

  /* Mostrar flecha en móvil */
  .nav__list .has-submenu > .submenu-toggle {
    display: inline-block;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding-left: 5px;
  }

  /* Menú principal móvil */
  .nav__list {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    background: linear-gradient(to left, #7fbff4f2, #3097ff);
    padding: 15px 10px;
    border-radius: 8px;
    width: 160px;
    gap: 10px;
    z-index: 9999;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Mostrar menú al marcar checkbox */
  .menu-toggle:checked ~ .nav .nav__list {
    display: flex;
  }

  /* Ítems con submenú */
  .has-submenu {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .has-submenu > a {
    pointer-events: auto;
    flex-grow: 1;
  }

  /* Submenú móvil */
  .nav__list li.has-submenu .submenu {
    display: flex;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background-color: transparent;
    border-radius: 6px;
    margin-top: 0;
    padding: 0;
    z-index: 9999;
    border: none;
  }

  /* Abrir submenú */
  .submenu.open {
    max-height: 300px;
    padding: 5px 0;
  }

  /* Rotar flecha al abrir */
  .submenu-toggle.open {
    transform: rotate(90deg);
  }

  /* Elementos del submenú */
  .submenu li {
    margin: 2px 0;
    border: none;
    list-style: none;
  }

  .submenu li a {
    padding: 10px 15px;
    color: #fff;
    text-decoration: none;
    display: block;
    border-radius: 4px;
    background-color: #4c8bd9;
    margin: 2px 5px;
    border: none;
    transition: background-color 0.3s ease, color 0.3s ease;
  }

  .submenu li a:hover {
    background-color: #80cef8;
    color: #000;
  }

  /* Iconos sociales centrados en móvil */
  .social-icons-header {
    justify-content: center;
    margin-top: 10px;
  }
}

/* ===================== POSICIONAMIENTO Z ===================== */
@media (min-width: 901px) {
  .nav__list, .nav__list ul, .nav__list li {
    position: relative;
    z-index: 9999;
  }
}


