/* ==========================================================
   Réglages spécifiques à l'arabe (chargé uniquement si dir="rtl")
   ========================================================== */

/* 1. Police arabe pour tout le site (les variables du template pointent vers des polices latines) */
html[dir="rtl"] {
    --tp-ff-body: 'IBM Plex Sans Arabic', 'Kanit', sans-serif;
    --tp-ff-heading: 'IBM Plex Sans Arabic', 'Space Grotesk', sans-serif;
    --tp-ff-p: 'IBM Plex Sans Arabic', 'Kanit', sans-serif;
    --tp-ff-dm: 'IBM Plex Sans Arabic', 'DM Sans', sans-serif;
    --tp-ff-inter: 'IBM Plex Sans Arabic', 'Inter', sans-serif;
    --tp-ff-jakarta: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', sans-serif;
    --tp-ff-poppins: 'IBM Plex Sans Arabic', 'Poppins', sans-serif;
    --tp-ff-sora: 'IBM Plex Sans Arabic', 'Sora', sans-serif;
}

html[dir="rtl"] body,
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"] p, html[dir="rtl"] a, html[dir="rtl"] span,
html[dir="rtl"] li, html[dir="rtl"] label, html[dir="rtl"] button,
html[dir="rtl"] input, html[dir="rtl"] textarea, html[dir="rtl"] .btn-text {
    font-family: 'IBM Plex Sans Arabic', sans-serif !important;
}

/* 2. Pas d'espacement négatif entre lettres : il casse la liaison des lettres arabes */
html[dir="rtl"] * {
    letter-spacing: 0 !important;
}

/* 3. L'arabe a besoin d'un peu plus de hauteur de ligne */
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] .al-section-title,
html[dir="rtl"] .tp-section-ai-title {
    line-height: 1.3 !important;
}

/* 4. Les flèches des boutons pointent vers la gauche en arabe */
html[dir="rtl"] .btn-icon svg,
html[dir="rtl"] .sl-card-link svg,
html[dir="rtl"] .tp-btn-circle svg {
    transform: scaleX(-1);
}

/* 5. Numéros de téléphone, e-mails et prix : toujours de gauche à droite */
html[dir="rtl"] a[href^="tel:"],
html[dir="rtl"] a[href^="mailto:"] {
    direction: ltr;
    unicode-bidi: isolate;
}

/* 6. Éléments positionnés en JavaScript à partir de la GAUCHE de l'écran
      (les calculs du template sont faits depuis la gauche, même en arabe) :
      on annule l'inversion left -> right faite par rtlcss. */

/* Cercles "Colis, Agences, Livreurs…" qui tombent (Matter.js / throwable.js) */
html[dir="rtl"] .tp-techonolgy-capsule-wrapper .tp-techonolgy-capsule-item-wrapper > p {
    left: 0;
    right: auto;
}

/* Curseur personnalisé (tp-cursor.js) */
html[dir="rtl"] #ball {
    left: 0;
    right: auto;
}

/* La zone des cercles fonctionne comme en anglais (gauche -> droite) :
   le moteur physique (throwable.js / Matter.js) ne gère pas le RTL.
   Seul le texte À L'INTÉRIEUR des cercles reste en arabe. */
html[dir="rtl"] .tp-techonolgy-capsule-item-wrapper {
    direction: ltr;
}

html[dir="rtl"] .tp-techonolgy-capsule-item {
    direction: rtl;
}
