/**
 * Atlas — RTL / mobile horizontal overflow fixes
 * Loaded after custom.css. Scope: html[dir="rtl"] to avoid affecting LTR.
 */

html[dir="rtl"] {
    overflow-x: clip;
    max-width: 100%;
}

html[dir="rtl"] body,
body.rtl {
    overflow-x: hidden;
    max-width: 100%;
}


/* Home hero / mother banner slider */
html[dir="rtl"] .header-banner-wrap {
    max-width: 100%;
    overflow-x: clip;
}

html[dir="rtl"] .header-banner-wrap .banner-slider,
html[dir="rtl"] .header-banner-wrap .banner-slider.swiper {
    max-width: 100%;
    overflow: hidden;
}

html[dir="rtl"] .banner-slider .swiper-wrapper {
    box-sizing: border-box;
}

html[dir="rtl"] .banner-slider-wrap,
html[dir="rtl"] .banner-slider-content {
    max-width: 100%;
    box-sizing: border-box;
}

html[dir="rtl"] .banner-slider-content h1,
html[dir="rtl"] .banner-slider-content p,
html[dir="rtl"] .banner-slider-content .lg-title-78px {
    word-break: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    max-width: 100%;
}

html[dir="rtl"] .banner-slider .swiper-pagination {
    max-width: 100%;
    width: 100%;
    left: 0;
    right: 0;
    margin-inline: auto;
    padding-inline: 10px;
    box-sizing: border-box;
}

/* Header: flex children must shrink so long Arabic lines do not widen past viewport */
html[dir="rtl"] .header-section .main-header-area,
html[dir="rtl"] .header-section .header-right-area,
html[dir="rtl"] .header-section .menu-btn-area,
html[dir="rtl"] .header-top-section .header-top-area {
    min-width: 0;
    max-width: 100%;
}

html[dir="rtl"] .header-logo {
    min-width: 0;
    flex-shrink: 1;
}

html[dir="rtl"] .header-logo img {
    max-width: 100%;
    height: auto;
}

html[dir="rtl"] .header-top-section .languageforall,
html[dir="rtl"] .header-top-section .search-select {
    max-width: 100%;
}

/* Offcanvas: LTR stylesheet pins .offcanvas-end to right + translateX(100%); mirror for RTL */
@media (max-width: 1199.98px) {
    html[dir="rtl"] .offcanvas.offcanvas-end {
        left: 0;
        right: auto !important;
        border-left: 0;
        border-right: var(--bs-offcanvas-border-width, 1px) solid var(--bs-offcanvas-border-color, rgba(0, 0, 0, 0.175));
    }

    html[dir="rtl"] .offcanvas.offcanvas-end:not(.show) {
        transform: translateX(-100%);
    }

    html[dir="rtl"] .offcanvas.offcanvas-end.show {
        transform: none;
    }
}

/* Full-width sections */
html[dir="rtl"] .atn-search-filter-section,
html[dir="rtl"] .atn-search-filter-wrap {
    max-width: 100%;
    overflow-x: clip;
}

@media (max-width: 991.98px) {
    html[dir="rtl"] .row {
        max-width: 100%;
    }

    html[dir="rtl"] .offcanvas-backdrop {
        width: 100%;
        max-width: 100%;
    }
}
