/*
 * Delight layer (v2, all themes): entrance motion, hover pop, sticker badges and the category icon chips.
 * Everything here is decoration: it is skipped for people who prefer reduced motion, and the page is fully visible without JS.
 */

/* ---------- Category icons: a round white chip with the drawing in the brand colour ---------- */
.wl-cat-ico {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--color-white, #fff); color: var(--color-brand-dark, #1a1a1a);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wl-cat-ico .wl-cat-svg { display: block; width: 26px; height: 26px; }
.category-section .cate-box .wl-cat-ico { width: 64px; height: 64px; margin: 0 auto 12px; }
.category-section .cate-box .wl-cat-ico .wl-cat-svg { width: 34px; height: 34px; }
@media (max-width: 575px) {
  .wl-cat-tile .wl-cat-ico { width: 40px; height: 40px; }
  .wl-cat-tile .wl-cat-ico .wl-cat-svg { width: 22px; height: 22px; }
}

@media (prefers-reduced-motion: no-preference) {
  .wl-cat-tile:hover .wl-cat-ico, .wl-cat-tile:focus-visible .wl-cat-ico,
  .category-section .cate-box:hover .wl-cat-ico { transform: scale(1.12) rotate(-6deg); }

  /* ---------- Entrance: items fade up as they scroll into view (only once JS has marked the page ready) ---------- */
  .wl-motion .wl-reveal { opacity: 0; transform: translateY(18px); }
  .wl-motion .wl-reveal.wl-in {
    opacity: 1; transform: none;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--wl-delay, 0ms);
  }

  /* ---------- Hover / tap: tiles lift (the offer number is not scaled: it overlapped the text next to it) ---------- */
  .card-box { transition: transform 0.2s ease, box-shadow 0.2s ease; }
  .card-box:hover, .card-box:focus-within { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12); }
  .card-box:active { transform: translateY(-1px) scale(0.99); }
  .wl-starters a, .wl-again-chip, .wl-recent-item { transition: transform 0.2s ease; }
  .wl-starters a:hover, .wl-again-chip:hover, .wl-recent-item:hover { transform: translateY(-3px); }

  /* ---------- Page changes cross-fade (supporting browsers only; others navigate as normal) ---------- */
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.2s; }

  /* ---------- A number that changes (the savings calculator) gives a little bump ---------- */
  @keyframes wl-bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
  .wl-bump { display: inline-block; animation: wl-bump 0.35s ease; }

  /* ---------- Empty states: the icon floats gently ---------- */
  @keyframes wl-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
  .wl-empty-icon { animation: wl-float 3.2s ease-in-out infinite; }

  /* ---------- Buttons: a soft press ---------- */
  .btn:not(:disabled):active, .wl-welcome-search button:active { transform: scale(0.97); }
}

/* ---------- Sticker badges (Popular / New / Limited-time): tilted, with a hard offset shadow ---------- */
.card-box .badge { transform: rotate(-4deg); box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18); letter-spacing: 0.02em; }

/* ---------- Confetti (purchase confirmation) ---------- */
.wl-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2000; }

