/**
 * Comprehensive RTL fixes for Arabic (dir="rtl").
 * Handles header, Elementor containers, carousels, arrows, and all pages.
 */

/* ===== Global Elementor Containers ===== */
/* Elementor uses CSS Grid for layout - reverse grid direction for RTL */
[dir="rtl"] .elementor-container {
    direction: rtl !important;
}

/* For flex containers (some Elementor widgets use flex) */
[dir="rtl"] .elementor-container:not(.elementor-column-gap-default):not(.elementor-column-gap-extended):not(.elementor-column-gap-wide):not(.elementor-column-gap-wider) {
    display: flex !important;
    flex-direction: row-reverse !important;
}

/* Reverse individual columns using transform - works with any layout method */
[dir="rtl"] .elementor-column {
    direction: rtl !important;
}

/* Proper column swapping using CSS order - NO OVERLAP */
[dir="rtl"] .elementor-container {
    display: flex !important;
    flex-direction: row-reverse !important;
    overflow: visible !important;
}

/* Ensure 50/50 columns maintain equal width */
[dir="rtl"] .elementor-col-50 {
    flex: 0 0 50% !important;
    max-width: 50% !important;
    transform: none !important;
}

/* Single-column sections: no flex reversal needed */
[dir="rtl"] .elementor-col-100 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    transform: none !important;
    direction: rtl;
}

/* For containers that already use flexbox */
[dir="rtl"] .elementor-container.elementor-column-gap-no {
    flex-direction: row-reverse !important;
}

/* ===== Base Layout ===== */
[dir="rtl"] .page-hero-breadcrumb,
[dir="rtl"] .legal-section,
[dir="rtl"] #main {
    direction: rtl;
    text-align: right;
}

/* ===== Header Utility Bar ===== */
[dir="rtl"] #header .elementor-section .elementor-container {
    flex-direction: row-reverse;
}

[dir="rtl"] .elementor-icon-list-items.elementor-inline-items {
    direction: rtl;
    flex-direction: row-reverse;
}

[dir="rtl"] .elementor-icon-list-item {
    direction: rtl;
}

[dir="rtl"] .elementor-icon-list-icon {
    margin-right: 0;
    margin-left: 5px;
}

/* ===== Header Nav Bar ===== */
[dir="rtl"] .wdt-primary-nav {
    direction: rtl;
    flex-direction: row-reverse;
}

[dir="rtl"] .wdt-primary-nav > li {
    direction: rtl;
    text-align: right;
}

/* Nav column layout: logo right, nav left in RTL */
[dir="rtl"] .elementor-element-47eec1c > .elementor-container {
    flex-direction: row-reverse;
}

/* Utility bar inner section: social right, contact left in RTL */
[dir="rtl"] .elementor-element-03f6679 > .elementor-container {
    flex-direction: row-reverse;
}

/* Nav justify to start (which is right in RTL) */
[dir="rtl"] .elementor-element-d95f6ac > .elementor-widget-wrap {
    justify-content: flex-start;
}

/* Logo justify to end (right in RTL) */
[dir="rtl"] .elementor-element-5c5725a > .elementor-widget-wrap {
    justify-content: flex-end;
}

/* Contact info list justify to start in RTL */
[dir="rtl"] .elementor-element-9df5969.elementor-column > .elementor-widget-wrap {
    justify-content: flex-start !important;
}

/* Social icons justify to end in RTL */
[dir="rtl"] .elementor-element-b2ef746.elementor-column > .elementor-widget-wrap {
    justify-content: flex-end;
}

/* Nav toggle margins for RTL */
[dir="rtl"] .fmc-nav-theme-toggle {
    margin-right: 6px !important;
    margin-left: 0 !important;
}

[dir="rtl"] .fmc-nav-lang-switch {
    margin-right: 4px !important;
    margin-left: 0 !important;
}

/* Social icons RTL */
[dir="rtl"] .elementor-element-b4c83dc .elementor-icon-list-items {
    direction: rtl !important;
    justify-content: flex-end !important;
}

