/* ==========================================================================
   ESTILOS DEL MENÚ DE NAVEGACIÓN Y HAMBURGUESA (BASE / MÓVIL)
   ========================================================================== */
body {
  /* ... tus otros estilos ... */
  padding-top: 60px; /* Ajusta este valor según el alto real de tu barra de navegación */
}

.main-nav {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0; /* Clave: se ancla a ambos bordes sin sobrepasar el 100% de la pantalla */
  width: auto !important; /* Anula el width rígido que empujaba el menú */
  background-color: #4a0505;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between; 
  align-items: center;
  z-index: 999999 !important; 
  box-sizing: border-box;
}

/* Estilos para el logo reactivo (Texto + Imagen) */
.nav-logo {
  color: #f1c40f; /* Dorado marcial */
  font-family: 'Segoe UI', sans-serif;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  padding: 5px 0;
  transition: color 0.3s ease;
}

/* Fuerza a la imagen interna del logo a medir exactamente lo mismo que el texto */
.nav-logo .logo-img {
  height: 1.2em !important;
  width: auto !important;
  display: block;
  object-fit: contain;
}

.nav-logo:hover {
  color: #ffffff; 
}

/* Botón Hamburguesa */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  /* CAMBIO CLAVE: Asegurar que flote sobre cualquier imagen o fondo */
  z-index: 100000 !important; 
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: #ffffff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Lista de enlaces en formato Móvil (Desplegable vertical) */
.nav-menu {
  display: flex;
  flex-direction: column;
  position: fixed; 
  top: 48px; /* Cambiado a 48px para que empiece justo debajo del borde de la barra fija */
  left: 0;
  width: 100%;
  background-color: #4a0505;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-in-out;
  z-index: 99999 !important; 
}
.nav-menu li {
  width: 100%;
  text-align: center;
}

.nav-link {
  display: block;
  padding: 15px 20px;
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
  box-sizing: border-box;
}

.nav-link:hover {
  background-color: #700b0b;
  color: #ffcc00; 
}

/* MODIFICADO EXTRA: Asegurar que cuando el JS añada ".is-active", el alto sea suficiente */
.nav-menu.is-active {
  max-height: 350px !important; /* Altura ideal para tus 5 enlaces */
  box-shadow: 0px 8px 16px rgba(0,0,0,0.4); /* Sombra elegante para notar que flota */
}

/* ==========================================================================
   ESTADOS ACTIVOS (Gestionados con JavaScript)
   ========================================================================== */

.nav-menu.is-active {
  max-height: 300px; 
}

.menu-toggle.is-active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* ==========================================================================
   VISTA DE ESCRITORIO (PANTALLAS GRANDES) - CORRECCIÓN PARA EDGE
   ========================================================================== */
@media (min-width: 768px) {
  .menu-toggle {
    display: none !important; /* Desaparece por completo en PC */
  }

  .nav-menu {
    display: flex !important;
    flex-direction: row !important; 
    position: static !important; /* Vuelve al flujo normal en PC */
    width: auto !important;
    max-height: none !important;   
    background-color: transparent !important;
    overflow: visible !important;
    align-items: center !important; 
    gap: 15px; 
    height: 100%; 
  }
}

  .nav-menu li {
    width: auto;
    display: flex !important;
    align-items: center !important; /* Fuerza a cada ítem de la lista a centrar su contenido */
    height: 100%;
  }

  /* Rediseño de enlaces para neutralizar el empuje de líneas/bordes */
  .nav-link {
    display: inline-flex !important;
    align-items: center !important;      /* Centra el texto verticalmente en su propia caja */
    justify-content: center;
    padding: 10px 15px !important;
    box-sizing: border-box !important;   /* Evita que los bordes sumen tamaño exterior */
    border-bottom: none !important;      /* Limpiamos herencias de móvil */
    height: 40px;                        /* Le damos una altura fija idéntica a todos los botones */
    line-height: 1 !important;           /* Resetea la altura de línea para que Edge no invente espacios */
  }
}