/**
 * GAT Insulation - RTL (Right-to-Left) Styles for Arabic
 */

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

html[dir="rtl"] body {
    font-family: 'Inter', 'Noto Sans Arabic', 'Arial', sans-serif;
    text-align: right;
}

/* Header */
html[dir="rtl"] .header .container {
    flex-direction: row-reverse;
}

/* Only apply row-reverse on desktop - mobile uses column */
@media (min-width: 769px) {
    html[dir="rtl"] .nav-list {
        flex-direction: row-reverse;
    }
}

html[dir="rtl"] .mobile-menu-btn {
    order: -1;
}

html[dir="rtl"] .lang-switcher {
    margin-left: 0;
    margin-right: auto;
}

/* Dropdown */
html[dir="rtl"] .dropdown {
    left: auto;
    right: 0;
    text-align: right;
}

html[dir="rtl"] .has-dropdown > a::after {
    margin-left: 0;
    margin-right: 6px;
}

/* Hero */
html[dir="rtl"] .hero-content {
    text-align: right;
}

html[dir="rtl"] .hero-buttons {
    justify-content: flex-start;
}

html[dir="rtl"] .hero-buttons .btn {
    margin-right: 0;
    margin-left: 15px;
}

/* Contact Bar */
html[dir="rtl"] .contact-bar-item {
    flex-direction: row-reverse;
}

html[dir="rtl"] .contact-bar-item svg {
    margin-right: 0;
    margin-left: 10px;
}

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

/* Service Cards */
html[dir="rtl"] .service-card {
    text-align: right;
}

html[dir="rtl"] .service-card-content {
    text-align: right;
}

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

html[dir="rtl"] .learn-more svg {
    margin-left: 0;
    margin-right: 8px;
    transform: rotate(180deg);
}

/* Branch Cards */
html[dir="rtl"] .branch-card-content {
    text-align: right;
}

/* About Grid */
html[dir="rtl"] .about-grid {
    direction: rtl;
}

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

/* Stats */
html[dir="rtl"] .stats-grid {
    direction: rtl;
}

/* Footer */
html[dir="rtl"] .footer-grid {
    direction: rtl;
}

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

html[dir="rtl"] .footer-col ul {
    padding-right: 0;
}

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

html[dir="rtl"] .contact-info svg {
    margin-right: 0;
    margin-left: 10px;
}

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

/* Buttons */
html[dir="rtl"] .btn svg {
    margin-left: 0;
    margin-right: 8px;
}

/* Back Link */
html[dir="rtl"] .back-link {
    flex-direction: row-reverse;
}

html[dir="rtl"] .back-link svg {
    margin-right: 0;
    margin-left: 8px;
    transform: rotate(180deg);
}

/* Service Detail */
html[dir="rtl"] .service-detail-grid {
    direction: rtl;
}

html[dir="rtl"] .service-detail-content {
    text-align: right;
}

html[dir="rtl"] .service-detail-content ul {
    margin-left: 0;
    margin-right: 20px;
}

/* Contact Form */
html[dir="rtl"] .contact-form {
    text-align: right;
}

html[dir="rtl"] .contact-form input,
html[dir="rtl"] .contact-form textarea {
    text-align: right;
}

html[dir="rtl"] .contact-form select,
html[dir="rtl"] .form-group select {
    text-align: right;
    background-position: left 16px center;
    padding-right: 16px;
    padding-left: 40px;
}

/* Gallery */
html[dir="rtl"] .gallery-grid {
    direction: rtl;
}

/* Clients Grid */
html[dir="rtl"] .clients-grid {
    direction: rtl;
}

/* Brochures */
html[dir="rtl"] .brochure-card {
    text-align: right;
}

/* Page Headers */
html[dir="rtl"] .page-header {
    text-align: center;
}

/* WhatsApp Button */
html[dir="rtl"] .whatsapp-float {
    right: auto;
    left: 30px;
    flex-direction: row-reverse;
}

html[dir="rtl"] .whatsapp-float-text {
    padding-right: 5px;
    padding-left: 0;
}

@keyframes whatsapp-slide-in-rtl {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

html[dir="rtl"] .whatsapp-float {
    animation: whatsapp-slide-in-rtl 0.5s ease-out 1s both;
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 20px;
}

.lang-btn {
    padding: 5px 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    color: #333;
}

.lang-btn.active {
    color: var(--accent-gold);
    font-weight: 600;
}

.lang-divider {
    color: #999;
    font-size: 0.8rem;
}

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

/* Scroll Indicator */
html[dir="rtl"] .scroll-indicator {
    text-align: center;
}

/* Lists */
html[dir="rtl"] ul {
    padding-right: 0;
}

html[dir="rtl"] li {
    text-align: right;
}

/* Mobile Menu */
@media (max-width: 768px) {
    html[dir="rtl"] .nav {
        right: auto !important;
        left: 0 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }

    html[dir="rtl"] .nav.active {
        transform: translateX(0) !important;
    }

    /* Ensure nav-list stays vertical on mobile */
    html[dir="rtl"] .nav-list {
        flex-direction: column;
        align-items: stretch;
        text-align: right;
    }

    html[dir="rtl"] .nav-list li {
        width: 100%;
    }

    html[dir="rtl"] .nav-list a {
        display: block;
        text-align: right;
    }

    html[dir="rtl"] .mobile-menu-btn {
        margin-left: 0;
        margin-right: auto;
    }

    html[dir="rtl"] .lang-switcher {
        position: absolute;
        right: auto;
        left: 60px;
        top: 50%;
        transform: translateY(-50%);
    }

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

/* Animations - reverse directions */
html[dir="rtl"] .animate-on-scroll.fade-left {
    transform: translateX(50px);
}

html[dir="rtl"] .animate-on-scroll.fade-right {
    transform: translateX(-50px);
}

html[dir="rtl"] .animate-on-scroll.fade-left.visible,
html[dir="rtl"] .animate-on-scroll.fade-right.visible {
    transform: translateX(0);
}