/**
 * Right-to-left corrections for Arabic pages.
 *
 * Woodmart already ships RTL support, so this is deliberately a thin
 * corrective layer for the places that still read wrong — mostly prices and
 * anything this plugin renders itself. It only ever adds rules; it never
 * dequeues or overrides the theme's own stylesheets, because doing so would
 * break on the next theme update.
 *
 * Loaded only when the current language is Arabic.
 */

/* --------------------------------------------------------------------------
   Prices

   A price is a bidirectional string: the number runs left-to-right even
   inside an RTL paragraph, while the symbol should sit beside it in reading
   order. Without isolation the browser can render "353,70 درهم" with the
   symbol jumping to the wrong side, or push a minus sign to the far end of
   the line.
   -------------------------------------------------------------------------- */
.rtl .woocommerce-Price-amount,
.rtl .amount {
	unicode-bidi: isolate;
	direction: rtl;
}

.rtl .woocommerce-Price-currencySymbol {
	unicode-bidi: isolate;
	margin-inline-start: .25em;
}

/* Price ranges and strike-through sale prices keep their order. */
.rtl del .woocommerce-Price-amount,
.rtl ins .woocommerce-Price-amount {
	unicode-bidi: isolate;
}

/* --------------------------------------------------------------------------
   Numbers that must stay left-to-right

   Phone numbers, SKUs, order numbers and tracking codes are Latin-digit
   strings. In an RTL paragraph a "+" or "-" inside them gets reordered, so
   "+212 612..." can render as "212 612...+". Isolating them fixes it without
   changing the surrounding text direction.
   -------------------------------------------------------------------------- */
.rtl .rc-ltr,
.rtl .rc-phone,
.rtl .rc-sku,
.rtl .rc-order-number,
.rtl .rc-tracking-number {
	direction: ltr;
	unicode-bidi: embed;
	display: inline-block;
}

/* Phone and email inputs: type Latin digits left-to-right even on an
   Arabic page, but keep the field itself aligned to the right margin. */
.rtl input[type="tel"],
.rtl input[type="email"],
.rtl input[type="url"] {
	direction: ltr;
	text-align: right;
}

/* --------------------------------------------------------------------------
   Plugin-rendered UI
   -------------------------------------------------------------------------- */
.rtl .rc-field-row {
	text-align: right;
}

.rtl .rc-inline-note {
	margin-inline-start: 0;
	margin-inline-end: .5em;
}

/* Anything using a logical float should mirror; use logical properties so
   these stay correct if the layout is reused LTR. */
.rtl .rc-align-start {
	text-align: right;
}

.rtl .rc-align-end {
	text-align: left;
}
