/* =====================================================
   HEADER PROFESIONAL MEJORADO
   Logo izquierda, menú derecha
   ===================================================== */

/* Header Principal */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 90, 238, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 90, 238, 0.15);
}

/* Navegación */
.navbar {
  padding: 0;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  position: relative;
  gap: var(--space-4);
}

/* Logo Profesional */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  text-decoration: none;
  transition: all 0.3s ease;
  padding: var(--space-3) 0;
  flex-shrink: 0;
  margin-right: var(--space-8);
}

.nav-logo:hover {
  transform: translateY(-1px);
}

.nav-logo i {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s ease;
}

.nav-logo:hover i {
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-orange) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transform: scale(1.05);
}

.nav-logo span {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--neutral-900);
  font-family: var(--font-headings);
  letter-spacing: -0.025em;
  transition: color 0.3s ease;
}

.nav-logo:hover span {
  color: var(--primary-500);
}

/* Menú de Navegación */
.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: var(--space-6);
  margin: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: var(--space-3) 0;
  text-decoration: none;
  color: var(--neutral-700);
  font-weight: 500;
  font-size: 0.95rem;
  font-family: var(--font-body);
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 6px;
}

.nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-500), var(--accent-purple));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
  border-radius: 1px;
}

.nav-link:hover {
  color: var(--primary-500);
  transform: translateY(-1px);
}

.nav-link:hover::before {
  width: 100%;
}

.nav-link:active {
  transform: translateY(0);
}

/* Estados especiales para enlaces activos */
.nav-link.active {
  color: var(--primary-500);
  font-weight: 600;
}

.nav-link.active::before {
  width: 100%;
}

/* Hamburger Menu para Móvil */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  padding: var(--space-2);
  border-radius: 6px;
  transition: all 0.3s ease;
}

.hamburger:hover {
  background-color: rgba(0, 90, 238, 0.1);
}

.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--neutral-900);
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.hamburger span:not(:last-child) {
  margin-bottom: 4px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Botón CTA en navegación */
.nav-cta {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--accent-purple) 100%);
  color: white !important;
  padding: var(--space-3) var(--space-6) !important;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: none;
  box-shadow: 0 4px 15px rgba(0, 90, 238, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-cta::before {
  display: none;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 90, 238, 0.4);
  background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-orange) 100%);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .nav-container {
    gap: var(--space-3);
  }
  
  .nav-logo {
    margin-right: var(--space-6);
  }
  
  .nav-menu {
    gap: var(--space-5);
  }
  
  .nav-link {
    font-size: 0.9rem;
    padding: var(--space-2) var(--space-1);
  }
  
  .nav-logo span {
    font-size: 1.35rem;
  }
  
  .nav-logo i {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .nav-container {
    padding: 0 var(--space-4);
    min-height: 70px;
    gap: var(--space-2);
  }
  
  .nav-logo {
    margin-right: var(--space-4);
  }
  
  .hamburger {
    display: flex;
  }
  
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: var(--space-12);
    gap: var(--space-8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  }
  
  .nav-menu.active {
    left: 0;
  }
  
  .nav-link {
    font-size: 1.1rem;
    padding: var(--space-4) var(--space-6);
    width: 200px;
    text-align: center;
    border-radius: 8px;
    background: rgba(0, 90, 238, 0.05);
    border: 1px solid transparent;
    transition: all 0.3s ease;
  }
  
  .nav-link:hover {
    background: rgba(0, 90, 238, 0.1);
    border-color: rgba(0, 90, 238, 0.2);
    transform: none;
  }
  
  .nav-cta {
    width: 200px;
    margin-top: var(--space-4);
    font-size: 1rem;
  }
  
  .nav-logo span {
    font-size: 1.25rem;
  }
  
  .nav-logo i {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .nav-container {
    padding: 0 var(--space-3);
    min-height: 65px;
    gap: var(--space-2);
  }
  
  .nav-logo {
    margin-right: var(--space-3);
  }
  
  .nav-menu {
    top: 65px;
    height: calc(100vh - 65px);
    padding-top: var(--space-8);
  }
  
  .nav-logo span {
    font-size: 1.1rem;
  }
  
  .nav-logo i {
    font-size: 1.8rem;
  }
  
  .nav-link {
    font-size: 1rem;
    padding: var(--space-3) var(--space-4);
    width: 180px;
  }
  
  .nav-cta {
    width: 180px;
  }
}

/* Animaciones adicionales */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header.animate-in .nav-logo {
  animation: fadeInDown 0.6s ease-out 0.2s both;
}

.header.animate-in .nav-menu .nav-link:nth-child(1) {
  animation: fadeInDown 0.6s ease-out 0.3s both;
}

.header.animate-in .nav-menu .nav-link:nth-child(2) {
  animation: fadeInDown 0.6s ease-out 0.4s both;
}

.header.animate-in .nav-menu .nav-link:nth-child(3) {
  animation: fadeInDown 0.6s ease-out 0.5s both;
}

.header.animate-in .nav-menu .nav-link:nth-child(4) {
  animation: fadeInDown 0.6s ease-out 0.6s both;
}

.header.animate-in .nav-menu .nav-link:nth-child(5) {
  animation: fadeInDown 0.6s ease-out 0.7s both;
}

.header.animate-in .nav-menu .nav-link:nth-child(6) {
  animation: fadeInDown 0.6s ease-out 0.8s both;
}

/* Mejoras de accesibilidad */
.nav-link:focus {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
  border-radius: 4px;
}

.hamburger:focus {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* Estados hover mejorados */
.nav-logo:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 4px;
  border-radius: 8px;
}

/* Clase para contenido solo para screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}