/* ===================================
   RTL Overrides for HavvaHub Arabic
   =================================== */

/* Language Switcher */
.lang-switch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    margin-right: 15px;
    transition: all 0.3s ease;
}

.lang-switch span {
    margin-bottom: -5px;
}

.lang-switch:hover {
    background: #fff;
    color: #000;
    border-color: #fff;
}

[dir="rtl"] .lang-switch {
    margin-right: 0;
    margin-left: 15px;
}

/* Skip Link - Visually Hidden but Keyboard Accessible */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    font-family: var(--font-family-arabic-body);
}

.skip-link:focus {
    top: 6px;
}

/* RTL Variables */
:root[dir="rtl"] {
    --text-direction: rtl;
    --float-start: right;
    --float-end: left;
    --margin-start: margin-right;
    --margin-end: margin-left;
    --padding-start: padding-right;
    --padding-end: padding-left;
    --border-start: border-right;
    --border-end: border-left;
    --text-align-start: right;
    --text-align-end: left;
    
    /* Arabic Font Stack */
    --font-family-arabic-primary: 'Cairo', 'Tajawal', 'Almarai', sans-serif;
    --font-family-arabic-heading: 'Cairo', 'Tajawal', sans-serif;
    --font-family-arabic-body: 'Tajawal', 'Almarai', 'Cairo', sans-serif;
}

/* Body and Base RTL */

/* RTL Global Styles */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
    overflow-x: hidden;
}

/* About section logo size */
[dir="rtl"] .services-sa .logo img {
    width: 180px !important;
    max-width: 180px !important;
}

/* Container overflow fix - keep original max-width */
[dir="rtl"] .container {
    overflow-x: hidden;
}

/* Hero section overflow fix */
[dir="rtl"] .header-sa {
    overflow-x: hidden;
}

/* Fix any absolute positioned elements that might overflow */
[dir="rtl"] .imgs,
[dir="rtl"] .cube {
    overflow: hidden;
}

/* Arabic Typography - exclude icon elements */
[dir="rtl"] h1, 
[dir="rtl"] h2, 
[dir="rtl"] h3, 
[dir="rtl"] h4, 
[dir="rtl"] h5, 
[dir="rtl"] h6 {
    font-family: var(--font-family-arabic-heading);
    font-weight: 700;
}

[dir="rtl"] p,
[dir="rtl"] li,
[dir="rtl"] a,
[dir="rtl"] span,
[dir="rtl"] .butn span,
[dir="rtl"] .nav-link,
[dir="rtl"] .link span {
    font-family: var(--font-family-arabic-body);
}

/* CRITICAL: Icon font overrides - MUST come AFTER text rules */
html[dir="rtl"] [class*="pe-7s"] {
    font-family: 'Pe-icon-7-stroke' !important;
}

html[dir="rtl"] [class*="ti-"] {
    font-family: 'themify' !important;
}

html[dir="rtl"] [class*="fa-"],
html[dir="rtl"] .fa-brands,
html[dir="rtl"] .fab {
    font-family: 'Font Awesome 6 Brands', 'Font Awesome 5 Brands' !important;
}

html[dir="rtl"] .fa-solid,
html[dir="rtl"] .fas,
html[dir="rtl"] .far {
    font-family: 'Font Awesome 6 Free' !important;
}

/* Arabic Typography Adjustments */
[dir="rtl"] .caption h1 {
    font-family: var(--font-family-arabic-heading);
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: 0;
}

[dir="rtl"] .sec-head h4 {
    font-family: var(--font-family-arabic-heading);
    font-weight: 700;
}

[dir="rtl"] .sec-head h6 {
    font-family: var(--font-family-arabic-body);
    font-weight: 600;
}

[dir="rtl"] .item h6 {
    font-family: var(--font-family-arabic-heading);
    font-weight: 700;
}

[dir="rtl"] .butn span:not(.icon):not([class*="pe-7s"]):not([class*="ti-"]):not([class*="fa-"]) {
    font-family: var(--font-family-arabic-body);
    font-weight: 600;
}

/* Navigation RTL Typography */
[dir="rtl"] .navbar-nav .nav-link {
    font-family: var(--font-family-arabic-body);
    font-weight: 500;
}

[dir="rtl"] .main-menu .link span:not(.icon):not([class*="pe-7s"]):not([class*="ti-"]):not([class*="fa-"]) {
    font-family: var(--font-family-arabic-heading);
    font-weight: 700;
}