@media (prefers-reduced-motion: no-preference) {
  /* ---------- Gift card tilt + shine (delight.js sets the angles and the light position) ---------- */
  .card-box .img.is-art, .wl-bp-logo:not(.is-square) { transform: perspective(700px) rotateX(var(--wl-rx, 0deg)) rotateY(var(--wl-ry, 0deg)); transition: transform 0.35s ease, box-shadow 0.35s ease; will-change: transform; position: relative; }
  .card-box .img.is-art.wl-tilting, .wl-bp-logo.wl-tilting { transition: transform 0.08s linear, box-shadow 0.2s ease; }
  .card-box .img.is-art.wl-tilting { box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18); }
  .card-box .img.is-art::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1; opacity: 0; transition: opacity 0.3s ease;
    background: radial-gradient(circle at var(--wl-mx, 50%) var(--wl-my, 50%), rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.12) 28%, rgba(255, 255, 255, 0) 55%),
                linear-gradient(115deg, rgba(255, 255, 255, 0) 35%, rgba(255, 255, 255, 0.22) 48%, rgba(255, 255, 255, 0) 60%);
    mix-blend-mode: soft-light; }
  .card-box .img.is-art.wl-tilting::before { opacity: 1; }
  .wl-bp-logo.wl-tilting::after { background: radial-gradient(circle at var(--wl-mx, 50%) var(--wl-my, 50%), rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 55%) !important; }
  /* The tile itself no longer scales on hover when the art is tilting, so the two don't fight. */
  .card-box .img.is-art:hover img { transform: none !important; }

  /* ---------- Amount chips pop; coins burst from the reward line ---------- */
  .amount-chip.wl-chip-pop { animation: wl-chip-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
  @keyframes wl-chip-pop { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
  .wl-coin { position: fixed; z-index: 2000; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; pointer-events: none;
    display: flex; align-items: center; justify-content: center; font: 800 12px/1 system-ui, sans-serif; color: #8a5a00;
    background: radial-gradient(circle at 35% 30%, #fff3b0 0%, #ffd34d 40%, #e5a300 100%); box-shadow: inset 0 0 0 2px #f2b705, 0 2px 4px rgba(0, 0, 0, 0.18);
    animation: wl-coin 0.95s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; opacity: 0; }
  @keyframes wl-coin {
    0% { opacity: 0; transform: translate(0, 0) scale(0.4) rotate(0deg); }
    15% { opacity: 1; }
    60% { opacity: 1; transform: translate(var(--wl-cx), var(--wl-cy)) scale(1) rotate(var(--wl-cr)); }
    100% { opacity: 0; transform: translate(var(--wl-cx), calc(var(--wl-cy) + 26px)) scale(0.85) rotate(var(--wl-cr)); }
  }

  /* ---------- Category icons act out their category on hover ---------- */
  :is(.wl-cat-tile, .category-section .cate-box, a, button):is(:hover, :focus-visible) .wl-cat-svg { animation: wl-ico-wiggle 0.6s ease; transform-origin: 50% 60%; }
  :is(.wl-cat-tile, .category-section .cate-box, a, button):is(:hover, :focus-visible) .wl-cat-svg[data-ico="cart"] { animation: wl-ico-roll 0.7s ease; }
  :is(.wl-cat-tile, .category-section .cate-box, a, button):is(:hover, :focus-visible) .wl-cat-svg:is([data-ico="shirt"], [data-ico="cap"]) { animation: wl-ico-sway 0.9s ease; transform-origin: 50% 0; }
  :is(.wl-cat-tile, .category-section .cate-box, a, button):is(:hover, :focus-visible) .wl-cat-svg[data-ico="plane"] { animation: wl-ico-fly 0.9s ease; }
  :is(.wl-cat-tile, .category-section .cate-box, a, button):is(:hover, :focus-visible) .wl-cat-svg:is([data-ico="heart"], [data-ico="diamond"]) { animation: wl-ico-beat 0.8s ease; }
  :is(.wl-cat-tile, .category-section .cate-box, a, button):is(:hover, :focus-visible) .wl-cat-svg:is([data-ico="gift"], [data-ico="gamepad"]) { animation: wl-ico-shake 0.6s ease; }
  :is(.wl-cat-tile, .category-section .cate-box, a, button):is(:hover, :focus-visible) .wl-cat-svg:is([data-ico="phone"], [data-ico="laptop"]) { animation: wl-ico-buzz 0.45s linear 2; }
  :is(.wl-cat-tile, .category-section .cate-box, a, button):is(:hover, :focus-visible) .wl-cat-svg:is([data-ico="dumbbell"], [data-ico="paw"], [data-ico="sprout"]) { animation: wl-ico-hop 0.7s ease; transform-origin: 50% 100%; }
  @keyframes wl-ico-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 50% { transform: rotate(8deg); } 75% { transform: rotate(-4deg); } }
  @keyframes wl-ico-roll { 0% { transform: translateX(0); } 35% { transform: translateX(5px) rotate(4deg); } 70% { transform: translateX(-3px) rotate(-2deg); } 100% { transform: translateX(0); } }
  @keyframes wl-ico-sway { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(9deg); } 65% { transform: rotate(-7deg); } }
  @keyframes wl-ico-fly { 0% { transform: translate(0, 0); } 45% { transform: translate(7px, -7px) rotate(-8deg); opacity: 0; } 46% { transform: translate(-7px, 7px); opacity: 0; } 100% { transform: translate(0, 0); opacity: 1; } }
  @keyframes wl-ico-beat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.2); } 40% { transform: scale(0.96); } 60% { transform: scale(1.12); } }
  @keyframes wl-ico-shake { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(-12deg) scale(1.05); } 30% { transform: rotate(10deg) scale(1.05); } 45% { transform: rotate(-8deg); } 60% { transform: rotate(6deg); } }
  @keyframes wl-ico-buzz { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }
  @keyframes wl-ico-hop { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-5px) scale(1.03, 0.97); } 60% { transform: translateY(0) scale(1.04, 0.95); } 75% { transform: translateY(-2px); } }
}

