/* =========================================================
   Global - RTL (Arabic) stylesheet
   Bootstrap 5.0 uses physical CSS properties, so we mirror
   the utility classes and template components when dir=rtl.
   ========================================================= */

/* --- Arabic font --- */
html[dir="rtl"] body {
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif !important;
}

html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
html[dir="rtl"] .display-1,
html[dir="rtl"] .display-2,
html[dir="rtl"] .display-3,
html[dir="rtl"] .display-4 {
    font-family: "Cairo", "Segoe UI", Tahoma, sans-serif !important;
}

html[dir="rtl"] .btn {
    letter-spacing: 0 !important;
}

/* --- Flip margin/padding utility classes --- */
html[dir="rtl"] .ms-auto { margin-right: auto !important; margin-left: 0 !important; }
html[dir="rtl"] .me-auto { margin-left: auto !important; margin-right: 0 !important; }

html[dir="rtl"] .me-0 { margin-left: 0 !important; }
html[dir="rtl"] .me-1 { margin-right: 0 !important; margin-left: .25rem !important; }
html[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
html[dir="rtl"] .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
html[dir="rtl"] .me-4 { margin-right: 0 !important; margin-left: 1.5rem !important; }
html[dir="rtl"] .me-5 { margin-right: 0 !important; margin-left: 3rem !important; }

html[dir="rtl"] .ms-0 { margin-left: 0 !important; }
html[dir="rtl"] .ms-1 { margin-left: 0 !important; margin-right: .25rem !important; }
html[dir="rtl"] .ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }
html[dir="rtl"] .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
html[dir="rtl"] .ms-4 { margin-left: 0 !important; margin-right: 1.5rem !important; }
html[dir="rtl"] .ms-5 { margin-left: 0 !important; margin-right: 3rem !important; }

html[dir="rtl"] .pe-0 { padding-left: 0 !important; }
html[dir="rtl"] .pe-1 { padding-right: 0 !important; padding-left: .25rem !important; }
html[dir="rtl"] .pe-2 { padding-right: 0 !important; padding-left: .5rem !important; }
html[dir="rtl"] .pe-3 { padding-right: 0 !important; padding-left: 1rem !important; }
html[dir="rtl"] .pe-4 { padding-right: 0 !important; padding-left: 1.5rem !important; }
html[dir="rtl"] .pe-5 { padding-right: 0 !important; padding-left: 3rem !important; }

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

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

/* --- Positioning helpers --- */
html[dir="rtl"] .start-0 { left: auto !important; right: 0 !important; }
html[dir="rtl"] .end-0   { right: auto !important; left: 0 !important; }

/* --- Border helpers used by the footer menu --- */
html[dir="rtl"] .border-end { border-right: 0 !important; border-left: 1px solid #dee2e6 !important; }
html[dir="rtl"] .border-start { border-left: 0 !important; border-right: 1px solid #dee2e6 !important; }

/* --- Directional arrow icons (Font Awesome) --- */
html[dir="rtl"] .fa-arrow-right:before { content: "\f060"; } /* fa-arrow-left */
html[dir="rtl"] .fa-arrow-left:before  { content: "\f061"; } /* fa-arrow-right */

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

html[dir="rtl"] .navbar-light .navbar-nav .nav-link {
    margin-right: 0;
    margin-left: 30px;
}

@media (max-width: 991.98px) {
    html[dir="rtl"] .navbar-light .navbar-nav .nav-link {
        margin-left: 0;
    }
}

html[dir="rtl"] .navbar-brand .brand-text {
    margin-right: 10px;
}

/* --- Carousel controls in RTL: swap sides and mirror glyphs --- */
html[dir="rtl"] .carousel-control-prev {
    left: auto;
    right: 0;
}

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

html[dir="rtl"] .carousel-control-prev-icon,
html[dir="rtl"] .carousel-control-next-icon {
    transform: scaleX(-1);
}

/* --- Hero caption alignment --- */
@media (min-width: 992px) {
    html[dir="rtl"] #header-carousel .row.justify-content-lg-start {
        justify-content: flex-end !important;
    }
}

/* --- Service pills --- */
html[dir="rtl"] .service .nav .nav-link {
    text-align: right !important;
}

/* --- Footer --- */
html[dir="rtl"] .footer .btn.btn-link {
    text-align: right;
}

html[dir="rtl"] .footer .btn.btn-link::before {
    content: "\f104"; /* angle-left */
    margin-right: 0;
    margin-left: 10px;
}

html[dir="rtl"] .footer .btn.btn-social {
    margin-right: 0;
    margin-left: 5px;
}

html[dir="rtl"] .footer .footer-menu a {
    margin-right: 0;
    margin-left: 15px;
    padding-right: 0;
    padding-left: 15px;
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, .3);
}

html[dir="rtl"] .footer .footer-menu a:last-child {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
}

/* --- Breadcrumb: Bootstrap 5.0 floats the separator and pads it for LTR,
       which pushed the "/" to the far end in RTL ("الرئيسية من نحن /").
       Un-float it and place the spacing correctly for RTL flow. --- */
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item {
    padding-left: 0;
    padding-right: .5rem;
}
html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    float: none;
    display: inline-block;
    vertical-align: middle;
    padding-right: 0;
    padding-left: .5rem;
}

/* --- Owl carousel testimonial: keep a stable LTR slide layout in both
       languages. Owl positions slides with physical `left`, so mimicking
       RTL on the stage only broke it; the Arabic text inside the slides
       still renders right-to-left via Unicode bidi. --- */
html[dir="rtl"] .testimonial-carousel,
html[dir="rtl"] .testimonial-carousel .owl-stage-outer,
html[dir="rtl"] .testimonial-carousel .owl-stage,
html[dir="rtl"] .testimonial-carousel .owl-item {
    direction: ltr;
}

/* --- keep centered dots --- */
html[dir="rtl"] .testimonial-carousel .owl-dots {
    direction: ltr;
}

/* --- Booking / CTA phone icon spacing --- */
html[dir="rtl"] .fa-phone-alt,
html[dir="rtl"] .fa-map-marker-alt,
html[dir="rtl"] .fa-clock,
html[dir="rtl"] .fa-envelope {
    margin-left: .4rem;
}

/* --- Language toggle button --- */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 700;
    border-radius: 2px;
    transition: .3s;
    white-space: nowrap;
    border: 0;
    color: var(--primary);
}

.lang-toggle:hover {
    opacity: .9;
}

/* --- Number counters keep LTR numerals direction --- */
[dir="rtl"] [data-toggle="counter-up"] {
    direction: ltr;
    unicode-bidi: embed;
}

/* --- Form controls: ensure text aligns with direction --- */
html[dir="rtl"] .form-control,
html[dir="rtl"] .form-select {
    text-align: right;
}

/* --- Navbar quote button: arrow already flipped via fa rule --- */
@media (min-width: 992px) {
    html[dir="rtl"] .navbar .btn-primary {
        border-radius: 0;
    }
}

/* --- Page header breadcrumb --- */
html[dir="rtl"] .breadcrumb {
    direction: rtl;
}