/* =========================================================================
   Kaetel&Kids — effets d'interaction (js/fx.js)
   transform / opacity uniquement, désactivés si prefers-reduced-motion
   ========================================================================= */

/* ---------- couche d'effets ---------- */
.kk-fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 120; overflow: hidden; }
.kk-fx-particle { position: absolute; display: block; will-change: transform, opacity; }
.kk-fx-particle svg { width: 100%; height: 100%; display: block; }

/* photo qui vole vers le panier */
.kk-fx-fly {
  position: absolute; border-radius: 50%; overflow: hidden; background: #fff;
  box-shadow: 0 8px 22px rgba(63, 68, 88, .22), 0 0 0 4px #fff, 0 0 0 7px var(--kk-secondary, #A3D2C0);
  will-change: transform, opacity;
}
.kk-fx-fly img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kk-fx-fly--shape { display: grid; place-items: center; background: var(--kk-primary-light, #FDE3DF); }
.kk-fx-fly--shape svg { width: 60%; height: 60%; }

/* ---------- coche dessinée ---------- */
.kk-fx-check--draw path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: kk-fx-draw .5s .12s cubic-bezier(.65, 0, .35, 1) forwards; }
@keyframes kk-fx-draw { to { stroke-dashoffset: 0; } }

/* bouton carte "ajouté" : petit halo menthe */
.kk-card__add.is-in { animation: kk-fx-halo .7s ease-out; }
@keyframes kk-fx-halo {
  0% { box-shadow: 0 0 0 0 rgba(163, 210, 192, .9); }
  100% { box-shadow: 0 0 0 14px rgba(163, 210, 192, 0); }
}

/* ---------- toast bulle + soleil ---------- */
.kk-fx-toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 130;
  display: flex; align-items: center; gap: 10px;
  max-width: calc(100vw - 28px); padding: 8px 18px 8px 8px;
  background: #fff; color: var(--kk-text, #3F4458); font-weight: 700;
  border-radius: 999px; border: 2px solid var(--kk-primary-light, #FDE3DF);
  box-shadow: 0 12px 32px rgba(63, 68, 88, .18);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 140%) scale(.9);
  transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), opacity .25s ease;
}
.kk-fx-toast.is-on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(1); }
.kk-fx-toast::after { /* petite queue de bulle */
  content: ""; position: absolute; left: 30px; bottom: -7px; width: 14px; height: 14px; background: #fff;
  border-right: 2px solid var(--kk-primary-light, #FDE3DF); border-bottom: 2px solid var(--kk-primary-light, #FDE3DF);
  transform: rotate(45deg); border-bottom-right-radius: 4px;
}
.kk-fx-toast__ico {
  flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: #FFF4DC;
}
.kk-fx-toast__ico.is-cloud { background: var(--kk-secondary-light, #E3F2EC); }
.kk-fx-toast__ico svg { width: 34px; height: 34px; display: block; }
.kk-fx-toast__ico.is-cloud svg { width: 28px; height: 28px; animation: kk-fx-float 2.4s ease-in-out infinite; }
.kk-fx-toast.is-on .kk-fx-toast__sun { animation: kk-fx-wiggle 1.6s ease-in-out infinite; }
.kk-fx-toast__sun .kk-fx-sun__rays { transform-origin: 50px 50px; transform-box: view-box; animation: kk-fx-spin 6s linear infinite; }
.kk-fx-toast__msg { line-height: 1.2; min-width: 0; }
@media (max-width: 420px) {
  .kk-fx-toast { gap: 8px; padding-right: 10px; font-size: .9rem; width: max-content; }
  .kk-fx-toast__link { padding: 6px 10px; font-size: .8rem; }
}
.kk-fx-toast__link {
  flex: none; color: var(--kk-text, #3F4458); background: var(--kk-accent, #F9D393);
  padding: 6px 12px; border-radius: 999px; text-decoration: none; font-size: .88rem;
  transition: transform .15s;
}
.kk-fx-toast__link:hover, .kk-fx-toast__link:focus-visible { transform: scale(1.06); }
/* l'ancien toast n'est plus utilisé quand fx.js est chargé */
.kk-toast { display: none; }

@keyframes kk-fx-spin { to { transform: rotate(360deg); } }
@keyframes kk-fx-wiggle { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg) translateY(-1px); } }
@keyframes kk-fx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* ---------- total qui défile ---------- */
.kk-fx-rolling { font-variant-numeric: tabular-nums; color: var(--kk-primary-dark, #E07F75); }

/* ---------- nuage endormi (panier vide) ---------- */
.kk-empty__emoji.kk-fx-cloudwrap { width: 180px; height: 130px; background: none; border-radius: 0; }
.kk-fx-cloud { width: 100%; height: 100%; overflow: visible; }
.kk-fx-cloud__body { animation: kk-fx-cloud 4s ease-in-out infinite; transform-box: view-box; transform-origin: 78px 64px; }
.kk-fx-cloud__shadow { animation: kk-fx-shadow 4s ease-in-out infinite; transform-box: view-box; transform-origin: 78px 104px; }
.kk-fx-cloud__z { font: 800 15px/1 system-ui, sans-serif; fill: var(--kk-secondary-dark, #6FAF97); opacity: 0; animation: kk-fx-z 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.kk-fx-cloud__z--2 { font-size: 12px; animation-delay: .9s; }
.kk-fx-cloud__z--3 { font-size: 10px; animation-delay: 1.8s; }
@keyframes kk-fx-cloud { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-9px) rotate(1.5deg); } }
@keyframes kk-fx-shadow { 0%, 100% { transform: scale(1); opacity: .08; } 50% { transform: scale(.8); opacity: .05; } }
@keyframes kk-fx-z {
  0% { opacity: 0; transform: translate(0, 6px) scale(.6); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(8px, -10px) scale(1.1); }
}

/* ---------- chargement : 3 points qui rebondissent ---------- */
.kk-fx-loading { cursor: progress; opacity: 1 !important; }
.kk-fx-dots { display: inline-flex; gap: 7px; align-items: center; height: 1.2em; }
.kk-fx-dots i { width: 10px; height: 10px; border-radius: 50%; background: currentColor; animation: kk-fx-dot .9s ease-in-out infinite; }
.kk-fx-dots i:nth-child(1) { background: #fff; }
.kk-fx-dots i:nth-child(2) { background: var(--kk-accent, #F9D393); animation-delay: .15s; }
.kk-fx-dots i:nth-child(3) { background: var(--kk-secondary, #A3D2C0); animation-delay: .3s; }
@keyframes kk-fx-dot {
  0%, 80%, 100% { transform: translateY(0) scale(1, 1); }
  20% { transform: translateY(1px) scale(1.25, .75); }
  45% { transform: translateY(-9px) scale(.9, 1.1); }
}

/* ---------- confettis ---------- */
.kk-fx-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 125; }

/* ---------- célébration : soleil qui se lève ---------- */
.kk-fx-hero { position: relative; height: 220px; margin: 0 auto -6px; width: min(100%, 360px); display: grid; place-items: center; }
.kk-fx-hero__sky {
  position: absolute; inset: 0; overflow: hidden; border-radius: 180px 180px 28px 28px;
  background: linear-gradient(180deg, #E8F5EF 0%, #FFF8F3 100%);
}
.kk-fx-hero__sun {
  position: absolute; left: 50%; top: 18px; width: 190px; height: 190px; margin-left: -95px;
  animation: kk-fx-rise 1.1s cubic-bezier(.2, .9, .3, 1.15) both;
}
.kk-fx-sun { width: 100%; height: 100%; display: block; }
.kk-fx-hero .kk-fx-sun__rays { transform-origin: 50px 50px; transform-box: view-box; animation: kk-fx-spin 14s linear infinite; }
.kk-fx-hero .kk-fx-sun__eyes { transform-origin: 50px 46px; transform-box: view-box; animation: kk-fx-blink 4s 1.4s infinite; }
@keyframes kk-fx-rise { from { transform: translateY(150px) scale(.7); opacity: 0; } 60% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes kk-fx-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }

.kk-fx-hero__cloud { position: absolute; width: 74px; height: 74px; opacity: .95; filter: drop-shadow(0 4px 6px rgba(63, 68, 88, .08)); }
.kk-fx-hero__cloud svg, .kk-fx-hero__twinkle svg { width: 100%; height: 100%; display: block; }
.kk-fx-hero__cloud--l { left: 6px; top: 118px; animation: kk-fx-drift-l 1s .3s ease-out both, kk-fx-float 4s 1.3s ease-in-out infinite; }
.kk-fx-hero__cloud--r { right: 2px; top: 92px; width: 60px; height: 60px; animation: kk-fx-drift-r 1s .45s ease-out both, kk-fx-float 5s 1.45s ease-in-out infinite; }
@keyframes kk-fx-drift-l { from { transform: translateX(-90px); opacity: 0; } to { transform: none; opacity: .95; } }
@keyframes kk-fx-drift-r { from { transform: translateX(90px); opacity: 0; } to { transform: none; opacity: .95; } }

.kk-fx-hero__twinkle { position: absolute; width: 20px; height: 20px; animation: kk-fx-twinkle 2.2s ease-in-out infinite; }
.kk-fx-hero__twinkle--1 { left: 22%; top: 18px; animation-delay: .8s; }
.kk-fx-hero__twinkle--2 { right: 20%; top: 30px; width: 16px; height: 16px; animation-delay: 1.3s; }
.kk-fx-hero__twinkle--3 { left: 14%; top: 70px; width: 14px; height: 14px; animation-delay: 1.8s; }
@keyframes kk-fx-twinkle { 0%, 100% { transform: scale(.4) rotate(0deg); opacity: 0; } 50% { transform: scale(1.1) rotate(25deg); opacity: 1; } }

.kk-fx-hero__merci {
  position: relative; margin: 150px 0 0; font-size: clamp(2.2rem, 7vw, 3rem); font-weight: 900; line-height: 1;
  color: var(--kk-text, #3F4458); letter-spacing: .5px;
  text-shadow: 0 3px 0 #fff, 0 -3px 0 #fff, 3px 0 0 #fff, -3px 0 0 #fff;
  animation: kk-fx-pop .7s .6s cubic-bezier(.34, 1.56, .64, 1) both;
}
.kk-fx-hero__badge {
  position: absolute; right: calc(50% - 112px); top: 132px; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--kk-secondary, #A3D2C0); color: #fff;
  box-shadow: 0 0 0 4px #fff, 0 6px 14px rgba(63, 68, 88, .15);
  animation: kk-fx-pop .6s .9s cubic-bezier(.34, 1.56, .64, 1) both;
}
.kk-fx-hero__badge .kk-ico { width: 28px; height: 28px; }
.kk-fx-hero__badge .kk-fx-check--draw path { animation-delay: 1.25s; }
@keyframes kk-fx-pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .kk-fx-layer, .kk-fx-confetti { display: none; }
  .kk-fx-toast { transition: opacity .2s; transform: translate(-50%, 0); }
  .kk-fx-toast, .kk-fx-toast *, .kk-fx-cloud *, .kk-fx-dots i, .kk-fx-hero, .kk-fx-hero *, .kk-card__add.is-in {
    animation: none !important;
  }
  .kk-fx-check--draw path { stroke-dashoffset: 0; }
  .kk-fx-cloud__z--1 { opacity: .8; }
}
