/*
 * MSB AI Polylang — Arabic RTL for the global header and footer only.
 * Основное содержимое страницы намеренно не затрагивается.
 */

body.msb-ai-pll-arabic-rtl .msb-ai-pll-rtl-scope {
  direction: rtl !important;
}

body.msb-ai-pll-arabic-rtl .msb-ai-pll-rtl-scope :where(nav, section, div, ul, ol, dl, form, fieldset, table) {
  direction: rtl;
}

body.msb-ai-pll-arabic-rtl .msb-ai-pll-rtl-scope :where(input:not([type="tel"]):not([type="email"]):not([type="url"]):not([type="number"]), textarea, select) {
  direction: rtl;
}

body.msb-ai-pll-arabic-rtl .msb-ai-pll-rtl-scope :where(
  .msb-ai-pll-rtl-ltr,
  [dir="ltr"],
  a[href^="tel:"],
  a[href^="mailto:"],
  a[href*="wa.me/"],
  a[href*="api.whatsapp.com/"],
  input[type="tel"],
  input[type="email"],
  input[type="url"],
  input[type="number"],
  code,
  pre,
  kbd,
  samp
) {
  direction: ltr !important;
  unicode-bidi: isolate !important;
}

body.msb-ai-pll-arabic-rtl .msb-ai-pll-rtl-scope :where(input[type="tel"], input[type="email"], input[type="url"], input[type="number"]) {
  text-align: left !important;
}

body.msb-ai-pll-arabic-rtl .msb-ai-pll-rtl-scope bdi.msb-ai-pll-rtl-ltr {
  display: inline;
  white-space: nowrap;
}

/* Исключение отдельного элемента внутри header/footer из автоматики. */
body.msb-ai-pll-arabic-rtl .msb-ai-pll-rtl-scope :where([data-msb-rtl-ignore], .msb-ai-pll-rtl-ignore) {
  direction: inherit;
}
