/**
 * RC34 RTL hardening for the product purchase flow.
 *
 * Arabic keeps natural right-to-left text, but the product composition,
 * merchant-saved package order, quantity semantics and payment actions retain
 * the same predictable structure as the source storefront.
 */

/* Keep the cover, product copy and favourite action in the approved physical
 * columns. Only the copy inside the centre column reads right-to-left. */
html[dir="rtl"] body.single-product.grz-product-design .grz-tp-hero__inner {
	direction: ltr;
}

html[dir="rtl"] body.single-product.grz-product-design .grz-tp-hero__main,
html[dir="rtl"] body.single-product.grz-product-design .grz-tp-hero .grz-favorite-button--product {
	direction: rtl;
	text-align: right;
}

/* CSS grid line 1 changes sides when direction changes. Keep the package card
 * in the main column and the purchase rail in the summary column, then restore
 * Arabic text direction inside both children. */
@media (min-width: 861px) {
	html[dir="rtl"] body.single-product.grz-product-design div.product form.grz-tp-form {
		direction: ltr;
	}

	html[dir="rtl"] body.single-product.grz-product-design div.product form.grz-tp-form > .grz-tp-card--package,
	html[dir="rtl"] body.single-product.grz-product-design div.product form.grz-tp-form > .grz-tp-rail {
		direction: rtl;
		text-align: right;
	}
}

/* Package ranking is merchant-controlled. An LTR grid prevents RTL from
 * reversing its saved positions; each package still presents Arabic copy in
 * the correct reading direction. */
html[dir="rtl"] body.single-product.grz-product-design .grz-tp-pills {
	direction: ltr;
}

html[dir="rtl"] body.single-product.grz-product-design .grz-tp-pill {
	direction: rtl;
	text-align: right;
}

/* Minus/value/plus and Cart/Buy are semantic controls, not prose. Keep their
 * established order in every language while allowing translated labels. */
html[dir="rtl"] body.single-product.grz-product-design .grz-tp-qty .quantity,
html[dir="rtl"] body.single-product.grz-product-design .grz-tp-action-row {
	direction: ltr;
}

html[dir="rtl"] body.single-product.grz-product-design .grz-tp-action-row :is(button, a),
html[dir="rtl"] body.single-product.grz-product-design .grz-tp-qty__compact-copy {
	direction: rtl;
}

html[dir="rtl"] body.single-product.grz-product-design .grz-tp-qty input.qty {
	direction: ltr;
	text-align: center;
	unicode-bidi: isolate;
}

/* Currency, denominations, percentages and account identifiers must not be
 * reordered by surrounding Arabic copy. */
html[dir="rtl"] body.single-product.grz-product-design :is(
	.woocommerce-Price-amount bdi,
	.grz-tp-pill__pricing,
	.grz-tp-total__prices,
	.grz-tp-summary-row dd,
	.grz-tp-player-input,
	[data-grz-player-id],
	[data-grz-account-id]
) {
	direction: ltr;
	unicode-bidi: isolate;
}

html[dir="rtl"] body.single-product.grz-product-design :is(
	.grz-tp-hero__title bdi,
	.grz-tp-simple__content bdi,
	.grz-tp-selected-package__copy bdi,
	.grz-tp-pill__label,
	.grz-tp-denom-trigger__value,
	.grz-tp-about__heading bdi,
	.grz-tp-related__copy bdi
) {
	unicode-bidi: plaintext;
}