/* ===== Swiper / Carousel Arrows ===== */
[dir="rtl"] .wdt-carousel-arrow-pagination {
    flex-direction: row-reverse;
}

[dir="rtl"] .wdt-arrow-pagination-prev {
    order: 2;
}

[dir="rtl"] .wdt-arrow-pagination-next {
    order: 1;
}

/* Custom carousel arrows (blog, projects, products): mirror to RTL edges; keep translateY(-50%) from theme */
[dir="rtl"] .carousel-prev {
    left: auto;
    right: 4px;
    transform: translateY(-50%);
}

[dir="rtl"] .carousel-next {
    right: auto;
    left: 4px;
    transform: translateY(-50%);
}

/* Hero slider thumbs carousel arrows */
[dir="rtl"] .wdt-thumb-carousel-holder .wdt-carousel-arrow-pagination .wdt-arrow-pagination-prev {
    transform: rotate(180deg);
}

[dir="rtl"] .wdt-thumb-carousel-holder .wdt-carousel-arrow-pagination .wdt-arrow-pagination-next {
    transform: rotate(180deg);
}

/* Swiper: Do NOT set direction:rtl on .swiper — it breaks slide positioning.
   Float reversal on columns handles content inside slides. */

/* Hero slider arrows */
[dir="rtl"] .wdt-thumb-carousel-holder .wdt-carousel-arrow-pagination {
    direction: rtl;
}

/* Hero slider text alignment */
[dir="rtl"] .wdt-slider-heading .wdt-heading-holder {
    text-align: right;
}

[dir="rtl"] .wdt-slider-heading .wdt-heading-title-wrapper,
[dir="rtl"] .wdt-slider-heading .wdt-heading-subtitle-wrapper {
    text-align: right;
    justify-content: flex-start;
}

[dir="rtl"] .wdt-slider-heading .wdt-heading-content-wrapper {
    text-align: right;
}

/* Content order maintained from LTR design */
[dir="rtl"] body[data-fmc-page="home"] .wdt-thumb-carousel-holder .wdt-slider-heading .wdt-heading-holder {
    display: flex !important;
    flex-direction: column !important;
    gap: 16px !important;
}

[dir="rtl"] body[data-fmc-page="home"] .wdt-thumb-carousel-holder .wdt-slider-heading .wdt-heading-subtitle-wrapper {
    order: 1 !important;
}

[dir="rtl"] body[data-fmc-page="home"] .wdt-thumb-carousel-holder .wdt-slider-heading .wdt-heading-title-wrapper {
    order: 2 !important;
}

[dir="rtl"] body[data-fmc-page="home"] .wdt-thumb-carousel-holder .wdt-slider-heading .wdt-heading-content-wrapper {
    order: 3 !important;
}

/* ===== Footer ===== */
[dir="rtl"] .footer-grid {
    direction: rtl;
}

[dir="rtl"] .footer-col {
    text-align: right;
}

[dir="rtl"] .footer-desc {
    text-align: right;
}

[dir="rtl"] .footer-social {
    justify-content: flex-start;
}

[dir="rtl"] .footer-links {
    text-align: right;
}

[dir="rtl"] .footer-contact-list {
    text-align: right;
}

[dir="rtl"] .footer-contact-list li {
    direction: rtl;
}

[dir="rtl"] .footer-contact-list i {
    margin-left: 8px;
    margin-right: 0;
}

[dir="rtl"] .footer-vision2030 {
    text-align: right;
}

