/* Right-to-left overrides for Arabic (/ar) pages only.
   Leaves public/assets/css/site.css untouched and mirrors every physical left/right layout rule. */
[dir="rtl"] .skip { left: auto; right: 12px; }

/* Prevent RTL horizontal overflow from off-screen honeypot input */
[dir="rtl"] .form .hp { left: auto; right: -9999px; }

/* Topbar, header, mega menu & language switcher */
[dir="rtl"] .topbar svg { margin-right: 0; margin-left: 6px; }
[dir="rtl"] .hdr-cta,
[dir="rtl"] .mnav,
[dir="rtl"] .mega-foot .btn { margin-left: 0; margin-right: auto; }
[dir="rtl"] .mega-col { border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .mega-col:first-child { padding-left: 28px; padding-right: 0; border-right: 0; }
[dir="rtl"] .mega-aside { margin-left: 0; margin-right: 28px; }
[dir="rtl"] .lang-menu { right: auto; left: 0; }
[dir="rtl"] .crumbs li + li::before { margin-right: 0; margin-left: 8px; }

/* Floating WhatsApp button flipped to bottom-left in RTL, with higher specificity than scoped component style */
html[dir="rtl"] a.wa-float { right: auto; left: max(20px, env(safe-area-inset-left)); }
@media (max-width: 700px) {
  html[dir="rtl"] a.wa-float { right: auto; left: max(16px, env(safe-area-inset-left)); }
}
@media (max-width: 1399px) {
  html[dir="rtl"] .ftr-bot { padding-right: 0; padding-left: 60px; }
}

/* Tables, key-value lists & cards */
[dir="rtl"] .tbl th,
[dir="rtl"] .tbl td,
[dir="rtl"] .prose th,
[dir="rtl"] .prose td { text-align: right; }
[dir="rtl"] .pgrid { border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .pcard { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .pcard .pc-tag { left: auto; right: 16px; }
[dir="rtl"] .pcard dt { padding-right: 0; padding-left: 16px; }
[dir="rtl"] .pcard dd { text-align: left; }
[dir="rtl"] .tcard .tc-list li span { text-align: left; }
[dir="rtl"] .tcard .tc-list li .pn { text-align: right; }
[dir="rtl"] .ftr-brand { padding-right: 0; padding-left: 40px; }
[dir="rtl"] .ftr-kv div:nth-child(odd) { padding-right: 0; padding-left: 12px; }
[dir="rtl"] .contam span.lbl,
[dir="rtl"] .bestfor span.lbl,
[dir="rtl"] .psizes span.lbl { margin-right: 0; margin-left: 6px; }

/* Vertical dividers between horizontal columns */
[dir="rtl"] .facts li,
[dir="rtl"] .facts-l li,
[dir="rtl"] .terms div,
[dir="rtl"] .legend dl > div { border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .facts li { border-right-color: var(--line-d); }
[dir="rtl"] .facts li:first-child,
[dir="rtl"] .facts-l li:first-child,
[dir="rtl"] .terms div:first-child,
[dir="rtl"] .legend dl > div:first-child { border-right: 0; padding-right: 0; padding-left: 24px; }
[dir="rtl"] .kspec div + div { padding-left: 0; padding-right: 16px; border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .pd-info .pspec div { padding-right: 0; padding-left: 8px; }
[dir="rtl"] .pd-info .pspec div + div { padding-left: 8px; padding-right: 16px; border-left: 0; border-right: 1px solid var(--line); }
@media (max-width: 1279px) {
  [dir="rtl"] .pd-info .pspec div:nth-child(3) { padding-right: 0; border-right: 0; }
}
@media (max-width: 700px) {
  [dir="rtl"] .legend dl > div { border-right: 0; }
  [dir="rtl"] .facts-l[style*="--n: 4"] li { border-right: 0; }
  [dir="rtl"] .facts-l[style*="--n: 4"] li:nth-child(even) { border-right: 1px solid var(--line); }
  [dir="rtl"] .facts-l[style*="--n: 4"] li:nth-child(odd):not(:first-child) { border-right: 0; }
  [dir="rtl"] .ftr-brand { padding-left: 0; }
}

/* Numbered step timelines */
[dir="rtl"] .step + .step { padding-left: 0; padding-right: 22px; border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .step .s-n::before { left: auto; right: 0; }
[dir="rtl"] .step + .step .s-n::before { left: auto; right: -5px; }
[dir="rtl"] .steps.s3 .step:nth-child(4) { padding-right: 0; border-right: 0; }
[dir="rtl"] .steps.s3 .step:nth-child(4) .s-n::before { left: auto; right: 0; }
@media (max-width: 720px) {
  [dir="rtl"] .steps.s3 .step,
  [dir="rtl"] .steps.s3 .step + .step { padding-left: 0; padding-right: 22px; border-right: 0; }
}
/* Centred step lists (.steps.c: home, factory, contact, solutions hub) keep their dot above the middle of each
   step, as in English (site.css: left 50%). The rules above also set "right"; with both sides set, a right-to-left
   page uses the right one and the dots sat on the step edges. Phone widths below. (Claude's audit, 2026-12-02) */
[dir="rtl"] .steps.c .step .s-n::before,
[dir="rtl"] .steps.c .step + .step .s-n::before { right: auto; }
/* Phone widths: site.css turns step lists into one column at 700px, every step with a line on its left and the dot
   on that line. In Arabic the line, the padding and the dot go to the right; without this the dot sat on the first
   letters of "الخطوة 0n" and the line was missing. */
@media (max-width: 700px) {
  [dir="rtl"] .step,
  [dir="rtl"] .step + .step { padding: 20px 22px 20px 0; border-left: 0; border-right: 1px solid var(--line); }
  [dir="rtl"] .step .s-n::before,
  [dir="rtl"] .step + .step .s-n::before { left: auto; right: -5px; top: 24px; }
  [dir="rtl"] .steps.c .step,
  [dir="rtl"] .steps.c .step + .step { text-align: right; padding: 20px 22px 20px 0; }
  [dir="rtl"] .steps.c .step .s-n::before,
  [dir="rtl"] .steps.c .step + .step .s-n::before { left: auto; right: -5px; margin-left: 0; }
}

/* Gallery badges */
[dir="rtl"] .gal-main .g-cnt { right: auto; left: 12px; }
[dir="rtl"] .gal-main .g-zoom { left: auto; right: 12px; }
[dir="rtl"] .gal-box-close { right: auto; left: 16px; }

/* Directional arrows mirror cleanly in RTL */
[dir="rtl"] .lnk svg,
[dir="rtl"] .btn svg,
[dir="rtl"] .apl .ar svg { transform: scaleX(-1); }
[dir="rtl"] .lnk:hover svg { transform: scaleX(-1) translateX(3px); }
[dir="rtl"] .arrow-cell { transform: scaleX(-1); display: table-cell; }

/* Preserve exact scientific casing (Al₂O₃, mg/g, m²/g) on uppercase English labels in RTL */
[dir="rtl"] :is(.kspec span, .eyebrow, .pd-eyebrow, .idx, .mono) {
  text-transform: none;
}

/* Keep numeric KPI values, ranges, inequalities, size chips and gallery counters strictly LTR so ≥/≤ and ranges never reverse */
[dir="rtl"] :is(.pspec dd, .psizes li, .facts-l li b, .facts li b, .kspec b, .gal-main .g-cnt, .coa td.mono, .mini-p dd, .pcard dd) {
  direction: ltr;
  unicode-bidi: isolate;
}
[dir="rtl"] :is(.pspec dd, .kspec b) {
  text-align: right;
}

/* Keep emails, phone numbers, codes and logarithmic sieve scales strictly LTR */
[dir="rtl"] a[href^="mailto:"],
[dir="rtl"] a[href^="https://wa.me"],
[dir="rtl"] .scale-body,
[dir="rtl"] .sieve .scale-inner {
  direction: ltr;
  unicode-bidi: isolate;
}
[dir="rtl"] .scale-body .sc-n,
[dir="rtl"] .sieve .sc-n {
  direction: rtl;
  text-align: right;
}
[dir="rtl"] .tb-r a[href^="mailto:"],
[dir="rtl"] .tb-r a[href^="https://wa.me"] {
  direction: ltr;
  unicode-bidi: isolate;
}
[dir="rtl"] .tb-r a svg { margin-left: 0; margin-right: 6px; }

/* Article / guide pages (TOC, prose callout/lists/timeline, prev/next nav, cards & numeric table cells) */
[dir="rtl"] .toc ol { border-left: 0; border-right: 1px solid var(--line); }
[dir="rtl"] .toc li a { padding: 8px 14px 8px 0; margin-left: 0; margin-right: -1px; border-left: 0; border-right: 2px solid transparent; }
[dir="rtl"] .toc li a[aria-current] { border-left-color: transparent; border-right-color: var(--amber); }
[dir="rtl"] .prose .callout { border-left: 1px solid var(--line); border-right: 0; }
[dir="rtl"] .prose > ol { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .prose .tl4 div { border-right: 0; border-left: 1px solid var(--line); }
[dir="rtl"] .prose .tl4 div:last-child { border-left: 0; }
@media (max-width: 640px) {
  [dir="rtl"] .prose .tl4 div:nth-child(2n) { border-left: 0; }
}
[dir="rtl"] .prevnext a:last-child { text-align: left; }
@media (max-width: 700px) {
  [dir="rtl"] .prevnext a:last-child { text-align: right; }
}
[dir="rtl"] .ccard .ctype { left: auto; right: 12px; }
[dir="rtl"] .ccard .dur { right: auto; left: 12px; }
[dir="rtl"] .ccard .cimg.ph .phl { left: auto; right: 12px; }
[dir="rtl"] .prose td.mono { direction: ltr; unicode-bidi: isolate; text-align: right; }
