/**
 * JAFRA — RTL exceptions
 *
 * DELIBERATELY SMALL. base.css and components.css are authored with logical
 * properties, so direction is handled by the engine for nearly everything.
 * This file carries only the cases logical properties cannot express.
 *
 * SCOPE (decision B2): the site ships LTR, exactly as designed. There is no
 * Arabic-locale composition in the source designs and none is invented here.
 * What this file guarantees is that (a) Arabic editorial content embedded in
 * LTR pages renders correctly, and (b) if a full Arabic locale is commissioned
 * later, the foundation flips without a rewrite.
 *
 * See docs/DESIGN-DISCREPANCIES.md §3.
 */

/* ==========================================================================
 * 1. Arabic type inside the LTR page
 * These apply regardless of document direction, because Arabic appears as
 * display content on every page of the LTR design.
 * ========================================================================== */

/* Arabic numerals should stay Western in prices and counts even inside an
 * RTL run — the designs show "$89.99", never Eastern Arabic numerals. */
.jafra-kufi,
.jafra-ar {
	font-variant-numeric: lining-nums;
	-moz-font-feature-settings: 'lnum';
	font-feature-settings: 'lnum';
}

/*
 * NOTE: an earlier pass added `padding-block-start: 0.06em` to .jafra-kufi to
 * "protect ascenders". That was an invention, not something the designs do, and
 * it made the Arabic display line 2.5px taller than the source. Removed —
 * .kufi in the designs carries no padding. Do not reintroduce it.
 */

/* A bidi-isolated inline run must not inherit the parent's alignment, or a
 * mixed Arabic/English string (the announcement bar carries one) reorders its
 * separator punctuation. */
.jafra-bidi > * {
	unicode-bidi: isolate;
}

/* ==========================================================================
 * 2. Document-level RTL
 * Applies only when the document is genuinely RTL.
 * ========================================================================== */

[dir='rtl'] body {
	font-family: var(--jafra-font-arabic);
}

/* Latin runs inside an RTL document keep the Latin stack. */
[dir='rtl'] .jafra-latin {
	font-family: var(--jafra-font-body);
	direction: ltr;
	unicode-bidi: isolate;
}

/* ==========================================================================
 * 3. Cases logical properties cannot cover
 * ========================================================================== */

/* Background-position keywords are physical. The select chevron must move to
 * the left edge in RTL. */
[dir='rtl'] .jafra-select {
	background-position: left 16px center;
}

/* `filter`, `transform` and gradient angles are all physical. The footer logo
 * inversion is direction-neutral, but any directional gradient added later
 * needs an explicit RTL counterpart — noted here as the place to put it. */

/* The hero entrance animation translates on the block axis only, so it is
 * direction-safe and needs no override. */

/* ==========================================================================
 * 4. Not overridden on purpose
 *
 *  - .jafra-header grid (1fr auto 1fr) is symmetrical.
 *  - .jafra-link-underline uses inset-inline-start, so the sweep already
 *    originates from the correct edge.
 *  - .jafra-cart-count uses inset-inline-end.
 *  - .jafra-drawer flips via the [dir='rtl'] transform rules in components.css,
 *    kept beside the component so the pair stays legible.
 * ========================================================================== */
