/*
 * Right-to-left overrides for Arabic.
 *
 * The stylesheet is written with logical properties throughout
 * (inset-inline-start, padding-inline, margin-inline, text-align: start), so
 * most of the layout mirrors on its own. Only the cases CSS logical properties
 * cannot express — background image positions, transforms, borders declared
 * physically, and a slightly looser line-height for Arabic script — need
 * fixing here.
 */

body {
	/* Arabic ascenders and descenders need more room than Latin. */
	line-height: 1.85;
}

h1, h2, h3, h4, h5, h6 {
	line-height: 1.35;
	/* Arabic has no case distinction, so tight tracking hurts legibility. */
	letter-spacing: 0;
}

.eyebrow,
.filters__title,
.footer__title,
.card__brand,
.brand__tag,
.hero__stat dt,
.product__ids dt,
.badge {
	/* Uppercasing and wide tracking are meaningless in Arabic and make text
	   harder to read; render these as ordinary text instead. */
	text-transform: none;
	letter-spacing: 0;
}

/* Select chevron sits on the left in RTL. */
select.sort {
	padding: 0.5rem 0.9rem 0.5rem 2.2rem;
	background-position: left 0.6rem center;
}

/* The details marker is drawn with physical borders. */
.faq__q::after {
	border-right: 0;
	border-bottom: 2px solid var(--muted);
	border-left: 2px solid var(--muted);
	transform: rotate(-45deg);
}

.faq__item[open] .faq__q::after { transform: rotate(135deg); }

/* Floats are physical by definition. */
.alignleft { float: right; margin: 0 0 var(--sp-4) var(--sp-5); }
.alignright { float: left; margin: 0 var(--sp-5) var(--sp-4) 0; }

/* The hero light source mirrors so it still falls behind the artwork. */
.hero::after {
	inset-inline-end: auto;
	inset-inline-start: -12%;
}

/* Numeric identifiers stay left-to-right inside RTL text. */
.card__sku,
.product__ids dd,
.spec-table td {
	direction: ltr;
	text-align: right;
	unicode-bidi: embed;
}

/* Statistics like "20+" are read as a number followed by a modifier. Without
   isolation the bidi algorithm moves the "+" to the wrong side and it renders
   as "+20". */
.hero__stat dd {
	unicode-bidi: isolate;
	direction: ltr;
	text-align: right;
}

/* Phone numbers and email addresses likewise. */
.topbar__contact a[href^="tel:"],
.topbar__contact a[href^="mailto:"],
.footer__contact a[href^="tel:"],
.footer__contact a[href^="mailto:"] {
	direction: ltr;
	unicode-bidi: embed;
}

/* Breadcrumb separator leans the other way. */
.breadcrumb li + li::before { content: "\\"; }
