/* Direction overrides based on <html dir="...">.
   Loaded AFTER main.css to flip hard-coded RTL rules when English (LTR) is active. */

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="ltr"] body {
  direction: ltr;
}

/* Inputs: main.css forces these to rtl; flip back for LTR */
html[dir="ltr"] [type="email"],
html[dir="ltr"] [type="number"],
html[dir="ltr"] [type="tel"],
html[dir="ltr"] [type="url"] {
  direction: ltr !important;
}

/* Star rating: main.css forces RTL ordering */
html[dir="ltr"] .rating {
  direction: ltr;
}

/* Utility classes used in templates */
html[dir="ltr"] .margin-r84px {
  margin-right: 0 !important;
  margin-left: -84px !important;
}

html[dir="ltr"] .margin-l-20px,
html[dir="ltr"] .margin-left-20px {
  margin-left: 0 !important;
  margin-right: 20px !important;
}

html[dir="ltr"] .margin-l15px {
  margin-left: 0 !important;
  margin-right: 15px !important;
}

html[dir="ltr"] .margin-left-10px {
  margin-left: 0 !important;
  margin-right: 10px !important;
}

/* table-main.css aligns table cells to the right by default */
html[dir="ltr"] table td,
html[dir="ltr"] table th {
  text-align: left;
}

/* If any elements explicitly set text-align right, this provides a safe opt-in flip */
html[dir="ltr"] .text-align-rtl {
  text-align: left !important;
}
