/* ============================================
   ADD TO CART ANIMATION (.aitl-cart-animation)
   Lightweight fly-to-cart particle & icon bounce
   ============================================ */

/* Flying Particle Element */
.aitl-cart-flyer {
  position: fixed;
  z-index: 999999;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.75), 0 0 4px rgba(255, 255, 255, 0.9);
  pointer-events: none;
  margin-top: -9px;
  margin-left: -9px;
  transition: transform 0.65s cubic-bezier(0.18, 0.89, 0.32, 1.15), opacity 0.65s ease-in;
  will-change: transform, opacity;
}

.aitl-cart-flyer::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.4);
  animation: aitlFlyerPulse 0.4s infinite alternate;
}

@keyframes aitlFlyerPulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0.2; }
}

/* Cart Icon Pop / Bounce Animation */
.aith-action.aitl-cart-pop,
.aitnav-bottom__cart-wrap.aitl-cart-pop,
.aitnav-bottom__item.aitl-cart-pop {
  animation: aitlCartPop 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

/* Ripple effect around cart icon when particle lands */
.aith-action.aitl-cart-pop::after,
.aitnav-bottom__cart-wrap.aitl-cart-pop::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.35);
  transform: translate(-50%, -50%) scale(0.6);
  animation: aitlCartRipple 0.55s ease-out forwards;
  pointer-events: none;
  z-index: 0;
}

@keyframes aitlCartPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.32) rotate(-6deg); }
  65% { transform: scale(0.92) rotate(3deg); }
  85% { transform: scale(1.08) rotate(-1deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes aitlCartRipple {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

/* Cart Badge Pop / Scale Bump */
.aitl-cart-count.aitl-badge-bump {
  animation: aitlBadgeBump 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

@keyframes aitlBadgeBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.45); background-color: #10b981; color: #ffffff; }
  100% { transform: scale(1); }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  .aitl-cart-flyer {
    display: none !important;
  }
  .aith-action.aitl-cart-pop,
  .aitnav-bottom__cart-wrap.aitl-cart-pop,
  .aitnav-bottom__item.aitl-cart-pop {
    animation: none !important;
  }
  .aitl-cart-count.aitl-badge-bump {
    animation: none !important;
  }
}
