/* =====================================================================
   RTL (arabe) + typographie arabe - Himaya Labs
   Charge sur toutes les pages ; chaque regle est inactive en LTR.
   Bootstrap 5.0 est ici le build LTR : on inverse uniquement les utilitaires
   directionnels reellement utilises par le site (liste verifiee par script).
   Le reste du site utilise des proprietes CSS logiques (css/style.css).
   ===================================================================== */

/* ---- Utilitaires Bootstrap inverses ---- */
[dir="rtl"] .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
[dir="rtl"] .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
[dir="rtl"] .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
[dir="rtl"] .ms-5 { margin-left: 0 !important; margin-right: 3rem !important; }
[dir="rtl"] .ms-auto { margin-left: 0 !important; margin-right: auto !important; }
[dir="rtl"] .ps-3 { padding-left: 0 !important; padding-right: 1rem !important; }
[dir="rtl"] .ps-4 { padding-left: 0 !important; padding-right: 1.5rem !important; }
@media (min-width: 1200px) {
    [dir="rtl"] .ms-xl-3 { margin-left: 0 !important; margin-right: 1rem !important; }
}
@media (min-width: 992px) {
    [dir="rtl"] .text-lg-start { text-align: right !important; }
    [dir="rtl"] .text-lg-end { text-align: left !important; }
}

/* ---- Composants Bootstrap ---- */
[dir="rtl"] .dropdown-toggle::after { margin-left: 0; }
[dir="rtl"] .dropdown-menu { text-align: right; }
[dir="rtl"] .btn-close { right: auto; left: 0; }
[dir="rtl"] .modal-header .btn-close { margin: -.5rem auto -.5rem -.5rem; }
[dir="rtl"] .input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu) { border-radius: 0 .25rem .25rem 0; }
[dir="rtl"] .input-group > :not(:first-child):not(.dropdown-menu) { margin-left: 0; margin-right: -1px; border-radius: .25rem 0 0 .25rem; }

/* ---- Carrousel d'en-tete : fleches inversees (precedent a droite, suivant a gauche) ---- */
[dir="rtl"] .carousel-control-prev { left: auto; right: 0; }
[dir="rtl"] .carousel-control-next { right: auto; left: 0; }
[dir="rtl"] .carousel-control-prev-icon,
[dir="rtl"] .carousel-control-next-icon { transform: scaleX(-1); }

/* ---- Owl Carousel : option rtl:true geree dans js/main.js ---- */
[dir="rtl"] .owl-carousel .owl-item img { margin-inline: auto; }

/* ---- Icones directionnelles (fleches des liens) ---- */
[dir="rtl"] .icon-dir { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .back-to-top .bi { transform: none; }

/* ---- Contenus toujours LTR dans une page RTL : telephone, e-mail, URL ---- */
bdi[dir="ltr"] { unicode-bidi: isolate; }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="tel"], [dir="rtl"] input[type="url"] { direction: ltr; text-align: right; }
[dir="rtl"] input[type="email"]::placeholder, [dir="rtl"] input[type="tel"]::placeholder { direction: rtl; }

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

/* =====================================================================
   Typographie arabe (Cairo charge dynamiquement par le <head> en AR uniquement)
   Repli : Noto Sans Arabic puis polices systeme arabes.
   ===================================================================== */
html[lang="ar"] body,
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3, html[lang="ar"] h4, html[lang="ar"] h5, html[lang="ar"] h6,
html[lang="ar"] .btn, html[lang="ar"] .nav-link, html[lang="ar"] .dropdown-item,
html[lang="ar"] .form-control, html[lang="ar"] .lang-switcher a, html[lang="ar"] .floating-icon-text {
    font-family: 'Cairo', 'Noto Sans Arabic', 'Segoe UI', Tahoma, 'Geeza Pro', Arial, sans-serif;
}
html[lang="ar"] body { font-size: 1.0625rem; line-height: 1.95; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3,
html[lang="ar"] h4, html[lang="ar"] h5, html[lang="ar"] h6 { line-height: 1.55; }
html[lang="ar"] .service-item p, html[lang="ar"] .form-control { line-height: 1.8; }
html[lang="ar"] .text-uppercase, html[lang="ar"] .section-title h5 { text-transform: none; letter-spacing: 0; }
@media (min-width: 1400px) { html[lang="ar"] .navbar-dark .navbar-nav .nav-link { font-size: 17px; } }
html[lang="ar"] .btn { font-weight: 700; }
html[lang="ar"] .lang-switcher a[lang="fr"], html[lang="ar"] .lang-switcher a[lang="en"] { font-family: 'Nunito', sans-serif; }
