/* Arabic RTL overrides */
body,
html {
    direction: rtl;
}

body {
    text-align: right;
}

/* Base RTL text alignment for common content blocks */
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"] .text-title,
html[dir="rtl"] .text-txt { text-align: right; }

.navigation-menu {
    direction: rtl;
}

.brackets li {
    float: right;
}

.brackets li.last {
    float: left;
}

/* RTL Navigation Arrows and Swiper Controls */
.swiper-button-prev,
.swiper-button-next {
    transform: scaleX(-1);
}
html[dir="rtl"] .parallax .swiper-button-prev { left: auto; right: 10px; }
html[dir="rtl"] .parallax .swiper-button-next { right: auto; left: 10px; }

/* Timeline swiper navigation RTL positioning - Mirror of EN */
.timeline .swiper-button-prev {
    top: 15%;
    right: auto;
    left: 15%;
    -webkit-transform: rotate(90deg) translate(0, 10px);
       -moz-transform: rotate(90deg) translate(0, 10px);
        -ms-transform: rotate(90deg) translate(0, 10px);
         -o-transform: rotate(90deg) translate(0, 10px);
            transform: rotate(90deg) translate(0, 10px);
}

.timeline .swiper-button-next {
    top: auto;
    bottom: 15%;
    right: auto;
    left: 15%;
    -webkit-transform: rotate(90deg) translate(0, 10px);
       -moz-transform: rotate(90deg) translate(0, 10px);
        -ms-transform: rotate(90deg) translate(0, 10px);
         -o-transform: rotate(90deg) translate(0, 10px);
            transform: rotate(90deg) translate(0, 10px);
}

/* Mobile timeline navigation RTL */
@media only screen and (max-width: 768px) {
    .timeline .swiper-button-prev {
        top: 50%;
        left: 6px;
        right: auto;
        -webkit-transform: rotate(0deg) translate(0);
           -moz-transform: rotate(0deg) translate(0);
            -ms-transform: rotate(0deg) translate(0);
             -o-transform: rotate(0deg) translate(0);
                transform: rotate(0deg) translate(0);
    }
    
    .timeline .swiper-button-next {
        top: 50%;
        left: 6px;
        right: auto;
        -webkit-transform: rotate(0deg) translate(0);
           -moz-transform: rotate(0deg) translate(0);
            -ms-transform: rotate(0deg) translate(0);
             -o-transform: rotate(0deg) translate(0);
                transform: rotate(0deg) translate(0);
    }
}

/* Swiper pagination RTL - Mirror of EN thedive template */
/* Override plugins.css with higher specificity */
.timeline .swiper-container .swiper-pagination,
.timeline .swiper-pagination {
    left: 15% !important;
    right: auto !important;
    margin-left: 5px;
    margin-right: 0;
    height: 100% !important;
    top: 0 !important;
    display: flex !important;
    flex-direction: column;
    justify-content: center !important;
    align-items: center;
    z-index: 1;
    opacity: 1 !important;
    visibility: visible !important;
    /* Override plugins.css transform */
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
    -o-transform: none !important;
    transform: none !important;
}

