/* ============================================================
   RTL / BILINGUAL SUPPORT
   ============================================================ */

/* Default site is RTL (Arabic).
   Apply .ltr class to body for English mode.
   Use CSS logical properties wherever possible
   so no manual flip is needed. */

/* ── LTR overrides (English mode) ──────────────────────── */
body.ltr,
.ltr {
  direction: ltr;
  text-align: left;
}

/* Nav direction */
body.ltr .nav-links { flex-direction: row; }
body.ltr .nav-links a::after {
  left: 50%;
  right: 50%;
}
body.ltr .nav-links a:hover::after,
body.ltr .nav-links a.active::after {
  left: 1rem;
  right: 1rem;
}

/* Mobile nav links */
body.ltr .mobile-nav-links a:hover {
  padding-left: 0.5rem;
  padding-right: 0;
}

/* Footer links */
body.ltr .footer-links a:hover {
  padding-left: 0.4rem;
  padding-right: 0;
}

/* Hero eyebrow */
body.ltr .hero-eyebrow::before {
  display: block;
}

/* Auth */
body.ltr .auth-visual-logo { left: var(--space-md); right: auto; }
body.ltr .forgot-link { text-align: right; }

/* ── RTL-specific rules ─────────────────────────────────── */
body,
body.rtl {
  direction: rtl;
}

/* Ensure logical properties work cross-browser for RTL */
[dir="rtl"] .hero-eyebrow::before {
  margin-right: 0;
  margin-left: 0;
}

[dir="rtl"] .how-step:not(:last-child)::after {
  /* flip connector arrow in RTL */
  inset-inline-start: auto;
  inset-inline-end: -1.5rem;
}

/* ── Language Toggle button ─────────────────────────────── */
#lang-toggle-btn {
  /* visual state driven by JS / body class */
}

/* ── Elementor RTL fixes ─────────────────────────────────── */
[dir="rtl"] .elementor-widget-text-editor p {
  text-align: right;
}

[dir="rtl"] .elementor-icon-list-item .elementor-icon-list-text {
  padding-right: 0.75rem;
  padding-left: 0;
}

/* ── WooCommerce RTL ─────────────────────────────────────── */
[dir="rtl"] .woocommerce ul.products li.product {
  text-align: right;
}

[dir="rtl"] .woocommerce span.onsale {
  left: 1rem !important;
  right: auto !important;
}

[dir="rtl"] .cart_totals table th,
[dir="rtl"] .cart_totals table td {
  text-align: right;
}

/* ── Typography direction ────────────────────────────────── */
[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] p,
[dir="rtl"] li {
  font-family: var(--font-arabic);
}

[dir="ltr"] h1,
[dir="ltr"] h2,
[dir="ltr"] h3,
[dir="ltr"] h4 {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

[dir="ltr"] p,
[dir="ltr"] li,
[dir="ltr"] a {
  font-family: var(--font-english);
}

/* ── Mixed content (Arabic inside English page) ────────── */
.arabic-text {
  font-family: var(--font-arabic);
  direction: rtl;
  unicode-bidi: embed;
}

.english-text {
  font-family: var(--font-english);
  direction: ltr;
  unicode-bidi: embed;
}

/* ── Transition on language switch ─────────────────────── */
body.lang-switching {
  opacity: 0;
  transition: opacity 0.2s ease;
}

body.lang-ready {
  opacity: 1;
  transition: opacity 0.3s ease;
}
