/* حرکت‌های مشترک قالب‌ها و نمایش پیام سبد خرید با رعایت تنظیم کاهش حرکت. */
.ask-motion-toast {
	position: fixed;
	z-index: 9999;
	inset-block-end: max(1.25rem, env(safe-area-inset-bottom));
	left: 50%;
	transform: translateX(-50%);
	max-inline-size: calc(100vw - 2rem);
	border-radius: 2rem;
	background: #222;
	color: #fff;
	padding: .55rem 1rem;
	text-align: center;
	font-size: .875rem;
	pointer-events: none;
}

.ask-motion-toast:empty {
	opacity: 0;
}

.ask-motion-check { display: none; }

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}

	.ask-motion .ask-motion-pending:not(:focus-within) {
		opacity: 0;
	}

	.ask-motion .ask-motion-reveal:not(:focus-within) {
		animation: ask-motion-reveal 280ms ease-out var(--ask-motion-delay, 0ms) backwards;
	}

	@keyframes ask-motion-reveal {
		from { opacity: 0; translate: 0 12px; }
		to { opacity: 1; translate: 0 0; }
	}

	.ask-motion-header {
		transition: box-shadow 200ms ease, padding-block-end 200ms ease;
	}

	.ask-motion-scrolled {
		box-shadow: 0 5px 16px -10px rgb(0 0 0 / 35%);
	}

	/* جبران کاهش فاصلهٔ داخلی برای ثابت ماندن جای محتوای صفحه. */
	.ask-motion-header-shell {
		transition: padding-block-end 200ms ease;
	}

	.ask-motion-header-shell:has(.ask-motion-scrolled) {
		padding-block-end: 4px;
	}

	.ask-motion-header:is(.bistro-header, .salon-header) { --ask-header-padding: .8rem; }
	.ask-motion-header.cafe-header { --ask-header-padding: .75rem; }
	.ask-motion-header:is(.boutique-header, .clinic-header) { --ask-header-padding: .9rem; }

	.ask-motion-header-shell:has(.ask-motion-scrolled) .ask-motion-scrolled:not(.news-header, .chida-header) {
		padding-block-end: calc(var(--ask-header-padding) - 4px) !important;
	}

	.ask-motion-header-shell :is(.news-brand, .chida-header-inner, .chida-checkout-brand) {
		transition: padding-block-end 200ms ease, min-height 200ms ease;
	}

	.ask-motion-header-shell:has(.ask-motion-scrolled) .ask-motion-scrolled > .news-brand {
		padding-block-end: calc(var(--wp--preset--spacing--40) - 4px);
	}

	.ask-motion-header-shell:has(.ask-motion-scrolled) .ask-motion-scrolled > :is(.chida-header-inner, .chida-checkout-brand) {
		padding-block-end: calc(.65rem - 4px);
		min-height: calc(4.75rem - 4px);
	}

	:is(.wp-element-button, .wp-block-button__link, .add_to_cart_button, .single_add_to_cart_button,
		.woocommerce button.single_add_to_cart_button) {
		transition: scale 120ms ease-out, background-color 200ms ease;
	}

	:is(.wp-element-button, .wp-block-button__link, .add_to_cart_button, .single_add_to_cart_button):active {
		scale: .97;
	}

	:where(:has(> .ask-motion-check)) { position: relative; }

	.ask-motion-check {
		display: block;
		position: absolute;
		inset-block-start: 0;
		inset-inline-end: 0;
		translate: 0 -45%;
		border-radius: 50%;
		padding-inline: .3em;
		background: #1d6643;
		color: #fff;
		pointer-events: none;
		animation: ask-motion-check 500ms ease-out both;
	}

	@keyframes ask-motion-check {
		0% { opacity: 0; scale: .7; }
		35% { opacity: 1; scale: 1.15; }
		65% { opacity: 1; scale: 1; }
		100% { opacity: 0; scale: 1; }
	}

	:where(.cart-contents .count, [class*="mini-cart"] .badge) { display: inline-block; }

	.ask-motion-bump { animation: ask-motion-bump 360ms ease-out; }

	@keyframes ask-motion-bump {
		0%, 100% { scale: 1; }
		50% { scale: 1.25; }
	}
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	:is(.wc-block-grid__product-image, .wc-block-components-product-image, .wp-block-woocommerce-product-image) {
		overflow: hidden;
	}

	ul.products li.product:not(.product-category) > a.woocommerce-loop-product__link {
		display: block;
		overflow: clip;
	}

	:is(.wc-block-grid__product-image, .wc-block-components-product-image, .wp-block-woocommerce-product-image) img,
	html ul.products li.product:not(.product-category) > a.woocommerce-loop-product__link > img {
		transition: transform 400ms ease;
	}

	html ul.products li.product:not(.product-category) > a.woocommerce-loop-product__link > img {
		transform: none;
	}

	:is(.wc-block-grid__product-image, .wc-block-components-product-image, .wp-block-woocommerce-product-image):hover img,
	html ul.products li.product:not(.product-category) > a.woocommerce-loop-product__link:hover > img {
		transform: scale(1.04);
	}
}

@media (hover: none), (prefers-reduced-motion: reduce) {
	html ul.products li.product:not(.product-category) > a.woocommerce-loop-product__link > img {
		transform: none;
		transition: none;
	}
}
