/* ==========================================================================
   ComptaAir UI v4 — Arabic / RTL pass. Loads last; every rule is scoped under
   html[dir="rtl"], so LTR is untouched. Page files carry their own logical
   properties; this file fixes what is global or comes from legacy CSS.
   ========================================================================== */

/* ---------- Global safety ---------- */
html[dir="rtl"] body { overflow-x: clip; }

/* ---------- Arabic type: no tracking (breaks letter joins), taller leading for diacritics ---------- */
html[dir="rtl"] :is(h1, h2, h3, h4, h5, h6, .ui-display, .ui-h1, .ui-h2, .ui-h3, [class*="__title"], [class*="-title"], .ui-kicker, .ui-badge, .ui-tabs__btn) { letter-spacing: 0; }
html[dir="rtl"] :is(h1, h2, h3, h4, .ui-display, .ui-h1, .ui-h2) { line-height: 1.35; }
html[dir="rtl"] body { line-height: 1.75; }

/* ---------- Contact atoms stay LTR ---------- */
html[dir="rtl"] a[href^="tel:"], html[dir="rtl"] a[href^="mailto:"], html[dir="rtl"] .footer-widget-contact-item a { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* ---------- User / CMS content is mostly French: each paragraph picks its own direction ---------- */
html[dir="rtl"] :is(.ui-page-head__title, .ui-page-head__lead, .ui-dash-head__title, .ui-dash-row__title, .myOrder-single-block-title, .single-jobs-para,
  [class*="ll-"][class*="__title"], [class*="ll-"][class*="__desc"], [class*="ld-"][class*="__title"], [class*="ld-"][class*="prose"], [class*="lc-"][class*="prose"]) {
  unicode-bidi: plaintext; text-align: start;
}

/* ---------- Header (legacy comptaair-rtl.css reverses the mobile flex row) ---------- */
@media (max-width: 991.98px) {
  html[dir="rtl"] .ui-nav__inner.nav-container { flex-direction: row; }
  html[dir="rtl"] .ui-nav__inner .responsive-mobile-menu .navbar-toggler { right: auto !important; left: 0 !important; }
  html[dir="rtl"] .ui-nav__links .sub-menu { padding: 0 12px 0 0 !important; }
  html[dir="rtl"] .ui-nav__links > li { text-align: right; }
}
html[dir="rtl"] .ui-nav__links > li.menu-item-has-children > a::after { margin: -3px 2px 0 0; }

/* ---------- Footer newsletter ---------- */
html[dir="rtl"] .ui-footer button i[class*="arrow-right"], html[dir="rtl"] .ui-footer .subscription_by_email i { transform: scaleX(-1); }

/* ---------- Floating WhatsApp: move to the other corner ---------- */
html[dir="rtl"] .whatsapp-integration-wrap > a { right: auto !important; left: 24px !important; }

/* ---------- Category rails ---------- */
html[dir="rtl"] .categorySub-list-slide, html[dir="rtl"] .categorySub-list { flex-direction: row; }

/* ---------- Dashboard wizard ---------- */
html[dir="rtl"] .lp-wizard .setup-wrapper-left { margin: 0; padding-right: 0; padding-left: 0; max-width: none; width: 100%; }
html[dir="rtl"] .lp-wizard .setup-wrapper-left::before { display: none; }
html[dir="rtl"] .select2-container--default .select2-selection--multiple .select2-selection__choice { margin-right: 0; margin-left: 6px; float: right; }

/* ---------- Forms ---------- */
html[dir="rtl"] :is(.form--control, .form-control, .form-select, input, textarea, select) { text-align: right; }
html[dir="rtl"] :is(input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="password"], input[name*="email"], input[name*="phone"]) { direction: ltr; text-align: right; }
html[dir="rtl"] :is(input[type="email"], input[type="tel"], input[type="url"], input[type="number"], input[type="password"])::placeholder { direction: rtl; text-align: right; }
html[dir="rtl"] .form-select { background-position: left .75rem center; padding-right: 12px; padding-left: 2.25rem; }

/* ---------- Tables ---------- */
html[dir="rtl"] :is(table, .table) :is(th, td) { text-align: right; }
