/* ============================================
   ESTILOS DE NAVEGACIÓN - ARCHIVO GLOBAL
   RESPONSIVO: mobile-first (base = 320px)
   ============================================ */

/* ============ NAV BASE (MOBILE) ============ */

nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  /* RESPONSIVO: mobile padding */
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* RESPONSIVO: fondo sólido en móvil — backdrop-filter en nav crea un containing
     block que hace que position:fixed del overlay se posicione relativo al nav
     en lugar del viewport, rompiendo el menú de pantalla completa */
  background: rgba(245, 239, 227, 0.97);
  border-bottom: 1px solid rgba(138, 47, 26, 0.08);
  transition: padding 0.3s ease;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  /* RESPONSIVO: texto más pequeño en móvil para que no se parta */
  font-size: 1rem;
  color: var(--ink, #1A0500);
  text-decoration: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100vw - 100px);
}

/* RESPONSIVO: imágenes siempre escalables */
.nav-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  max-width: 100%;
  display: block;
}

/* RESPONSIVO: nav-links ocultos en móvil */
.nav-links {
  display: none;
  list-style: none;
}

.nav-links a {
  color: var(--ink-soft, #3D3028);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0;
  width: 0; height: 1px;
  background: var(--mustard, #C9952A);
  transition: width 0.3s ease;
}

.nav-links a:hover        { color: var(--mustard, #C9952A); }
.nav-links a:hover::after { width: 100%; }
.nav-links a.active        { color: var(--mustard, #C9952A); }
.nav-links a.active::after { width: 100%; }

/* RESPONSIVO: CTA oculto en móvil */
.nav-cta {
  display: none;
  background: var(--mustard, #C9952A);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.3s ease;
  align-items: center;
  gap: 0.5rem;
}

.nav-cta:hover {
  background: var(--mustard-deep, #A67A1E);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(201, 149, 42, 0.25);
}

/* RESPONSIVO: botón hamburger — siempre visible en móvil */
.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  /* RESPONSIVO: área mínima de toque 44×44px */
  padding: 10px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  /* encima del overlay 9998 */
  z-index: 9999;
  border-radius: 8px;
  transition: background 0.2s ease;
}

/* quita el outline de focus del navegador */
.menu-toggle:focus { outline: none; }
.menu-toggle:focus-visible { outline: 2px solid var(--mustard, #C9952A); outline-offset: 2px; }

/* fondo suave al hacer hover/tap */
.menu-toggle:hover { background: rgba(201, 149, 42, 0.1); }

.menu-toggle span {
  width: 24px; height: 2px;
  background: var(--ink, #1A0500);
  border-radius: 2px;
  transition: all 0.3s ease;
  display: block;
}

/* Animación hamburger → X */
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.menu-toggle.open span { background: #fff; }

/* RESPONSIVO: menú overlay — usa clase .open (igual que todo el JS) */
.nav-links.open {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  /* RESPONSIVO: color fijo (no variable) para garantizar el fondo oscuro */
  background: #1A0500;
  z-index: 9998;
  justify-content: center;
  align-items: center;
  gap: 0;
  padding: 0;
  list-style: none;
  animation: navFadeIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links.open::before {
  content: '✦';
  font-size: 1.6rem;
  color: var(--mustard, #C9952A);
  margin-bottom: 2rem;
}

.nav-links.open li {
  width: 100%;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-links.open li:first-child { border-top: 1px solid rgba(255, 255, 255, 0.06); }

.nav-links.open li a {
  display: block;
  /* RESPONSIVO: altura mínima de toque 44px */
  padding: 1.1rem 2rem;
  min-height: 44px;
  font-size: 1.4rem;
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}

.nav-links.open li a:hover,
.nav-links.open li a.active {
  color: var(--mustard, #C9952A);
  background: rgba(255, 255, 255, 0.04);
}

/* quita el subrayado ::after del desktop dentro del overlay móvil */
.nav-links.open li a::after { width: 0 !important; }

@keyframes navFadeIn {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ DESKTOP NAV (≥768px) ============ */
@media (min-width: 768px) {
  nav {
    padding: 1.25rem 3rem;
    /* RESPONSIVO: blur solo en desktop, sin riesgo de romper el overlay móvil */
    background: rgba(245, 239, 227, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .nav-logo { font-size: 1.15rem; }
  .nav-logo-img { width: 42px; height: 42px; }

  /* RESPONSIVO: mostrar nav en tablet+ */
  .nav-links {
    display: flex;
    gap: 2.5rem;
  }

  /* RESPONSIVO: mostrar CTA en tablet+ */
  .nav-cta { display: inline-flex; }

  /* RESPONSIVO: ocultar hamburger en tablet+ */
  .menu-toggle { display: none; }
}

/* ============ FIN DE NAVEGACIÓN ============ */