.timeline .swiper-container .swiper-pagination::before,
.timeline .swiper-pagination::before {
    right: -30px !important;
    left: auto !important;
    width: 2px;
    background-color: rgba(255, 255, 255, .4);
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

.timeline .swiper-container .swiper-pagination-bullet::before,
.timeline .swiper-pagination-bullet::before {
    right: -31px !important;
    left: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Ensure timeline pagination bullets are properly styled in RTL */
/* Override plugins.css with higher specificity */
.timeline .swiper-container .swiper-pagination-bullet,
.timeline .swiper-pagination-bullet {
    position: relative !important;
    width: auto !important;
    height: auto !important;
    text-align: center !important;
    background: transparent !important;
    color: #fff !important;
    margin: 15px 0 !important;
    font-family: 'Poppins', sans-serif !important;
    font-size: 15px !important;
    line-height: normal !important;
    font-style: italic !important;
    text-transform: uppercase !important;
    font-weight: 400 !important;
    letter-spacing: normal !important;
    text-shadow: 1px 1px 2px #111 !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    /* Override plugins.css default styles */
    border-radius: 0 !important;
}

.timeline .swiper-container .swiper-pagination-bullet-active,
.timeline .swiper-pagination-bullet-active {
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    background: transparent !important;
}

.timeline .swiper-container .swiper-pagination-bullet-active::before,
.timeline .swiper-pagination-bullet-active::before {
    -webkit-transform: scale(1) !important;
       -moz-transform: scale(1) !important;
        -ms-transform: scale(1) !important;
         -o-transform: scale(1) !important;
            transform: scale(1) !important;
}

/* Section titles RTL positioning */
/* Mirror section title spacing to match EN visual balance */
html[dir="rtl"] .section-title-vertical {
    left: auto;
    right: 35px;
}

/* In RTL, titles marked right-side should sit on the opposite edge to mirror EN */
html[dir="rtl"] .section-title-vertical.right-side {
    right: auto;
    left: 45px;
}

/* Mirror the decorative line spacing to the other side in RTL */
html[dir="rtl"] .section-title-vertical:after {
    margin: 20px 12px 0 0; /* was margin-left in EN; use margin-right in RTL */
}

/* Timeline content RTL positioning - Mirror of EN thedive template */
.timeline .swiper-slide-content {
    position: absolute;
    width: 400px;
    top: 50%;
    right: auto;
    left: 23%;
    text-align: right;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    font-style: normal;
    font-weight: 400;
    color: #fff;
    text-shadow: 1px 1px 2px #111;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
       -moz-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    -webkit-transform: translateY(-50%);
       -moz-transform: translateY(-50%);
        -ms-transform: translateY(-50%);
         -o-transform: translateY(-50%);
            transform: translateY(-50%);
    z-index: 2;
}

@media only screen and (max-width: 1200px) {
    .timeline .swiper-slide-content {
        left: 25%;
    }
}

@media only screen and (max-width: 880px) {
    .timeline .swiper-slide-content {
        left: 30%;
    }
}

@media only screen and (max-width: 768px) {
    .timeline .swiper-slide-content {
        max-width: 300px;
        top: 50%;
        margin-top: -115px;
        left: 50%;
        right: auto;
        text-align: center;
        transform: translate(-50%, 0);
    }
}

/* Timeline slide overlay gradient RTL */
.timeline .swiper-slide::after {
    background: -moz-linear-gradient(left, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .1) 50%);
    background: -webkit-linear-gradient(left, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .1) 50%);
    background: linear-gradient(to right, rgba(0, 0, 0, .7) 0%, rgba(0, 0, 0, .1) 50%);
}

/* Form elements RTL */
.form-group.half {
    float: right;
}

.form-group.half:nth-child(even) {
    float: left;
}

/* Button text alignment */
.c-btn {
    text-align: center;
}

/* Social icons RTL */
.social-icons li {
    float: right;
}

/* Contact info RTL: match EN centered layout and prevent overlaps */
html[dir="rtl"] .contact-info-description { text-align: center; }
html[dir="rtl"] .contact-info-description .contact-info-text a {
    direction: ltr;
    unicode-bidi: plaintext;
    text-align: left;
    display: inline-block;
    overflow-wrap: anywhere;
    word-break: break-word;
}
/* Improve Arabic contact text readability and spacing */
html[dir="rtl"] .contact-info-text { text-transform: none; letter-spacing: normal; line-height: 1.8; display: inline-block; }
/* Center and prevent overlap of the three contact columns */
html[dir="rtl"] .contact-info-wrapper { display: flex; justify-content: center; align-items: flex-start; gap: 24px; flex-wrap: wrap; text-align: center; }
html[dir="rtl"] .contact-info-wrapper .col-sm-4 { float: none; display: inline-block; }
@media only screen and (max-width: 880px) {
  html[dir="rtl"] .contact-info-wrapper { gap: 16px; }
}
/* Center contact section content vertically/horizontally like EN */
html[dir="rtl"] .section.section-contact .container.sections,
html[dir="rtl"] .section.section-contact .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}
@media only screen and (max-width: 880px) {
    html[dir="rtl"] .section.section-contact .container.sections,
    html[dir="rtl"] .section.section-contact .container {
        min-height: auto;
        justify-content: flex-start;
    }
}