[dir="rtl"] .footer-copyright-inner {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer-legal-links {
    text-align: left;
}

/* ===== Newsletter ===== */
[dir="rtl"] .site-newsletter {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .site-newsletter-form {
    direction: rtl;
}

[dir="rtl"] .site-newsletter-form input {
    text-align: right;
    padding-right: 20px;
    padding-left: 20px;
}

/* ===== Contact Bar ===== */
[dir="rtl"] .contact-bar {
    direction: rtl;
}

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

[dir="rtl"] .contact-bar-item i {
    margin-left: 10px;
    margin-right: 0;
}

/* ===== Floating Action Buttons ===== */
[dir="rtl"] .floating-action-button {
    right: auto;
    left: 20px;
}

[dir="rtl"] .fab-option {
    right: auto;
    left: 20px;
}

[dir="rtl"] .scroll-to-top {
    left: auto;
    right: 20px;
}

/* ===== Breadcrumbs ===== */
[dir="rtl"] .page-hero-breadcrumb ul {
    direction: rtl;
}

[dir="rtl"] .page-hero-breadcrumb li {
    direction: rtl;
}

/* ===== Home: custom sections (products / blog / projects carousels) ===== */
[dir="rtl"] #main .fmc-home-custom {
    direction: rtl;
    text-align: start;
}

[dir="rtl"] #main .fmc-home-custom .home-products-header,
[dir="rtl"] #main .fmc-home-custom .home-blog-header,
[dir="rtl"] #main .fmc-home-custom .home-projects-header {
    direction: rtl;
}

[dir="rtl"] #main .fmc-home-custom .home-products-subtitle,
[dir="rtl"] #main .fmc-home-custom .home-blog-subtitle,
[dir="rtl"] #main .fmc-home-custom .home-projects-subtitle {
    letter-spacing: 0;
}

[dir="rtl"] #main .fmc-home-custom .product-photo-card__icon-row {
    flex-direction: row-reverse;
}

/* Carousel arrows: “previous” sits on the inline-start side in RTL */
[dir="rtl"] #main .fmc-home-custom .carousel-prev {
    left: auto;
    right: 4px;
}
[dir="rtl"] #main .fmc-home-custom .carousel-next {
    right: auto;
    left: 4px;
}

/* ===== Blog Sidebar ===== */
[dir="rtl"] .blog-sidebar-search-wrap {
    flex-direction: row-reverse;
}

[dir="rtl"] .blog-sidebar {
    text-align: right;
}

[dir="rtl"] .sidebar-categories a {
    text-align: right;
}

[dir="rtl"] .blog-card-tag {
    direction: rtl;
}

