/* =========================================================================
   RTL overrides for Arabic (loaded only when the locale is `ar`).
   Layered on top of style.css to flip direction, alignment and spacing.
   ========================================================================= */

html[dir="rtl"],
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
  font-family: "Tajawal", "Jost", sans-serif;
}

/* Headings / paragraphs default to the right */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] p,
html[dir="rtl"] label,
html[dir="rtl"] li {
  text-align: inherit;
}

/* ----- Text alignment utilities ----- */
html[dir="rtl"] .text-start { text-align: right !important; }
html[dir="rtl"] .text-end { text-align: left !important; }

/* ----- Margin start/end utilities (Bootstrap me-* / ms-*) ----- */
html[dir="rtl"] .me-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-3 { margin-left: 1rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-4 { margin-left: 1.5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-5 { margin-left: 3rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-auto { margin-left: auto !important; margin-right: 0 !important; }
html[dir="rtl"] .ms-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-3 { margin-right: 1rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-4 { margin-right: 1.5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-5 { margin-right: 3rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ms-auto { margin-right: auto !important; margin-left: 0 !important; }

/* ----- Padding start/end utilities ----- */
html[dir="rtl"] .pe-1 { padding-left: 0.25rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pe-2 { padding-left: 0.5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pe-3 { padding-left: 1rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pe-4 { padding-left: 1.5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .ps-1 { padding-right: 0.25rem !important; padding-left: 0 !important; }
html[dir="rtl"] .ps-2 { padding-right: 0.5rem !important; padding-left: 0 !important; }
html[dir="rtl"] .ps-3 { padding-right: 1rem !important; padding-left: 0 !important; }
html[dir="rtl"] .ps-4 { padding-right: 1.5rem !important; padding-left: 0 !important; }

/* ----- Float utilities ----- */
html[dir="rtl"] .float-start { float: right !important; }
html[dir="rtl"] .float-end { float: left !important; }

/* ----- Position helpers commonly used for badges/labels ----- */
html[dir="rtl"] .start-0 { right: 0 !important; left: auto !important; }
html[dir="rtl"] .end-0 { left: 0 !important; right: auto !important; }

/* ----- Header / navigation ----- */
html[dir="rtl"] .header-tools { margin-right: auto; margin-left: 0; }
html[dir="rtl"] .navigation__link .ms-auto { transform: scaleX(-1); }

/* ----- Footer ----- */
html[dir="rtl"] .footer-copyright { margin-left: auto; margin-right: 0; }

/* ----- Product single ----- */
html[dir="rtl"] .product-single__addtolinks { flex-direction: row-reverse; justify-content: flex-end; }
html[dir="rtl"] .breadcrumb { text-align: right; }

/* ----- Cart drawer ----- */
html[dir="rtl"] .cart-drawer-item__info { text-align: right; }
html[dir="rtl"] .btn-close-xs { left: 0; right: auto; }

/* ----- Toasts: slide in from the left ----- */
html[dir="rtl"] .app-toast-container { right: auto; left: 24px; }
html[dir="rtl"] .app-toast { border-left: none; border-right: 4px solid #c49e41; transform: translateX(-24px); }
html[dir="rtl"] .app-toast.is-visible { transform: translateX(0); }
html[dir="rtl"] .app-toast.app-toast--success { border-right-color: #2e9e5b; }
html[dir="rtl"] .app-toast.app-toast--error { border-right-color: #d64545; }

/* ----- Generic icon mirroring for directional chevrons ----- */
html[dir="rtl"] .swiper-button-prev svg,
html[dir="rtl"] .swiper-button-next svg,
html[dir="rtl"] .products-carousel__prev svg,
html[dir="rtl"] .products-carousel__next svg { transform: scaleX(-1); }

/* =========================================================================
   Positioned / absolute elements — flip left<->right for RTL.
   ========================================================================= */

/* Custom position utilities used across the theme */
html[dir="rtl"] .right-0 { right: auto !important; left: 0 !important; }
html[dir="rtl"] .left-0 { left: auto !important; right: 0 !important; }
html[dir="rtl"] .left-auto { left: auto !important; right: 0 !important; }
html[dir="rtl"] .right-auto { right: auto !important; left: 0 !important; }
html[dir="rtl"] .start-100 { left: auto !important; right: 100% !important; }
html[dir="rtl"] .start-0 { left: auto !important; right: 0 !important; }
html[dir="rtl"] .end-0 { right: auto !important; left: 0 !important; }

/* Sub-menus open toward the left in RTL */
html[dir="rtl"] .sub-menu,
html[dir="rtl"] .sub-menu__wrapper.position-absolute { right: 100%; left: auto; }

/* Slideshow character (uses left-based positioning) */
html[dir="rtl"] .pos_right-center { left: auto; right: 50%; }
@media (min-width: 992px) {
  html[dir="rtl"] .pos_right-center { left: auto; right: 60%; }
}

/* Product cards: sale labels, wishlist and add-to-cart buttons */
html[dir="rtl"] .product-label.bg-red,
html[dir="rtl"] .pc-labels__right { right: auto !important; left: 0 !important; margin-left: 0.5rem; margin-right: 0; }
html[dir="rtl"] .pc__btn-wl.end-0 { right: auto !important; left: 0 !important; }
html[dir="rtl"] .pc__btn-wl { right: auto; left: 0; }

/* Product single sale label */
html[dir="rtl"] .product-single__media .sale-label { right: auto; left: 0; }

/* Anim-appear add-to-cart bar */
html[dir="rtl"] .anim_appear-bottom.start-0 { left: auto !important; right: 0 !important; }

/* Drawers / asides: hidden off-screen on the LEFT, slide in when visible */
html[dir="rtl"] .aside_right { right: auto !important; left: -26.25rem; }
html[dir="rtl"] .aside_right.aside_visible { left: 0 !important; right: auto !important; }
html[dir="rtl"] .aside-header .ms-auto { margin-right: auto !important; margin-left: 0 !important; }

/* Search popup result panel */
html[dir="rtl"] .search-result,
html[dir="rtl"] .position-absolute.start-0 { left: auto; right: 0; }

/* Quantity control +/- positions */
html[dir="rtl"] .qty-control__reduce { right: auto; left: 0; }
html[dir="rtl"] .qty-control__increase { left: auto; right: 0; }

/* Cart badge on the header cart icon */
html[dir="rtl"] .header-tools__cart .cart-amount { right: auto; left: -8px; }
