/* ============================================
   GRUPO VALSER — Animations v2
   Rich scroll-triggered + micro-interactions
   ============================================ */

/* ── Scroll-triggered base (hidden before animation) ── */
[data-animate] {
  opacity: 0;
  will-change: transform, opacity;
  transition-property: transform, opacity, filter;
  transition-duration: .7s;
  transition-timing-function: var(--ease-out-expo);
}
[data-animate].animated {
  opacity: 1;
  transform: none !important;
  filter: none !important;
}

/* ── Direction variants ── */
[data-animate="fade-up"]    { transform: translateY(40px); }
[data-animate="fade-down"]  { transform: translateY(-40px); }
[data-animate="fade-left"]  { transform: translateX(40px); }
[data-animate="fade-right"] { transform: translateX(-40px); }

[data-animate="zoom-in"]    { transform: scale(.88); }
[data-animate="zoom-out"]   { transform: scale(1.12); }

[data-animate="flip-up"]    { transform: perspective(800px) rotateX(12deg) translateY(30px); }
[data-animate="flip-left"]  { transform: perspective(800px) rotateY(-10deg) translateX(30px); }

[data-animate="blur-in"]    { filter: blur(12px); transform: translateY(20px); }

[data-animate="slide-up"]   { transform: translateY(60px); }
[data-animate="slide-left"] { transform: translateX(60px); }
[data-animate="slide-right"]{ transform: translateX(-60px); }

/* Stagger children animation delay (added by JS) */
[data-animate-stagger] > * { transition-delay: calc(var(--stagger-i, 0) * .08s); }

/* ── Keyframes — decorative ── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes float-slow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-8px) rotate(2deg); }
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .7; transform: scale(1.05); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,180,0,.3); }
  50%      { box-shadow: 0 0 0 14px rgba(255,180,0,0); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes bounce-soft {
  0%, 100% { transform: translateY(0); }
  40%      { transform: translateY(-8px); }
  60%      { transform: translateY(-4px); }
}
@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes scale-in {
  from { transform: scale(.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(3deg); }
  75%      { transform: rotate(-3deg); }
}
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes reveal-text {
  from { clip-path: inset(0 100% 0 0); }
  to   { clip-path: inset(0 0 0 0); }
}
@keyframes ripple {
  0%   { transform: scale(0); opacity: .6; }
  100% { transform: scale(2.5); opacity: 0; }
}
@keyframes dash-in {
  from { stroke-dashoffset: 100; }
  to   { stroke-dashoffset: 0; }
}

/* ── Utility animation classes ── */
.anim-float       { animation: float 4s ease-in-out infinite; }
.anim-float-slow  { animation: float-slow 6s ease-in-out infinite; }
.anim-pulse-soft  { animation: pulse-soft 3s ease-in-out infinite; }
.anim-pulse-glow  { animation: pulse-glow 2.5s ease-out infinite; }
.anim-shimmer     {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.04) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 3s linear infinite;
}
.anim-spin-slow   { animation: spin-slow 12s linear infinite; }
.anim-bounce-soft { animation: bounce-soft 2s ease-in-out infinite; }
.anim-wiggle:hover{ animation: wiggle .5s ease-in-out; }

/* ── Micro-interactions ── */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.hover-scale {
  transition: transform var(--transition-base);
}
.hover-scale:hover {
  transform: scale(1.04);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* Button ripple effect */
.btn-ripple {
  position: relative; overflow: hidden;
}
.btn-ripple .ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  animation: ripple .6s linear;
  pointer-events: none;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  [data-animate] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}