/* =====================================================
   DORRAT AL JOUDA - RTL (Right-to-Left) Stylesheet
   For Arabic Language Support
   ===================================================== */

/* Base RTL Setup */
html[dir="rtl"] {
    direction: rtl;
}

html[dir="rtl"] body {
    font-family: 'Cairo', 'Poppins', sans-serif;
    text-align: right;
}

/* =====================================================
   HEADER RTL
   ===================================================== */
html[dir="rtl"] .nav {
    flex-direction: row-reverse;
}

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

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

/* Desktop nav-menu should be visible normally for RTL */
/* Mobile menu positioning is handled in the media query below */

/* =====================================================
   HERO RTL
   ===================================================== */
html[dir="rtl"] .hero-content {
    text-align: center;
}

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

/* =====================================================
   ABOUT SECTION RTL
   ===================================================== */
html[dir="rtl"] .about-content {
    direction: rtl;
}

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

html[dir="rtl"] .about-features .feature i {
    margin-left: 10px;
    margin-right: 0;
}

/* =====================================================
   SERVICES RTL
   ===================================================== */
html[dir="rtl"] .service-card {
    text-align: center;
}

/* =====================================================
   WORKS/PORTFOLIO RTL
   ===================================================== */
html[dir="rtl"] .works-filter {
    flex-direction: row-reverse;
}

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

html[dir="rtl"] .work-view {
    right: auto;
    left: 20px;
}

/* =====================================================
   PRODUCTS RTL
   ===================================================== */
html[dir="rtl"] .product-info {
    text-align: center;
}

/* =====================================================
   CONTACT SECTION RTL
   ===================================================== */
html[dir="rtl"] .contact-content {
    direction: rtl;
}

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

html[dir="rtl"] .info-icon {
    margin-left: 20px;
    margin-right: 0;
}

html[dir="rtl"] .social-links {
    flex-direction: row-reverse;
    justify-content: flex-end;
}

/* Contact Form RTL */
html[dir="rtl"] .contact-form {
    direction: rtl;
}

html[dir="rtl"] .form-group input,
html[dir="rtl"] .form-group select,
html[dir="rtl"] .form-group textarea {
    text-align: right;
    padding-right: 20px;
    padding-left: 15px;
}

html[dir="rtl"] .form-group label {
    left: auto;
    right: 20px;
}

html[dir="rtl"] .form-group input:focus ~ label,
html[dir="rtl"] .form-group input:not(:placeholder-shown) ~ label,
html[dir="rtl"] .form-group select:focus ~ label,
html[dir="rtl"] .form-group select:valid ~ label,
html[dir="rtl"] .form-group textarea:focus ~ label,
html[dir="rtl"] .form-group textarea:not(:placeholder-shown) ~ label {
    right: 15px;
    left: auto;
}

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

html[dir="rtl"] .btn-submit i {
    margin-right: 10px;
    margin-left: 0;
    transform: scaleX(-1);
}

/* =====================================================
   FOOTER RTL
   ===================================================== */
html[dir="rtl"] .footer-content {
    direction: rtl;
}

html[dir="rtl"] .footer h4::after {
    left: auto;
    right: 0;
}

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

html[dir="rtl"] .footer-contact ul li i {
    margin-left: 12px;
    margin-right: 0;
}

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

html[dir="rtl"] .footer-links ul li a:hover,
html[dir="rtl"] .footer-services ul li a:hover {
    padding-left: 0;
    padding-right: 5px;
}

html[dir="rtl"] .footer-links ul li a::before,
html[dir="rtl"] .footer-services ul li a::before {
    content: '←';
    left: auto;
    right: -20px;
}

html[dir="rtl"] .footer-links ul li a:hover::before,
html[dir="rtl"] .footer-services ul li a:hover::before {
    left: auto;
    right: -15px;
}

/* =====================================================
   WHATSAPP & BACK TO TOP RTL - Both on left side
   ===================================================== */
html[dir="rtl"] .whatsapp-float {
    right: auto;
    left: 30px;
    bottom: 30px; /* Keep original bottom position */
}

html[dir="rtl"] .whatsapp-tooltip {
    right: auto;
    left: 70px;
}

html[dir="rtl"] .whatsapp-tooltip::after {
    right: auto;
    left: -8px;
    border-left-color: transparent;
    border-right-color: var(--primary-black);
}

html[dir="rtl"] .back-to-top {
    right: auto;
    left: 30px;
}

/* =====================================================
   BUTTONS RTL
   ===================================================== */
html[dir="rtl"] .btn {
    flex-direction: row-reverse;
}

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

/* =====================================================
   SECTION HEADERS RTL
   ===================================================== */
html[dir="rtl"] .section-header {
    text-align: center;
}

/* =====================================================
   NAVIGATION LINK UNDERLINE RTL
   ===================================================== */
html[dir="rtl"] .nav-link::after {
    left: auto;
    right: 0;
}

