/* CHXN component: animations — the approved 4-group motion pass (A scroll-
   reveal, B micro-interactions, C hero/countdown, D cart feedback).
   Ground rules: transform/opacity only (no layout-triggering properties),
   and every effect either lives inside a prefers-reduced-motion:
   no-preference block or is a sub-second feedback cue — the "reduce"
   setting gets a fully static page. Class hooks (.chxn-reveal, .chxn-tick,
   .chxn-bounce, .chxn-item-flash, .chxn-fly-img) are applied by
   assets/js/modules/animations.js; nothing here hides content unless that
   JS is actually running. */

/* ==== A. scroll-reveal ==== */
@media (prefers-reduced-motion: no-preference) {
	.chxn-reveal {
		opacity: 0;
		transform: translateY(22px);
		transition:
			opacity .55s cubic-bezier(.22, .61, .36, 1),
			transform .55s cubic-bezier(.22, .61, .36, 1);
		transition-delay: var(--chxn-reveal-delay, 0s);
	}
	.chxn-reveal.is-revealed {
		opacity: 1;
		transform: none;
	}
}

/* ==== B. micro-interactions ==== */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.chxn-product-card {
		transition: transform .22s ease, box-shadow .22s ease;
	}
	.chxn-product-card:hover {
		transform: translateY(-4px);
		box-shadow: 0 14px 28px rgba(18, 107, 72, .12);
	}
}
/* press feedback — quick enough to keep even under reduced motion it
   would be fine, but grouped with the rest for one consistent rule. */
@media (prefers-reduced-motion: no-preference) {
	.chxn-btn,
	.button,
	.chxn-btn-white,
	.chxn-btn-ghost,
	.chxn-footer-cta,
	.single_add_to_cart_button,
	a.add_to_cart_button {
		transition: transform .12s ease, background-color .18s ease, color .18s ease;
	}
	.chxn-btn:active,
	.button:active,
	.chxn-btn-white:active,
	.chxn-btn-ghost:active,
	.chxn-footer-cta:active,
	.single_add_to_cart_button:active,
	a.add_to_cart_button:active {
		transform: scale(.96);
	}
	/* hotline FAB: soft expanding ring, drawing the eye without moving
	   the button itself. On its own pseudo element so the button's real
	   box-shadow (fab.css) stays untouched. */
	.chxn-fab-hotline::after {
		content: "";
		position: absolute;
		inset: 0;
		border-radius: 50%;
		pointer-events: none;
		animation: chxn-fab-pulse 2.6s ease-out infinite;
	}
}
@keyframes chxn-fab-pulse {
	0% { box-shadow: 0 0 0 0 rgba(18, 107, 72, .40); }
	70% { box-shadow: 0 0 0 16px rgba(18, 107, 72, 0); }
	100% { box-shadow: 0 0 0 0 rgba(18, 107, 72, 0); }
}

/* ==== C. hero entrance + countdown tick ==== */
@media (prefers-reduced-motion: no-preference) {
	.chxn-hero-text .chxn-hero-badge,
	.chxn-hero-text h1,
	.chxn-hero-text p,
	.chxn-hero-text .chxn-hero-actions,
	.chxn-hero-text .chxn-hero-coupons,
	.chxn-hero-media,
	.chxn-about-hero-inner .chxn-hero-badge,
	.chxn-about-hero-inner h1,
	.chxn-about-hero-inner p {
		animation: chxn-rise .6s cubic-bezier(.22, .61, .36, 1) both;
	}
	.chxn-hero-text .chxn-hero-badge,
	.chxn-about-hero-inner .chxn-hero-badge { animation-delay: .05s; }
	.chxn-hero-text h1,
	.chxn-about-hero-inner h1 { animation-delay: .14s; }
	.chxn-hero-text p,
	.chxn-about-hero-inner p { animation-delay: .24s; }
	.chxn-hero-text .chxn-hero-actions { animation-delay: .34s; }
	.chxn-hero-text .chxn-hero-coupons { animation-delay: .44s; }
	.chxn-hero-media { animation-delay: .28s; }
	/* flash-sale countdown: the seconds box pops each tick
	   (animations.js re-applies .chxn-tick on every value change). */
	.chxn-flash-countdown-box {
		display: inline-block;
	}
	.chxn-flash-countdown-box.chxn-tick {
		animation: chxn-num-pop .3s ease;
	}
}
@keyframes chxn-rise {
	from { opacity: 0; transform: translateY(18px); }
	to { opacity: 1; transform: none; }
}
@keyframes chxn-num-pop {
	50% { transform: scale(1.16); }
}

/* ==== D. cart feedback ==== */
/* the clone animations.js floats from the clicked product to the header
   cart button */
.chxn-fly-img {
	position: fixed;
	z-index: 9999;
	width: 64px;
	height: 64px;
	border-radius: 12px;
	object-fit: cover;
	pointer-events: none;
	box-shadow: 0 8px 22px rgba(18, 107, 72, .3);
	transition:
		transform .75s cubic-bezier(.5, -.05, .75, .5),
		opacity .75s ease;
}
.chxn-cart-count.chxn-bounce {
	animation: chxn-badge-pop .5s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes chxn-badge-pop {
	30% { transform: scale(1.45); }
	60% { transform: scale(.92); }
}
.chxn-flying-cart-item.chxn-item-flash {
	animation: chxn-item-flash 1.2s ease;
}
@keyframes chxn-item-flash {
	0% { background: var(--chxn-green-l); }
	100% { background: transparent; }
}
