/* ============================================================
   ELSADECOR Motion System — motionsites-style effects
   Hero reveal · scroll stagger · card hover · marquee · shine
   Zero dependencies. Progressive enhancement (no-JS = static).
   ============================================================ */

/* ---------- base safety ---------- */
html.elsa-js body { overflow-x: hidden; }

/* ---------- hero entrance ---------- */
html.elsa-js .elsa-hero {
  clip-path: inset(100% 0 0 0);
  animation: elsaHeroReveal 1.25s cubic-bezier(.77, 0, .18, 1) .15s forwards;
}
@keyframes elsaHeroReveal {
  to { clip-path: inset(0 0 0 0); }
}

.elsa-h-eyebrow,
.elsa-h-title .elsa-word > span,
.elsa-h-sub,
.elsa-h-cta {
  opacity: 0;
}
body.elsa-hero-in .elsa-h-eyebrow {
  animation: elsaFadeUp .8s cubic-bezier(.22, 1, .36, 1) .55s forwards;
}
body.elsa-hero-in .elsa-h-title .elsa-word > span {
  animation: elsaWordUp .95s cubic-bezier(.22, 1, .36, 1) forwards;
  animation-delay: var(--elsa-d, .7s);
}
body.elsa-hero-in .elsa-h-sub {
  animation: elsaFadeUp .8s cubic-bezier(.22, 1, .36, 1) 1.35s forwards;
}
body.elsa-hero-in .elsa-h-cta {
  animation: elsaFadeUp .8s cubic-bezier(.22, 1, .36, 1) 1.5s forwards;
}
@keyframes elsaFadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
@keyframes elsaWordUp {
  from { opacity: 1; transform: translateY(115%); }
  to   { opacity: 1; transform: none; }
}
.elsa-h-title .elsa-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: .1em;
  margin-bottom: -.1em;
}
.elsa-h-title .elsa-word > span {
  display: inline-block;
  will-change: transform;
}

/* ---------- hero parallax content ---------- */
.elsa-hero-inner { will-change: transform; }

/* ---------- scroll reveal ---------- */
.elsa-rv {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.22, 1, .36, 1), transform .8s cubic-bezier(.22, 1, .36, 1);
  transition-delay: var(--elsa-d, 0ms);
  will-change: opacity, transform;
}
.elsa-rv.elsa-in {
  opacity: 1;
  transform: none;
}
.elsa-rv-img img,
img.elsa-rv-img {
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .9s ease, transform 1.1s cubic-bezier(.22, 1, .36, 1);
}
.elsa-rv-img.elsa-in img,
img.elsa-rv-img.elsa-in {
  opacity: 1;
  transform: none;
}

/* ---------- marquee band ---------- */
.elsa-marquee {
  overflow: hidden;
  background: #1a1a2e;
  color: #c9a96e;
  padding: 16px 0;
  position: relative;
  user-select: none;
}
.elsa-marquee-track {
  display: flex;
  width: max-content;
  animation: elsaMarquee 26s linear infinite;
}
.elsa-marquee:hover .elsa-marquee-track { animation-play-state: paused; }
.elsa-marquee span {
  font-size: 13px;
  letter-spacing: .35em;
  text-transform: uppercase;
  white-space: nowrap;
  padding-right: 2.5em;
}
@keyframes elsaMarquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- product card hover (WooCommerce + home cards) ---------- */
.elsa-card {
  transition: transform .55s cubic-bezier(.22, 1, .36, 1), box-shadow .55s cubic-bezier(.22, 1, .36, 1);
}
.elsa-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 22px 44px rgba(26, 26, 46, .13);
  z-index: 2;
}
.elsa-imgwrap {
  overflow: hidden;
  display: block;
}
.elsa-imgwrap img {
  transition: transform .8s cubic-bezier(.22, 1, .36, 1) !important;
  will-change: transform;
}
.elsa-card:hover .elsa-imgwrap img,
.woocommerce ul.products li.product:hover .elsa-imgwrap img {
  transform: scale(1.07);
}

/* WooCommerce shop grid card polish */
.woocommerce ul.products li.product.elsa-card {
  background-clip: padding-box;
}

/* sale badge pop on hover */
.woocommerce ul.products li.product:hover .onsale {
  animation: elsaPop .45s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes elsaPop {
  0% { transform: scale(1); }
  55% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

/* ---------- button shine sweep ---------- */
.elsa-shine {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.elsa-shine::after {
  content: "";
  position: absolute;
  top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.45) 50%, transparent 100%);
  transform: skewX(-20deg);
  transition: left .65s ease;
  pointer-events: none;
}
.elsa-shine:hover::after { left: 120%; }

/* ---------- single product page ---------- */
.elsa-sp .woocommerce-product-gallery {
  animation: elsaFadeUp .9s cubic-bezier(.22, 1, .36, 1) both;
}
.elsa-sp .summary > * {
  opacity: 0;
  transform: translateY(18px);
  animation: elsaFadeUp .7s cubic-bezier(.22, 1, .36, 1) forwards;
}
.elsa-sp .summary > *:nth-child(1) { animation-delay: .15s; }
.elsa-sp .summary > *:nth-child(2) { animation-delay: .25s; }
.elsa-sp .summary > *:nth-child(3) { animation-delay: .35s; }
.elsa-sp .summary > *:nth-child(4) { animation-delay: .45s; }
.elsa-sp .summary > *:nth-child(5) { animation-delay: .55s; }
.elsa-sp .summary > *:nth-child(n+6) { animation-delay: .65s; }

/* ---------- dropdown smooth transition (override) ---------- */
.elsa-dd-menu {
  display: block;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .28s ease, transform .28s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .28s;
  pointer-events: none;
}
.elsa-dd:hover .elsa-dd-menu,
.elsa-dd:focus-within .elsa-dd-menu {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition-delay: 0s;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html.elsa-js .elsa-hero { animation: none; clip-path: none; }
  .elsa-h-eyebrow, .elsa-h-title .elsa-word > span, .elsa-h-sub, .elsa-h-cta { opacity: 1 !important; animation: none !important; transform: none !important; }
  .elsa-rv, .elsa-rv-img img, img.elsa-rv-img, .elsa-sp .summary > * { opacity: 1 !important; transform: none !important; transition: none !important; animation: none !important; }
  .elsa-marquee-track { animation: none; }
  .elsa-card, .elsa-imgwrap img { transition: none !important; }
}
