/* Arabic desktop centring for XStore's fixed-width containers and legacy
 * Elementor stretched/boxed sections. Mobile geometry is handled separately. */
@media (min-width: 768px) {
    html[dir="rtl"] body.language-ar .container.content-page,
    html[dir="rtl"] body.language-ar .container.content-page > .sidebar-position-without,
    html[dir="rtl"] body.language-ar .elementor-section-boxed > .elementor-container,
    html[dir="rtl"] body.language-ar .e-con.e-con-boxed > .e-con-inner {
        box-sizing: border-box !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Elementor calculates a physical negative left offset for stretched
     * sections. When its containing block is RTL, the browser resolves that
     * relative offset from the opposite side and applies the viewport gutter
     * twice. Keep only the page canvas LTR for offset calculation, then restore
     * RTL immediately on every top-level section and all visible content. */
    html[dir="rtl"] body.language-ar.page-id-16 .elementor-16 {
        direction: ltr !important;
    }

    html[dir="rtl"] body.language-ar.page-id-16 .elementor-16 > .elementor-section {
        direction: rtl !important;
    }

    html[dir="rtl"] body.language-ar.page-id-16 .elementor-element-174b850 > .elementor-container,
    html[dir="rtl"] body.language-ar.page-id-16 .elementor-element-26afca6 > .elementor-container {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Keep lazy XStore product grids centred after their AJAX markup arrives. */
    html[dir="rtl"] body.language-ar .elementor-widget-etheme_products .products-grid,
    html[dir="rtl"] body.language-ar .elementor-widget-etheme_products .swiper-entry,
    html[dir="rtl"] body.language-ar .elementor-widget-etheme_products .swiper-container {
        box-sizing: border-box !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}
