/* RTL (Right to Left) Styling for Arabic Support */

/* Global RTL Settings */
html[dir="rtl"] body {
    text-align: right;
    direction: rtl;
    font-family: 'Cairo', 'DM Sans', 'Inter', sans-serif;
}

html[dir="rtl"] * {
    font-family: 'Cairo', 'DM Sans', 'Inter', sans-serif;
}

/* حماية الأيقونات من تطبيق الخط العربي */
html[dir="rtl"] .fa,
html[dir="rtl"] .fas,
html[dir="rtl"] .far,
html[dir="rtl"] .fab,
html[dir="rtl"] .fal,
html[dir="rtl"] .fad,
html[dir="rtl"] [class*="fa-"],
html[dir="rtl"] .bi,
html[dir="rtl"] [class*="bi-"],
html[dir="rtl"] .glyphicon,
html[dir="rtl"] i[class*="fa"],
html[dir="rtl"] i[class*="bi"],
html[dir="rtl"] span[class*="fa"],
html[dir="rtl"] span[class*="bi"] {
    font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands", "bootstrap-icons" !important;
}

/* Back to Top Button */
html[dir="rtl"] .back-to-top {
    right: auto;
    left: 30px;
}

/* Topbar RTL */
html[dir="rtl"] .topbar .dropdown-toggle::after {
    margin-left: 0;
    margin-right: 8px;
}

/* Topbar Mobile Responsive */
@media (max-width: 991px) {
    .topbar .col-lg-8,
    .topbar .col-lg-4 {
        width: 100%;
        text-align: center !important;
        margin-bottom: 0.5rem;
    }

    .topbar .d-flex {
        justify-content: center !important;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .topbar .border-end {
        border-left: none !important;
        border-right: none !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .topbar .ps-3,
    .topbar .pe-3,
    .topbar .ms-3 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .topbar a.btn {
        margin: 0 0.25rem !important;
    }
}

html[dir="rtl"] .topbar .border-end {
    border-left: 1px solid #dee2e6 !important;
    border-right: 0 !important;
}

html[dir="rtl"] .topbar .pe-3 {
    padding-left: 1rem !important;
    padding-right: 0 !important;
}

html[dir="rtl"] .topbar .ps-3 {
    padding-right: 1rem !important;
    padding-left: 0 !important;
}

html[dir="rtl"] .topbar .me-2,
html[dir="rtl"] .topbar .me-3 {
    margin-left: 0.5rem;
    margin-right: 0 !important;
}

html[dir="rtl"] .topbar .ms-3 {
    margin-right: 1rem;
    margin-left: 0 !important;
}

/* Navbar RTL */
html[dir="rtl"] .navbar .dropdown-toggle::after {
    margin-left: 0;
    margin-right: 8px;
}

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

html[dir="rtl"] .navbar .nav-btn .ms-3 {
    margin-right: 1rem;
    margin-left: 0 !important;
}

/* Carousel Navigation RTL */
html[dir="rtl"] .header-carousel .owl-nav .owl-prev {
    left: auto;
    right: 50%;
    margin-left: 0;
    margin-right: 30px;
}

html[dir="rtl"] .header-carousel .owl-nav .owl-next {
    right: auto;
    left: 50%;
    margin-right: 0;
    margin-left: 30px;
}

@media (max-width: 767px) {
    html[dir="rtl"] .header-carousel .owl-nav .owl-prev {
        left: auto;
        right: 50%;
        margin-left: 0;
        margin-right: -45px;
    }

    html[dir="rtl"] .header-carousel .owl-nav .owl-next {
        left: 50%;
        right: auto;
        margin-left: 45px;
        margin-right: 0;
    }
}

/* Feature Icons RTL */
html[dir="rtl"] .feature .feature-icon::after {
    left: auto;
    right: 0;
}

/* Service Items RTL */
html[dir="rtl"] .service .service-item .service-img .service-icon {
    right: auto;
    left: 25px;
}

html[dir="rtl"] .service .service-item .service-img::after {
    left: auto;
    right: 0;
}

/* Blog Category Badge RTL */
html[dir="rtl"] .blog .blog-item .blog-img .blog-categiry {
    right: auto;
    left: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 10px;
}

/* Team Icons RTL */
html[dir="rtl"] .team .team-item .team-img .team-icon {
    right: auto;
    left: 20px;
}

/* Testimonial Navigation RTL */
html[dir="rtl"] .testimonial .owl-nav .owl-prev {
    left: auto;
    right: 0;
}

html[dir="rtl"] .testimonial .owl-nav .owl-next {
    right: auto;
    left: 0;
}

html[dir="rtl"] .testimonial-carousel .owl-stage-outer {
    margin-right: 0;
    margin-left: -1px;
}

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"] .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"] .pe-3 {
    padding-left: 1rem !important;
    padding-right: 0 !important;
}

html[dir="rtl"] .ps-3,
html[dir="rtl"] .ps-4 {
    padding-right: 1rem !important;
    padding-left: 0 !important;
}

/* Text Alignment RTL */
html[dir="rtl"] .text-start {
    text-align: right !important;
}

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

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

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

/* Contact Image Effects RTL */
html[dir="rtl"] .contact .contact-img::after {
    left: auto;
    right: 0;
}

/* Footer RTL */
html[dir="rtl"] .footer .footer-item .footer-instagram .footer-search-icon {
    left: auto;
    right: 0;
}

/* Button Arrows RTL */
html[dir="rtl"] .btn .fa-arrow-right::before {
    content: "\f060"; /* fa-arrow-left */
}

html[dir="rtl"] .btn .fa-arrow-left::before {
    content: "\f061"; /* fa-arrow-right */
}

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

/* Angle Icons RTL */
html[dir="rtl"] .fas.fa-angle-right::before {
    content: "\f104"; /* fa-angle-left */
}

/* Border Radius RTL Adjustments */
html[dir="rtl"] .border-end {
    border-left: 1px solid #dee2e6 !important;
    border-right: 0 !important;
}

/* Flexbox RTL */
html[dir="rtl"] .justify-content-start {
    justify-content: flex-end !important;
}

html[dir="rtl"] .justify-content-end {
    justify-content: flex-start !important;
}

html[dir="rtl"] .justify-content-md-start {
    justify-content: flex-end !important;
}

html[dir="rtl"] .justify-content-md-end {
    justify-content: flex-start !important;
}

/* List Items RTL */
html[dir="rtl"] ul,
html[dir="rtl"] ol {
    padding-right: 2rem;
    padding-left: 0;
}

/* Phone Icon Position RTL */
html[dir="rtl"] .position-absolute[style*="right: 12px"] {
    right: auto !important;
    left: 12px !important;
}

/* Carousel Caption RTL */
html[dir="rtl"] .header-carousel .header-carousel-item .carousel-caption {
    left: auto;
    right: 0;
}

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

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