/* ============================================================
   NimKora website — v3 phone-screen ANIMATIONS
   Layered on top of site.css. Tasteful, looping, GPU-cheap.
   All gated behind prefers-reduced-motion.
   ============================================================ */

.mini { position: relative; }

@media (prefers-reduced-motion: no-preference) {

  /* category icons pop in a gentle stagger */
  .anim-cats .mini-cat .ic { animation: nk-catpop 4.2s ease-in-out infinite; }
  .anim-cats .mini-cat:nth-child(1) .ic { animation-delay: 0s; }
  .anim-cats .mini-cat:nth-child(2) .ic { animation-delay: .18s; }
  .anim-cats .mini-cat:nth-child(3) .ic { animation-delay: .36s; }
  .anim-cats .mini-cat:nth-child(4) .ic { animation-delay: .54s; }
  @keyframes nk-catpop { 0%,68%,100% { transform: none; } 10% { transform: translateY(-5px) scale(1.07); } }

  /* product cards float softly */
  .anim-prod { animation: nk-prodfloat 3.6s ease-in-out infinite; }
  .anim-prod.d2 { animation-delay: .5s; }
  @keyframes nk-prodfloat { 0%,100% { transform: none; } 50% { transform: translateY(-6px); } }

  /* recurring "added to cart" toast */
  .anim-toast {
    position: absolute; left: 12px; right: 12px; bottom: 12px;
    background: var(--nk-char-900); color: #fff; border-radius: 12px;
    padding: 9px 12px; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow-2);
    opacity: 0; transform: translateY(14px); pointer-events: none;
    animation: nk-toast 4.6s ease-in-out infinite;
  }
  .anim-toast .material-symbols-rounded { font-size: 16px; color: #4ADE80; }
  @keyframes nk-toast {
    0%, 100% { opacity: 0; transform: translateY(14px); }
    14%, 44% { opacity: 1; transform: translateY(0); }
    56%      { opacity: 0; transform: translateY(14px); }
  }

  /* cart badge bump in the header */
  .anim-cartbadge {
    position: absolute; top: 30px; right: 16px;
    display: inline-flex; align-items: center; gap: 4px;
    background: var(--nk-orange); color: #fff; border-radius: 999px;
    padding: 4px 8px 4px 6px; font-size: 11px; font-weight: 800;
    animation: nk-bump 4.6s ease-in-out infinite;
  }
  .anim-cartbadge .material-symbols-rounded { font-size: 14px; }
  @keyframes nk-bump { 0%,40%,100% { transform: scale(1); } 47% { transform: scale(1.32); } 56% { transform: scale(1); } }

  /* moto drives along the tracking route (hero B) */
  .anim-moto { animation: nk-motoride 3.4s ease-in-out infinite alternate; }
  @keyframes nk-motoride {
    0%   { left: 22%; top: 78%; }
    100% { left: 80%; top: 24%; }
  }
  /* route dashes flow toward the destination */
  .anim-dash { animation: nk-dashflow 0.9s linear infinite; }
  @keyframes nk-dashflow { to { stroke-dashoffset: -13; } }

  /* primary CTA inside a phone breathes */
  .anim-cta { animation: nk-ctapulse 2.6s ease-in-out infinite; }
  @keyframes nk-ctapulse {
    0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--nk-orange) 55%, transparent); }
    50%     { box-shadow: 0 0 0 7px color-mix(in srgb, var(--nk-orange) 0%, transparent); }
  }
}

/* ============================================================
   Section "demo" sequences — show how the app works.
   Buyer (5s loop): tap a product → "+1" flies to cart → toast.
   Seller (6s loop): order "À confirmer" → press → ✓ → "Confirmée".
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {

  /* --- buyer browse→add demo --- */
  .demo-tapcard { animation: nk-tap 5s ease-in-out infinite; }
  @keyframes nk-tap { 0%,22%,40%,100% { transform: none; } 30% { transform: scale(.93); } }

  .demo-ripple { animation: nk-ripple 5s ease-out infinite; }
  @keyframes nk-ripple {
    0%,24% { transform: translate(-50%,-50%) scale(0); opacity: .7; }
    40%    { transform: translate(-50%,-50%) scale(3.4); opacity: 0; }
    41%,100% { opacity: 0; }
  }

  .demo-fly { animation: nk-fly 5s cubic-bezier(.5,0,.5,1) infinite; }
  @keyframes nk-fly {
    0%,28% { opacity: 0; left: 34%; top: 64%; transform: scale(.4); }
    34%    { opacity: 1; transform: scale(1); }
    54%    { opacity: 1; left: 84%; top: 5%; transform: scale(.5); }
    60%,100% { opacity: 0; left: 84%; top: 5%; }
  }

  .demo-cartbadge { animation: nk-bump5 5s ease-in-out infinite; }
  @keyframes nk-bump5 { 0%,52%,100% { transform: scale(1); } 58% { transform: scale(1.34); } 66% { transform: scale(1); } }

  .demo-toast { animation: nk-toast5 5s ease-in-out infinite; }
  @keyframes nk-toast5 {
    0%,52% { opacity: 0; transform: translateY(14px); }
    60%,86% { opacity: 1; transform: translateY(0); }
    94%,100% { opacity: 0; transform: translateY(14px); }
  }

  /* --- seller confirm demo --- */
  .demo-status .y { animation: nk-statY 6s ease-in-out infinite; }
  .demo-status .b { animation: nk-statB 6s ease-in-out infinite; }
  @keyframes nk-statY { 0%,46% { opacity: 1; } 52%,100% { opacity: 0; } }
  @keyframes nk-statB { 0%,48% { opacity: 0; } 54%,100% { opacity: 1; } }

  .demo-cta { animation: nk-ctaswap 6s ease-in-out infinite; }
  @keyframes nk-ctaswap {
    0%,40% { background: var(--nk-orange); transform: scale(1); }
    44%    { transform: scale(.96); }
    48%    { background: var(--nk-orange); transform: scale(1); }
    54%,100% { background: var(--status-blue); transform: scale(1); }
  }
  .demo-cta .t-confirm { animation: nk-tc 6s ease-in-out infinite; }
  @keyframes nk-tc { 0%,48% { opacity: 1; } 52%,100% { opacity: 0; } }
  .demo-cta .t-wait { animation: nk-tw 6s ease-in-out infinite; }
  @keyframes nk-tw { 0%,50% { opacity: 0; } 56%,100% { opacity: 1; } }

  .demo-check { animation: nk-check 6s ease-in-out infinite; }
  @keyframes nk-check { 0%,44% { opacity: 0; } 48%,56% { opacity: 1; } 64%,100% { opacity: 0; } }
  .demo-check .material-symbols-rounded { animation: nk-checkpop 6s ease-in-out infinite; }
  @keyframes nk-checkpop { 0%,44% { transform: scale(.5); } 50% { transform: scale(1.12); } 58%,100% { transform: scale(1); } }
}
