/* State dasar non-destruktif agar ukuran & radius tema v38 tidak berubah */
.sopy-atc-fx {
  position: relative !important;
  overflow: hidden !important;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.25s ease,
              border-color 0.25s ease,
              color 0.25s ease !important;
}

.sopy-atc-fx:active {
  transform: scale(0.95);
}

/* Lapisan konten asli tombol */
.sopy-atc-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

/* Lapisan animasi tas (Atelier) & centang selesai */
.sopy-atc-stage,
.sopy-atc-done {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(14px);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

/* Sembunyikan teks sukses pada tombol ikon kotak (misal w-11 h-11 di .sopy-ref3-card) */
.sopy-atc-fx.sopy-atc-compact .sopy-atc-done-text {
  display: none !important;
}

/* State 1: Packing item ke dalam tas belanja */
.sopy-atc-fx.sopy-fx-packing {
  pointer-events: none;
}

.sopy-atc-fx.sopy-fx-packing .sopy-atc-label {
  opacity: 0;
  transform: translateY(-16px);
}

.sopy-atc-fx.sopy-fx-packing .sopy-atc-stage {
  opacity: 1;
  transform: translateY(0);
}

.sopy-bag-svg {
  width: 21px;
  height: 21px;
  overflow: visible;
}

.sopy-atc-fx.sopy-fx-packing .sopy-svg-parcel {
  animation: sopyParcelDrop 0.62s cubic-bezier(0.34, 1.4, 0.64, 1) infinite;
}

.sopy-atc-fx.sopy-fx-packing .sopy-svg-bag {
  transform-origin: center bottom;
  animation: sopyBagBounce 0.62s ease-in-out infinite;
}

@keyframes sopyParcelDrop {
  0%   { transform: translateY(-9px) scale(0.8); opacity: 0; }
  30%  { opacity: 1; }
  75%  { transform: translateY(3px) scale(0.95); opacity: 1; }
  100% { transform: translateY(5px) scale(0.55); opacity: 0; }
}

@keyframes sopyBagBounce {
  0%, 55%, 100% { transform: scale(1, 1); }
  75%           { transform: scale(1.12, 0.85); }
}

/* State 2: Konfirmasi sukses hijau emerald */
.sopy-atc-fx.sopy-fx-done {
  background-color: #10b981 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
}

.sopy-atc-fx.sopy-fx-done .sopy-atc-label,
.sopy-atc-fx.sopy-fx-done .sopy-atc-stage {
  opacity: 0;
  transform: translateY(-14px);
}

.sopy-atc-fx.sopy-fx-done .sopy-atc-done {
  opacity: 1;
  transform: translateY(0);
  font-weight: 700;
}

/* Kloningan foto produk melayang ke ikon keranjang */
.sopy-fly-clone {
  position: fixed;
  z-index: 999999;
  pointer-events: none;
  border-radius: 14px;
  object-fit: contain;
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.25);
  will-change: transform, opacity;
}

/* Pantulan ikon keranjang saat produk tiba */
@keyframes sopyCartBump {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.26) rotate(-7deg); }
  65%  { transform: scale(0.92) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

.sopy-cart-bump {
  animation: sopyCartBump 0.48s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-reduced-motion: reduce) {
  .sopy-atc-fx,
  .sopy-atc-label,
  .sopy-atc-stage,
  .sopy-atc-done,
  .sopy-cart-bump {
    transition: none !important;
    animation: none !important;
  }
}