/* Wholesale Website — RTL overrides for right-to-left languages
   Loaded last in the CSS bundle so it can override LTR defaults. */

html[dir="rtl"] body {
    font-family: var(--font-family-arabic);
    text-align: right;
}

/* Layout direction */
html[dir="rtl"] .me-auto,
html[dir="rtl"] .navbar-nav.me-auto {
    margin-left: auto !important;
    margin-right: 0 !important;
}

html[dir="rtl"] .ms-auto,
html[dir="rtl"] .navbar-nav.ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

html[dir="rtl"] .pull-right { float: left !important; }
html[dir="rtl"] .pull-left { float: right !important; }

html[dir="rtl"] .text-right { text-align: left !important; }
html[dir="rtl"] .text-left { text-align: right !important; }

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

/* Header */
html[dir="rtl"] .header-top .header-left,
html[dir="rtl"] .header-middle .header-left {
    flex-direction: row-reverse;
}

html[dir="rtl"] .header-dropdown > a::after {
    margin-inline-start: 0.25rem;
}

html[dir="rtl"] .header-dropdown .header-menu {
    inset-inline-start: 0;
    inset-inline-end: auto;
}

html[dir="rtl"] .top-menu ul {
    inset-inline-end: 0;
    inset-inline-start: auto;
}

/* Carousel */
html[dir="rtl"] .carousel-control-prev,
html[dir="rtl"] .carousel .left.carousel-control {
    left: auto;
    right: 0;
}

html[dir="rtl"] .carousel-control-next,
html[dir="rtl"] .carousel .right.carousel-control {
    right: auto;
    left: 0;
}

/* Input groups */
html[dir="rtl"] .input-group > .form-control:first-child,
html[dir="rtl"] .input-group > .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
}

html[dir="rtl"] .input-group > .form-control:last-child,
html[dir="rtl"] .input-group > .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-top-right-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
}

/* Dropdowns */
html[dir="rtl"] .dropdown-menu {
    text-align: right;
}

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

/* Product card action buttons */
html[dir="rtl"] .product-card .product-action,
html[dir="rtl"] .product-card .btn-action {
    transform: translateX(-20px);
}

html[dir="rtl"] .product-card:hover .product-action,
html[dir="rtl"] .product-card:hover .btn-action {
    transform: translateX(0);
}

/* Breadcrumb */
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    content: '\\';
}

/* Badge cart */
html[dir="rtl"] .badge-cart {
    margin-inline-start: var(--spacing-2);
}

/* Footer */
html[dir="rtl"] .footer .social-icons a,
html[dir="rtl"] .site-footer .social-icons a {
    margin: 0;
}

/* Checkout steps */
html[dir="rtl"] .checkout-steps {
    flex-direction: row-reverse;
}

/* Track steps */
html[dir="rtl"] .track-steps {
    flex-direction: row-reverse;
}

/* Misc */
html[dir="rtl"] .price .original-price {
    margin-inline-start: var(--spacing-2);
}

html[dir="rtl"] .add-to-cart-section .form-inline > * {
    margin-inline-end: var(--spacing-2);
}

html[dir="rtl"] .select-custom::after {
    inset-inline-end: var(--spacing-3);
}

/* Bootstrap 5 RTL overrides for flex utilities */
html[dir="rtl"] .float-start { float: right !important; }
html[dir="rtl"] .float-end { float: left !important; }
html[dir="rtl"] .start-0 { left: auto !important; right: 0 !important; }
html[dir="rtl"] .end-0 { right: auto !important; left: 0 !important; }
html[dir="rtl"] .start-50 { left: auto !important; right: 50% !important; transform: translateX(50%) !important; }
html[dir="rtl"] .end-50 { right: auto !important; left: 50% !important; transform: translateX(-50%) !important; }
html[dir="rtl"] .ms-1 { margin-left: 0.25rem !important; margin-right: 0 !important; }
html[dir="rtl"] .ms-2 { margin-left: 0.5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .ms-3 { margin-left: 1rem !important; margin-right: 0 !important; }
html[dir="rtl"] .me-1 { margin-right: 0.25rem !important; margin-left: 0 !important; }
html[dir="rtl"] .me-2 { margin-right: 0.5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .me-3 { margin-right: 1rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ps-1 { padding-left: 0.25rem !important; padding-right: 0 !important; }
html[dir="rtl"] .ps-2 { padding-left: 0.5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .ps-3 { padding-left: 1rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pe-1 { padding-right: 0.25rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pe-2 { padding-right: 0.5rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pe-3 { padding-right: 1rem !important; padding-left: 0 !important; }
