/* Customer shop motion (kit phase 5). Loaded last. Motion only: no colour, size or layout change.
   Everything is behind html.shop-fx, which shop-fx-v1.js sets only when motion is allowed. */
:root{--fx-ease:cubic-bezier(.2,.8,.2,1)}
/* rolling digits (from the kit) */
.ax-fx-roll{display:inline-flex;white-space:pre;font-variant-numeric:tabular-nums;line-height:inherit;vertical-align:top}
.ax-fx-roll__c,.ax-fx-roll__d{display:block;height:1.2em;height:1lh;line-height:inherit}
.ax-fx-roll__d{overflow:hidden}
.ax-fx-roll__d>span{display:block;transition:transform .6s var(--fx-ease);will-change:transform}
.ax-fx-roll__d>span>span{display:block;height:1.2em;height:1lh}
/* overlay that shows the rolling digits; the CSS timers end both states even if the script stops */
.shop-fx-ghost{position:absolute;z-index:1;margin:0;pointer-events:none;white-space:pre;animation:shop-fx-ghost 1.2s steps(1,end) forwards}
@keyframes shop-fx-ghost{to{opacity:0}}
[data-fx-rolling]{animation:shop-fx-hide-a .95s steps(1,end)}
[data-fx-rolling="b"]{animation-name:shop-fx-hide-b}
@keyframes shop-fx-hide-a{from,to{opacity:0}}
@keyframes shop-fx-hide-b{from,to{opacity:0}}

@media (prefers-reduced-motion:no-preference){
  @keyframes shop-fx-in{from{opacity:0;transform:translateY(10px)}}
  @keyframes shop-fx-pop{0%{transform:scale(.94)}60%{transform:scale(1.04)}100%{transform:scale(1)}}
  @keyframes shop-fx-check{from{opacity:0;transform:scale(.3) rotate(-20deg)}}
  @keyframes shop-fx-ring{from{box-shadow:0 0 0 0 #7c2be055}to{box-shadow:0 0 0 22px #7c2be000}}

  /* first paint: the card fills in block by block */
  html.shop-fx-boot .shop-card>:not(form),
  html.shop-fx-boot .shop-topup-fields>*,
  html.shop-fx-boot .shop-topup-summary>*{animation:shop-fx-in .45s var(--fx-ease) both}
  html.shop-fx-boot .shop-topup-fields>:nth-child(2){animation-delay:.04s}
  html.shop-fx-boot .shop-topup-fields>:nth-child(3){animation-delay:.08s}
  html.shop-fx-boot .shop-topup-fields>:nth-child(4){animation-delay:.12s}
  html.shop-fx-boot .shop-topup-fields>:nth-child(5){animation-delay:.16s}
  html.shop-fx-boot .shop-topup-fields>:nth-child(n+6){animation-delay:.2s}
  html.shop-fx-boot .shop-topup-summary>*{animation-delay:.24s}
  html.shop-fx-boot .shop-topup-summary>:nth-child(n+3){animation-delay:.3s}

  /* amount chips: press, then the chosen one pops and its tick draws in */
  html.shop-fx .shop-amounts button:active:not(:disabled){transform:scale(.95)}
  html.shop-fx .shop-amounts button.selected{animation:shop-fx-pop .32s var(--fx-ease)}
  html.shop-fx .shop-amounts button.selected svg{animation:shop-fx-check .3s var(--fx-ease) both}
  html.shop-fx .shop-bonus-pill{animation:shop-fx-pop .32s var(--fx-ease)}
  html.shop-fx .shop-hint{animation:shop-fx-in .25s var(--fx-ease) both}
  html.shop-fx .shop-phone-mark{animation:shop-fx-check .3s var(--fx-ease) both}

  /* pay button: press, and the icon swaps in instead of jumping */
  html.shop-fx .shop-primary:active:not(:disabled){transform:scale(.98)}
  html.shop-fx .shop-primary>svg:not(.shop-spin){animation:shop-fx-check .25s var(--fx-ease) both}

  /* progress steps: the tick of a finished step draws in */
  html.shop-fx .shop-step.done>span svg{animation:shop-fx-check .35s var(--fx-ease) both}

  /* order view: rows arrive one after another */
  html.shop-fx .shop-order-details>div{animation:shop-fx-in .4s var(--fx-ease) both}
  html.shop-fx .shop-order-details>div:nth-child(2){animation-delay:.06s}
  html.shop-fx .shop-order-details>div:nth-child(3){animation-delay:.12s}
  html.shop-fx .shop-order-details>div:nth-child(n+4){animation-delay:.18s}
  html.shop-fx .shop-qr img{animation:shop-fx-pop .4s var(--fx-ease)}

  /* success: the tick keeps its bounce and sends out one ring */
  html.shop-fx .shop-success>svg{border-radius:50%;animation:shop-celebrate .55s cubic-bezier(.2,.8,.2,1) both,shop-fx-ring .9s .25s ease-out}
  html.shop-fx .shop-success>strong{animation:shop-fx-in .45s .15s var(--fx-ease) both}
}
