/* ==========================================================================
   LEAFA — Motion
   Elegant · Smooth · Premium · Subtle
   Transform and opacity only. Tokens live in style.css.
   ========================================================================== */

@keyframes leafa-fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes leafa-rise {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes leafa-hero-still {
  from {
    opacity: 0.65;
    transform: scale(1.045);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.u-fade-in {
  animation: leafa-fade-in var(--duration-med) var(--ease-out) both;
}

.u-rise {
  animation: leafa-rise var(--duration-slow) var(--ease-emphasize) both;
}

/* --------------------------------------------------------------------------
   Hero entrance
   -------------------------------------------------------------------------- */

.hero__media img,
.page-hero__media img {
  animation: leafa-hero-still 1.1s var(--ease-out) both;
}

.hero__content > *,
.page-hero__content > * {
  animation: leafa-rise 0.72s var(--ease-emphasize) both;
}

.hero__content > :nth-child(1),
.page-hero__content > :nth-child(1) {
  animation-delay: 60ms;
}

.hero__content > :nth-child(2),
.page-hero__content > :nth-child(2) {
  animation-delay: 140ms;
}

.hero__content > :nth-child(3),
.page-hero__content > :nth-child(3) {
  animation-delay: 220ms;
}

.hero__content > :nth-child(4),
.page-hero__content > :nth-child(4) {
  animation-delay: 300ms;
}

.hero__media img,
.page-hero__media img {
  animation-delay: 0ms;
}

/* --------------------------------------------------------------------------
   Scroll reveal / fade up
   -------------------------------------------------------------------------- */

.has-motion .reveal {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 0.7s var(--ease-emphasize),
    transform 0.7s var(--ease-emphasize);
}

.has-motion .reveal.is-inview {
  opacity: 1;
  transform: none;
}

.has-motion .reveal-stagger > * {
  opacity: 0;
  transform: translate3d(0, 12px, 0);
  transition: opacity 0.64s var(--ease-emphasize),
    transform 0.64s var(--ease-emphasize);
}

.has-motion .reveal-stagger.is-inview > * {
  opacity: 1;
  transform: none;
}

.has-motion .reveal-stagger.is-inview > :nth-child(1) {
  transition-delay: 0ms;
}

.has-motion .reveal-stagger.is-inview > :nth-child(2) {
  transition-delay: 70ms;
}

.has-motion .reveal-stagger.is-inview > :nth-child(3) {
  transition-delay: 140ms;
}

.has-motion .reveal-stagger.is-inview > :nth-child(4) {
  transition-delay: 210ms;
}

.has-motion .reveal-stagger.is-inview > :nth-child(5) {
  transition-delay: 280ms;
}

.has-motion .reveal-stagger.is-inview > :nth-child(6) {
  transition-delay: 350ms;
}

/* --------------------------------------------------------------------------
   Image zoom
   -------------------------------------------------------------------------- */

@media (hover: hover) and (pointer: fine) {
  .split__media img,
  .promo img,
  .ritual-card img,
  .ingredient-card img {
    transition: transform 0.8s var(--ease-emphasize);
  }

  .split:hover .split__media img,
  .promo:hover img,
  .ritual-card:hover img,
  .ingredient-card:hover img {
    transform: scale(1.035);
  }
}

/* --------------------------------------------------------------------------
   Product hover
   -------------------------------------------------------------------------- */

.product-card {
  transition: transform 0.45s var(--ease-standard);
}

.product-card__wishlist,
.pdp-wish {
  transition: transform var(--transition-fast), var(--transition-color);
}

.product-card__wishlist svg,
.pdp-wish svg {
  transition: fill var(--duration-base) var(--ease-standard),
    stroke var(--duration-base) var(--ease-standard);
}

@media (hover: hover) and (pointer: fine) {
  .product-card:hover {
    transform: translate3d(0, -3px, 0);
  }

  .product-card__wishlist:hover,
  .pdp-wish:hover {
    transform: scale(1.06);
  }
}

/* --------------------------------------------------------------------------
   Button hover
   -------------------------------------------------------------------------- */

.btn {
  transition: var(--transition-color),
    transform var(--duration-fast) var(--ease-standard);
}

.icon-btn {
  transition: var(--transition-color),
    transform var(--duration-fast) var(--ease-standard);
}

@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover {
    transform: translate3d(0, -1px, 0);
  }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header__bar {
  transition: background-color var(--duration-med) var(--ease-standard),
    box-shadow var(--duration-med) var(--ease-standard),
    border-color var(--duration-med) var(--ease-standard);
}

.site-header.is-scrolled .site-header__bar {
  box-shadow: var(--shadow-xs);
}

.header-count {
  transition: transform var(--duration-fast) var(--ease-emphasize),
    opacity var(--duration-fast) var(--ease-standard);
}

.header-count[hidden] {
  opacity: 0;
  transform: scale(0.7);
}

/* --------------------------------------------------------------------------
   Mobile menu
   -------------------------------------------------------------------------- */

.mobile-menu__nav a {
  transition: color var(--transition-fast),
    padding-left 0.36s var(--ease-emphasize);
}

/* --------------------------------------------------------------------------
   Cart & wishlist drawers
   -------------------------------------------------------------------------- */

.cart-line {
  transition: opacity var(--duration-med) var(--ease-standard);
}

.cart-line__media img {
  transition: transform 0.6s var(--ease-emphasize);
}

@media (hover: hover) and (pointer: fine) {
  .cart-line:hover .cart-line__media img {
    transform: scale(1.04);
  }
}

/* --------------------------------------------------------------------------
   Quick View
   -------------------------------------------------------------------------- */

.quick-view__media img {
  transition: none;
}

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */

.search-overlay.is-open .search-overlay__frame {
  animation: leafa-rise 0.56s var(--ease-emphasize) both;
}

.search-result {
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.search-result__media img {
  transition: transform 0.6s var(--ease-emphasize);
}

@media (hover: hover) and (pointer: fine) {
  .search-result:hover .search-result__media img {
    transform: scale(1.04);
  }
}

/* --------------------------------------------------------------------------
   FAQ accordion
   -------------------------------------------------------------------------- */

.faq-item__q {
  transition: color var(--duration-base) var(--ease-standard);
}

.faq-nav button {
  transition: var(--transition-color),
    transform var(--duration-fast) var(--ease-standard);
}

@media (hover: hover) and (pointer: fine) {
  .faq-nav button:hover {
    transform: translate3d(0, -1px, 0);
  }
}

/* --------------------------------------------------------------------------
   Carousel
   -------------------------------------------------------------------------- */

.carousel__viewport {
  scroll-behavior: smooth;
}

.carousel__dots button {
  transition: background-color var(--duration-base) var(--ease-standard),
    transform var(--duration-base) var(--ease-emphasize);
}

.carousel__dots button.is-active {
  transform: scale(1.28);
}

.testimonial.is-active {
  animation: leafa-rise 0.62s var(--ease-emphasize) both;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

/* Toast motion is defined on .toast in style.css */

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero__media img,
  .page-hero__media img,
  .hero__content > *,
  .page-hero__content > *,
  .search-overlay.is-open .search-overlay__frame,
  .testimonial.is-active {
    animation: none;
  }

  .has-motion .reveal,
  .has-motion .reveal-stagger > *,
  .has-motion .reveal.is-inview,
  .has-motion .reveal-stagger.is-inview > * {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .product-card:hover,
  .product-card:hover .product-card__media img,
  .category-card:hover img,
  .split:hover .split__media img,
  .promo:hover img,
  .ritual-card:hover img,
  .ingredient-card:hover img,
  .instagram-grid a:hover img,
  .pdp-zoom:hover img,
  .btn:hover,
  .icon-btn:hover,
  .quick-view__panel:hover .quick-view__media img,
  .cart-line:hover .cart-line__media img,
  .search-result:hover .search-result__media img,
  .toast.is-visible,
  .carousel__dots button.is-active {
    transform: none;
  }

  .hero__media img,
  .page-hero__media img {
    transform: none;
  }

  .faq-item__a {
    transition: none;
  }

  .mobile-menu:not(.is-open) {
    transform: translateX(-100%);
  }

  .cart-drawer:not(.is-open) .cart-drawer__panel {
    transform: translateX(100%);
  }

  .carousel__viewport {
    scroll-behavior: auto;
  }
}
