/* ==========================================================================
   ANIMACIONES Y MICRO-INTERACCIONES - LAS DELICIAS DE SOYA
   ========================================================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.6);
    opacity: 0;
  }
  100% {
    transform: scale(0.95);
  }
}

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

/* Animaciones del Toast */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(110%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
    max-height: 120px;
    margin-bottom: var(--space-xs);
  }
  to {
    opacity: 0;
    transform: translateX(110%);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Animaciones de la Vista Previa del Header */
@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Animación de selección para Métodos de Pago */
@keyframes popSelect {
  0% {
    transform: scale(0.97);
  }
  50% {
    transform: scale(1.02);
  }
  100% {
    transform: scale(1);
  }
}

/* Animación para el cambio de pasos en el Drawer */
@keyframes stepTransition {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-float {
  animation: floatSoft 4s ease-in-out infinite;
}

.animate-step {
  animation: stepTransition 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Animación de pulso para botón de Wishlist */
@keyframes heartPulse {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.35);
  }
  65% {
    transform: scale(0.9);
  }
  100% {
    transform: scale(1);
  }
}

/* Animación de entrada para botón flotante de comparar */
@keyframes compareBounce {
  0% {
    transform: scale(0.6) translateY(20px);
    opacity: 0;
  }
  70% {
    transform: scale(1.08) translateY(-4px);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.heart-animated {
  animation: heartPulse 0.4s ease-in-out;
}

.animate-compare-in {
  animation: compareBounce 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Reducción de movimiento para usuarios que lo soliciten */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
