/* ============================================================
   Ballour Admin Theme v2 — RTL fine-tuning
   The shell already handles RTL via inset-inline-* logical props.
   This file fixes a few legacy markup quirks.
   ============================================================ */

/* ------------------------------------------------------------------
   Page-header pattern fix:

   <div class="row">
       <div class="col-sm-6">      <h4>title</h4>     </div>
       <div class="col-sm-6 text-right">  <a>+ Add</a>  </div>
   </div>

   Bootstrap's `.text-right` is *literal* (always right). In RTL the
   second column lives on the LEFT half of the row, so aligning its
   contents to the visual right makes the button land in the MIDDLE
   of the page. We translate column-level `.text-right` to inline-end
   so the action sits at the far edge of the row in both directions.
   This pattern is used across products / orders / coupons / etc.
   ------------------------------------------------------------------ */
body.theme-v2 .row > [class*="col-"].text-right {
    text-align: end !important;
}

body.theme-v2 .row > [class*="col-"].text-left {
    text-align: start !important;
}

/* Bootstrap-5-compatible aliases */
body.theme-v2 .row > [class*="col-"].text-end {
    text-align: end !important;
}

body.theme-v2 .row > [class*="col-"].text-start {
    text-align: start !important;
}

/* margin/padding utility flips for RTL */
html[dir="rtl"] body.theme-v2 .ml-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

html[dir="rtl"] body.theme-v2 .mr-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

/* dropdown alignment in topbar (animated dropdowns) */
html[dir="rtl"] body.theme-v2 .dropdown-menu-right {
    right: 0 !important;
    left: auto !important;
}

html[dir="ltr"] body.theme-v2 .dropdown-menu-right {
    right: auto !important;
    left: 0 !important;
}

/* float helpers used in legacy code */
html[dir="rtl"] body.theme-v2 .f-l {
    float: right !important;
}

html[dir="rtl"] body.theme-v2 .f-r {
    float: left !important;
}

/* notifications mailbox */
html[dir="rtl"] body.theme-v2 .mailbox.scale-up {
    right: auto;
    left: 0;
}

/* fa external link arrow flip in RTL */
html[dir="rtl"] body.theme-v2 .fa-external-link {
    transform: scaleX(-1);
    display: inline-block;
}

/* "to_site" header element from legacy header */
html[dir="rtl"] body.theme-v2 .to_site {
    text-align: right;
}

/* fix for tooltip arrow direction (rare cases) */
html[dir="rtl"] body.theme-v2 .tooltip {
    direction: rtl;
}