/* Newsletter form RTL */
#newsletter form {
    text-align: right;
}
/* Email inputs should type LTR even in RTL */
html[dir="rtl"] input[type="email"],
html[dir="rtl"] .subscribe-email {
    direction: ltr;
    text-align: left;
}
/* All other inputs default to RTL */
html[dir="rtl"] input:not([type="email"]),
html[dir="rtl"] select,
html[dir="rtl"] textarea { direction: rtl; text-align: right; }

/* Services accordion RTL */
.services-accordion ul li ul {
    padding-right: 20px;
    padding-left: 0;
}

/* Facts counter RTL */
.facts-counter-wrapper .col-xs-6 {
    float: right;
}

.facts-counter-wrapper .col-xs-6:nth-child(even) {
    float: left;
}

/* Works carousel RTL */
.works-page-img-carousel-text {
    text-align: right;
}

/* News carousel RTL */
.news-page-img-carousel-text {
    text-align: right;
}

/* Ensure news panels overlay above carousels only when open */
html[dir="rtl"] .news-page-img-wrapper { position: relative; z-index: 1; }
html[dir="rtl"] .panel-left-1,
html[dir="rtl"] .panel-left-2,
html[dir="rtl"] .panel-left-3,
html[dir="rtl"] .panel-left-4,
html[dir="rtl"] .panel-right { z-index: 3; }

/* Slick RTL arrow mirroring and placement */
.slick-prev,
.slick-next {
    direction: rtl;
    z-index: 2;
}
/* Keep Slick arrows inside their slider blocks in RTL */
html[dir="rtl"] .slick-left-about,
html[dir="rtl"] .slick-right-about,
html[dir="rtl"] .slick-services,
html[dir="rtl"] .office-slider {
    position: relative;
}
html[dir="rtl"] .slick-left-about .slick-prev,
html[dir="rtl"] .slick-right-about .slick-prev,
html[dir="rtl"] .slick-services .slick-prev,
html[dir="rtl"] .office-slider .slick-prev { right: 10px; left: auto; }
html[dir="rtl"] .slick-left-about .slick-next,
html[dir="rtl"] .slick-right-about .slick-next,
html[dir="rtl"] .slick-services .slick-next,
html[dir="rtl"] .office-slider .slick-next { left: 10px; right: auto; }

/* Owl RTL arrow placement */
/* Keep Owl arrows inside their carousel blocks in RTL */
html[dir="rtl"] .owl-carousel { position: relative; }
html[dir="rtl"] .owl-carousel .owl-nav { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); z-index: 2; pointer-events: none; }
html[dir="rtl"] .owl-carousel .owl-nav button { pointer-events: auto; }
html[dir="rtl"] .owl-carousel .owl-nav .owl-prev { position: absolute; right: 10px; left: auto; }
html[dir="rtl"] .owl-carousel .owl-nav .owl-next { position: absolute; left: 10px; right: auto; }
/* fine tune icon offsets */
html[dir="rtl"] .owl-prev .owl-custom { right: 0; left: auto; }
html[dir="rtl"] .owl-next .owl-custom { left: 0; right: auto; }

/* Panel positioning RTL (mirror slide-in directions) */
html[dir="rtl"] .panel-left-1,
html[dir="rtl"] .panel-left-2,
html[dir="rtl"] .panel-left-3,
html[dir="rtl"] .panel-left-4 {
    left: auto;
    right: -100%;
    pointer-events: none;
}
html[dir="rtl"] .panel-left-1.open,
html[dir="rtl"] .panel-left-2.open,
html[dir="rtl"] .panel-left-3.open,
html[dir="rtl"] .panel-left-4.open {
    right: 0;
    pointer-events: auto;
}
html[dir="rtl"] .panel-left-1.close,
html[dir="rtl"] .panel-left-2.close,
html[dir="rtl"] .panel-left-3.close,
html[dir="rtl"] .panel-left-4.close {
    right: -100%;
    pointer-events: none;
}

