/* =====================================================================
   TROPIC IE – Arabic (RTL) layout
   Loaded by header.php only when the site is in Arabic (<html dir="rtl">).
   Flips the Bootstrap 5 left/right utilities and the template details.
   ===================================================================== */

/* ---------- Arabic font ---------- */
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] .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, html[dir=rtl] .display-5, html[dir=rtl] .display-6,
html[dir=rtl] .btn, html[dir=rtl] .form-control, html[dir=rtl] .form-select,
html[dir=rtl] .nav-link, html[dir=rtl] input, html[dir=rtl] textarea, html[dir=rtl] select, html[dir=rtl] button {
    font-family: 'Cairo', Roboto, Arial, sans-serif;
}
/* keep the TROPIC logo text in its original font */
html[dir=rtl] .navbar-brand .h1 { font-family: 'Playfair Display', serif; }
/* Arabic does not use letter-spacing / uppercase */
html[dir=rtl] .text-uppercase { text-transform: none !important; }
html[dir=rtl] [style*="letter-spacing"], html[dir=rtl] .tx-head .k, html[dir=rtl] .tx-hero .cap .k { letter-spacing: 0 !important; }
html[dir=rtl] body { line-height: 1.8; }
html[dir=rtl] h1, html[dir=rtl] h2, html[dir=rtl] h3, html[dir=rtl] .display-4, html[dir=rtl] .display-5, html[dir=rtl] .display-6 { line-height: 1.4; }

/* ---------- Text alignment ---------- */
html[dir=rtl] .text-start { text-align: right !important; }
html[dir=rtl] .text-end { text-align: left !important; }
@media (min-width: 576px) { html[dir=rtl] .text-sm-start { text-align: right !important; } html[dir=rtl] .text-sm-end { text-align: left !important; } }
@media (min-width: 768px) { html[dir=rtl] .text-md-start { text-align: right !important; } html[dir=rtl] .text-md-end { text-align: left !important; } }
@media (min-width: 992px) { html[dir=rtl] .text-lg-start { text-align: right !important; } html[dir=rtl] .text-lg-end { text-align: left !important; } }
@media (min-width: 1200px) { html[dir=rtl] .text-xl-start { text-align: right !important; } html[dir=rtl] .text-xl-end { text-align: left !important; } }

/* ---------- Floats & positions ---------- */
html[dir=rtl] .float-start { float: right !important; }
html[dir=rtl] .float-end { float: left !important; }
html[dir=rtl] .start-0 { left: auto !important; right: 0 !important; }
html[dir=rtl] .end-0 { right: auto !important; left: 0 !important; }
html[dir=rtl] .start-50 { left: auto !important; right: 50% !important; }
html[dir=rtl] .end-50 { right: auto !important; left: 50% !important; }

/* ---------- Margins (me-* <-> ms-*) ---------- */
html[dir=rtl] .ms-0 { margin-left: 0 !important; margin-right: 0 !important; }
html[dir=rtl] .me-0 { margin-right: 0 !important; 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] .ms-auto { margin-left: 0 !important; margin-right: auto !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] .me-auto { margin-right: 0 !important; margin-left: auto !important; }
@media (min-width: 992px) {
    html[dir=rtl] .ms-lg-0 { margin-right: 0 !important; margin-left: 0 !important; }
    html[dir=rtl] .ms-lg-2 { margin-left: 0 !important; margin-right: .5rem !important; }
    html[dir=rtl] .ms-lg-3 { margin-left: 0 !important; margin-right: 1rem !important; }
    html[dir=rtl] .ms-lg-auto { margin-left: 0 !important; margin-right: auto !important; }
    html[dir=rtl] .me-lg-2 { margin-right: 0 !important; margin-left: .5rem !important; }
    html[dir=rtl] .me-lg-auto { margin-right: 0 !important; margin-left: auto !important; }
}

/* ---------- Paddings (pe-* <-> ps-*) ---------- */
html[dir=rtl] .ps-0 { padding-left: 0 !important; padding-right: 0 !important; }
html[dir=rtl] .pe-0 { padding-right: 0 !important; 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; }
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; }

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

