/* =====================================================
   COMPONENTE: NAVBAR
   Links de navegación y menú móvil
   ===================================================== */

/* =====================================================
   NAVEGACIÓN DESKTOP
   ===================================================== */
.navbar {
  display: flex;
  gap: 24px;
  align-items: center;
}

.nav-link {
  position: relative;
  font-weight: 600;
  font-size: 0.95rem;
  color: #33434b;
  padding: 10px 14px;
  border-radius: var(--radius);
  transition: var(--transition-base);
  overflow: hidden;
}

/* Efecto de fondo al hover */
.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(243, 229, 180, 0.1);
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition-base);
  z-index: -1;
}

.nav-link:hover::before {
  transform: scaleX(1);
}

/* Línea inferior animada */
.nav-link::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 8px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  transform: scaleX(0);
  transition: var(--transition-base);
}

.nav-link:hover::after {
  transform: scaleX(1);
}

/* Hover state */
.nav-link:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* Active state (página actual) */
.nav-link.active {
  color: var(--accent);
  background: rgba(253, 197, 0, 0.15);
  box-shadow: var(--shadow-sm);
}

.nav-link.active::after {
  transform: scaleX(1);
}

/* Click feedback */
.nav-link:active {
  transform: translateY(0);
  transition: var(--transition-fast);
}

/* Focus state para accesibilidad */
.nav-link:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}

/* =====================================================
   MENÚ MÓVIL
   ===================================================== */
.mobile-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  padding: 0;
  gap: 8px;
  position: fixed;
  top: 70px;
  right: 0;
  width: 25%;
  z-index: 999;
  box-shadow: var(--shadow-lg);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease;
}

.mobile-panel.open {
  display: flex;
  max-height: 500px;
  opacity: 1;
  padding: 24px;
  animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-panel a {
  color: var(--white);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  transition: var(--transition-base);
  position: relative;
  overflow: hidden;
}

/* Efecto de brillo al hover */
.mobile-panel a::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: translateX(-100%);
  transition: var(--transition-slow);
}

.mobile-panel a:hover::before {
  transform: translateX(100%);
}

.mobile-panel a:hover {
  background: rgba(255, 255, 255, 0.1);
  padding-left: 24px;
  box-shadow: inset 4px 0 0 var(--accent);
}

/* Active state con animación */
.mobile-panel a.active {
  background: rgba(253, 197, 0, 0.2);
  border-left: 4px solid var(--accent);
  padding-left: 20px;
  animation: pulse 2s ease infinite;
}

/* Focus state para accesibilidad móvil */
.mobile-panel a:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: -3px;
}

/* =====================================================
   ANIMACIONES
   ===================================================== */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: inset 4px 0 0 var(--accent), 0 0 0 rgba(253, 197, 0, 0);
  }
  50% {
    box-shadow: inset 4px 0 0 var(--accent), 0 0 12px rgba(253, 197, 0, 0.4);
  }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 992px) {
  /* Ocultar navegación horizontal en tablets */
  .navbar {
    display: none;
  }

  .mobile-panel {
    width: 50%;
    max-width: 320px;
  }
}

@media (max-width: 768px) {
  .mobile-panel {
    width: 70%;
    border-radius: 0 0 0 var(--radius-lg);
  }
}

@media (max-width: 480px) {
  .mobile-panel {
    width: 85%;
    top: 60px;
  }

  .mobile-panel a {
    font-size: 1.05rem;
    padding: 16px 16px;
  }
  
  .mobile-panel a:hover {
    padding-left: 20px;
  }
  
  .mobile-panel a.active {
    padding-left: 16px;
  }
}