/* ==========================================================================
   TRENDY SHOP - 1:1 ANIMATIONS & MICRO-INTERACTIONS
   ========================================================================== */

/* Fade In Keyframes */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Badge Pulse */
@keyframes badgePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(232, 61, 132, 0.4);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(232, 61, 132, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(232, 61, 132, 0);
  }
}

.product-card__badge {
  animation: badgePulse 2.5s infinite;
}

/* Cart Badge Bounce */
@keyframes cartBounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.35);
  }
}

.cart-badge.bounce {
  animation: cartBounce 0.35s ease;
}

/* Floating WhatsApp (Static, no pulse animation) */
.floating-whatsapp {
  animation: none !important;
}

/* Play button ripple */
@keyframes ripple {
  0% {
    box-shadow: 0 0 0 0 rgba(232, 61, 132, 0.6), 0 0 0 10px rgba(232, 61, 132, 0.3);
  }
  100% {
    box-shadow: 0 0 0 20px rgba(232, 61, 132, 0), 0 0 0 35px rgba(232, 61, 132, 0);
  }
}

.play-button {
  animation: ripple 2s infinite;
}

/* Heart pop on wishlist click */
@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); color: #E83D84; }
  100% { transform: scale(1); color: #E83D84; }
}

.product-card__wishlist-btn.active svg {
  animation: heartPop 0.3s ease forwards;
  fill: #E83D84;
}

/* Benefits ticker scroll */
@keyframes ticker-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* ==========================================================================
   TRENDY SHOP - SKELETON LOADING & SHIMMER SYSTEM
   Provides seamless skeleton placeholders across all product cards,
   PDP galleries, categories, checkout summaries, cart drawers, and media.
   ========================================================================== */

@keyframes skeletonShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Universal Skeleton Base Utility */
.skeleton {
  background: linear-gradient(90deg, #F0F0F2 0%, #FAEDF4 50%, #F0F0F2 100%) !important;
  background-size: 200% 100% !important;
  animation: skeletonShimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
  border-radius: 4px;
  color: transparent !important;
  user-select: none !important;
  pointer-events: none !important;
}

/* Skeleton Loading Container State for Images */
.skeleton-loading {
  position: relative !important;
  overflow: hidden !important;
  background: linear-gradient(90deg, #F2F2F4 0%, #FCEAF2 50%, #F2F2F4 100%) !important;
  background-size: 200% 100% !important;
  animation: skeletonShimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
}

.skeleton-loading > img,
.skeleton-loading img {
  opacity: 0 !important;
  transition: opacity 0.35s ease-in-out !important;
}

/* When image finishes loading */
.skeleton-loaded {
  background: #FFFFFF !important;
  animation: none !important;
}

.skeleton-loaded > img,
.skeleton-loaded img,
img.img-loaded {
  opacity: 1 !important;
}

/* Atomic Skeleton Elements */
.skeleton-text {
  height: 14px;
  border-radius: 4px;
  margin-bottom: 6px;
  width: 100%;
}
.skeleton-text.sm { height: 10px; width: 55%; }
.skeleton-text.md { height: 14px; width: 80%; }
.skeleton-text.lg { height: 18px; width: 45%; }

.skeleton-circle,
.skeleton-avatar {
  border-radius: 50% !important;
}

.skeleton-btn {
  height: 38px;
  border-radius: 6px;
  width: 100%;
}

/* Ready-to-use Skeleton Product Card */
.skeleton-card {
  background: #FFFFFF;
  border: 1px solid #ECECEC;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-card-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
}

/* Order Item Skeleton (Checkout & Voucher) */
.skeleton-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #F0F0F0;
  gap: 12px;
}

.skeleton-order-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.skeleton-order-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  flex-shrink: 0;
}

.skeleton-order-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* Specific Wrapper Shimmer Hooks */
.shelf-img-wrapper:not(.skeleton-loaded),
.category-circle-img-wrapper:not(.skeleton-loaded),
.cart-item-img-link:not(.skeleton-loaded),
.order-item-img-box:not(.skeleton-loaded),
.pdp-main-image-wrap:not(.skeleton-loaded),
.pdp-thumb-item:not(.skeleton-loaded),
.modal-img-box:not(.skeleton-loaded),
.modal-image-col:not(.skeleton-loaded) {
  background: linear-gradient(90deg, #F2F2F4 0%, #FCEAF2 50%, #F2F2F4 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

/* Accessibility: respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .skeleton,
  .skeleton-loading,
  .shelf-img-wrapper:not(.skeleton-loaded),
  .category-circle-img-wrapper:not(.skeleton-loaded),
  .cart-item-img-link:not(.skeleton-loaded),
  .order-item-img-box:not(.skeleton-loaded),
  .pdp-main-image-wrap:not(.skeleton-loaded),
  .pdp-thumb-item:not(.skeleton-loaded),
  .modal-img-box:not(.skeleton-loaded),
  .modal-image-col:not(.skeleton-loaded) {
    animation: none !important;
    background: #EFEFEF !important;
  }
}