/* ---------- Bootstrap components ---------- */
/* lists */
html[dir=rtl] ul, html[dir=rtl] ol { padding-right: 2rem; padding-left: 0; }
html[dir=rtl] .list-unstyled, html[dir=rtl] .nav, html[dir=rtl] .navbar-nav, html[dir=rtl] .pagination,
html[dir=rtl] .tx-check, html[dir=rtl] .pd-points, html[dir=rtl] .carousel-indicators { padding-right: 0; }
/* input groups: rounded corners on the correct side */
html[dir=rtl] .input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu) {
    border-top-left-radius: 0; border-bottom-left-radius: 0;
    border-top-right-radius: .25rem; border-bottom-right-radius: .25rem;
}
html[dir=rtl] .input-group > :not(:first-child):not(.dropdown-menu) {
    margin-left: 0; margin-right: -1px;
    border-top-right-radius: 0; border-bottom-right-radius: 0;
    border-top-left-radius: .25rem; border-bottom-left-radius: .25rem;
}
html[dir=rtl] .input-group-lg > :not(:last-child) { border-top-right-radius: .3rem; border-bottom-right-radius: .3rem; }
html[dir=rtl] .input-group-lg > :not(:first-child) { border-top-left-radius: .3rem; border-bottom-left-radius: .3rem; }
/* select arrow */
html[dir=rtl] .form-select { background-position: left .75rem center; padding-right: .75rem; padding-left: 2.25rem; }
/* modal close button */
html[dir=rtl] .modal-header .btn-close { margin: -.5rem auto -.5rem -.5rem; }
/* pagination corners */
html[dir=rtl] .page-item:first-child .page-link { border-radius: 0 .25rem .25rem 0; }
html[dir=rtl] .page-item:last-child .page-link { border-radius: .25rem 0 0 .25rem; }
html[dir=rtl] .page-item:not(:first-child) .page-link { margin-left: 0; margin-right: -1px; }
/* carousel arrows: "previous" is on the right in Arabic */
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); }
/* dropdowns */
html[dir=rtl] .dropdown-menu { text-align: right; }
/* alerts with a list */
html[dir=rtl] .alert ul.ps-3 { padding-right: 1rem !important; padding-left: 0 !important; }

/* ---------- Direction arrows point the other way ---------- */
html[dir=rtl] .bi-arrow-right::before, html[dir=rtl] .bi-arrow-left::before,
html[dir=rtl] .bi-chevron-right::before, html[dir=rtl] .bi-chevron-left::before,
html[dir=rtl] .fa-angle-right::before, html[dir=rtl] .fa-angle-left::before,
html[dir=rtl] .fa-arrow-right::before, html[dir=rtl] .fa-arrow-left::before {
    display: inline-block; transform: scaleX(-1);
}
/* except inside blocks that are written in English (dir="ltr") */
html[dir=rtl] [dir=ltr] .bi-arrow-right::before, html[dir=rtl] [dir=ltr] .bi-arrow-left::before,
html[dir=rtl] [dir=ltr] .bi-chevron-right::before, html[dir=rtl] [dir=ltr] .bi-chevron-left::before { transform: none; }

/* ---------- Template (style.css) details ---------- */
/* back-to-top button on the left side */
html[dir=rtl] .back-to-top { right: auto !important; left: 30px; }
/* footer links */
html[dir=rtl] .footer .footer-item a, html[dir=rtl] .footer .footer-item .nav-link { text-align: right; }
/* newsletter button inside the input */
html[dir=rtl] .footer #subemail { padding-left: 7rem !important; padding-right: 1.5rem !important; }
/* top bar */
html[dir=rtl] .topbar .justify-content-end { justify-content: flex-start !important; }
/* navbar spacing */
html[dir=rtl] .navbar .nav-link i { margin-left: 3px; }
@media (min-width: 992px) {
    /* keep each menu item on one line ("من نحن" was breaking into two lines) */
    html[dir=rtl] .navbar .navbar-nav .nav-link { white-space: nowrap; font-size: 14.5px; padding-left: .4rem !important; padding-right: .4rem !important; }
}
@media (min-width: 992px) and (max-width: 1299px) {
    html[dir=rtl] .navbar .navbar-nav .nav-link { font-size: 13px; padding-left: .25rem !important; padding-right: .25rem !important; }
}

/* ---------- Home page (index.php) ---------- */
html[dir=rtl] .tx-hero .carousel-item::after { background: linear-gradient(270deg, rgba(0,18,72,.88) 0%, rgba(0,18,72,.55) 55%, rgba(0,18,72,.15) 100%); }
html[dir=rtl] .tx-hero .cap h1, html[dir=rtl] .tx-hero .cap .h1x { line-height: 1.35; }
html[dir=rtl] .tx-why::before { transform-origin: right; }
html[dir=rtl] .tx-p .ar, html[dir=rtl] .p-ar, html[dir=rtl] .c-ar { font-family: Roboto, Arial, sans-serif; text-align: start; }

/* ---------- Product page ---------- */
html[dir=rtl] .pd-ar { font-family: Roboto, Arial, sans-serif; font-size: 1.1rem; text-align: right; }
html[dir=rtl] .pd-content[dir=ltr] { text-align: left; }
html[dir=rtl] .spec-table td:first-child { border-left: 0; }

/* ---------- Numbers, phones, emails, codes stay left-to-right ---------- */
html[dir=rtl] a[href^="tel:"], html[dir=rtl] a[href^="mailto:"] span:only-child { unicode-bidi: plaintext; }
html[dir=rtl] input[type=email], html[dir=rtl] input[type=tel] { text-align: right; }
