/* BOSTAN GROUP - RTL Support for Arabic */

[dir="rtl"] {
    /* Font */
    font-family: var(--font-arabic);

    /* Text alignment */
    text-align: right;
}

[dir="rtl"] .text-left {
    text-align: right;
}

[dir="rtl"] .text-right {
    text-align: left;
}

/* Flip directional margins and paddings */
[dir="rtl"] .ml-auto {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] .mr-auto {
    margin-right: 0;
    margin-left: auto;
}

/* Navigation - Keep same layout in RTL (logo stays right, menu stays left) */
[dir="rtl"] .nav__container {
    direction: ltr;
}

[dir="rtl"] .nav__link,
[dir="rtl"] .lang-switcher__option {
    direction: rtl;
    text-align: right;
}

/* Nav Social Icons - RTL */
[dir="rtl"] .nav__social {
    margin-left: 0;
    margin-right: var(--space-4);
    padding-left: 0;
    padding-right: var(--space-4);
    border-left: none;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

[dir="rtl"] .nav--scrolled .nav__social {
    border-right-color: var(--color-gray-200);
}

/* Language switcher - move to left in RTL */
[dir="rtl"] .lang-switcher {
    margin-right: auto;
    margin-left: 0;
    order: -1;
}

/* When social icons exist, we should adjust order */
[dir="rtl"] .nav__social {
    order: -2;
    /* Move social icons to far left, before lang switcher */
    margin-right: auto;
    margin-left: var(--space-4);
}

[dir="rtl"] .lang-switcher__dropdown {
    right: auto;
    left: 0;
}

/* Buttons with icons */
[dir="rtl"] .btn svg {
    transform: scaleX(-1);
}

[dir="rtl"] .btn:hover svg {
    transform: scaleX(-1) translateX(-4px);
}

/* Cards */
[dir="rtl"] .service-card__content {
    text-align: right;
}

/* Forms */
[dir="rtl"] .form-group--floating .form-label {
    left: auto;
    right: var(--space-5);
}

[dir="rtl"] .form-select {
    background-position: left var(--space-4) center;
    padding-right: var(--space-5);
    padding-left: var(--space-12);
}

/* Reveal animations - flip direction */
[dir="rtl"] .reveal-left {
    transform: translateX(50px);
}

[dir="rtl"] .reveal-right {
    transform: translateX(-50px);
}

[dir="rtl"] .reveal-left.revealed,
[dir="rtl"] .reveal-right.revealed {
    transform: translateX(0);
}

/* Link underline */
[dir="rtl"] .link--underline::after {
    left: auto;
    right: 0;
}

/* Section header */
[dir="rtl"] .section-header {
    text-align: center;
}

/* Grid items order can be reversed if needed */
[dir="rtl"] .grid--rtl-reverse {
    direction: rtl;
}

/* Footer and horizontal lists */
[dir="rtl"] .flex-row {
    flex-direction: row-reverse;
}

/* Mobile menu */
@media (max-width: 1023px) {
    [dir="rtl"] .nav__container {
        direction: ltr;
    }

    [dir="rtl"] .nav__menu {
        direction: ltr;
        left: auto;
        right: 0;
        transform: translateX(100%);
    }

    [dir="rtl"] .nav__menu.active {
        transform: translateX(0);
    }

    [dir="rtl"] .nav__link {
        direction: rtl;
        text-align: right;
    }

    /* Social icons stay at bottom */
    [dir="rtl"] .nav__social {
        order: 10;
        margin-top: auto;
        padding: 20px 0;
        border: none;
        border-top: 1px solid #ddd;
    }

    /* Language switcher in nav actions */
    [dir="rtl"] .lang-switcher {
        direction: rtl;
    }

    [dir="rtl"] .lang-switcher__dropdown {
        right: auto;
        left: 0;
    }
}