/* Footer RTL Typography */
[dir="rtl"] .footer-sa h4 {
    font-family: var(--font-family-arabic-heading);
    font-weight: 700;
}

[dir="rtl"] .footer-sa .links a {
    font-family: var(--font-family-arabic-body);
    font-weight: 500;
}

/* Button RTL - Icon positioning */
[dir="rtl"] .butn .icon.ml-10 {
    margin-left: 0 !important;
    margin-right: 10px !important;
}

[dir="rtl"] .butn .icon.mr-10 {
    margin-right: 0 !important;
    margin-left: 10px !important;
}

/* Flip icons for RTL buttons */
[dir="rtl"] .butn .pe-7s-play {
    transform: scaleX(-1);
}

[dir="rtl"] .butn .pe-7s-angle-left,
[dir="rtl"] .butn .pe-7s-angle-right {
    transform: scaleX(1);
}

/* Navigation RTL Overrides */
[dir="rtl"] .navbar .logo {
    margin-right: 0 !important;
    margin-left: 0;
}

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

[dir="rtl"] .topnav .butn {
    margin-left: 15px;
}

[dir="rtl"] .topnav .menu-icon {
    margin-right: 0;
    margin-left: 0;
}

[dir="rtl"] .navbar-nav {
    direction: rtl;
}

[dir="rtl"] .navbar-nav .nav-item {
    float: right;
}

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

[dir="rtl"] .menu-icon {
    order: -1;
    margin-right: 0 !important;
    margin-left: auto !important;
}

/* Hamburger Menu RTL */
[dir="rtl"] .hamenu {
    left: auto !important;
    right: -100%;
}

[dir="rtl"] .hamenu.open {
    right: 0 !important;
    left: auto !important;
}

[dir="rtl"] .hamenu .menu-links {
    order: 2;
}

[dir="rtl"] .hamenu .cont-info {
    order: 1;
}

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

/* Header Section RTL */
[dir="rtl"] .header-sa .caption {
    text-align: right;
}

[dir="rtl"] .header-sa .imgs {
    text-align: left;
}

/* Fix Absolute Positioning for RTL */
[dir="rtl"] .header-sa .background {
    /* Keep background positioning consistent */
    left: 0;
    right: 0;
}

/* Service Cards RTL */
[dir="rtl"] .services-sa .item .cont {
    text-align: right;
}

