.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 16px 0;
  transition: background 0.3s ease, padding 0.3s ease;
}

.navbar.scrolled {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  display: inline-flex;
  align-items: center;
}

.navbar-logo img {
  height: 46px;
  width: auto;
  display: block;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.navbar.scrolled .navbar-logo img {
  height: 40px;
}

.navbar-logo:hover img {
  opacity: 0.85;
  transform: scale(1.03);
}

@media (max-width: 768px) {
  .navbar-logo img { height: 40px; }
}

.navbar-logo span {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--text);
}

.navbar-logo span em {
  color: var(--red);
  font-style: normal;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.navbar-links a {
  font-family: var(--font-sub);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
  display: inline-block;
}

.navbar-links a:hover {
  color: var(--text);
  transform: scale(1.12);
}

@keyframes draakFlame {
  0%, 100% {
    text-shadow:
      0 0 4px rgba(224, 30, 30, 0.8),
      0 0 10px rgba(224, 30, 30, 0.55),
      0 0 20px rgba(224, 30, 30, 0.2);
  }
  40% {
    text-shadow:
      0 0 6px rgba(255, 60, 50, 0.9),
      0 0 14px rgba(224, 30, 30, 0.6),
      0 0 26px rgba(224, 30, 30, 0.25);
  }
  70% {
    text-shadow:
      0 0 3px rgba(224, 30, 30, 0.85),
      0 0 11px rgba(224, 30, 30, 0.65),
      0 0 22px rgba(224, 30, 30, 0.22);
  }
}

.navbar-links a.active {
  color: var(--text);
  animation: draakFlame 2.8s ease-in-out infinite;
}

.navbar-mobile a.active {
  color: var(--red);
  animation: draakFlame 2.8s ease-in-out infinite;
}

.navbar-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Botón de perfil circular */
.navbar-profile-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  background: none;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  overflow: hidden;
  flex-shrink: 0;
  text-decoration: none;
}

.navbar-profile-btn:hover {
  border-color: var(--red);
  color: var(--text);
}

.navbar-profile-btn.logged-in {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1;
}

.navbar-profile-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

/* Mobile hamburger */
/* Las 3 rayitas ocupan 16px: con `padding: 4px` el botón medía 24px de alto, la mitad del
   mínimo táctil, y es la ÚNICA forma de abrir el menú en mobile (de donde viene todo el
   tráfico). El padding lo lleva a 48×44 de área tocable y el margin negativo se lo
   devuelve al layout: sigue ocupando los mismos 32×24 de antes, así que el navbar NO
   cambia de alto y no se mueve nada en pantalla. Verificado con `npm run smoke:mobile`. */
.navbar-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 14px 12px;
  margin: -10px -8px;
}

.navbar-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: all 0.3s ease;
  transform-origin: center;
}
/* Abierto: las 3 barras se vuelven una X (afordancia de cerrar tocando la misma hamburguesa) */
.navbar-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.navbar-toggle.active span:nth-child(2) { opacity: 0; }
.navbar-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.navbar-mobile {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 999;
  flex-direction: column;
  align-items: center;
  /* Arranca debajo de la navbar (la hamburguesa-X vive ahí, z-index 1000): el
     padding-top despeja el área de cierre para que el primer ítem no quede tapado.
     flex-start + overflow-y garantizan que en pantallas chicas igual se acceda a todo. */
  justify-content: flex-start;
  gap: 34px;
  padding: 104px 24px 48px;
  overflow-y: auto;
}

.navbar-mobile.open {
  display: flex;
}

.navbar-mobile a {
  font-family: var(--font-display);
  font-size: 36px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
  transition: color 0.2s;
}

.navbar-mobile a:hover {
  color: var(--red);
}

.navbar-mobile-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 32px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
}

@media (max-width: 768px) {
  .navbar-links {
    display: none;
  }

  /* Mantenemos el avatar de perfil visible en mobile (abre el drawer/bottom-sheet).
     Solo ocultamos el botón "Reservar", que ya vive en el menú hamburguesa. */
  .navbar-cta {
    display: flex;
    gap: 10px;
  }
  .navbar-cta .btn {
    display: none;
  }

  /* Más claro y táctil en mobile: avatar relleno con ícono a contraste pleno,
     para que se lea como "perfil" y no se confunda con la hamburguesa.
     (La variante .logged-in sigue ganando: círculo rojo con la inicial.) */
  .navbar-profile-btn {
    width: 44px;
    height: 44px;
    background: var(--surface-high);
    border-color: var(--border);
    color: var(--text);
  }

  .navbar-toggle {
    display: flex;
  }
}