/* ---------- Gift card stack: three brands' card art fanned behind the "Find a brand" panel (desktop) ---------- */
.wl-welcome-grid { position: relative; }
.wl-card-stack { display: none; }
@media (min-width: 992px) {
  .wl-card-stack { display: block; position: absolute; right: -28px; top: -66px; width: 320px; height: 200px; pointer-events: none; z-index: 0; }
  .wl-card-stack img { position: absolute; width: 190px; height: auto; aspect-ratio: 330 / 214; object-fit: cover; border-radius: 12px; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2); }
  .wl-card-stack img:nth-child(1) { right: 128px; top: 64px; transform: rotate(-14deg); }
  .wl-card-stack img:nth-child(2) { right: 58px; top: 20px; transform: rotate(-2deg); }
  .wl-card-stack img:nth-child(3) { right: -6px; top: 74px; transform: rotate(12deg); }
  .wl-welcome-card { position: relative; z-index: 1; }
}

/* ---------- Card strip: gift card artwork scrolling slowly across the page ---------- */
.wl-card-strip { padding: 44px 0 26px; background: var(--color-surface, #f3f4f6); overflow: hidden; }
.wl-card-strip-title { text-align: center; font-size: 22px !important; line-height: 1.3; margin: 0 16px 22px !important; }
.wl-card-strip-viewport { overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.wl-card-strip-viewport::-webkit-scrollbar { display: none; }
.wl-card-strip-track { display: flex; gap: 18px; width: max-content; list-style: none; margin: 0; padding: 18px 18px 22px; }
.wl-card-strip-track li { flex: 0 0 auto; }
.wl-card-strip-track a { display: block; border-radius: 10px; transition: transform 0.25s ease; }
.wl-card-strip-track img { display: block; width: 170px; height: auto; aspect-ratio: 330 / 214; object-fit: cover; border-radius: 10px; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15); }
.wl-card-strip-track li:nth-child(odd) img { transform: rotate(-2deg); }
.wl-card-strip-track li:nth-child(even) img { transform: rotate(2deg); }
.wl-card-strip-track a:hover, .wl-card-strip-track a:focus-visible { transform: translateY(-4px) scale(1.04); }
@media (max-width: 575px) { .wl-card-strip-track img { width: 130px; } .wl-card-strip-title { font-size: 19px !important; } }
@media (prefers-reduced-motion: no-preference) {
  .wl-card-stack img { animation: wl-stack-bob 4.5s ease-in-out infinite; }
  .wl-card-stack img:nth-child(2) { animation-delay: -1.5s; }
  .wl-card-stack img:nth-child(3) { animation-delay: -3s; }
  @keyframes wl-stack-bob { 50% { translate: 0 -8px; } }
  .wl-card-strip-viewport { overflow: hidden; }
  .wl-card-strip-track { animation: wl-strip 40s linear infinite; }
  .wl-card-strip:focus-within .wl-card-strip-track { animation-play-state: paused; }
  /* Hover slows the strip down (delight.js); without JS it pauses as before. */
  html:not(.wl-motion) .wl-card-strip:hover .wl-card-strip-track { animation-play-state: paused; }
  @keyframes wl-strip { to { transform: translateX(-50%); } }
}
/* Without motion the second copy is just repetition. */
@media (prefers-reduced-motion: reduce) { .wl-card-strip-track li[aria-hidden="true"] { display: none; } }

/* ---------- Festive layer (body.wl-festive, 1 Dec - 5 Jan): falling snow in the hero, festive "Popular" badges ---------- */
.wl-snow { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.wl-snow i { position: absolute; top: -12px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%; background: #fff; opacity: var(--o); }
@media (prefers-reduced-motion: no-preference) {
  .wl-snow i { animation: wl-snow var(--d) linear var(--dl) infinite; }
  @keyframes wl-snow { from { transform: translate(0, 0); } to { transform: translate(var(--dx), 110vh); } }
}
@media (prefers-reduced-motion: reduce) { .wl-snow i { top: var(--y); } }
.wl-festive :is(.wl-welcome, .wl-bp, .page-hero) > .container { position: relative; z-index: 1; }
.wl-festive .card-box .badge.popular { background: #c8102e !important; color: #fff !important; padding-right: 22px; }
.wl-festive .card-box .badge.popular::after { content: ""; position: absolute; right: 4px; top: 50%; width: 14px; height: 14px; margin-top: -7px;
  background: radial-gradient(circle at 50% 50%, #ffd34d 0 2px, transparent 2.5px), radial-gradient(ellipse 4px 7px at 30% 50%, #1f8a3b 98%, transparent), radial-gradient(ellipse 4px 7px at 70% 50%, #1f8a3b 98%, transparent); }

/* ---------- More motion (all skipped for reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* Home: the example's picture springs in each time its step shows; step pictures bob on hover */
  .wl-ex-panel.is-on .wl-ex-visual > * { animation: wl-spring 0.55s cubic-bezier(.34, 1.56, .64, 1) both; }
  .wl-ex-panel.is-on .wl-ex-visual > *:nth-child(2) { animation-delay: 0.08s; }
  @keyframes wl-spring { from { opacity: 0; transform: translateY(14px) scale(0.92); } to { opacity: 1; transform: none; } }
  .how-does-section .step-box:hover .top img { animation: wl-hop 0.6s ease; }
  @keyframes wl-hop { 40% { transform: translateY(-10px) rotate(-3deg); } 70% { transform: translateY(2px); } }

  /* All brands: tiles cascade in after a filter; a bar slides under the chosen category */
  .card-box.wl-cascade { animation: wl-cascade 0.45s ease both; animation-delay: calc(var(--wl-i, 0) * 35ms); }
  @keyframes wl-cascade { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
  .wl-cat-chips { position: relative; }
  .wl-chip-bar { position: absolute; left: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--color-brand-dark); pointer-events: none; transition: transform 0.35s cubic-bezier(.4, 1.3, .5, 1), width 0.35s ease, opacity 0.2s ease; }
  .wl-cat-chip.is-active .wl-cat-ico { animation: wl-pop 0.35s ease; }
  @keyframes wl-pop { 50% { transform: scale(1.18); } }

  /* Brand page: the card art is dealt onto the table; the reward line pulses; the journey draws itself */
  .wl-bp-logo { animation: wl-deal-in 0.7s cubic-bezier(.2, .9, .3, 1.15) 0.1s both; }
  @keyframes wl-deal-in { from { opacity: 0; transform: translate(60px, -24px) rotate(14deg) scale(0.9); } to { opacity: 1; transform: none; } }
  .cashback-highlight-box.wl-pulse { animation: wl-pulse 0.5s ease; }
  @keyframes wl-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--color-accent) 55%, transparent); } 60% { transform: scale(1.02); } 100% { box-shadow: 0 0 0 12px transparent; transform: none; } }
  .wl-bp-journey.wl-draw::before { transform: scaleX(0); transform-origin: left center; transition: transform 1.1s ease 0.2s; }
  .wl-bp-journey.wl-draw.is-drawn::before { transform: scaleX(1); }
  .wl-bp-journey.wl-draw .wl-bp-j-ico { opacity: 0; transform: scale(0.6); transition: opacity 0.3s ease, transform 0.45s cubic-bezier(.34, 1.56, .64, 1); }
  .wl-bp-journey.wl-draw.is-drawn .wl-bp-j-ico { opacity: 1; transform: none; }
  .wl-bp-journey.wl-draw.is-drawn li:nth-child(2) .wl-bp-j-ico { transition-delay: 0.3s; }
  .wl-bp-journey.wl-draw.is-drawn li:nth-child(3) .wl-bp-j-ico { transition-delay: 0.6s; }
  .wl-bp-journey.wl-draw.is-drawn li:nth-child(4) .wl-bp-j-ico { transition-delay: 0.9s; }
  @media (max-width: 991px) { .wl-bp-journey.wl-draw li::after { transform: scaleY(0); transform-origin: top; transition: transform 0.4s ease 0.3s; } .wl-bp-journey.wl-draw.is-drawn li::after { transform: none; } }

  /* After a purchase: coins fly to "My gift cards", which bumps; the newest card flips over */
  .wl-coin-fly { animation: wl-coin-fly 1.1s cubic-bezier(.5, 0, .3, 1) both !important; }
  @keyframes wl-coin-fly { 0% { opacity: 0; transform: scale(0.6); } 15% { opacity: 1; } 55% { transform: translate(calc(var(--wl-tx) * 0.5), calc(var(--wl-ty) * 0.5 - 60px)) scale(1.1); } 100% { opacity: 0.2; transform: translate(var(--wl-tx), var(--wl-ty)) scale(0.5); } }
  header#header .wl-account-chip.wl-bump { animation: wl-chip-bump 0.5s ease; }
  @keyframes wl-chip-bump { 30% { transform: scale(1.12); } 60% { transform: scale(0.97); } }
  .wl-gc-face.wl-flip-in { animation: wl-flip 0.9s cubic-bezier(.3, .8, .3, 1.1) 0.3s both; }
  @keyframes wl-flip { from { transform: perspective(900px) rotateY(-180deg); opacity: 0.4; } 50% { opacity: 1; } to { transform: perspective(900px) rotateY(0); } }

  /* My gift cards: dealt out from a stack */
  .wl-vc-col.wl-deal { animation: wl-deal 0.7s cubic-bezier(.2, .9, .3, 1.1) both; animation-delay: calc(var(--wl-i, 0) * 70ms); }
  @keyframes wl-deal { from { transform: translate(var(--wl-dx), var(--wl-dy)) rotate(var(--wl-dr)); } to { transform: none; } }

  /* Milestone ring fills */
  .wl-ms-anim .wl-milestone-fill { stroke-dashoffset: var(--wl-ms-len); transition: stroke-dashoffset 1.2s cubic-bezier(.3, .8, .3, 1) 0.2s; }
  .wl-ms-anim.is-in .wl-milestone-fill { stroke-dashoffset: var(--wl-ms-off); }

  /* Help: no matches */
  .wl-shake { animation: wl-shake 0.4s ease; }
  @keyframes wl-shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
}
