/* epijama fx.css - micro interactions (ThreeUI-style soft glow + motion) */
.p-img-link { display: block; width: 100%; height: 100%; }

/* Ripple */
.fx-ripple-host { position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.fx-ripple {
    position: absolute; border-radius: 50%; pointer-events: none;
    background: rgba(255, 255, 255, .45); transform: scale(0);
    animation: fxRipple .6s ease-out forwards;
}
@keyframes fxRipple { to { transform: scale(1); opacity: 0; } }

/* Add to cart button states */
.add-to-cart-btn, .add-cart-huge, .slider-btn, .load-more-btn { transition: transform .15s ease, background-color .25s, box-shadow .25s; }
.add-to-cart-btn:active, .add-cart-huge:active, .slider-btn:active { transform: scale(.96); }
.fx-added { background: #16a34a !important; border-color: #16a34a !important; color: #fff !important; pointer-events: none; }
.fx-added i { animation: fxPop .45s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes fxPop { 0% { transform: scale(0) rotate(-40deg); } 100% { transform: scale(1) rotate(0); } }

/* Flying product image */
.fx-fly {
    position: fixed; z-index: 9999; border-radius: 12px; object-fit: cover; pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    transition: transform .8s cubic-bezier(.5, -.2, .8, .4), opacity .8s ease; will-change: transform;
}
.badge.fx-bump, .cart-icon-wrap .badge.fx-bump { animation: fxBump .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes fxBump { 0% { transform: scale(1); } 40% { transform: scale(1.6); } 100% { transform: scale(1); } }
.cart-btn.fx-shake i, .nav-b-item.cart.fx-shake i { animation: fxShake .5s ease; }
@keyframes fxShake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }

/* Favorite heart */
.fav-box { position: absolute; }
.fav-box i { transition: transform .2s; }
.fav-box.active i { color: #FF006A; animation: fxHeart .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes fxHeart { 0% { transform: scale(.4); } 60% { transform: scale(1.4); } 100% { transform: scale(1); } }
.fx-spark {
    position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #FF006A; pointer-events: none;
    animation: fxSpark .6s ease-out forwards;
}
@keyframes fxSpark { to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }

/* Scroll reveal */
.fx-reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .2, 1); transition-delay: var(--fx-delay, 0s); }
.fx-reveal.fx-in { opacity: 1; transform: none; }

/* Toast */
.fx-toast-wrap { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 10000; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
@media (min-width: 768px) { .fx-toast-wrap { bottom: 28px; } }
.fx-toast {
    background: #111827; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 500;
    display: flex; align-items: center; gap: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
    animation: fxToastIn .35s cubic-bezier(.2, .8, .2, 1);
}
.fx-toast i { color: #4ade80; font-size: 18px; }
.fx-toast.out { animation: fxToastOut .3s ease forwards; }
@keyframes fxToastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes fxToastOut { to { opacity: 0; transform: translateY(8px); } }

/* Soft animated glow in hero (ThreeUI-inspired gradient orbs) */
.hero-slider { isolation: isolate; }
.fx-orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; mix-blend-mode: soft-light; }
.fx-orbs span { position: absolute; width: 55%; aspect-ratio: 1; border-radius: 50%; filter: blur(60px); opacity: .55; animation: fxOrb 14s ease-in-out infinite alternate; }
.fx-orbs span:nth-child(1) { background: #ff006a; left: -10%; top: -30%; }
.fx-orbs span:nth-child(2) { background: #ffb300; right: -15%; bottom: -35%; animation-delay: -5s; }
.hero-slider .slider-overlay, .hero-slider .slider-arrows, .hero-slider .slider-dots { z-index: 2; }
@keyframes fxOrb { to { transform: translate(18%, 12%) scale(1.15); } }
.slide.active .slider-text > * { animation: fxSlideText .7s cubic-bezier(.2, .7, .2, 1) both; }
.slide.active .slider-text > *:nth-child(2) { animation-delay: .12s; }
.slide.active .slider-text > *:nth-child(3) { animation-delay: .24s; }
@keyframes fxSlideText { from { opacity: 0; transform: translateY(18px); } }

/* Tabs: product grid swap */
.p-grid.fx-swap .p-card { animation: fxCardIn .5s ease both; }
.p-grid.fx-swap .p-card:nth-child(2) { animation-delay: .06s; }
.p-grid.fx-swap .p-card:nth-child(3) { animation-delay: .12s; }
.p-grid.fx-swap .p-card:nth-child(4) { animation-delay: .18s; }
@keyframes fxCardIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }

/* Mobile: touch-friendly targets, no hover-only motion */
@media (max-width: 767px) {
    .fav-box { width: 40px; height: 40px; }
    .mobile-nav-bottom .nav-b-item { min-height: 48px; }
    .fx-orbs span { filter: blur(40px); }
}
@media (hover: none) { .p-card:hover .p-img-box img { transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .fx-orbs, .fx-ripple { display: none; }
    .fx-reveal { opacity: 1; transform: none; transition: none; }
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