[dir="rtl"] .services-sa .item .cont .d-flex {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

[dir="rtl"] .services-sa .item .cont .d-flex > div:first-child {
    text-align: right;
}

[dir="rtl"] .services-sa .item .cont .d-flex > div:first-child h6 {
    text-align: right;
}

[dir="rtl"] .services-sa .item .cont .mr-auto {
    margin-right: 0 !important;
    margin-left: 15px !important;
}

[dir="rtl"] .services-sa .item .img {
    text-align: center;
}

[dir="rtl"] .services-sa .row {
    direction: rtl;
}

[dir="rtl"] .services-sa .col-lg-4:first-child {
    order: 3;
}

[dir="rtl"] .services-sa .col-lg-4:nth-child(2) {
    order: 2;
}

[dir="rtl"] .services-sa .col-lg-4:last-child {
    order: 1;
}

/* Media Section RTL */
[dir="rtl"] .work-card .sec-head {
    text-align: right;
}

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

[dir="rtl"] .work-card .row {
    direction: rtl;
}

[dir="rtl"] .work-card .col-lg-4:first-child {
    order: 3;
}

[dir="rtl"] .work-card .col-lg-4:nth-child(2) {
    order: 2;
}

[dir="rtl"] .work-card .col-lg-4:last-child {
    order: 1;
}

/* Contact Section RTL */
[dir="rtl"] .contact-sa .info {
    text-align: right;
}

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

/* Fix Bootstrap Offsets for RTL */
[dir="rtl"] .offset-lg-1 {
    margin-right: 8.333333%;
    margin-left: 0;
}

[dir="rtl"] .offset-lg-5 {
    margin-right: 41.666667%;
    margin-left: 0;
}

/* Footer RTL */
[dir="rtl"] .footer-sa .sec-head .row {
    flex-direction: row-reverse;
}

[dir="rtl"] .footer-sa .contact-info .row {
    flex-direction: row-reverse;
}

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

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

/* Section Headers RTL */
[dir="rtl"] .sec-head {
    text-align: right;
}

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

/* Button RTL Overrides */
[dir="rtl"] .butn .d-flex {
    flex-direction: row-reverse;
}

[dir="rtl"] .butn .icon.ml-10 {
    margin-left: 0 !important;
    margin-right: 10px;
}

[dir="rtl"] .butn .icon.mr-10 {
    margin-right: 0 !important;
    margin-left: 10px;
}

/* Arrow Icon Direction Fixes */
[dir="rtl"] .butn .icon img,
[dir="rtl"] .pe-7s-angle-left,
[dir="rtl"] .pe-7s-angle-right {
    transform: scaleX(-1);
}

[dir="rtl"] .pe-7s-play {
    /* Keep play button pointing right as it's universal */
    transform: none;
}

/* Loading Animation RTL */
[dir="rtl"] .loader-wrap-heading {
    direction: ltr; /* Keep loading animation LTR for visual effect */
}

/* Progress Scroll RTL */
[dir="rtl"] .progress-wrap {
    left: 30px;
    right: auto;
}

[dir="rtl"] .progress-wrap:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Cursor RTL */
[dir="rtl"] .cursor {
    direction: ltr; /* Keep cursor behavior consistent */
}

/* Text Alignment RTL */
[dir="rtl"] .text-center {
    text-align: center !important;
}

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

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

/* Margin and Padding RTL Overrides */
[dir="rtl"] .ml-10 {
    margin-left: 0 !important;
    margin-right: 10px !important;
}

[dir="rtl"] .mr-10 {
    margin-right: 0 !important;
    margin-left: 10px !important;
}

[dir="rtl"] .ml-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

[dir="rtl"] .mr-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

/* Flex Direction RTL - More specific selectors */
[dir="rtl"] .navbar .topnav,
[dir="rtl"] .header-sa .row,
[dir="rtl"] .services-sa .row,
[dir="rtl"] .work-card .row,
[dir="rtl"] .contact-sa .row,
[dir="rtl"] .footer-sa .sec-head .row,
[dir="rtl"] .footer-sa .contact-info .row {
    flex-direction: row-reverse;
}

/* Remove overly broad flex override - let component-specific rules handle it */

/* Grid System RTL */
[dir="rtl"] .row {
    direction: rtl;
}

[dir="rtl"] .col-lg-6:first-child,
[dir="rtl"] .col-lg-5:first-child {
    order: 2;
}

[dir="rtl"] .col-lg-6:last-child,
[dir="rtl"] .col-lg-7:last-child {
    order: 1;
}

/* Social Icons RTL */
[dir="rtl"] .social-icon {
    direction: ltr; /* Keep social icons LTR for consistency */
}

/* Video and Media RTL */
[dir="rtl"] video {
    direction: ltr; /* Keep video controls LTR */
}

[dir="rtl"] .safety-thumb {
    direction: ltr;
}

/* Links RTL */
[dir="rtl"] a {
    unicode-bidi: plaintext;
}

/* Form Elements RTL */
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
    text-align: right;
    direction: rtl;
}

/* Responsive RTL Overrides */
@media (max-width: 768px) {
    [dir="rtl"] .navbar .logo {
        margin-left: 0;
        margin-right: auto;
    }
    
    [dir="rtl"] .topnav {
        flex-direction: row;
    }
    
    [dir="rtl"] .header-sa .row {
        flex-direction: column-reverse;
    }
    
    [dir="rtl"] .services-sa .row {
        direction: rtl;
    }
}

@media (max-width: 576px) {
    [dir="rtl"] .sec-head .row {
        flex-direction: column;
    }
    
    [dir="rtl"] .footer-sa .sec-head .row {
        flex-direction: column;
    }
}

/* Print RTL */
@media print {
    [dir="rtl"] {
        direction: rtl;
    }
    
    [dir="rtl"] body {
        direction: rtl;
        text-align: right;
    }
}

/* ===================================
   RTL Mobile Responsiveness
   =================================== */