/* ===== Modals ===== */
[dir="rtl"] .product-pdf-modal-footer-actions {
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    [dir="rtl"] .product-pdf-modal-footer-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

[dir="rtl"] .cert-modal-footer-actions {
    flex-direction: row-reverse;
}

@media (max-width: 768px) {
    [dir="rtl"] .cert-modal-footer-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

[dir="rtl"] .cert-modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .product-pdf-modal-header {
    flex-direction: row-reverse;
}


[dir="rtl"] .chatbot-modal-header {
    flex-direction: row-reverse;
}

[dir="rtl"] .chatbot-messages {
    direction: rtl;
}

[dir="rtl"] .chatbot-message {
    text-align: right;
}

/* tel inputs default to LTR — placeholder hugged left; align right like other fields (digits stay LTR) */
[dir="rtl"] .chatbot-form input[type="tel"],
[dir="rtl"] .contact-form input[type="tel"],
[dir="rtl"] .job-application-form input[type="tel"] {
    text-align: right;
    direction: ltr;
    unicode-bidi: isolate;
}

/* ===== Products & Equipments Pages ===== */
[dir="rtl"] .products-grid,
[dir="rtl"] .equipments-grid {
    direction: rtl;
}

[dir="rtl"] .product-card,
[dir="rtl"] .equipment-card {
    text-align: right;
}

[dir="rtl"] .product-card-title,
[dir="rtl"] .equipment-card-title {
    text-align: right;
}

[dir="rtl"] .product-card-excerpt,
[dir="rtl"] .equipment-card-excerpt {
    text-align: right;
}

[dir="rtl"] .product-filters,
[dir="rtl"] .equipment-filters {
    direction: rtl;
}

/* Product/Equipment Single Page */
[dir="rtl"] .product-detail-grid,
[dir="rtl"] .equipment-detail-grid {
    direction: rtl;
}

[dir="rtl"] .product-detail-description,
[dir="rtl"] .equipment-detail-description {
    text-align: right;
}

[dir="rtl"] .product-features-list,
[dir="rtl"] .equipment-features-list {
    text-align: right;
}

[dir="rtl"] .product-features-list li,
[dir="rtl"] .equipment-features-list li {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .product-features-list li::before,
[dir="rtl"] .equipment-features-list li::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .product-action-buttons,
[dir="rtl"] .equipment-action-buttons {
    direction: rtl;
}

[dir="rtl"] .product-action-btn i,
[dir="rtl"] .equipment-action-btn i {
    margin-left: 8px;
    margin-right: 0;
}

[dir="rtl"] .related-products-grid,
[dir="rtl"] .related-equipments-grid {
    direction: rtl;
}

/* ===== Projects Pages ===== */
[dir="rtl"] .projects-grid {
    direction: rtl;
}

[dir="rtl"] .project-card {
    text-align: right;
}

[dir="rtl"] .project-card-title {
    text-align: right;
}

[dir="rtl"] .project-card-meta {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .project-card-meta i {
    margin-left: 6px;
    margin-right: 0;
}

[dir="rtl"] .project-filters {
    direction: rtl;
}

/* Project Single Page */
[dir="rtl"] .project-detail-content {
    text-align: right;
}

[dir="rtl"] .project-info-list {
    text-align: right;
}

[dir="rtl"] .project-info-list li {
    direction: rtl;
}

[dir="rtl"] .project-gallery {
    direction: rtl;
}

/* ===== Certificates Page ===== */
[dir="rtl"] .certificates-grid {
    direction: rtl;
}

[dir="rtl"] .certificate-card {
    text-align: right;
}

[dir="rtl"] .certificate-title {
    text-align: right;
}

/* ===== Careers Pages ===== */
[dir="rtl"] .careers-grid {
    direction: rtl;
}

[dir="rtl"] .career-card {
    text-align: right;
}

[dir="rtl"] .career-card-title {
    text-align: right;
}

[dir="rtl"] .career-card-meta {
    direction: rtl;
}

[dir="rtl"] .career-card-meta i {
    margin-left: 8px;
    margin-right: 0;
}

/* Career Single & Application Form */
[dir="rtl"] .career-detail-content {
    text-align: right;
}

[dir="rtl"] .career-requirements,
[dir="rtl"] .career-responsibilities {
    text-align: right;
}

[dir="rtl"] .career-requirements li,
[dir="rtl"] .career-responsibilities li {
    text-align: right;
    direction: rtl;
}

[dir="rtl"] .career-application-form {
    direction: rtl;
}

/* ===== Contact Page ===== */
[dir="rtl"] .contact-info-grid {
    direction: rtl;
}

[dir="rtl"] .contact-info-card {
    text-align: right;
}

/* Spacing for the heading icon only — do not target .contact-info-icon > i (margin + inherited text-align shift FA glyphs right in the circle) */
[dir="rtl"] .contact-info-card h3 i {
    margin-left: 12px;
    margin-right: 0;
}

[dir="rtl"] .contact-info-icon {
    text-align: center !important;
    unicode-bidi: isolate;
}

[dir="rtl"] .contact-info-icon > i {
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: center !important;
}

[dir="rtl"] .contact-form {
    direction: rtl;
}

[dir="rtl"] .contact-form input,
[dir="rtl"] .contact-form textarea,
[dir="rtl"] .contact-form select {
    text-align: right;
}

[dir="rtl"] .contact-form label {
    text-align: right;
}

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

[dir="rtl"] .about-tab-buttons {
    direction: rtl;
}

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

[dir="rtl"] .about-stats-grid {
    direction: rtl;
}

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

[dir="rtl"] .about-timeline {
    direction: rtl;
}

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

/* ===== Blog Pages ===== */
[dir="rtl"] .blog-archive-grid {
    direction: rtl;
}

[dir="rtl"] .blog-card {
    text-align: right;
}

[dir="rtl"] .blog-card-title {
    text-align: right;
}

[dir="rtl"] .blog-card-excerpt {
    text-align: right;
}

[dir="rtl"] .blog-card-meta {
    direction: rtl;
}

[dir="rtl"] .blog-card-meta i {
    margin-left: 6px;
    margin-right: 0;
}

/* Blog Single Page */
[dir="rtl"] .blog-single-content {
    text-align: right;
}

[dir="rtl"] .blog-single-body {
    text-align: right;
}

[dir="rtl"] .blog-single-body h1,
[dir="rtl"] .blog-single-body h2,
[dir="rtl"] .blog-single-body h3,
[dir="rtl"] .blog-single-body h4,
[dir="rtl"] .blog-single-body h5,
[dir="rtl"] .blog-single-body h6 {
    text-align: right;
}

[dir="rtl"] .blog-single-body ul,
[dir="rtl"] .blog-single-body ol {
    padding-right: 20px;
    padding-left: 0;
}

[dir="rtl"] .blog-single-body blockquote {
    border-left: none;
    border-right: 4px solid #128AF0;
    padding-left: 0;
    padding-right: 20px;
}

[dir="rtl"] .blog-single-tags {
    direction: rtl;
}

[dir="rtl"] .blog-single-share {
    direction: rtl;
}

[dir="rtl"] .related-posts-grid {
    direction: rtl;
}

/* ===== Forms (General) ===== */
[dir="rtl"] .form-group {
    text-align: right;
}

[dir="rtl"] .form-label {
    text-align: right;
}

[dir="rtl"] .form-control {
    text-align: right;
}

[dir="rtl"] .form-check {
    direction: rtl;
}

[dir="rtl"] .form-check-input {
    margin-left: 8px;
    margin-right: 0;
}

[dir="rtl"] .form-error {
    text-align: right;
}

[dir="rtl"] .form-success {
    text-align: right;
}

/* ===== Tables ===== */
[dir="rtl"] table {
    direction: rtl;
}

[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

[dir="rtl"] .table-responsive {
    direction: rtl;
}

/* ===== Pagination ===== */
[dir="rtl"] .pagination {
    direction: rtl;
}

[dir="rtl"] .pagination-list {
    direction: rtl;
}

[dir="rtl"] .pagination-prev {
    order: 2;
}

[dir="rtl"] .pagination-next {
    order: 1;
}

/* ===== Buttons with Icons ===== */
[dir="rtl"] .btn i {
    margin-left: 8px;
    margin-right: 0;
}

[dir="rtl"] .wdt-button i {
    margin-left: 8px;
    margin-right: 0;
}

/* ===== Lists with Icons ===== */
[dir="rtl"] .icon-list li {
    direction: rtl;
}

[dir="rtl"] .icon-list i {
    margin-left: 10px;
    margin-right: 0;
}

/* ===== Partners Marquee ===== */
[dir="rtl"] .fmc-partners-scroll-inner {
    direction: rtl;
}

/* ===== About Mobile Slider ===== */
[dir="rtl"] .fmc-about-mobile-slider-viewport {
    direction: rtl;
}

/* ===== Elementor Widgets ===== */
[dir="rtl"] .elementor-widget-container {
    direction: rtl;
}

[dir="rtl"] .wdt-heading-holder {
    text-align: right;
}

[dir="rtl"] .wdt-heading-title-wrapper {
    text-align: right;
}

[dir="rtl"] .wdt-heading-subtitle-wrapper {
    text-align: right;
}

[dir="rtl"] .wdt-heading-content-wrapper {
    text-align: right;
}

/* ===== Home Page: Elementor Multi-Column Sections ===== */

/* Float:right on .elementor-column handles all column reversal globally.
   No per-section overrides needed. */

/* Hero slide content text alignment */
[dir="rtl"] .swiper-slide .wdt-heading-holder {
    text-align: right !important;
}

[dir="rtl"] .swiper-slide .wdt-heading-title-wrapper {
    text-align: right !important;
    justify-content: flex-end !important;
}

[dir="rtl"] .swiper-slide .wdt-heading-subtitle-wrapper {
    text-align: right !important;
    justify-content: flex-end !important;
}

[dir="rtl"] .swiper-slide .wdt-heading-content-wrapper {
    text-align: right !important;
}

/* RTL: Buttons should align left in RTL */
[dir="rtl"] .swiper-slide .wdt-button-holder,
[dir="rtl"] .wdt-button-holder {
    text-align: left !important;
    justify-content: flex-start !important;
}

/* RTL: Arrow icons in buttons should flip */
[dir="rtl"] .wdt-button-icon-after .wdt-button-text::after {
    transform: rotate(180deg);
    margin-left: 0;
    margin-right: 5px;
}

/* RTL: Icon arrows in links */
[dir="rtl"] .project-card-cta::after {
    transform: rotate(180deg);
    margin-left: 0;
    margin-right: 5px;
}

/* RTL: Breadcrumb arrows */
[dir="rtl"] .page-hero-breadcrumb li + li::before {
    content: "◀";
    transform: rotate(180deg);
}

/* RTL: Pagination arrows */
[dir="rtl"] .pagination-prev::before {
    content: "▶";
    margin-right: 5px;
}

[dir="rtl"] .pagination-next::after {
    content: "◀";
    margin-left: 5px;
}

/* ===== Products Section - Match Blog Design ===== */
/* Simplify header structure to match blog section */
.home-products-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Remove extra wrapper divs and make layout like blog */
.home-products-header-left,
.home-products-header-right {
    display: contents !important;
}

/* RTL: Header layout - reverse in RTL */
[dir="rtl"] .home-products-header {
    flex-direction: row-reverse !important;
}

[dir="rtl"] .home-products-header-left {
    text-align: right !important;
}

[dir="rtl"] .home-products-header-right {
    text-align: left !important;
}

/* Products carousel arrows - already handled by global carousel rules */

/* Product cards content alignment */
[dir="rtl"] .home-product-slide {
    text-align: right;
}

[dir="rtl"] .product-photo-card-title {
    text-align: right;
}

[dir="rtl"] .product-photo-card-category {
    text-align: right;
}

[dir="rtl"] .product-photo-card-description {
    text-align: right;
}

[dir="rtl"] .product-photo-card-cta {
    text-align: right;
}

/*
 * Home horizontal carousels: flex + translateX(%) assume LTR track layout.
 * #main is RTL, so tracks inherited direction:rtl and broke slide positions (“empty” columns).
 * Isolate carousel engine as LTR; card copy still uses RTL via rules on slides/cards below.
 */
[dir="rtl"] .fmc-home-custom .home-products-carousel,
[dir="rtl"] .fmc-home-custom .home-blog-carousel,
[dir="rtl"] .fmc-home-custom .home-projects-carousel,
[dir="rtl"] .fmc-home-custom .home-products-track,
[dir="rtl"] .fmc-home-custom .home-blog-track,
[dir="rtl"] .fmc-home-custom .home-projects-track {
    direction: ltr !important;
}

[dir="rtl"] .related-products-section .home-products-carousel,
[dir="rtl"] .related-products-section .home-products-track {
    direction: ltr !important;
}

[dir="rtl"] .fmc-home-custom .home-product-slide,
[dir="rtl"] .fmc-home-custom .home-blog-slide,
[dir="rtl"] .fmc-home-custom .home-project-slide {
    direction: rtl;
    unicode-bidi: isolate;
}

/* Products browse button - match blog/projects button design (both languages) */
.home-products-browse-btn {
    background: linear-gradient(135deg, #023B4A, #128AF0) !important;
    color: white !important;
    padding: 10px 22px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: opacity 0.3s !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    border: none !important;
}

.home-products-browse-btn:hover {
    opacity: 0.9 !important;
    color: white !important;
}

/* Also fix projects button to match exactly */
.home-projects-browse-btn {
    background: linear-gradient(135deg, #023B4A, #128AF0) !important;
    color: white !important;
    padding: 10px 22px !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: opacity 0.3s !important;
    white-space: nowrap !important;
}

.home-projects-browse-btn:hover {
    opacity: 0.9 !important;
    color: white !important;
}

/* Home carousels: edges + vertical center (JS swaps prev/next when dir=rtl) */
[dir="rtl"] .fmc-home-custom .carousel-prev,
[dir="rtl"] #projCarouselPrev,
[dir="rtl"] #relatedProjectsPrev,
[dir="rtl"] #relatedCarouselPrev,
[dir="rtl"] #relatedEquipPrev {
    left: auto !important;
    right: 4px !important;
    transform: translateY(-50%) !important;
}

[dir="rtl"] .fmc-home-custom .carousel-next,
[dir="rtl"] #projCarouselNext,
[dir="rtl"] #relatedProjectsNext,
[dir="rtl"] #relatedCarouselNext,
[dir="rtl"] #relatedEquipNext {
    right: auto !important;
    left: 4px !important;
    transform: translateY(-50%) !important;
}

/* All column reversal is handled by the global float:right rule above */

[dir="rtl"] .wdt-counter-holder {
    direction: rtl;
}

/* Tabs (Mission/Vision/Objective/Values) */
[dir="rtl"] .wdt-tabs-container {
    direction: rtl;
}

[dir="rtl"] .wdt-tabs-list {
    direction: rtl;
}

[dir="rtl"] .wdt-tabs-content {
    text-align: right;
    direction: rtl;
}

/* Team carousel arrows */
[dir="rtl"] .wdt-image-box-holder .wdt-carousel-arrow-pagination {
    flex-direction: row-reverse;
}

/* Icon boxes in service section */
[dir="rtl"] .wdt-icon-holder {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .wdt-icon-holder .wdt-content-title {
    text-align: right;
}

[dir="rtl"] .wdt-icon-holder .wdt-content-description {
    text-align: right;
}

/* CTA arrow reversal for RTL */
[dir="rtl"] .project-card-cta {
    direction: rtl;
}

/* Elementor animations: flip fadeInLeft ↔ fadeInRight */
[dir="rtl"] .elementor-invisible[data-settings*="fadeInLeft"] {
    animation-name: fadeInRight !important;
}

[dir="rtl"] .elementor-invisible[data-settings*="fadeInRight"] {
    animation-name: fadeInLeft !important;
}

/* ===== Search & Filters ===== */
[dir="rtl"] .search-form {
    direction: rtl;
}

[dir="rtl"] .filter-group {
    direction: rtl;
}

[dir="rtl"] .filter-label {
    text-align: right;
}

/* ===== Cards with Badges ===== */
[dir="rtl"] .badge {
    direction: rtl;
}

[dir="rtl"] .card-badge {
    left: auto;
    right: 12px;
}

/* ===== Tooltips ===== */
[dir="rtl"] .tooltip {
    direction: rtl;
}

/* ===== Alerts & Notifications ===== */
[dir="rtl"] .alert {
    text-align: right;
}

[dir="rtl"] .alert i {
    margin-left: 10px;
    margin-right: 0;
}

/* ===== Mobile Menu ===== */
[dir="rtl"] .mobile-menu {
    direction: rtl;
    right: 0 !important;
    left: auto !important;
}

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

/* ===== Mobile Nav RTL ===== */
[dir="rtl"] .mobile-nav-container.mobile-nav-offcanvas-right {
    right: 0 !important;
    left: auto !important;
}

[dir="rtl"] .mobile-nav-container .menu-trigger {
    order: -1;
}

@media (max-width: 1024px) {
    [dir="rtl"] .mobile-menu .wdt-primary-nav > li:not(.close-nav) > a {
        text-align: right;
    }
    [dir="rtl"] .mobile-menu .fmc-nav-theme-toggle > a,
    [dir="rtl"] .mobile-menu .fmc-nav-lang-switch > a {
        flex-direction: row-reverse;
    }
    [dir="rtl"] .mobile-menu .fmc-nav-theme-toggle > a span,
    [dir="rtl"] .mobile-menu .fmc-nav-lang-switch > a span {
        flex-direction: row-reverse;
    }
}

/* ===== Blog List Layout ===== */
[dir="rtl"] .blog-list-layout {
    direction: rtl;
}

/* ===== Partners Marquee: RTL scrolling direction ===== */
[dir="rtl"] .fmc-partners-marquee-shell .fmc-partners-scroll-inner {
    animation-direction: reverse;
}

[dir="rtl"] .fmc-partners-marquee-shell.fmc-drag-scroll {
    direction: rtl;
}

/* ===== Newsletter Popup Form: RTL Layout ===== */
/* Keep natural LTR flex flow but swap visual order with CSS order property for cleaner layout */
[dir="rtl"] .wdt-mailchimp-holder .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form input[type='text'] {
    order: 2;
}

[dir="rtl"] .wdt-mailchimp-holder .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form input[type='email'] {
    order: 3;
}

[dir="rtl"] .wdt-mailchimp-holder .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form .wdt-mailchimp-subscription-button-holder {
    order: 1;
}

/* Type 3: Absolute positioned button - move to right side seamlessly */
[dir="rtl"] .wdt-mailchimp-holder.wdt-template-type3 .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form .wdt-mailchimp-subscription-button-holder {
    right: 0;
    left: auto;
}

/* Type 3: Adjust input padding for button on right */
[dir="rtl"] .wdt-mailchimp-holder.wdt-template-type3 .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form.with-btn-icon-and-text input {
    padding-right: 8em;
    padding-left: 1em;
    text-align: right;
}

[dir="rtl"] .wdt-mailchimp-holder.wdt-template-type3 .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form.with-btn-icon input {
    padding-right: 4em;
    padding-left: 1em;
    text-align: right;
}

[dir="rtl"] .wdt-mailchimp-holder.wdt-template-type3 .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form.with-btn-text input {
    padding-right: 6em;
    padding-left: 1em;
    text-align: right;
}

/* Type 3: Fix button margin for RTL - button on right edge */
[dir="rtl"] .wdt-mailchimp-holder.wdt-template-type3 .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form.with-btn-icon .wdt-mailchimp-subscription-button-holder button {
    margin-right: 10px;
    margin-left: 0;
}

/* Type 2: Seamless inline form RTL */
[dir="rtl"] .wdt-mailchimp-holder.wdt-template-type2 .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form {
    flex-direction: row-reverse;
}

[dir="rtl"] .wdt-mailchimp-holder.wdt-template-type2 .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form input[type='email'] {
    padding-right: 1em;
    padding-left: 25px;
    text-align: right;
}

[dir="rtl"] .wdt-mailchimp-holder.wdt-template-type2 .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form .wdt-mailchimp-subscription-button-holder button[type='submit'] {
    padding: 15px 0 15px 25px;
    border-left-width: 0;
    border-right-width: 1px;
    border-right-style: solid;
    border-right-color: #e1e1e1;
}

/* Button icon/text spacing RTL - icon comes before text in RTL */
[dir="rtl"] .wdt-mailchimp-holder .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form .wdt-mailchimp-subscription-button-holder button[type='submit'] {
    flex-direction: row-reverse;
}

[dir="rtl"] .wdt-mailchimp-holder .wdt-mailchimp-wrapper .wdt-mailchimp-subscribe-form .wdt-mailchimp-subscription-button-holder button[type='submit'] > *:last-child {
    margin: 0 10px 0 0;
}

/* ===== Site Newsletter Form: RTL - Button on Right ===== */
[dir="rtl"] .site-newsletter-form {
    flex-direction: row-reverse;
}

[dir="rtl"] .site-newsletter-form input {
    text-align: right;
}

[dir="rtl"] .site-newsletter-form button i {
    margin-left: 0;
    margin-right: 8px;
}

/* Mobile: Keep vertical stacking */
@media (max-width: 768px) {
    [dir="rtl"] .site-newsletter-form {
        flex-direction: column;
    }
    
    [dir="rtl"] .site-newsletter-form input {
        text-align: right;
    }
}

/* ===== Breadcrumb separator flip ===== */
[dir="rtl"] .page-hero-breadcrumb li + li::before {
    content: "\\25C2";
    padding: 0 8px;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 1024px) {
    /* Stack columns vertically on tablet/mobile — no need to reverse */
    [dir="rtl"] .elementor-container {
        flex-direction: column;
    }
    [dir="rtl"] #header .elementor-section .elementor-container {
        flex-direction: row-reverse;
    }
    [dir="rtl"] .elementor-element-47eec1c > .elementor-container {
        flex-direction: row-reverse;
    }
}

