/*
 * Direction parity layer
 * The same Bootstrap/CSS geometry is used for both languages. Only rules that
 * are semantically directional live here. Keep this file small and explicit.
 */
html[dir="rtl"],
html[dir="rtl"] body {
  direction: rtl;
  text-align: right;
}

/* Bootstrap 4 directional helpers (we intentionally load bootstrap.min.css for both locales). */
html[dir="rtl"] .text-left { text-align: right !important; }
html[dir="rtl"] .text-right { text-align: left !important; }
html[dir="rtl"] .float-left { float: right !important; }
html[dir="rtl"] .float-right { float: left !important; }
html[dir="rtl"] .dropdown-menu-right { right: auto; left: 0; }
html[dir="rtl"] .list-unstyled,
html[dir="rtl"] .list-inline { padding-right: 0; padding-left: initial; }
html[dir="rtl"] .list-inline-item:not(:last-child) { margin-right: 0; margin-left: .5rem; }
html[dir="rtl"] .custom-control { padding-left: 0; padding-right: 1.5rem; }
html[dir="rtl"] .custom-control-label::before,
html[dir="rtl"] .custom-control-label::after { left: auto; right: -1.5rem; }

/* Bootstrap spacing utilities that encode physical L/R in v4. */
html[dir="rtl"] .ml-0 { margin-left: 0 !important; margin-right: 0 !important; }
html[dir="rtl"] .ml-1 { margin-left: 0 !important; margin-right: .25rem !important; }
html[dir="rtl"] .ml-2 { margin-left: 0 !important; margin-right: .5rem !important; }
html[dir="rtl"] .ml-3 { margin-left: 0 !important; margin-right: 1rem !important; }
html[dir="rtl"] .ml-4 { margin-left: 0 !important; margin-right: 1.5rem !important; }
html[dir="rtl"] .ml-5 { margin-left: 0 !important; margin-right: 3rem !important; }
html[dir="rtl"] .ml-auto { margin-left: 0 !important; margin-right: auto !important; }
html[dir="rtl"] .mr-0 { margin-right: 0 !important; margin-left: 0 !important; }
html[dir="rtl"] .mr-1 { margin-right: 0 !important; margin-left: .25rem !important; }
html[dir="rtl"] .mr-2 { margin-right: 0 !important; margin-left: .5rem !important; }
html[dir="rtl"] .mr-3 { margin-right: 0 !important; margin-left: 1rem !important; }
html[dir="rtl"] .mr-4 { margin-right: 0 !important; margin-left: 1.5rem !important; }
html[dir="rtl"] .mr-5 { margin-right: 0 !important; margin-left: 3rem !important; }
html[dir="rtl"] .mr-auto { margin-right: 0 !important; margin-left: auto !important; }
@media (min-width: 576px) { html[dir="rtl"] .mr-sm-2 { margin-right: 0 !important; margin-left: .5rem !important; } }
html[dir="rtl"] .pl-1 { padding-left: 0 !important; padding-right: .25rem !important; }
html[dir="rtl"] .pl-2 { padding-left: 0 !important; padding-right: .5rem !important; }
html[dir="rtl"] .pl-3 { padding-left: 0 !important; padding-right: 1rem !important; }
html[dir="rtl"] .pl-4 { padding-left: 0 !important; padding-right: 1.5rem !important; }
html[dir="rtl"] .pl-5 { padding-left: 0 !important; padding-right: 3rem !important; }
html[dir="rtl"] .pr-1 { padding-right: 0 !important; padding-left: .25rem !important; }
html[dir="rtl"] .pr-2 { padding-right: 0 !important; padding-left: .5rem !important; }
html[dir="rtl"] .pr-3 { padding-right: 0 !important; padding-left: 1rem !important; }
html[dir="rtl"] .pr-4 { padding-right: 0 !important; padding-left: 1.5rem !important; }
html[dir="rtl"] .pr-5 { padding-right: 0 !important; padding-left: 3rem !important; }

/* Header: let CSS direction mirror the DOM once; do not reverse it a second time. */
html[dir="rtl"] .header-search-composite { flex-direction: row !important; }
html[dir="rtl"] .search-input-icon { left: auto; right: 4px; }
html[dir="rtl"] .search-input-input { padding-left: .75rem; padding-right: 30px; }
html[dir="rtl"] .header-shop-tier .cart-badge { right: auto; left: 2px; }
html[dir="rtl"] .cart-badge { right: auto; left: 20px; }
html[dir="rtl"] .ic.menu { left: 4px; right: auto; text-align: right; }
html[dir="rtl"] .icon-menu-top { margin-right: 0 !important; margin-left: 10px !important; }
html[dir="rtl"] .sm-search-icon { margin-right: 0; margin-left: 20px; }
html[dir="rtl"] .availability-bar .ab-close,
html[dir="rtl"] .announcement-bar .ab-close { right: auto; left: 0; }

/* Footer */
html[dir="rtl"] .footer-store-section,
html[dir="rtl"] .footer-store-section .links_row,
html[dir="rtl"] .footer-store-section .links_col { text-align: right; }
html[dir="rtl"] .footer-about-us-div { padding-right: 0; padding-left: 20%; }

/* Catalog / pagination */
html[dir="rtl"] #products-list-filter-form-close { right: auto; left: 0; }
html[dir="rtl"] .sort-block-width { margin-left: 0; margin-right: 30px; }
html[dir="rtl"] .products-pagination .page-item:first-child .page-link {
  border-top-left-radius: 0; border-bottom-left-radius: 0;
  border-top-right-radius: 5px; border-bottom-right-radius: 5px;
}
html[dir="rtl"] .products-pagination .page-item:last-child .page-link {
  border-top-left-radius: 5px; border-bottom-left-radius: 5px;
  border-top-right-radius: 0; border-bottom-right-radius: 0;
}
html[dir="rtl"] .breadcrumb-item svg,
html[dir="rtl"] .products-details .swiper-button-next svg,
html[dir="rtl"] .products-details .swiper-button-prev svg { transform: rotate(180deg); }

/* Product details */
html[dir="rtl"] .add-to-wishlist { right: auto; left: 0; }
html[dir="rtl"] .user-review-date,
html[dir="rtl"] .div-btnrating { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .bottom-buttons,
html[dir="rtl"] .review-remaining-count,
html[dir="rtl"] .bundle-offer-more { text-align: left; }

/* Cart / side-cart: place controls at logical end and keep prices readable. */
html[dir="rtl"] .cart-header-total { margin-right: 0; margin-left: 10px; }
html[dir="rtl"] .coupon-form button { margin-left: 0; margin-right: 15px; }
html[dir="rtl"] .block-side-cart .side-cart-close,
html[dir="rtl"] .block-side-cart .side-cart-close.btn-close { right: auto !important; left: 10px !important; }
html[dir="rtl"] .block-side-cart .price-old-new .old { margin-right: 0; margin-left: 6px; }

/* Preserve LTR for numeric/technical fragments without changing component layout. */
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] .product-price,
html[dir="rtl"] .cart-total-price { unicode-bidi: plaintext; }
