/**
 * RC34 RTL hardening for curated homepage collections.
 *
 * The storefront stays Arabic, while the merchant's saved ranking and the
 * horizontal rail origin remain identical across languages and breakpoints.
 */

html[dir="rtl"] body.home :is(
	.grz-home-section--featured-offers .grz-fx-grid,
	.grz-product-library--curated-rows .grz-product-library__grid,
	.grz-cat-section .grz-cat-grid
) {
	direction: ltr;
}

html[dir="rtl"] body.home :is(
	.grz-home-section--featured-offers .grz-fx-card,
	.grz-product-library--curated-rows .grz-product-library__product,
	.grz-cat-section .grz-cat-tile
) {
	direction: rtl;
}

html[dir="rtl"] body.home :is(
	.grz-fx-title bdi,
	.grz-product-library__copy bdi
) {
	unicode-bidi: plaintext;
}

html[dir="rtl"] body.home :is(
	.grz-fx-price,
	.grz-fx-price .woocommerce-Price-amount bdi
) {
	direction: ltr;
	unicode-bidi: isolate;
}

@media (max-width: 640px) {
	/* Let translated one-line names use their natural height instead of
	 * reserving an empty 38px caption lane below every product image. */
	html[dir="rtl"] body.home .grz-product-library--curated-rows .grz-product-library__product,
	html[dir="rtl"] body.home .grz-product-library--curated-rows .grz-product-library__product:nth-child(7n + 1),
	html[dir="rtl"] body.home .grz-product-library--curated-rows .grz-product-library__product:nth-child(7n),
	html[dir="rtl"] body.home .grz-product-library--curated-rows .grz-product-library__product:nth-child(8n + 1),
	html[dir="rtl"] body.home .grz-product-library--curated-rows .grz-product-library__product:nth-child(8n) {
		grid-template-rows: calc(var(--grz-mobile-product-card) - 6px) auto;
		min-height: 0;
		align-content: start;
	}
}

