/* ============================================================
   Arabic (ar/) RTL overrides — SJ Petroleum Machinery
   Loaded ONLY by /ar/* pages (after styles.css / products.css).
   The global CSS shared by all five LTR languages is untouched.
   Rules follow the Arabic translation mechanism spec (section 3)
   and the v1.0/v1.1 audit recommendations.
   ============================================================ */

/* ---- Typography: Arabic connected script ----
   letter-spacing / text-transform / Georgia-serif break Arabic
   cursive joining; Arabic has no uppercase. */
[dir="rtl"] body {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Trebuchet MS", sans-serif;
  line-height: 1.7;
}
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
  font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;
  letter-spacing: 0;
}
[dir="rtl"] .eyebrow,
[dir="rtl"] .card .meta,
[dir="rtl"] .article .meta,
[dir="rtl"] .lang-panel-label,
[dir="rtl"] .about-media-note strong,
[dir="rtl"] .about-chip {
  letter-spacing: 0;
  text-transform: none;
}

/* ---- Header / navigation / language switcher mirroring ----
   In RTL the flex rows mirror automatically; only hard-coded
   left/right values need explicit overrides. */
[dir="rtl"] .lang-switcher {
  margin-left: 0;
  margin-right: auto;
}
[dir="rtl"] .lang-switcher-panel {
  right: auto;
  left: 0;
}
[dir="rtl"] .nav-products-panel {
  left: auto;
  right: 0;
}

/* ---- Table alignment ---- */
[dir="rtl"] .about-table th,
[dir="rtl"] .about-table td,
[dir="rtl"] .spec-table th,
[dir="rtl"] .spec-table td,
[dir="rtl"] .parameter-data-table th,
[dir="rtl"] .parameter-data-table td {
  text-align: right;
}

/* ---- Parameter tables: value cells keep LTR order ----
   Cells like "4500(1,011,000)" / "952(37-1/2")" mix digits with
   parenthesized Latin; in an RTL cell the parenthetical is visually
   re-ordered before the number. Fixing cell direction to LTR (while
   keeping right alignment) makes numbers + units read in written order.
   Arabic label cells (strong RTL) render correctly inside LTR cells. */
[dir="rtl"] table.parameter-data-table td {
  direction: ltr;
  text-align: right;
}

/* ---- Lists: padding moves to the inline-start (right) side ---- */
[dir="rtl"] .list,
[dir="rtl"] .article .mini-list,
[dir="rtl"] .products-hero-points,
[dir="rtl"] .category-feature-list,
[dir="rtl"] .detail-notes,
[dir="rtl"] .detail-step-list {
  padding-left: 0;
  padding-right: 20px;
}

/* ---- Bidi: Latin-data inputs stay LTR inside an RTL page ---- */
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="url"],
[dir="rtl"] input[type="tel"],
[dir="rtl"] input[name*="email"],
[dir="rtl"] input[name*="phone"],
[dir="rtl"] input[name*="url"] {
  direction: ltr;
  text-align: left;
}
[dir="rtl"] input[name*="name"],
[dir="rtl"] input[name*="company"],
[dir="rtl"] input[name*="country"],
[dir="rtl"] textarea {
  direction: auto;
}

/* ---- Focus outline: browser default RTL position anomaly ---- */
[dir="rtl"] a:focus-visible,
[dir="rtl"] button:focus-visible,
[dir="rtl"] input:focus-visible,
[dir="rtl"] textarea:focus-visible,
[dir="rtl"] summary:focus-visible {
  outline: 2px solid #35b6ff;
  outline-offset: 2px;
}

/* ---- chat.js floating widget ----
   External widget anchors itself fixed right:70px bottom:20px.
   Verified in browser test (Playwright, locale ar-EG, 1400px):
   mirror it to the inline-start (left) side on RTL pages.
   !important guards against the widget's inline styles. */
[dir="rtl"] #chatbox {
  right: auto !important;
  left: 70px !important;
}
