/* ==========================================================================
   Fields Builder — RTL (Right-to-Left) Overrides
   Loaded conditionally when WordPress is set to an RTL language (e.g. Arabic)
   ========================================================================== */

/* ---------- Arabic Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

html[dir="rtl"] body,
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
html[dir="rtl"] button {
    font-family: 'Tajawal', 'Poppins', sans-serif;
    letter-spacing: 0;
}

/* ---------- General Direction ---------- */
html[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

/* ---------- Header ---------- */
html[dir="rtl"] .header__inner {
    flex-direction: row-reverse;
}

html[dir="rtl"] .nav__list {
    flex-direction: row-reverse;
}

html[dir="rtl"] .header__actions {
    flex-direction: row-reverse;
}

html[dir="rtl"] .nav__arrow {
    margin-left: 0;
    margin-right: 6px;
}

html[dir="rtl"] .lang-dropdown {
    margin-left: 0;
    margin-right: auto;
}

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

html[dir="rtl"] .mega-menu__col {
    border-left: none;
    border-right: 1px solid rgba(255,255,255,.08);
}

html[dir="rtl"] .mega-menu__col:first-child {
    border-right: none;
}

/* ---------- Hero ---------- */
html[dir="rtl"] .hero__content {
    text-align: right;
}

html[dir="rtl"] .hero__controls {
    flex-direction: row-reverse;
}

/* ---------- Buttons & Links ---------- */
html[dir="rtl"] .btn i,
html[dir="rtl"] .btn .fas,
html[dir="rtl"] .btn .far {
    margin-left: 0;
    margin-right: 0.5rem;
}

html[dir="rtl"] .btn--primary i.fa-arrow-right {
    transform: scaleX(-1);
}

/* ---------- Section Labels ---------- */
html[dir="rtl"] .section-label {
    text-align: right;
}

html[dir="rtl"] .section-top {
    flex-direction: row-reverse;
}

/* ---------- About Section ---------- */
html[dir="rtl"] .about__inner {
    flex-direction: row-reverse;
}

html[dir="rtl"] .about__badge {
    left: auto;
    right: -40px;
}

/* ---------- Stats ---------- */
html[dir="rtl"] .stat__icon {
    margin-right: 0;
    margin-left: 1rem;
}

/* ---------- Facilities Slider ---------- */
html[dir="rtl"] .facility-card__link i {
    transform: scaleX(-1);
}

/* ---------- Product Sync Slider ---------- */
html[dir="rtl"] .product-sync__inner {
    flex-direction: row-reverse;
}

/* ---------- News Cards ---------- */
html[dir="rtl"] .news-card__content {
    text-align: right;
}

html[dir="rtl"] .news-card__date i {
    margin-right: 0;
    margin-left: 0.5rem;
}

html[dir="rtl"] .news-arch-card__content {
    text-align: right;
}

html[dir="rtl"] .news-arch-card__date i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* ---------- News Single ---------- */
html[dir="rtl"] .news-layout {
    flex-direction: row-reverse;
}

html[dir="rtl"] .news-share {
    left: auto;
    right: 0;
}

html[dir="rtl"] .news-breadcrumb {
    direction: rtl;
}

html[dir="rtl"] .news-breadcrumb .sep {
    margin: 0 0.5rem;
}

/* ---------- News Archive ---------- */
html[dir="rtl"] .news-archive__bar {
    flex-direction: row-reverse;
}

html[dir="rtl"] .news-archive__search {
    flex-direction: row-reverse;
}

/* ---------- CTA ---------- */
html[dir="rtl"] .cta__buttons {
    flex-direction: row-reverse;
}

/* ---------- Footer ---------- */
html[dir="rtl"] .footer__top {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .footer__col i {
    margin-right: 0;
    margin-left: 0.5rem;
}

html[dir="rtl"] .footer__office-tabs {
    direction: rtl;
}

html[dir="rtl"] .footer__office-panel p i {
    margin-right: 0;
    margin-left: 0.5rem;
}

html[dir="rtl"] .footer__bottom {
    direction: rtl;
    text-align: right;
}

/* ---------- Contact Page ---------- */
html[dir="rtl"] .contact-offices__inner {
    flex-direction: row-reverse;
}

html[dir="rtl"] .contact-form__inner {
    flex-direction: row-reverse;
}

html[dir="rtl"] .office-accordion__header {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .office-accordion__content p i {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* ---------- About Page ---------- */
html[dir="rtl"] .about-hero__breadcrumb {
    direction: rtl;
}

html[dir="rtl"] .about-company__wrapper {
    flex-direction: row-reverse;
}

html[dir="rtl"] .about-circular .container--flex {
    flex-direction: row-reverse;
}

html[dir="rtl"] .about-mv__content {
    text-align: right;
}

html[dir="rtl"] .about-brands__inner {
    flex-direction: row-reverse;
}

/* ---------- Facility Page ---------- */
html[dir="rtl"] .facility-features {
    direction: rtl;
}

html[dir="rtl"] .facility-details__grid {
    direction: rtl;
}

html[dir="rtl"] .facility-details__content {
    text-align: right;
}

html[dir="rtl"] .facility-details__item i {
    margin-right: 0;
    margin-left: 0.75rem;
}

/* ---------- Resources Page ---------- */
html[dir="rtl"] .resource-card__body {
    flex-direction: row-reverse;
    text-align: right;
}

/* ---------- 404 Page ---------- */
html[dir="rtl"] .not-found__content {
    text-align: center;
}

/* ---------- FAB ---------- */
html[dir="rtl"] .fab-container {
    right: auto;
    left: 2rem;
}

html[dir="rtl"] .fab-tooltip {
    right: auto;
    left: calc(100% + 12px);
}

/* ---------- Quote Modal ---------- */
html[dir="rtl"] .quote-modal {
    text-align: right;
}

html[dir="rtl"] .quote-modal__close {
    right: auto;
    left: 1rem;
}

/* ---------- Mobile Nav ---------- */
html[dir="rtl"] .mobile-nav {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

html[dir="rtl"] .mobile-nav.open {
    transform: translateX(0);
}

html[dir="rtl"] .mobile-nav__link {
    text-align: right;
}

html[dir="rtl"] .mobile-nav__dropdown-toggle {
    margin-left: 0;
    margin-right: auto;
}

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

html[dir="rtl"] .breadcrumb-item + .breadcrumb-item::before {
    content: '\\' ;
    float: right;
    padding-left: 0.5rem;
    padding-right: 0;
}

/* ---------- Page Header ---------- */
html[dir="rtl"] .page-header__content {
    text-align: right;
}

/* ---------- Pagination ---------- */
html[dir="rtl"] .news-archive__pagination {
    direction: rtl;
}

/* ---------- Slider Navigation Flip ---------- */
html[dir="rtl"] .slider-controls .nav-btn:first-child i,
html[dir="rtl"] .details-nav-btn i,
html[dir="rtl"] .about-slider-prev i,
html[dir="rtl"] .about-slider-next i,
html[dir="rtl"] .brands-button-prev i,
html[dir="rtl"] .brands-button-next i {
    transform: scaleX(-1);
}

/* ---------- Responsive Adjustments ---------- */
@media (max-width: 768px) {
    html[dir="rtl"] .contact-offices__inner,
    html[dir="rtl"] .contact-form__inner,
    html[dir="rtl"] .about-company__wrapper,
    html[dir="rtl"] .about-brands__inner,
    html[dir="rtl"] .about-circular .container--flex {
        flex-direction: column;
    }

    html[dir="rtl"] .header__inner {
        flex-direction: row-reverse;
    }
}