/* =====================================================
   STATS RTL - Plus sign handled by JavaScript
   ===================================================== */

/* =====================================================
   ANIMATIONS RTL ADJUSTMENTS
   ===================================================== */
html[dir="rtl"] [data-aos="fade-left"] {
    transform: translateX(-50px);
}

html[dir="rtl"] [data-aos="fade-left"].aos-animate {
    transform: translateX(0);
}

html[dir="rtl"] [data-aos="fade-right"] {
    transform: translateX(50px);
}

html[dir="rtl"] [data-aos="fade-right"].aos-animate {
    transform: translateX(0);
}

/* =====================================================
   RESPONSIVE RTL
   ===================================================== */

/* Tablet */
@media (max-width: 992px) {
    /* RTL Mobile Menu - opens from left */
    html[dir="rtl"] .nav-menu {
        left: -100%;
        right: auto;
        width: 280px;
        max-width: 80vw;
        text-align: right;
        padding: 80px 30px 50px;
    }

    html[dir="rtl"] .nav-menu.active {
        left: 0;
    }

    /* RTL Nav links alignment */
    html[dir="rtl"] .nav-menu .nav-link {
        text-align: right;
        width: 100%;
        display: block;
    }

    /* RTL Hamburger position */
    html[dir="rtl"] .nav-actions {
        flex-direction: row-reverse;
    }

    /* RTL Hamburger active state - position on left */
    html[dir="rtl"] .hamburger.active {
        right: auto;
        left: 20px;
    }

    html[dir="rtl"] .about-content {
        grid-template-columns: 1fr;
    }

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

/* Mobile - Large */
@media (max-width: 768px) {
    html[dir="rtl"] .footer-content {
        text-align: center;
    }

    html[dir="rtl"] .footer h4::after {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    html[dir="rtl"] .footer-social,
    html[dir="rtl"] .social-links {
        justify-content: center;
    }

    html[dir="rtl"] .footer-contact ul li {
        justify-content: center;
    }

    /* Hero buttons stack on mobile */
    html[dir="rtl"] .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    /* Trust badges stack vertically */
    html[dir="rtl"] .hero-trust-badges {
        flex-direction: column;
        align-items: center;
    }

    /* Works filter scrollable */
    html[dir="rtl"] .works-filter {
        flex-direction: row;
        justify-content: flex-start;
    }

    /* Contact cards centered */
    html[dir="rtl"] .info-card {
        flex-direction: column;
        text-align: center;
    }

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

    /* CTA features stack */
    html[dir="rtl"] .cta-features {
        flex-direction: column;
        align-items: center;
    }
}

/* Mobile */
@media (max-width: 576px) {
    html[dir="rtl"] .whatsapp-float {
        right: auto !important;
        left: 15px !important;
        bottom: 90px !important;
    }

    html[dir="rtl"] .back-to-top {
        left: 15px !important;
        right: auto !important;
        bottom: 150px !important;
    }

    html[dir="rtl"] .hero-buttons {
        flex-direction: column;
    }

    html[dir="rtl"] .contact-form {
        grid-template-columns: 1fr;
    }

    html[dir="rtl"] .btn-submit {
        width: 100%;
        justify-content: center;
    }

    /* Language switch - hide text on mobile */
    html[dir="rtl"] .lang-switch span {
        display: none;
    }
}

/* Extra small mobile */
@media (max-width: 375px) {
    html[dir="rtl"] .whatsapp-float {
        right: auto;
        left: 12px;
    }

    html[dir="rtl"] .back-to-top {
        left: 12px;
        right: auto;
    }
}

/* =====================================================
   TYPOGRAPHY 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: 'Cairo', sans-serif;
}

html[dir="rtl"] p,
html[dir="rtl"] span,
html[dir="rtl"] a,
html[dir="rtl"] li {
    font-family: 'Cairo', sans-serif;
}

/* Numbers should remain LTR */
html[dir="rtl"] .stat-number,
html[dir="rtl"] [dir="ltr"] {
    direction: ltr;
    unicode-bidi: embed;
}

/* Phone numbers and emails should be LTR */
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="email"] {
    direction: ltr;
    text-align: right;
}

/* =====================================================
   FORM SELECT ARROW RTL
   ===================================================== */
html[dir="rtl"] .form-group select {
    background-position: left 15px center;
    padding-left: 40px;
    padding-right: 20px;
}

/* =====================================================
   ICON ADJUSTMENTS RTL
   ===================================================== */
html[dir="rtl"] .fa-chevron-right::before {
    content: "\f053"; /* chevron-left */
}

html[dir="rtl"] .fa-chevron-left::before {
    content: "\f054"; /* chevron-right */
}

html[dir="rtl"] .fa-arrow-right::before {
    content: "\f060"; /* arrow-left */
}

html[dir="rtl"] .fa-arrow-left::before {
    content: "\f061"; /* arrow-right */
}
