/* Arabic-only refinements. Loaded after the generated RTL stylesheets. */
html[dir="rtl"] body {
  direction: rtl;
  --bs-body-text-align: right;
}

/* Preserve the readability of values that have an inherently LTR syntax. */
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] bdi[dir="ltr"] {
  direction: ltr;
  unicode-bidi: isolate;
}

/* Keep language menus within the navbar's inline end. */
html[dir="rtl"] .container-fluid.banner nav.navbar .dropdown-menu.languages,
html[dir="rtl"] .container-fluid.banner-minor nav.navbar .dropdown-menu.languages {
  left: 0 !important;
  right: auto !important;
}

html[dir="rtl"] .block-space .nav.ar,
html[dir="rtl"] .block-space .dropdown-menu.ar ul {
  padding: 0;
}

/* Mirror directional UI arrows, not product logos or document previews. */
html[dir="rtl"] .btn-rounded-next > svg,
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
  transform: scaleX(-1);
}

/* Keep layout positions explicit instead of depending on inherited direction. */
html[dir="rtl"] .arabic-header-nav {
  direction: rtl;
  flex-direction: row;
}
html[dir="rtl"] .arabic-header-nav > a {
  margin-right: 0 !important;
  margin-left: auto !important;
}
html[dir="rtl"] .arabic-breadcrumb-bar {
  direction: rtl;
  flex-direction: row;
  justify-content: flex-start;
}
html[dir="rtl"] .arabic-breadcrumb-bar > :first-child {
  order: 0;
}
html[dir="rtl"] .arabic-breadcrumb-bar .breadcrumb {
  direction: rtl;
  justify-content: flex-start;
  text-align: right;
}

/* Product navigation stays on the left; its labels still read right to left. */
@media (min-width: 992px) {
  html[dir="rtl"] .arabic-product-menu {
    order: 1;
  }
}
html[dir="rtl"] .arabic-product-menu-mobile {
  text-align: left;
}
html[dir="rtl"] .arabic-product-menu-mobile > .dropdown-menu {
  left: 0 !important;
  right: auto !important;
  text-align: right;
  max-width: 100%;
}

html[dir="rtl"] #faq .faq-header,
html[dir="rtl"] #faq .faq-item-header {
  direction: rtl;
  flex-direction: row;
  text-align: right;
}
html[dir="rtl"] #faq .faq-header > img,
html[dir="rtl"] #faq .faq-item-header > .faq-icon {
  order: 0;
  margin-right: 0;
  margin-left: 0;
}
html[dir="rtl"] #faq .faq-header > h3,
html[dir="rtl"] #faq .faq-item-header > h4 {
  order: 1;
  min-width: 0;
}

/* Absolute counter markers cannot jump to the left of an LTR word or link. */
html[dir="rtl"] main ol {
  direction: rtl;
}
html[dir="rtl"] .block-space ol:not(.list-right-orange):not(.list-right-green):not(.list-right-ban) > li,
html[dir="rtl"] ol.number-list > li.steps {
  position: relative;
  padding-inline-start: 2.5rem;
  text-align: right;
}
html[dir="rtl"] .block-space ol:not(.list-right-orange):not(.list-right-green):not(.list-right-ban) > li::before,
html[dir="rtl"] ol.number-list > li.steps::before {
  position: absolute;
  right: 0;
  left: auto;
  top: 0;
  width: 2rem;
  padding: 0;
  margin: 0;
  direction: ltr;
  unicode-bidi: isolate;
  text-align: right;
}
html[dir="rtl"] ol.number-list {
  counter-reset: questionNumber;
}
