/* ================================================================
   Artivaz — Animations Stylesheet
   All compositor-only (opacity + transform) — mobile-safe
   Heavy visual FX only at (hover: hover) = real pointer devices
   ================================================================ */

/* ─────────────────────────────────────
   KEYFRAME LIBRARY
   ───────────────────────────────────── */

/* Generic fade + slide up */
@keyframes art-fade-up {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Slide in from left */
@keyframes art-slide-right {
  from { opacity: 0; transform: translateX(-36px); }
  to   { opacity: 1; transform: translateX(0);     }
}

/* Slide in from right */
@keyframes art-slide-left {
  from { opacity: 0; transform: translateX(36px); }
  to   { opacity: 1; transform: translateX(0);    }
}

/* Scale-up pop */
@keyframes art-pop-in {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1);    }
}

/* Gentle float — desktop only (filter: blur used, so gated below) */
@keyframes art-float {
  0%, 100% { transform: translateY(0px);    }
  50%       { transform: translateY(-10px); }
}

/* CTA pulse ring — used on hero button */
@keyframes art-cta-ripple {
  0%   { transform: scale(1);    opacity: 0.55; }
  100% { transform: scale(1.6);  opacity: 0;    }
}

/* Shine sweep — trust chips on hover */
@keyframes art-shine-sweep {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

/* Image cross-fade reveal (hero slideshow) */
@keyframes art-img-fade-in {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1);    }
}

/* Section heading underline expand */
@keyframes art-underline-grow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* Floating sparkle dots — desktop decoration */
@keyframes art-sparkle {
  0%, 100% { opacity: 0;    transform: translateY(0)   scale(0.8); }
  50%       { opacity: 0.7; transform: translateY(-18px) scale(1.2); }
}

/* ─────────────────────────────────────
   SCROLL-REVEAL STATES
   JS adds .art-hidden on mount, then .art-revealed when in viewport
   ───────────────────────────────────── */

.art-hidden {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.art-revealed {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Slide-from-left variant */
.art-hidden-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.art-hidden-left.art-revealed {
  opacity: 1 !important;
  transform: translateX(0) !important;
}

/* Slide-from-right variant */
.art-hidden-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.art-hidden-right.art-revealed {
  opacity: 1 !important;
  transform: translateX(0) !important;
}

/* Scale-pop variant */
.art-hidden-pop {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: opacity, transform;
}

.art-hidden-pop.art-revealed {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* ─────────────────────────────────────
   IMAGE SLIDE-IN / CROSSFADE
   ───────────────────────────────────── */

.art-img-hidden {
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.art-img-revealed {
  opacity: 1 !important;
  transform: scale(1) !important;
}

/* Hero image crossfade — driven by JS slideshow */
.hero-art img.hero-slide-active {
  opacity: 1;
  transition: opacity 1.1s ease;
}

.hero-art img.hero-slide-exit {
  opacity: 0;
  transition: opacity 1.1s ease;
}

/* ─────────────────────────────────────
   PAGE TRANSITIONS
   ───────────────────────────────────── */

.art-page-in {
  animation: art-fade-up 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.art-page-out {
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: none;
}

/* ─────────────────────────────────────
   CTA PULSE — Hero button ripple ring
   ───────────────────────────────────── */

.art-cta-pulse {
  position: relative;
}

.art-cta-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid var(--accent);
  animation: art-cta-ripple 0.9s ease-out 2;
  pointer-events: none;
}

/* ─────────────────────────────────────
   TRUST CHIP SHINE on hover
   ───────────────────────────────────── */

.art-shine {
  background-image: linear-gradient(
    105deg,
    transparent 20%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 80%
  ) !important;
  background-size: 200% auto !important;
  animation: art-shine-sweep 0.7s linear forwards !important;
}

/* ─────────────────────────────────────
   SECTION HEADING DECORATIVE UNDERLINE
   ───────────────────────────────────── */

.section-head h2 {
  position: relative;
  display: inline-block;
}

.section-head h2::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
  border-radius: 2px;
}

.section-head h2.art-heading-revealed::after {
  transform: scaleX(1);
}

/* ─────────────────────────────────────
   PRODUCT CARD MICRO-INTERACTIONS
   Desktop only — hover: hover guard
   ───────────────────────────────────── */

@media (hover: hover) and (pointer: fine) {
  .product-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease !important;
  }

  .product-card:hover {
    transform: translateY(-5px) scale(1.015) !important;
    box-shadow: 0 18px 42px rgba(68, 45, 26, 0.14) !important;
  }

  .product-card:hover .product-media img {
    transform: scale(1.07);
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* Brand value card tilt */
  .brand-value-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease;
  }

  .brand-value-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 45px rgba(68, 45, 26, 0.12);
  }

  /* Review card gentle lift */
  .review-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .review-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 38px rgba(68, 45, 26, 0.12);
  }

  /* Category pill hover bounce */
  .category-slide-pill {
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.28s ease;
  }

  .category-slide-pill:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 10px 28px rgba(68, 45, 26, 0.12);
  }

  /* Floating decorative sparkles on desktop hero */
  .hero-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
    pointer-events: none;
    z-index: 3;
    animation: art-sparkle var(--dur, 2.8s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
    opacity: 0;
  }
}

/* ─────────────────────────────────────
   MOBILE OVERRIDES — keep everything lightweight
   ───────────────────────────────────── */

@media (max-width: 768px) {

  /* Reduce transition duration for feel of speed */
  .art-hidden,
  .art-hidden-left,
  .art-hidden-right,
  .art-hidden-pop {
    transition-duration: 0.38s !important;
  }

  .art-img-hidden {
    transition-duration: 0.4s !important;
    transform: none !important; /* skip scale on mobile */
  }

  /* Heading underline still works (cheap) */
  .section-head h2::after {
    transition-duration: 0.45s !important;
  }

  /* Kill sparkles & floating dots entirely on mobile */
  .hero-sparkle {
    display: none !important;
  }

  /* CTA pulse — keep but simplify */
  .art-cta-pulse::after {
    animation-iteration-count: 1;
  }
}

/* ─────────────────────────────────────
   STAGGER HELPERS (via JS inline delay)
   ───────────────────────────────────── */
/* staggered siblings get style.transitionDelay set by JS — nothing extra needed */

/* ─────────────────────────────────────
   HERO IMAGE SLIDESHOW TRANSITIONS
   ───────────────────────────────────── */

/* Hero art holds the slideshow; JS manages active/prev classes */
.hero-slide-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.4s ease;
  filter: saturate(0.88) contrast(1.06);
  will-change: opacity;
}

.hero-slide-img.is-active {
  opacity: 1;
}

/* ─────────────────────────────────────
   REDUCED MOTION — full override
   ───────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {

  .art-hidden,
  .art-hidden-left,
  .art-hidden-right,
  .art-hidden-pop {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .art-img-hidden {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .art-page-in,
  .art-page-out {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .section-head h2::after {
    transform: scaleX(1) !important;
    transition: none !important;
  }

  .hero-slide-img {
    transition: none !important;
  }

  .hero-sparkle {
    display: none !important;
  }
}
