/* Estilos generales del header */
header, .main-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: #fff;
  color: #181c24;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%; /* Cambiado de 100vw a 100% */
  min-width: 0; /* Cambiado de 100vw a 0 */
  max-width: 100%; /* Cambiado de 100vw a 100% */
  z-index: 1000;
  font-family: 'Segoe UI', Arial, sans-serif;
  box-shadow: 0 4px 18px -6px rgba(0,0,0,0.13);
  border-top: none;
  margin-top: 0;
}

/* Contenedor del logo */
.logo-container {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.logo {
  height: 80px;
  cursor: pointer;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.08));
  transition: filter 0.2s;
  background: transparent; 
}

.logo:hover {
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.18));
}

/* Nueva clase para el logo en el header */
.header-logo {
    width: 50px;
    max-width: 95vw;
    height: auto;
    transition: transform 0.2s;
}

/* Botón hamburguesa - solo visible en móvil */
.hamburger {
  font-size: 28px;
  background: none;
  border: none;
  color: #181c24;
  cursor: pointer;
  display: none; /* oculto en desktop */
}

/* Navegación */
.nav-menu {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.nav-menu ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

.nav-menu ul li a {
  color: #181c24;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s, border-bottom 0.3s;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.nav-menu ul li a:hover {
  color: #3a4a7c;
  border-bottom: 2px solid #3a4a7c;
}

/* Acciones del header (botones, enlaces, etc.) */
.header-actions {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Responsive: menú hamburguesa visible y menú oculto en pantallas pequeñas */
@media (max-width: 768px) {
  header {
    padding: 0 12px;
    background: #fff;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%; /* Cambiado de 100vw a 100% */
    min-width: 0;
    max-width: 100%;
    justify-content: space-between;
  }

  .hamburger {
    display: block;
  }

  .nav-menu {
    flex: 1 1 0;
    display: none;
    position: absolute;
    top: 60px;
    right: 20px;
    background-color: #ffffff;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 10px;
    width: 150px;
    justify-content: center;
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 10px;
  }

  /* Cuando el menú está activo, mostrarlo */
  .nav-menu.active {
    display: block;
  }

  .logo {
    height: 60px;
  }

  .header-logo {
    width: 120px;
  }
}

/* Asegura máxima visibilidad del botón hamburguesa en móviles */
@media (max-width: 900px) {
  .hamburger {
    display: block !important;
    position: relative;
    z-index: 2000 !important;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  }
}

/* Refuerzo para dispositivos muy pequeños */
@media (max-width: 480px) {
  .hamburger {
    font-size: 32px !important;
    padding: 8px !important;
  }
}

/* --- MENÚ HAMBURGUESA MODERNO --- */

/* Oculta el menú de navegación en móviles/tablets */
@media (max-width: 900px) {
  .nav-menu {
    display: none !important;
  }
  .hamburger {
    display: block !important;
    position: relative;
    z-index: 3001 !important;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-size: 32px;
    padding: 8px 12px;
    margin-right: 8px;
  }
  /* MENÚ HAMBURGUESA: estilos base y animación */
  .mobile-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: -100vw;
    width: 80vw;
    max-width: 320px;
    height: 100vh;
    background: #fff;
    box-shadow: -2px 0 16px rgba(0,0,0,0.18);
    z-index: 3000;
    padding: 32px 24px 24px 24px;
    transition: right 0.3s cubic-bezier(.4,0,.2,1);
    gap: 24px;
  }
  .mobile-menu.active {
    right: 0;
  }
  .mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .mobile-menu ul li a {
    color: #181c24;
    font-size: 1.2rem;
    font-weight: 500;
    text-decoration: none;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    transition: color 0.2s;
  }
  .mobile-menu ul li a:hover {
    color: #3a4a7c;
  }
  /* Fondo semitransparente detrás del menú */
  .mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.25);
    z-index: 2999;
    transition: opacity 0.3s;
    opacity: 0;
  }
  .mobile-menu-backdrop.active {
    display: block;
    opacity: 1;
  }
}

/* Desktop: muestra el menú normal y oculta el menú móvil */
@media (min-width: 901px) {
  .mobile-menu, .mobile-menu-backdrop {
    display: none !important;
  }
  .nav-menu {
    display: flex !important;
  }
  .hamburger {
    display: none !important;
  }
}
