/* ==========================================================================
   Antalya Balik - "Playful" motion & accents
   Tasteful, slightly comic micro-interactions (cart, buttons, mascot, bubbles).
   Emphasized on mobile, never childish. Animates ONLY transform / opacity to
   protect CLS. Every animation is killed under prefers-reduced-motion (bottom).
   Colors use the global --ab-* custom properties with hardcoded fallbacks.
   ========================================================================== */

/* ==========================================================================
   1. Add-to-cart splash ripple
   A <span class="ab-ripple"> is injected by JS at the click point. The host
   buttons get position:relative + overflow:hidden so the splash is clipped.
   ========================================================================== */
.single_add_to_cart_button,
ul.products li.product .button,
a.ajax_add_to_cart {
	position: relative;
	overflow: hidden;
}

.ab-ripple {
	position: absolute;
	border-radius: 50%;
	pointer-events: none;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.6), transparent 70%);
	transform: scale(0);
	opacity: 0.5;
	animation: ab-ripple 0.45s ease-out forwards;
}
@keyframes ab-ripple {
	to {
		transform: scale(4);
		opacity: 0;
	}
}

/* ==========================================================================
   2. Cart count badge pulse (toggled by JS adding .bouncing on add-to-cart)
   ========================================================================== */
.header-cart__count.bouncing {
	animation: ab-bounce 0.6s ease;
}
@keyframes ab-bounce {
	0%   { transform: scale(1) rotate(0deg); }
	35%  { transform: scale(1.5) rotate(-6deg); }
	60%  { transform: scale(1.15) rotate(4deg); }
	100% { transform: scale(1) rotate(0deg); }
}

/* ==========================================================================
   3. Product card image micro-wobble on hover (DESKTOP / fine-pointer only)
   Combines with the theme's existing scale(1.05) so they stack cleanly.
   ========================================================================== */
@media (hover: hover) and (min-width: 769px) {
	ul.products li.product .woocommerce-loop-product__link img,
	.post-card__thumb img {
		transition: transform 0.4s ease;
	}
	ul.products li.product:hover .woocommerce-loop-product__link img,
	.post-card:hover .post-card__thumb img {
		transform: scale(1.05) rotate(0.4deg);
	}
}

/* ==========================================================================
   4. Floating background bubbles on product / cart pages
   Two decorative bubbles via ::before / ::after; content sits above on z:1
   so bubbles never overlap interactive targets.
   ========================================================================== */
.single-product .site-main,
.woocommerce-cart .site-main {
	position: relative;
}
.single-product div.product,
.single-product .site-main > *,
.woocommerce-cart .site-main > * {
	position: relative;
	z-index: 1;
}

.single-product .site-main::before,
.single-product .site-main::after,
.woocommerce-cart .site-main::before,
.woocommerce-cart .site-main::after {
	content: "";
	position: absolute;
	z-index: 0;
	bottom: 8%;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	opacity: 0.06;
	mix-blend-mode: screen;
	background: radial-gradient(circle at 35% 35%, var(--ab-saffron, #C2571A), transparent 70%);
	pointer-events: none;
	animation: ab-bubble-rise 15s linear infinite;
}
.single-product .site-main::before,
.woocommerce-cart .site-main::before {
	left: 14%;
	width: 8px;
	height: 8px;
	animation-duration: 13s;
}
.single-product .site-main::after,
.woocommerce-cart .site-main::after {
	right: 12%;
	width: 14px;
	height: 14px;
	animation-duration: 17s;
	animation-delay: 4s;
}
@keyframes ab-bubble-rise {
	0%   { transform: translate(0, 0) scale(0.7); opacity: 0; }
	15%  { opacity: 0.06; }
	50%  { transform: translate(10px, -45vh) scale(1); }
	100% { transform: translate(-6px, -90vh) scale(1.1); opacity: 0; }
}

/* ==========================================================================
   5. Friendly fish mascot idle wobble (404 + empty cart)
   The SVG uses currentColor for fill/stroke, so `color` drives its tint.
   ========================================================================== */
[data-playful-mascot] {
	display: block;
	width: 140px;
	height: auto;
	color: var(--ab-saffron, #C2571A);
	animation: ab-wobble 3s ease-in-out infinite;
	transform-origin: 50% 80%;
}
@keyframes ab-wobble {
	0%, 100% { transform: rotate(-4deg) translateY(0); }
	50%      { transform: rotate(4deg) translateY(-5px); }
}

.error-404__mascot,
.cart-empty__mascot {
	display: flex;
	justify-content: center;
	margin: 0 auto 1.5rem;
}

/* ==========================================================================
   Responsive - lean the mascot down a touch on small screens
   ========================================================================== */
@media (max-width: 768px) {
	[data-playful-mascot] { width: 110px; }
}

/* ==========================================================================
   Reduced motion - kill EVERY animation/transition added in this file.
   Static fallbacks (no wobble, no ripple, upright cards) read fine.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.ab-ripple,
	.header-cart__count.bouncing,
	ul.products li.product .woocommerce-loop-product__link img,
	.post-card__thumb img,
	.single-product .site-main::before,
	.single-product .site-main::after,
	.woocommerce-cart .site-main::before,
	.woocommerce-cart .site-main::after,
	[data-playful-mascot] {
		animation: none !important;
		transition: none !important;
	}
	/* Hide the ripple span entirely so no stray scaled circle lingers. */
	.ab-ripple { display: none !important; }
}