html[dir="rtl"] .panel-right {
    right: auto;
    left: -100%;
    pointer-events: none;
}
html[dir="rtl"] .panel-right.open {
    left: 0;
    pointer-events: auto;
}
html[dir="rtl"] .panel-right.close {
    left: -100%;
    pointer-events: none;
}

/* About content RTL */
.about-content-inner {
    text-align: right;
}

/* Skills bar RTL */
.skillbar-title {
    float: right;
}

.skill-bar-percent {
    float: left;
}

/* Leasing form RTL */
.leasing-form .form-group {
    text-align: right;
}

/* Mobile responsive RTL adjustments */
/* Logo and hamburger swap in RTL */
html[dir="rtl"] .logo { left: auto; right: 10px; }
/* Mirror hamburger spacing from EN: 50/35/25px from edge and center with logo */
html[dir="rtl"] .main-menu { 
    right: auto; 
    left: 50px; 
    top: 97.5px; /* Centered with logo (logo center at 110px, hamburger center at 110px) */
}
@media only screen and (max-width: 880px) {
  html[dir="rtl"] .main-menu { 
      left: 35px; 
      top: 82.5px; /* Centered with logo and language button */
  }
}
@media only screen and (max-width: 640px) {
  html[dir="rtl"] .main-menu { 
      left: 25px; 
      top: 72.5px; /* Centered with logo and language button */
  }
}
/* Language switch button in AR (swap side with EN) */
/* Language switch aligned/sized like hamburger, to the right of it in AR and centered with logo */
html[dir="rtl"] .lang-switch {
    position: fixed;
    top: 97.5px; /* Centered with logo (logo center at 110px, button center at 110px) */
    left: calc(50px + 40px); /* to the right of hamburger (which is at left in AR) */
    right: auto;
    z-index: 99999;
    display: inline-block;
    width: 35px; /* Same size as hamburger menu */
    height: 25px; /* Same size as hamburger menu */
    line-height: 25px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    color: #000;
    background: #fff;
    border: 2px solid #000;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
@media only screen and (max-width: 880px) {
  html[dir="rtl"] .lang-switch { top: 82.5px; left: calc(35px + 30px); height: 25px; line-height: 25px; width: 35px; }
}
@media only screen and (max-width: 640px) {
  html[dir="rtl"] .lang-switch { top: 72.5px; left: calc(25px + 20px); }
}

/* Hover effect for Arabic language switch */
html[dir="rtl"] .lang-switch:hover { 
    background: #000; 
    color: #fff; 
    border-color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
@media only screen and (max-width: 880px) {
  html[dir="rtl"] .logo { left: auto; right: 10px; z-index: 99999; }
}

/* Ensure logo background URLs resolve relative to AR */
/* Always show the light logo in AR for maximum contrast */
html[dir="rtl"] .logo .logo-img:before { 
    background-image: url(../../img/logo-light.png) !important; 
    z-index: 99999;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}
html[dir="rtl"] .logo .logo-img-dark:before { 
    background-image: url(../../img/logo-dark.png) !important; 
    z-index: 99999;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}
html[dir="rtl"] .logo-img,
html[dir="rtl"] .logo-img-dark {
    z-index: 99999;
    position: relative;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Ensure fadeIn elements are visible in RTL */
html[dir="rtl"] .fadeIn-element {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

/* Ensure logo is visible in RTL */
html[dir="rtl"] .logo,
html[dir="rtl"] .logo-img,
html[dir="rtl"] .logo-img-dark {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    z-index: 99999 !important;
}

html[dir="rtl"] .logo .logo-img:before,
html[dir="rtl"] .logo .logo-img-dark:before {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    z-index: 99999 !important;
}
@media only screen and (max-width: 768px) {
    .brackets li {
        float: none;
        display: block;
        text-align: center;
    }
    
    .brackets li.last {
        float: none;
    }
    
    .form-group.half,
    .form-group.half:nth-child(even) {
        float: none;
        width: 100%;
    }
}