/**
 * nav.css
 * ─────────────────────────────────────────────────────────────
 * Estilos para el sistema de navegación (hamburger menu)
 * ─────────────────────────────────────────────────────────────
 */

/* Reset y base para el nav */
#main-nav,
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ── BOTÓN HAMBURGER (3 rayitas) ── */
.nav-toggle {
  position: fixed;
  top: 16px;
  left: 16px;
  width: 44px;
  height: 44px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 12px 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-toggle:hover {
  background: rgba(30, 41, 59, 0.96);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.nav-toggle:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.nav-toggle[aria-expanded="true"] {
  background: rgba(30, 23, 42, 0.98);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: #f8fafc;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease, width 0.2s ease;
}

/* Animación cuando está abierto */
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  width: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ── DRAWER (menú lateral) ── */
.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  z-index: 1002;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.nav-drawer.open {
  transform: translateX(0);
}

.nav-drawer-inner {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 20px;
}

/* ── CABECERA DEL DRAWER ── */
.nav-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.nav-close {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #f8fafc;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-close:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
  transform: scale(1.05);
}

.nav-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: contain;
}

.nav-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  margin: 16px 0;
}

/* ── LINKS DE NAVEGACIÓN ── */
.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
  background: rgba(56, 189, 248, 0.12);
  color: #f8fafc;
}

.nav-link.active {
  background: rgba(0, 142, 218, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(0, 142, 218, 0.3);
}

.nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ── SPACER ── */
.nav-spacer {
  flex: 1;
  min-height: 20px;
}

/* ── TEMA CLARO/OSCURO ── */
.nav-theme-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  margin-top: auto;
}

.nav-theme-label {
  flex: 1;
  font-size: 0.85rem;
  font-weight: 500;
  color: #cbd5e1;
}

.nav-theme-btn {
  position: relative;
  width: 52px;
  height: 28px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.nav-theme-btn::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-theme-btn.on::before {
  transform: translateX(24px);
}

.nav-theme-btn[aria-checked="true"] {
  background: rgba(15, 23, 42, 0.9);
}

.nav-theme-knob {
  display: none;
}



.nav-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .nav-toggle {
    top: 12px;
    left: 12px;
    width: 40px;
    height: 40px;
    padding: 10px 8px;
  }

  .nav-drawer {
    width: 85vw;
  }

  .nav-link {
    padding: 12px 14px;
    font-size: 0.9rem;
  }
}

/* ── NAV TOGGLE SIEMPRE VISIBLE (en todas las pantallas) ── */
/* El hamburger menu se muestra siempre - no se oculta en pantallas grandes */
.nav-toggle {
  display: flex;
}

@media (min-width: 1024px) {
  .nav-toggle {
    /* Mantener visible incluso en escritorio */
  }

  .nav-drawer {
    display: block;
    transform: translateX(-100%);
  }

  .nav-drawer.open {
    transform: translateX(0);
  }


}