/* Global overflow fix for mobile */
@media (max-width: 991px) {
    html[dir="rtl"],
    html[dir="rtl"] body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    [dir="rtl"] * {
        max-width: 100vw;
    }
    
    [dir="rtl"] .container {
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Mobile RTL Fixes */
@media (max-width: 991px) {
    /* 1. Fix navbar - Order: Burger | EN | Talk to us | Logo (left to right) */
    [dir="rtl"] .navbar {
        display: flex;
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
    }
    
    [dir="rtl"] .navbar .logo {
        order: 4;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    
    [dir="rtl"] .navbar .topnav {
        order: 1;
        flex-direction: row !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }
    
    [dir="rtl"] .topnav .menu-icon {
        order: 1;
    }
    
    [dir="rtl"] .topnav .lang-switch {
        order: 2;
        margin-left: 10px !important;
        margin-right: 10px !important;
    }
    
    [dir="rtl"] .topnav .butn {
        order: 3;
    }
}

@media (max-width: 768px) {
    [dir="rtl"] .navbar .logo {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
    
    /* Fix overflow issues */
    [dir="rtl"] .header-sa {
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }
    
    [dir="rtl"] .header-sa .container {
        overflow: visible !important;
        padding: 0 15px;
    }
    
    /* 2. Hero section - stack vertically */
    [dir="rtl"] .header-sa .row {
        flex-direction: column !important;
        overflow: visible !important;
    }
    
    [dir="rtl"] .header-sa .row > .col-lg-6:first-child {
        order: 1 !important;
        width: 100% !important;
    }
    
    [dir="rtl"] .header-sa .row > .col-lg-6:last-child {
        order: 2 !important;
        width: 100% !important;
        margin-top: 40px;
    }
    
    [dir="rtl"] .header-sa .caption {
        text-align: center;
        padding: 0 15px;
    }
    
    [dir="rtl"] .header-sa .caption h1 {
        font-size: 32px !important;
        line-height: 1.3 !important;
        text-align: center;
    }
    
    [dir="rtl"] .header-sa .caption .row {
        justify-content: center !important;
    }
    
    [dir="rtl"] .header-sa .caption .text {
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    [dir="rtl"] .header-sa .caption .text p {
        text-align: center !important;
        padding: 0 10px;
    }
    
    [dir="rtl"] .header-sa .caption .row {
        width: 100% !important;
        margin: 0 !important;
        justify-content: center !important;
    }
    
    [dir="rtl"] .header-sa .caption .row .col-lg-8 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    
    /* 3. Fix italic text and plane - show fully */
    [dir="rtl"] .header-sa .imgs {
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        overflow: visible !important;
        width: 100% !important;
        padding: 0 15px;
    }
    
    [dir="rtl"] .header-sa .imgs p {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        text-align: center !important;
        margin-bottom: 30px !important;
        padding: 0 !important;
        font-size: 16px !important;
    }
    
    [dir="rtl"] .header-sa .imgs .cube {
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        display: flex;
        justify-content: center;
    }
    
    [dir="rtl"] .header-sa .imgs .cube img {
        max-width: 100% !important;
        width: auto !important;
        height: auto !important;
        transform: scaleX(-1) !important;
    }
    
    [dir="rtl"] .header-sa .imgs img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* 4. Card titles - all content far right for RTL */
    [dir="rtl"] .services-sa .item .cont {
        text-align: right !important;
    }
    
    [dir="rtl"] .services-sa .item .cont h6 {
        text-align: right !important;
    }
    
    [dir="rtl"] .services-sa .item .cont .d-flex {
        flex-direction: row-reverse !important;
        justify-content: flex-end !important;
        width: 100%;
    }
    
    [dir="rtl"] .services-sa .item .cont .d-flex > div:first-child {
        text-align: right !important;
    }
    
    [dir="rtl"] .services-sa .item .cont .d-flex .mr-auto {
        margin-right: 0 !important;
        margin-left: 10px !important;
    }
    
    [dir="rtl"] .services-sa .item .cont .text {
        text-align: right !important;
    }
    
    [dir="rtl"] .services-sa .item .cont .text p {
        text-align: right !important;
    }
    
    /* Video cards - play icon on far left, text on right */
    [dir="rtl"] #video1 .item > .cont .d-flex {
        flex-direction: row !important;
        justify-content: space-between !important;
        width: 100%;
    }
    
    [dir="rtl"] #video1 .item > .cont .d-flex > div:first-child {
        order: 2 !important;
    }
    
    [dir="rtl"] #video1 .item > .cont .d-flex > div:last-child {
        order: 1 !important;
        text-align: right !important;
    }
    
    [dir="rtl"] #video1 .item > .cont .d-flex h6 {
        text-align: right !important;
    }
    
    [dir="rtl"] .services-sa .row {
        direction: rtl;
        flex-direction: column;
    }
    
    [dir="rtl"] .services-sa .col-lg-4 {
        order: unset !important;
    }
    
    [dir="rtl"] .work-card .row {
        direction: rtl;
        flex-direction: column;
    }
    
    [dir="rtl"] .work-card .col-lg-4 {
        order: unset !important;
    }
    
    /* 5. Footer alignment fix */
    [dir="rtl"] .contact-sa .info {
        text-align: right;
    }
    
    [dir="rtl"] .contact-sa .sec-head h4 {
        text-align: right;
    }
    
    [dir="rtl"] .contact-sa .info p {
        text-align: right;
    }
    
    [dir="rtl"] .footer-sa .sec-head .row {
        flex-direction: column;
        text-align: right;
    }
    
    [dir="rtl"] .footer-sa .sec-head h4 {
        text-align: right;
    }
    
    [dir="rtl"] .footer-sa .contact-info .row {
        flex-direction: column;
    }
    
    [dir="rtl"] .footer-sa .contact-info .item {
        text-align: right;
    }
    
    [dir="rtl"] .footer-sa .sub-footer .row {
        flex-direction: column;
    }
    
    [dir="rtl"] .footer-sa .sub-footer .copy {
        text-align: right;
    }
    
    [dir="rtl"] .footer-sa .sub-footer .links {
        justify-content: flex-start;
        text-align: right;
    }
    
    [dir="rtl"] .progress-wrap {
        left: 15px;
        bottom: 15px;
    }
    
    /* Footer contact info - everything far right */
    [dir="rtl"] .footer-sa .contact-info {
        direction: rtl !important;
    }
    
    [dir="rtl"] .footer-sa .contact-info > .row {
        flex-direction: column !important;
        align-items: flex-end !important;
    }
    
    [dir="rtl"] .footer-sa .contact-info .col-lg-6,
    [dir="rtl"] .footer-sa .contact-info .col-lg-6.offset-lg-5 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    [dir="rtl"] .footer-sa .contact-info .col-lg-6 > .row {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    [dir="rtl"] .footer-sa .contact-info .col-md-6 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 20px;
    }
    
    [dir="rtl"] .footer-sa .contact-info .item {
        text-align: right !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
    }
    
    [dir="rtl"] .footer-sa .contact-info .item span,
    [dir="rtl"] .footer-sa .contact-info .item p {
        text-align: right !important;
    }
    
    [dir="rtl"] .footer-sa .contact-info .social-icon {
        justify-content: flex-end !important;
        width: 100% !important;
        display: flex !important;
    }
    
    [dir="rtl"] .footer-sa .contact-info .d-flex {
        justify-content: flex-end !important;
    }
    
    /* Contact section items alignment - all centered */
    [dir="rtl"] section#contact .box .row {
        flex-direction: column !important;
    }
    
    [dir="rtl"] section#contact .box .col-lg-6,
    [dir="rtl"] section#contact .box .col-lg-5 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        text-align: center !important;
    }
    
    [dir="rtl"] section#contact .box .offset-lg-1 {
        margin-left: 0 !important;
    }
    
    [dir="rtl"] section#contact .box .col-lg-5 .row {
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    [dir="rtl"] section#contact .box .col-md-12 {
        text-align: center !important;
        width: 100% !important;
    }
    
    [dir="rtl"] section#contact .box .col-md-12 span {
        display: block !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    [dir="rtl"] section#contact .box .col-md-12 h6 {
        text-align: center !important;
        width: 100% !important;
    }
    
    [dir="rtl"] section#contact .box .col-md-12 h6 a {
        display: block !important;
        text-align: center !important;
    }
    
    [dir="rtl"] section#contact .box .social-icon {
        justify-content: center !important;
        width: 100% !important;
    }
    
    [dir="rtl"] section#contact .box .info {
        text-align: center !important;
        margin-bottom: 40px;
    }
    
    [dir="rtl"] section#contact .box .info h4,
    [dir="rtl"] section#contact .box .info p {
        text-align: center !important;
    }
    
    /* First hero section - logo then jet stacked */
    [dir="rtl"] .contact-sa .box {
        padding: 40px 20px !important;
        overflow: hidden !important;
    }
    
    [dir="rtl"] .contact-sa .box .row {
        flex-direction: column !important;
        overflow: hidden !important;
    }
    
    [dir="rtl"] .contact-sa .box .row > .col-lg-6:first-child {
        order: 1 !important;
        text-align: center !important;
        margin-bottom: 30px;
        width: 100% !important;
    }
    
    [dir="rtl"] .contact-sa .box .row > .col-lg-6:last-child {
        order: 2 !important;
        text-align: center !important;
        width: 100% !important;
    }
    
    [dir="rtl"] .contact-sa .box .row .col-lg-6 a {
        margin-right: 0 !important;
        display: block;
        text-align: center;
    }
    
    [dir="rtl"] .contact-sa .box .row .col-lg-6 img {
        margin: 0 auto;
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Press release section mobile fix */
    [dir="rtl"] .sec-head .row {
        flex-direction: column !important;
    }
    
    [dir="rtl"] .sec-head .row .col-lg-5,
    [dir="rtl"] .sec-head .row .col-lg-7 {
        width: 100% !important;
        text-align: right;
    }
    
    [dir="rtl"] .sec-head .row .col-lg-5 {
        margin-bottom: 20px;
        order: 1 !important;
    }
    
    [dir="rtl"] .sec-head .row .col-lg-7 {
        order: 2 !important;
    }
    
    /* About section - title/logo first, then content */
    [dir="rtl"] .services-sa .sec-head .row {
        flex-direction: column !important;
    }
    
    [dir="rtl"] .services-sa .sec-head .row .col-lg-5 {
        order: 1 !important;
        margin-bottom: 30px;
    }
    
    [dir="rtl"] .services-sa .sec-head .row .col-lg-7 {
        order: 2 !important;
    }
    
    /* About section logo smaller on mobile */
    [dir="rtl"] .services-sa .sec-head .col-lg-5 img,
    [dir="rtl"] .services-sa .about-logo {
        width: 120px !important;
        max-width: 120px !important;
    }
    
    /* About section content centered on mobile */
    [dir="rtl"] .services-sa .sec-head .col-lg-5,
    [dir="rtl"] .services-sa .sec-head .col-lg-7 {
        text-align: center !important;
    }
    
    [dir="rtl"] .services-sa .sec-head .col-lg-7 h4,
    [dir="rtl"] .services-sa .sec-head .col-lg-7 p {
        text-align: center !important;
    }
    
    [dir="rtl"] .services-sa .sec-head .col-lg-7 .butn {
        display: inline-flex;
        margin: 0 auto;
    }
}

