/* ===================================
   HEADER / NAVBAR
   Barra de navegación sticky con gradiente morado/rosa
   =================================== */

.header {
  position: sticky;
  /* Se queda fijo al hacer scroll */
  top: 0;
  /* Pegado arriba */
  z-index: 40;
  /* Alta prioridad sobre otros elementos */
  background: linear-gradient(90deg, #c026d3 0%, #a21caf 50%, #f97316 100%) !important;
  /* Gradiente morado/rosa/naranja como Stripe */
  color: #ffffff;
  /* Color de texto blanco */
  box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
  /* Sombra morada sutil */
  overflow: visible;
  /* Permite que mega menú salga del header */
  border-bottom: none;
  /* Sin borde */
}

/* Contenedor con flexbox para alinear logo, nav y acciones */
.nav-container {
  display: flex;
  align-items: center;
  /* Centrado vertical */
  justify-content: space-between;
  /* Espacio entre elementos */
  padding: 0.9rem 0;
}

/* Logo: Imagen + texto */
.logo {
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  /* Espacio entre imagen y texto */
}

.logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  /* Mantiene proporciones de la imagen */
}

.logo span {
  color: #ffffff;
  /* Texto del logo en blanco */
}

/* Navegación principal: Lista de links horizontales */
.nav {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  /* Espacio entre cada link */
  position: relative;
  /* Para posicionar mega menús */
}

/* Estilos de cada link de navegación */
.nav a {
  font-size: 0.94rem;
  text-decoration: none;
  color: #fff !important;
  /* Blanco con ligera transparencia */
  font-weight: 500;
  /* Peso medio */
  position: relative;
  /* Para el subrayado ::after */
  padding: 0;
  background: transparent;
  box-shadow: none;
  transition: color var(--transition-fast);
  /* Transición suave */
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Subrayado animado que aparece al hacer hover */
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.3rem;
  /* Debajo del texto */
  width: 0;
  /* Inicia sin ancho */
  height: 2px;
  /* Grosor de línea */
  background: #ffffff;
  /* Color blanco del subrayado */
  transition: width var(--transition-fast);
  /* Animación del crecimiento */
}

/* Estado hover: texto blanco sólido */
.nav a:hover {
  color: #ffffff;
  /* Blanco sólido al hacer hover */
  transform: none;
  box-shadow: none;
}

/* Al hacer hover, el subrayado crece de 0 a 100% de ancho */
.nav a:hover::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.nav-login {
  font-size: 0.94rem;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.2s;
}

.nav-login:hover {
  color: #ffffff;
}

.nav-login .arrow-right,
.btn-outline .arrow-right {
  display: inline-block;
  transition: transform 0.2s;
}

.nav-login:hover .arrow-right,
.btn-outline:hover .arrow-right {
  transform: translateX(3px);
}

.header .nav-actions .btn-outline {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: none;
  font-weight: 500;
  transition: all 0.2s;
}

.header .nav-actions .btn-outline:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

.header .nav-actions .btn-primary {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: none;
}

.header .nav-actions .btn-primary:hover {
  background: rgba(255, 255, 255, 0.28);
  border-color: rgba(255, 255, 255, 0.55);
}

/* NAV TOGGLE (MOBILE) */

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: #fff !important;
  border-radius: 999px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

/* RESPONSIVE NAV */

@media (max-width: 1024px) {
  .nav {
    position: absolute;
    top: 60px;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 0.9rem 1rem;
    flex-direction: column;
    gap: 0.7rem;
    min-width: 180px;
    display: none;
  }

  .nav.open {
    display: flex;
  }

  .nav-actions .btn-outline {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    margin-right: 1.2rem;
  }

  .nav a {
    color: #1e293b !important;
    background: transparent;
    border-radius: 12px;
    padding: 0.7rem 1.2rem;
    text-align: center;
    font-size: 1.1rem;
    position: relative;
    transition: color 0.2s;
  }

  .nav a::after {
    content: "";
    position: absolute;
    left: 20%;
    bottom: 8px;
    width: 0;
    height: 2px;
    background: #2563eb;
    border-radius: 2px;
    transition: width 0.2s;
  }

  .nav a:hover {
    color: #2563eb;
    background: transparent;
  }

  .nav a:hover::after {
    width: 60%;
  }
}

@media (max-width: 720px) {
  .nav {
    position: absolute;
    top: 60px;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 0.9rem 1rem;
    flex-direction: column;
    gap: 0.7rem;
    min-width: 180px;
    display: none;
  }

  .nav.open {
    display: flex;
  }

  .nav-actions .btn-outline {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }
}