/* Core Labs — Arabic / RTL layer.
   Active only when core-labs-i18n.js sets html[lang="ar"][dir="rtl"].
   The .pl-lang-btn rules apply in both languages (header toggle). */

/* ---------- language toggle button (both languages) ---------- */
.pl-lang-btn {
  width: auto;
  min-width: 44px;
  padding: 0 10px;
  font-family: var(--pl-font-body, 'Manrope', sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
html[lang="ar"] .pl-lang-btn { font-family: 'Manrope', sans-serif; letter-spacing: .04em !important; }

/* ---------- Arabic typography ---------- */
html[lang="ar"] {
  --pl-font-heading: 'Cairo', 'Tajawal', 'Montserrat', sans-serif;
  --pl-font-display: 'Cairo', 'Tajawal', 'Montserrat', sans-serif;
  --pl-font-body: 'Tajawal', 'Manrope', sans-serif;
}
html[lang="ar"] body,
html[lang="ar"] button,
html[lang="ar"] input,
html[lang="ar"] select,
html[lang="ar"] textarea {
  font-family: var(--pl-font-body);
}
/* Latin tracking looks broken on Arabic script */
html[lang="ar"] body *:not(.pl-lang-btn) { letter-spacing: 0 !important; }
/* Arabic needs a touch more line height */
html[lang="ar"] p, html[lang="ar"] li { line-height: 1.75; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { line-height: 1.45; }

/* ---------- directional flips ---------- */
/* blocks explicitly left-aligned in LTR */
html[dir="rtl"] .hero__copy,
html[dir="rtl"] .process__card,
html[dir="rtl"] .cat-card,
html[dir="rtl"] .cat-card .cat-card__copy,
html[dir="rtl"] .faq-q,
html[dir="rtl"] .search-result,
html[dir="rtl"] .section__head p,
html[dir="rtl"] .format-card,
html[dir="rtl"] .coa-card,
html[dir="rtl"] .hv2-catbtn,
html[dir="rtl"] .cx-steps,
html[dir="rtl"] .cx-picker__btn,
html[dir="rtl"] .cx-picker__item,
html[dir="rtl"] .aff-step,
html[dir="rtl"] .add-bac { text-align: right; }

/* value columns right-aligned in LTR -> left in RTL */
html[dir="rtl"] .cart-page__pricecol,
html[dir="rtl"] .trkw-res__tl-time,
html[dir="rtl"] .cx-blend__mg { text-align: left; }

/* spec values are Latin data (CAS, Da, °C): keep LTR inside RTL layout */
html[dir="rtl"] .spec-table__row .v,
html[dir="rtl"] .coa-doc__lot {
  text-align: left;
  direction: ltr;
  unicode-bidi: isolate;
}

/* corner badges / flags pinned left in LTR */
html[dir="rtl"] .product-card__flags { left: auto; right: 10px; }
html[dir="rtl"] .format-card__badge { left: auto; right: 14px; }
html[dir="rtl"] .pl-soon,
html[dir="rtl"] .sp-soon { left: auto; right: 12px; }
html[dir="rtl"] .hv2-format__soon { left: auto; right: 14px; }
html[dir="rtl"] .pen-band__flag { left: auto; right: 16px; }
/* badges pinned right in LTR */
html[dir="rtl"] .process__step,
html[dir="rtl"] .cat-card .cat-card__arrow { right: auto; left: 24px; }
html[dir="rtl"] .cart-count { right: auto; left: -4px; }

/* list bullets drawn with :before at left:0 + padding-left */
html[dir="rtl"] .pl-tier__list li,
html[dir="rtl"] .pl-td__list li,
html[dir="rtl"] .sp-pdp__facts li,
html[dir="rtl"] .pdp__includes-list li { padding-left: 0; padding-right: 1.4em; }
html[dir="rtl"] .pl-tier__list li:before,
html[dir="rtl"] .pl-td__list li:before,
html[dir="rtl"] .sp-pdp__facts li:before,
html[dir="rtl"] .pdp__includes-list li:before { left: auto; right: 0; }

/* select chevron */
html[dir="rtl"] .cx-select svg { right: auto; left: 15px; }
html[dir="rtl"] .cx-select select { padding-right: 16px; padding-left: 38px; }

/* track-order input prefix */
html[dir="rtl"] .trkw__prefix { left: auto; right: 14px; }
html[dir="rtl"] .trkw__pill { right: auto; left: 9px; }

/* cat-card icon shine sweep + arrow stay decorative; leave as-is */

/* phone numbers: keep "+971 …" reading left-to-right inside RTL text */
html[dir="rtl"] a[href^="tel:"],
html[dir="rtl"] a[href*="wa.me"] {
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* phone/CAS/lot inputs and numeric outputs read better LTR even in AR UI */
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="number"] {
  direction: ltr;
  text-align: right;
}

/* keep prices/doses (Latin digits + $) from flipping order inside AR sentences */
html[dir="rtl"] .price, html[dir="rtl"] .product-card__price,
html[dir="rtl"] .dose-pill, html[dir="rtl"] .cart-line__price {
  unicode-bidi: isolate;
}