/* Small mobile RTL Fixes */
@media (max-width: 576px) {
    [dir="rtl"] .navbar .topnav .butn {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    [dir="rtl"] .navbar .topnav .butn .icon {
        display: none;
    }
    
    /* Hero heading smaller on small screens */
    [dir="rtl"] .header-sa .caption h1 {
        font-size: 26px !important;
        line-height: 1.4 !important;
    }
    
    /* Italic text smaller */
    [dir="rtl"] .header-sa .imgs p {
        font-size: 14px !important;
        line-height: 1.6 !important;
    }
    
    /* Card title and icon alignment - both on far right */
    [dir="rtl"] .services-sa .item .cont .d-flex {
        flex-direction: row-reverse !important;
        justify-content: flex-end !important;
        width: 100%;
    }
    
    [dir="rtl"] .services-sa .item .cont .d-flex h6 {
        text-align: right !important;
        margin-right: 0 !important;
        font-size: 18px !important;
    }
    
    [dir="rtl"] .services-sa .item .cont .d-flex .icon {
        margin-left: 10px !important;
        margin-right: 0 !important;
    }
    
    /* Footer links */
    [dir="rtl"] .footer-sa .sub-footer .links {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* First box section smaller padding */
    [dir="rtl"] .contact-sa .box {
        padding: 30px 15px !important;
    }
    
    [dir="rtl"] .contact-sa .box .logo-shine-img {
        width: 250px !important;
    }
}

/* Tablet RTL Fixes */
@media (min-width: 769px) and (max-width: 1024px) {
    [dir="rtl"] .services-sa .row {
        direction: rtl;
    }
    
    [dir="rtl"] .work-card .row {
        direction: rtl;
    }
}

/* ===================================
   RTL Browser Compatibility
   =================================== */

/* Safari RTL Fixes */
@supports (-webkit-appearance: none) {
    [dir="rtl"] body {
        -webkit-font-smoothing: antialiased;
    }
}

/* Firefox RTL Fixes */
@-moz-document url-prefix() {
    [dir="rtl"] .loader-wrap-heading {
        direction: ltr;
        unicode-bidi: bidi-override;
    }
}
