/* ============================================================
   H-Bot — RTL (Arabic) overrides + language-toggle styling.
   Loaded on every page. RTL rules apply only under [dir="rtl"].
   Most flex/grid/text flips happen automatically from dir=rtl;
   these rules fix the pieces that use physical left/right.
   ============================================================ */

/* ---- Language toggle button (both directions) ---- */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  margin-inline-start: var(--space-3, 12px);
  border: 1px solid var(--border-soft, rgba(255,255,255,0.14));
  border-radius: 999px;
  background: transparent;
  color: var(--text-primary, #fff);
  font-family: 'Readex Pro', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.lang-toggle:hover { border-color: var(--brand-blue, #0883fd); background: rgba(8,131,253,0.10); }
.mobile-menu .lang-toggle { width: 100%; margin: 8px 0 0; height: 44px; }

/* ============================================================
   RTL
   ============================================================ */

/* Arabic reads best with a touch more line-height */
[dir="rtl"] body { line-height: 1.75; }

/* Eyebrow connector line — English: gradient runs to the right.
   RTL: mirror so the line sits on the correct (visual-start) side. */
[dir="rtl"] .expertise-intro .section-eyebrow::after,
[dir="rtl"] .patents-copy .section-eyebrow::after {
  background: linear-gradient(270deg, var(--brand-blue), transparent);
}

/* Advantage carousel — flip absolute nav buttons + card caption anchor */
[dir="rtl"] .adv-nav-prev { left: auto; right: -8px; }
[dir="rtl"] .adv-nav-next { right: auto; left: -8px; }
[dir="rtl"] .adv-card-text { left: auto; right: var(--space-6); }

/* Patented "Patented" tag sits top-left in LTR → top-right in RTL */
[dir="rtl"] .patents-tag { left: auto; right: var(--space-4); }

/* Product "Most Sold" badge and card links read from the right */
[dir="rtl"] .product-card .body { text-align: right; }

/* Two-column intros: text right-aligned in Arabic */
[dir="rtl"] .expertise-intro,
[dir="rtl"] .patents-copy { text-align: right; }

/* Section-head paragraphs stay centered (auto), headings too — no change needed.
   Hero is centered — no change needed. */

/* Footer columns right-align their copy in RTL */
[dir="rtl"] .footer-col { text-align: right; }


/* Numerals in expertise cards (01–04) keep LTR ordering visually fine;
   ensure they don't get reversed punctuation */
[dir="rtl"] .expertise-num { direction: ltr; unicode-bidi: isolate; }

/* Keep brand/product Latin tokens (H-Bot, 2CH, WiFi, iOS) rendering LTR
   inside Arabic runs so they don't visually reverse */
[dir="rtl"] .accent,
[dir="rtl"] .stat-value { unicode-bidi: isolate; }

/* Skip link — the base rule hides it at left:-9999px, which does not hide it
   in RTL (it sat over the logo). Hide it by sliding it above the viewport in
   both directions; show it at the visual start corner when focused. */
.skip-link { left: var(--space-4, 16px); top: 0; transform: translateY(-200%); transition: transform .15s ease; }
.skip-link:focus { transform: none; top: var(--space-4, 16px); }
[dir="rtl"] .skip-link { left: auto; right: var(--space-4, 16px); }

/* Arabic: phone numbers and e-mail addresses keep their left-to-right order */
[dir="rtl"] a[href^="tel:"], [dir="rtl"] a[href^="mailto:"] { direction: ltr; unicode-bidi: isolate; }

/* Phone/tablet menu: the header's flex .container rule also hit the menu's
   inner .container, running the links into one line. Stack them. */
.site-header .mobile-menu .container { display: block; height: auto; }

/* Keep phone numbers on one line */
a[href^="tel:"] { white-space: nowrap; }

/* ---- Standalone legal pages (privacy-policy.html, terms-of-service.html) ---- */
.header-inner { position: relative; }
.legal-toggle { height: 44px; min-width: 44px; position: absolute; top: 0; inset-inline-end: 0; margin: 0; color: #fff; border-color: rgba(255,255,255,0.18); }
.legal-pending:empty { display: none; }
.legal-pending { background: rgba(255,184,0,0.08); border: 1px solid rgba(255,184,0,0.35); color: #ffd27a; border-radius: 10px; padding: 12px 16px; font-size: 14px; margin-bottom: 20px; }
[dir="rtl"] .content, [dir="rtl"] .header-inner { font-family: 'Readex Pro', sans-serif; }
[dir="rtl"] .content ul, [dir="rtl"] .content ol { margin-left: 0; margin-right: 24px; }
[dir="rtl"] .highlight { border-left: 0; border-right: 3px solid var(--blue); }
[dir="rtl"] .content table th, [dir="rtl"] .content table td { text-align: right; }
[dir="rtl"] .hlogo svg { direction: ltr; }
[dir="rtl"] .content span[dir="ltr"], [dir="rtl"] .content a[href^="mailto:"] { white-space: nowrap; unicode-bidi: isolate; }
