/* ============================================================
   SHUBHAM FASHION - Animation Layer
   Vanilla CSS equivalents of React Bits components:
   1. SplitText stagger (hero headline words)
   2. ShinyText sweep (trust badge, new-season tag)
   3. Clip-path photo reveal (storefront & interior images)
   4. Magnetic button CSS custom-property slots
   ============================================================ */


/* ============================================================
   1. SPLIT TEXT - Per-word stagger fade+rise
      JS splits .split-text into .split-word spans,
      then staggers adding .split-word--visible.
   ============================================================ */

.split-text {
  display: block;
  text-align: left; /* prevent any justify bleed from parent */
}

.split-line {
  display: block;
  /* overflow: hidden removed — the opacity fade replaces the clip mask */
}

.split-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 480ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 480ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
  /* NO margin-left here — the space character between spans in HTML
     provides natural word spacing without double-spacing */
}

.split-word--visible {
  opacity: 1;
  transform: translateY(0);
}

/* Space spans between words — no animation, just normal font word spacing */
.split-space {
  display: inline-block;
  white-space: pre; /* preserve the single space character width */
}

/* prefers-reduced-motion: show immediately, no motion */
@media (prefers-reduced-motion: reduce) {
  .split-word {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}


/* ============================================================
   2. SHINY TEXT - CSS light-sweep shimmer
      A warm-white gradient sweeps left-to-right on a loop.
      Only use on 1-2 accent spots (badge, promo tag).
   ============================================================ */

@keyframes shinySwipe {
  0% {
    background-position: -200% center;
  }
  60%, 100% {
    background-position: 200% center;
  }
}

.shiny-text {
  /* Base appearance stays whatever the parent defines.
     The shimmer is layered on top via background-clip. */
  display: inline-block;
  background-image: linear-gradient(
    105deg,
    currentColor 20%,
    rgba(255, 255, 255, 0.85) 40%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(255, 255, 255, 0.85) 60%,
    currentColor 80%
  );
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shinySwipe 3s ease-in-out infinite;
  animation-delay: 1s;
}

/* Fallback: if background-clip:text not supported, just show solid color */
@supports not (-webkit-background-clip: text) {
  .shiny-text {
    color: currentColor;
    -webkit-text-fill-color: currentColor;
    animation: none;
    background-image: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shiny-text {
    animation: none !important;
    background-position: 0 center !important;
  }
}


/* ============================================================
   3. CLIP-PATH PHOTO REVEAL - Left-to-right wipe
      Applied to image wrapper elements with .photo-reveal.
      Triggers when .revealed or .photo-reveal--visible is added.
   ============================================================ */

.photo-reveal {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 850ms cubic-bezier(0.65, 0, 0.35, 1);
  will-change: clip-path;
}

.photo-reveal.revealed,
.photo-reveal--visible {
  clip-path: inset(0 0% 0 0);
}

@media (prefers-reduced-motion: reduce) {
  .photo-reveal {
    clip-path: none !important;
    transition: none !important;
  }
  .photo-reveal.revealed,
  .photo-reveal--visible {
    clip-path: none !important;
    transition: none !important;
  }
}


/* ============================================================
   4. MAGNETIC BUTTON SLOTS
      JS writes --magnet-x and --magnet-y custom properties
      on .magnet-btn elements. CSS applies the translate.
      Wrapping element has pointer-events and overflow visible.
   ============================================================ */

.magnet-btn {
  --magnet-x: 0px;
  --magnet-y: 0px;
  display: inline-block; /* needed when wrapping an <a> */
  transition: transform 300ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: translate(var(--magnet-x), var(--magnet-y));
}

/* On touch devices or when hover is not the primary input,
   disable the magnetic transform entirely */
@media (hover: none), (pointer: coarse) {
  .magnet-btn {
    transform: none !important;
    transition: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .magnet-btn {
    transform: none !important;
    transition: none !important;
  }
}


/* ============================================================
   TRUST BADGE (ShinyText instance)
   Trust section rating score gets a subtle shiny treatment.
   Parent color is --text-primary; shimmer is warm-white.
   ============================================================ */

.trust__score.shiny-text {
  /* Override: the shimmer should use dark + warm-gold tones
     to match the brand's warm off-white palette */
  background-image: linear-gradient(
    105deg,
    var(--text-primary) 20%,
    var(--brand-yellow) 40%,
    #fff8e1 50%,
    var(--brand-yellow) 60%,
    var(--text-primary) 80%
  );
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shinySwipe 4s ease-in-out infinite;
  animation-delay: 2s;
}


/* ============================================================
   NEW SEASON TAG (ShinyText instance on products.html)
   Small inline label above the page header eyebrow.
   ============================================================ */

.new-season-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-green);
  margin-bottom: var(--space-sm);
  position: relative;
}

.new-season-tag .shiny-text {
  background-image: linear-gradient(
    105deg,
    var(--brand-green) 15%,
    #b8f5a0 40%,
    #e8fff0 50%,
    #b8f5a0 60%,
    var(--brand-green) 85%
  );
  background-size: 220% auto;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shinySwipe 3.5s ease-in-out infinite;
  animation-delay: 0.5s;
}

/* Dot separator */
.new-season-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-green);
  flex-shrink: 0;
}


/* ============================================================
   LAYOUT INTEGRATION OVERRIDES
   Rules that make the animation wrappers coexist cleanly
   with the existing site layout.
   ============================================================ */

/* Hero CTA magnet wrapper: inherit the heroFadeUp animation
   so the whole button group fades in on load, then the
   magnet transform animates on hover. */
.hero .magnet-btn {
  display: inline-block; /* keeps the button inline within hero__content */
  opacity: 0;
  animation: heroFadeUp 500ms cubic-bezier(0.25, 0.46, 0.45, 0.94) 500ms forwards;
  /* Layer on top of magnet transform — both apply simultaneously */
  transform: translate(var(--magnet-x), var(--magnet-y));
}

/* When magnet is disabled (touch), reset transform but keep fade animation */
@media (hover: none), (pointer: coarse) {
  .hero .magnet-btn {
    transform: none !important;
  }
}

/* CTA banner: keep the reveal class on .magnet-btn and ensure
   it still renders as inline for centering */
.cta-banner .magnet-btn {
  display: inline-block;
}

/* page-header new-season-tag: center it since page-header is text-align:center */
.page-header .new-season-tag {
  justify-content: center;
  display: flex;
  width: 100%;
}

