/* ==================================================
   HEADER Y NAVEGACIÓN
   ================================================== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #060125;
  padding: 10px 40px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Logo */
.logo img {
  height: 100px;
  width: auto;
}

/* Menú principal - ESCRITORIO */
.menu {
  display: flex;
  align-items: center;
  gap: 25px;
}

.menu a {
  color: #FFFFFF;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

.menu a:hover {
  color: #e0e0e0;
}

/* Botón hamburguesa - OCULTO EN ESCRITORIO */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  width: 40px;
  height: 40px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Líneas del ícono hamburguesa */
.hamburger {
  display: block;
  width: 24px;
  height: 2px;
  background: #FFFFFF;
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background: #FFFFFF;
  left: 0;
}

.hamburger::before {
  top: -6px;
}

.hamburger::after {
  bottom: -6px;
}

/* ==================================================
   RESPONSIVE - MÓVIL (max-width: 768px)
   ================================================== */
@media (max-width: 768px) {
  .navbar {
    padding: 10px 20px;
    flex-wrap: wrap;
  }

  /* Mostrar botón hamburguesa */
  .menu-toggle {
    display: flex;
    order: 2;
  }

  /* Ocultar menú por defecto en móvil */
  .menu {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    background-color: #060125;
    margin-top: 10px;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Mostrar menú cuando tiene clase "open" */
  .menu.open {
    display: flex;
  }

  /* Todos los elementos del menú en móvil */
  .menu a,
  .menu .dropbtn,
  .menu .login-link,
  .menu .user-menu-button {
    width: calc(100% - 40px);
    margin: 5px auto;
    padding: 12px 16px;
    background: #060125;
    color: #ffffff;
    font-weight: bold;
    text-align: center;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    display: block;
  }

  /* Efecto hover */
  .menu a:hover,
  .menu .dropbtn:hover,
  .menu .login-link:hover,
  .menu .user-menu-button:hover {
    background: #04325a;
  }

  /* Menú de usuario en móvil */
  .user-menu {
    width: 100%;
  }

  .user-menu-button {
    width: 100%;
    justify-content: center;
  }

  .user-dropdown {
    position: static !important;
    width: calc(100% - 40px) !important;
    margin: 10px auto 0 auto;
    background: rgba(255, 255, 255, 0.05) !important;
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  /* Ocultar dropdown por defecto */
  .user-dropdown {
    display: none;
  }

  /* Mostrar cuando user-menu tiene clase "open" */
  .user-menu.open .user-dropdown {
    display: block;
  }

  .user-dropdown a {
    color: white !important;
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  /* Prevenir scroll cuando menú está abierto */
  body.no-scroll {
    overflow: hidden;
  }
}

/* ==================================================
   MENÚ DE USUARIO (ESCRITORIO)
   ================================================== */
.user-menu {
  position: relative;
}

.user-menu-button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px 12px;
  font-size: inherit;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 4px;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  min-width: 180px;
  display: none;
  z-index: 1000;
}

.user-menu.open .user-dropdown {
  display: block;
}

.user-dropdown a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}

.user-dropdown a:hover {
  background: #f5f5f5;
}

.user-dropdown a:last-child {
  border-bottom: none;
}
