/* RTL Arabic Styles - Extends style.css */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* General RTL Overrides */
html[dir="rtl"] body {
    font-family: 'Tajawal', 'Segoe UI', sans-serif;
    text-align: right;
}

/* RTL Header Adjustments */
body.rtl .header-container {
    flex-direction: row-reverse !important;
    justify-content: space-between !important;
    padding: 0.5rem 1rem;
}

/* Override any conflicting styles for the logo in RTL */
body.rtl .logo {
    order: 1 !important;
    margin-left: 0 !important;
    margin-right: 1rem !important;
    text-align: right !important;
}

body.rtl nav {
    order: 2 !important;
    margin: 0 !important;
    text-align: right !important;
}

body.rtl nav ul {
    flex-direction: row-reverse !important;
    justify-content: flex-end !important;
    margin-right: 0 !important;
    padding-right: 0 !important;
    text-align: right !important;
}

body.rtl nav ul li {
    text-align: right !important;
}

body.rtl nav ul li a {
    text-align: right !important;
}

body.rtl .header-right {
    order: 3 !important;
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

body.rtl .btn-contact {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

body.rtl .mobile-nav-toggle {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

/* RTL Mobile Navigation */
body.rtl .mobile-nav-toggle {
    display: none;
}

@media (max-width: 768px) {
    body.rtl .mobile-nav-toggle {
        display: block;
    }

    body.rtl nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: rgba(8, 109, 56, 0.95);
        padding: 2rem;
        transition: 0.3s ease-in-out;
        z-index: 1000;
    }

    body.rtl nav.active {
        right: 0;
    }

    body.rtl nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    body.rtl nav ul li {
        width: 100%;
    }

    body.rtl nav ul li a {
        display: block;
        padding: 0.5rem 0;
        font-size: 1.2rem;
    }

    body.rtl .mobile-nav-toggle.active {
        position: fixed;
        right: 1rem;
        top: 1rem;
        z-index: 1001;
    }
}

body.rtl .lang-icon {
    margin-right: 0;
    margin-left: 5px;
}

/* Hero Section RTL */
body.rtl .hero-content {
    flex-direction: row-reverse;
}

body.rtl .hero-text {
    text-align: right;
}

body.rtl .hero-text .subtitle {
    display: inline-block;
    background-color: #9bc59e;
    color: #086D38;
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-align: right;
}

body.rtl .hero-text h1 {
    text-align: right;
}

body.rtl .hero-text p {
    text-align: right;
}

body.rtl .btn-download .icon {
    display: inline-block;
}

/* Two Column Sections RTL */
body.rtl .two-col-container {
    flex-direction: row-reverse;
}

body.rtl .two-col-container.reverse {
    flex-direction: row;
}

/* Partners Section RTL */
body.rtl .partners-container {
    flex-direction: row-reverse;
}

/* Service Cards RTL */
body.rtl .service-card {
    text-align: right;
}

/* Footer RTL */
body.rtl .footer-container {
    text-align: right;
}

body.rtl .footer-info p {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
    align-items: center;
    text-align: right;
}

body.rtl .footer-info p .icon {
    margin-right: 0;
    margin-left: 10px;
    order: 1;
}

body.rtl .footer-info p span {
    order: 2;
}

/* Contact Page RTL */
body.rtl .contact-item {
    text-align: right;
}

/* RTL Styles for Arabic Pages */
/* body.rtl {  <- Remove this redundant/potentially conflicting rule 
    text-align: right;
    direction: rtl;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
} */

/* RTL Text Alignment */
body.rtl h1, body.rtl h2, body.rtl h3, body.rtl h4, body.rtl p, body.rtl li, body.rtl a {
    text-align: right;
}

/* RTL Styles for Arabic Pages */
body.rtl .hero-text {
    text-align: right;
}

body.rtl .hero-text .subtitle {
    text-align: right;
}

body.rtl .hero-text h1 {
    text-align: right;
}

body.rtl .hero-text p {
    text-align: right;
}

body.rtl .btn-download .icon {
    display: inline-block;
}

body.rtl .footer-container {
    text-align: right;
}

body.rtl .footer-links ul {
    text-align: right;
}

body.rtl .social-icons {
    justify-content: flex-start;
}

/* Header RTL adjustments */
body.rtl .header-container {
    flex-direction: row-reverse !important;
}

body.rtl nav ul {
    flex-direction: row-reverse;
}

body.rtl .btn-contact {
    margin-left: 0;
    margin-right: 20px;
}

body.rtl .mobile-nav-toggle {
    right: auto;
    left: 20px;
}

/* Language icon */
body.rtl .lang-icon:before {
    content: "🌐";
    margin-left: 5px;
    margin-right: 0;
}

/* Hero section adjustments */
body.rtl .hero-text {
    text-align: right;
}

body.rtl .hero-buttons {
    justify-content: flex-start;
}

/* Two column sections */
body.rtl .two-column {
    flex-direction: row-reverse;
}

body.rtl .col {
    text-align: right;
}

/* Lists */
body.rtl ul, body.rtl ol {
    padding-right: 20px;
    padding-left: 0;
}

/* Icons */
body.rtl .icon {
    margin-right: 0;
    margin-left: 5px;
}

/* Footer */
body.rtl .footer-container {
    flex-direction: row-reverse;
    text-align: right;
}

body.rtl .social-icons {
    justify-content: flex-start;
}

/* Content wrapper for terms and privacy pages */
body.rtl .content-wrapper {
    text-align: right;
}

body.rtl .content-wrapper h2 {
    text-align: right;
}

/* Services grid */
body.rtl .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

body.rtl .service-card {
    text-align: right;
}

/* Media Queries */
@media (max-width: 768px) {
    body.rtl .two-column {
        flex-direction: column-reverse;
    }
    
    body.rtl .footer-container {
        flex-direction: column;
    }
}

/* Fix for logo position in RTL */
body.rtl .header-container .logo {
    order: 1 !important;
    margin-left: 0 !important;
    margin-right: 1rem !important;
    align-self: flex-start !important;
}

/* Override any conflicting styles */
body.rtl .header-container {
    display: flex !important;
    flex-direction: row-reverse !important;
    justify-content: space-between !important;
    align-items: center !important;
}

/* Ensure logo is on the right in RTL */
body.rtl .logo {
    margin-right: 0 !important;
    margin-left: 1rem !important;
    order: 1 !important;
}

/* Reset any inline styles that might be causing issues */
body.rtl .header-container > * {
    order: unset !important;
}

/* Force the logo to be first in RTL */
body.rtl .header-container .logo {
    order: 1 !important;
}

/* Force the navigation to be second in RTL */
body.rtl .header-container nav {
    order: 2 !important;
}

/* Force the contact button to be third in RTL */
body.rtl .header-container .btn-contact {
    order: 3 !important;
}

/* Force the mobile toggle to be fourth in RTL */
body.rtl .header-container .mobile-nav-toggle {
    order: 4 !important;
}

/* Ensure Headings use Tajawal Font in RTL */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6 {
    font-family: 'Tajawal', 'Segoe UI', sans-serif;
} 