/* Right-to-left overrides. Loaded only on dir="rtl" language builds.
   The English sheet is written with physical properties (left/right,
   margin-left, text-align:left), so the job here is to mirror the ones that
   carry meaning and leave the ones that do not - numbers, model codes and
   spec tables stay in logical order. */

html[dir="rtl"] body { direction: rtl; text-align: right; }

/* Rows that read as a sequence: nav, top bar, card actions, breadcrumbs. */
html[dir="rtl"] .header-inner,
html[dir="rtl"] .nav,
html[dir="rtl"] .topbar .container,
html[dir="rtl"] .topbar__meta,
html[dir="rtl"] .breadcrumb,
html[dir="rtl"] .footer-grid { flex-direction: row-reverse; }

/* Lists and quotes hang off the start edge, whichever side that is. */
html[dir="rtl"] ul,
html[dir="rtl"] ol { padding-inline-start: 1.25rem; padding-inline-end: 0; }
html[dir="rtl"] blockquote { border-inline-start: 3px solid currentColor;
                             border-inline-end: 0; padding-inline-start: 1rem; }

/* Tables: headers and cells flip, but a numeric column stays readable. */
html[dir="rtl"] table { direction: rtl; }
html[dir="rtl"] th, html[dir="rtl"] td { text-align: right; }
html[dir="rtl"] td.num, html[dir="rtl"] .spec-value { direction: ltr;
                                                      text-align: right;
                                                      unicode-bidi: isolate; }

/* Model codes, dimensions and phone numbers must not be re-ordered by the
   bidi algorithm when they sit inside an Arabic sentence. */
html[dir="rtl"] code, html[dir="rtl"] .model, html[dir="rtl"] .sku,
html[dir="rtl"] a[href^="tel:"] { direction: ltr; unicode-bidi: isolate; }

/* Floating contact button moves to the other corner. */
html[dir="rtl"] .fab, html[dir="rtl"] .floating-contact,
html[dir="rtl"] .wa-fab { right: auto; left: 18px; }

/* Arrow glyphs in "Browse →" style links point the other way. */
html[dir="rtl"] .arrow, html[dir="rtl"] .more::after { transform: scaleX(-1);
                                                       display: inline-block; }

/* Anything positioned with physical offsets in the base sheet. */
html[dir="rtl"] .mega, html[dir="rtl"] .dropdown { left: auto; right: 0; }
html[dir="rtl"] .langsw__menu { inset-inline-end: 0; inset-inline-start: auto; }
