/* Budi Organiziran — motion. Everything here is opt-in: html.motion is set by motion.js only
   when the visitor has not asked for reduced motion, so content is always visible without JS. */

:root {
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1); /* small overshoot for "pop" moments */
}

/* ---------- Old price: a drawn strike instead of text-decoration ---------- */
.price__old { position: relative; text-decoration: none !important; display: inline-block; }
.price__old::after {
  content: ""; position: absolute; left: -6%; right: -6%; top: 50%;
  height: 3px; border-radius: 2px; background: var(--malina);
  transform: rotate(-10deg); transform-origin: left center;
}
.buybar__text s, .annbar__offer s, .marquee s { text-decoration-color: var(--fuksija); }

/* ---------- Price reveal sequence (once, when the price scrolls into view) ---------- */
html.motion .price:not(.is-in) .price__old { opacity: 0; }
html.motion .price:not(.is-in) .price__old::after { transform: rotate(-10deg) scaleX(0); }
html.motion .price:not(.is-in) .price__now { opacity: 0; transform: translateY(8px) scale(.86); }

html.motion .price.is-in .price__old { animation: fade-in .35s var(--ease-out) both; }
html.motion .price.is-in .price__old::after { animation: strike .45s var(--ease-out) .3s both; }
html.motion .price.is-in .price__now { animation: pop-in .6s var(--ease-pop) .6s both; transform-origin: left bottom; }
.offer__card .price.is-in .price__now { transform-origin: center bottom; }

@keyframes fade-in { from { opacity: 0; } }
@keyframes strike { from { transform: rotate(-10deg) scaleX(0); } to { transform: rotate(-10deg) scaleX(1); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.86); } to { opacity: 1; transform: none; } }

/* ---------- Savings badge: stamped in, then a periodic shine ---------- */
.save-badge, .save-pill { overflow: hidden; }
.save-badge::after, .save-pill::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateX(-120%);
  pointer-events: none;
}
.save-pill { position: relative; }
html.motion .save-badge::after, html.motion .save-pill::after { animation: shine 3.6s ease-in-out 2.2s infinite; }
@keyframes shine { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(320%); } }

/* Offer card badge keeps its centring transform while stamping in */
html.motion .offer__card:not(.is-in) .save-badge { opacity: 0; }
html.motion .offer__card.is-in .save-badge { animation: stamp-center .55s var(--ease-pop) 1s both; }
@keyframes stamp-center {
  from { opacity: 0; transform: translateX(-50%) rotate(-14deg) scale(1.7); }
  to { opacity: 1; transform: translateX(-50%) rotate(-2deg) scale(1); }
}
html.motion .price:not(.is-in) .save-pill,
html.motion .feature:not(.is-in) .save-pill { opacity: 0; }
html.motion .feature.is-in .save-pill { animation: stamp .5s var(--ease-pop) 1s both; }
@keyframes stamp {
  from { opacity: 0; transform: rotate(-14deg) scale(1.7); }
  to { opacity: 1; transform: rotate(-3deg) scale(1); }
}
.feature .save-pill { transform: rotate(-3deg); font-size: 15px; padding: 5px 12px; }

/* "Valid until" line slides in after the price */
html.motion .offer__card:not(.is-in) .offer__until { opacity: 0; }
html.motion .offer__card.is-in .offer__until { animation: rise-in .5s var(--ease-out) 1.2s both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Countdown: each changed digit drops in ---------- */
.timer b { display: inline-block; font-weight: 800; }
html.motion .timer b.tick { animation: tick .32s var(--ease-out); }
@keyframes tick { from { transform: translateY(-45%); opacity: .2; } }

/* ---------- Buy buttons: a soft ring that breathes outward ---------- */
.btn--pulse { position: relative; isolation: isolate; }
.btn--pulse::before {
  content: ""; position: absolute; inset: -2px; z-index: -1;
  border-radius: inherit; border: 2px solid var(--fuksija);
  opacity: 0; pointer-events: none;
}
html.motion .btn--pulse::before { animation: ring 2.6s var(--ease-out) 1.4s infinite; }
@keyframes ring {
  0% { opacity: .75; transform: scale(1); }
  70%, 100% { opacity: 0; transform: scale(1.12, 1.35); }
}
.btn--white.btn--pulse::before { border-color: #fff; }
@media (hover: hover) and (pointer: fine) {
  .btn--pulse:hover::before { animation-play-state: paused; opacity: 0; }
}

/* ---------- Scroll reveal ---------- */
html.motion [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(22px); }
html.motion [data-reveal] {
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}

@media (prefers-reduced-motion: reduce) {
  html.motion [data-reveal]:not(.is-in) { opacity: 1; transform: none; }
}
