/* Efectos avanzados: animaciones, scroll reveal, hover, micro-interacciones */

/* Animación de entrada suave al cargar */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(63, 185, 80, 0.15); }
  50% { box-shadow: 0 0 32px rgba(63, 185, 80, 0.25); }
}

@keyframes floatSubtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Planeta neuronal: pulso del centro y movimiento de líneas */
@keyframes neuralCentroPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 40px rgba(63, 185, 80, 0.4), inset 0 0 20px rgba(63, 185, 80, 0.2);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 56px rgba(63, 185, 80, 0.55), inset 0 0 24px rgba(63, 185, 80, 0.25);
  }
}

@keyframes neuralLineDash {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -28; }
}

/* Aplicar animación de entrada a hero y secciones */
.hero-titulo {
  animation: fadeInUp 0.7s ease-out;
}

.hero-descripcion {
  animation: fadeInUp 0.7s ease-out 0.1s both;
}

.hero .btn {
  animation: fadeInUp 0.7s ease-out 0.2s both;
}

/* Scroll reveal: elementos visibles al entrar en viewport */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Tarjetas: hover con elevación y borde acento */
.tarjeta {
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.tarjeta:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Botones: micro-interacción */
.btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Nav: enlaces con subrayado animado */
.nav-enlaces a {
  position: relative;
}

.nav-enlaces a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--color-acento);
  transition: width 0.25s ease;
}

.nav-enlaces a:hover::after,
.nav-enlaces a[aria-current="page"]::after {
  width: 100%;
}

/* CTA con glow sutil */
.cta {
  animation: glowPulse 4s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.cta:hover {
  transform: scale(1.01);
}

/* Cotizador: contenedor resultado con aparición */
.cotizador-resultado {
  animation: scaleIn 0.5s ease-out;
}

.cotizador-resultado .precio-nuestro {
  animation: fadeInUp 0.5s ease-out 0.2s both;
}

/* Lista ventajas: icono con pulse al hover */
.lista-ventajas li {
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.lista-ventajas li:hover {
  transform: translateX(4px);
}

.lista-ventajas li::before {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lista-ventajas li:hover::before {
  transform: scale(1.1);
  box-shadow: 0 0 12px var(--color-acento-suave);
}

/* Input focus: glow suave */
.formulario-contacto input:focus,
.formulario-contacto textarea:focus,
.cotizador-form textarea:focus {
  box-shadow: 0 0 0 3px var(--color-acento-suave);
}

/* Bloque de precio: destacado */
.precio-destacado {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.precio-destacado:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(63, 185, 80, 0.2);
}

/* Barra de ahorro animada */
.ahorro-bar {
  overflow: hidden;
  border-radius: var(--radio);
  height: 8px;
  background: var(--color-surface-alt);
}

.ahorro-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-acento), var(--color-acento-hover));
  border-radius: var(--radio);
  transition: width 1s ease-out;
}

/* Menú móvil: botón hamburguesa */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-borde);
  border-radius: var(--radio);
  background: var(--color-surface);
  color: var(--color-texto);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.nav-toggle:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-acento);
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  margin: 0 auto;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 900px) {
  .nav-toggle {
    display: flex;
  }
  .nav-enlaces {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 1rem 1.5rem;
    background: rgba(13, 15, 18, 0.98);
    border-bottom: 1px solid var(--color-borde);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  }
  .nav-inner {
    position: relative;
    flex-wrap: wrap;
  }
  .nav-enlaces.is-open {
    display: flex;
  }
  .nav-enlaces li {
    border-bottom: 1px solid var(--color-borde);
  }
  .nav-enlaces li:last-child {
    border-bottom: none;
  }
  .nav-enlaces a {
    display: block;
    padding: 0.75rem 0;
  }
}

@media (max-width: 640px) {
  .cotizador-resultado .tarjetas {
    grid-template-columns: 1fr !important;
  }
}
