/* Arabic RTL overrides, loaded only when locale() === 'ar'.
   Bootstrap's RTL build handles the grid/utilities; this file mirrors the
   physical left/right rules the custom theme still carries. */
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", Arial, sans-serif;
}

/* header
   The full-width mega menu lives in li.position-static and is positioned by
   inline JS (left:0), so it is excluded here; only the small menus centered
   under a nav item get mirrored. */
html[dir="rtl"] header .header-content .nav-item.dropdown:not(.position-static) > .dropdown-menu {
  left: auto;
  right: 50%;
  transform: translate(50%, .5rem);
  transform-origin: top center;
}

html[dir="rtl"] header .header-content .nav-item.dropdown:not(.position-static):hover > .dropdown-menu {
  transform: translate(50%);
}

/* account menu sits in the mirrored right-btn group at the viewport's left
   edge, so align it to the icon's left edge instead of centering it */
html[dir="rtl"] header .header-content .right-btn .nav-item.dropdown > .dropdown-menu {
  right: auto;
  left: 0;
  transform: translate(0, .5rem);
}

html[dir="rtl"] header .header-content .right-btn .nav-item.dropdown:hover > .dropdown-menu {
  transform: translate(0);
}

html[dir="rtl"] header .header-content .menu-wrap > .navbar-nav > .nav-item > .nav-link > svg {
  margin-left: 0;
  margin-right: -3px;
}

html[dir="rtl"] header .cart-badge-quantity {
  left: auto;
  right: 27px;
}

html[dir="rtl"] header .header-mobile .mobile-content .left .mobile-open-search {
  margin-left: 0;
  margin-right: 12px;
}

html[dir="rtl"] header .header-mobile .mobile-content .right .m-cart .cart-badge-quantity {
  left: auto;
  right: 11px;
}

/* search offcanvas */
html[dir="rtl"] #offcanvas-search-top .search-input-wrap {
  margin-right: 0;
  margin-left: 6px;
}

html[dir="rtl"] #offcanvas-search-top .search-input-wrap .input-group-text {
  right: auto;
  left: 0;
}

/* account drawer */
html[dir="rtl"] .account-sides-info {
  left: auto;
  right: 0;
  transform: translateX(100%);
}

html[dir="rtl"] .account-sides-wrap.active .account-sides-info {
  transform: translateX(0);
}

html[dir="rtl"] .account-sides-info .head .portrait {
  margin-right: 0;
  margin-left: 10px;
}

html[dir="rtl"] .account-sides-info .account-links > a > span.icon {
  margin-right: 0;
  margin-left: 8px;
}

/* cart drawer */
html[dir="rtl"] #offcanvas-right-cart .select-wrap {
  margin-right: 0;
  margin-left: 10px;
}

html[dir="rtl"] #offcanvas-right-cart .offcanvas-right-products .product-list .left {
  margin-right: 0;
  margin-left: 10px;
}

html[dir="rtl"] #offcanvas-right-cart .offcanvas-right-products .product-list .right .price input {
  margin-left: 0;
  margin-right: 10px;
}

/* product cards */
html[dir="rtl"] .product-wrap.list .product-bottom-info {
  text-align: right;
  padding-left: 0;
  padding-right: 20px;
}

html[dir="rtl"] .product-wrap .product-price .price-old {
  margin-left: 0;
  margin-right: 4px;
}

/* product page */
html[dir="rtl"] body.page-product .product-image .left {
  margin-right: 0;
  margin-left: 1rem;
}

/* article / page lists */
html[dir="rtl"] .page-categories-home .post-item .image,
html[dir="rtl"] .page-pages .post-item .image {
  margin-right: 0;
  margin-left: 20px;
}

/* footer */
html[dir="rtl"] footer .footer-content .social-network > a {
  margin-right: 0;
  margin-left: 10px;
}

/* mobile menu */
html[dir="rtl"] #offcanvas-mobile-menu .mobile-menu-wrap #menu-accordion .accordion-item .nav-item-text > a {
  padding-left: 0;
  padding-right: 10px;
}

html[dir="rtl"] #offcanvas-mobile-menu .mobile-menu-wrap #menu-accordion .accordion-item .nav-item-text > a .badge {
  margin-left: 0;
  margin-right: 13px;
}

html[dir="rtl"] #offcanvas-mobile-menu .mobile-menu-wrap #menu-accordion .accordion-item .nav-item-text > span {
  border-left: 0;
  border-right: 1px solid #e5e5e5;
}

html[dir="rtl"] #offcanvas-mobile-menu .mobile-menu-wrap #menu-accordion .accordion-item > .accordion-collapse .children-group .children-title span {
  margin-right: 0;
  margin-left: -10px;
}
