/* ============================================
   Mobile RTL Emergency Fixes - Load After app.css
   ============================================ */

/* Critical Mobile Fixes - ONLY FOR MOBILE */
@media (max-width: 991.98px) {
    /* Force proper width ON MOBILE ONLY */
    html, body {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* Container stays normal on mobile */
    .container {
        max-width: 100% !important;
        padding-right: 15px !important;
        padding-left: 15px !important;
    }

    .container-fluid {
        padding-right: 15px !important;
        padding-left: 15px !important;
    }

    /* RTL Navigation */
    [dir="rtl"] .navbar-collapse {
        direction: rtl !important;
        text-align: right !important;
    }

    [dir="rtl"] .navbar-nav {
        width: 100% !important;
    }

    [dir="rtl"] .nav-item {
        width: 100% !important;
        text-align: right !important;
    }

    [dir="rtl"] .nav-link {
        width: 100% !important;
        text-align: right !important;
        display: block !important;
    }

    /* Hero Section */
    [dir="rtl"] .hero-content-wrapper {
        text-align: center !important;
        width: 100% !important;
    }

    [dir="rtl"] .hero-buttons {
        width: 100% !important;
        padding: 0 1rem !important;
    }

    [dir="rtl"] .btn-primary-modern,
    [dir="rtl"] .btn-outline-modern {
        width: 100% !important;
        text-align: center !important;
    }

    /* About Section */
    [dir="rtl"] .about-text {
        text-align: right !important;
        direction: rtl !important;
        width: 100% !important;
    }

    /* Menu Section */
    [dir="rtl"] .menu-card-body {
        text-align: right !important;
        direction: rtl !important;
    }

    [dir="rtl"] .menu-item-name,
    [dir="rtl"] .menu-item-description,
    [dir="rtl"] .menu-item-price {
        text-align: right !important;
    }

    /* Contact Form */
    [dir="rtl"] .contact-form input,
    [dir="rtl"] .contact-form textarea {
        text-align: right !important;
        direction: rtl !important;
    }

    /* Footer */
    [dir="rtl"] .footer-brand,
    [dir="rtl"] .footer-text,
    [dir="rtl"] .footer-title,
    [dir="rtl"] .footer-heading {
        text-align: right !important;
    }
}

@media (max-width: 768px) {
    /* Small Mobile Critical Fixes */
    [dir="rtl"] .hero-title {
        font-size: 2rem !important;
        line-height: 1.4 !important;
    }

    [dir="rtl"] .hero-description {
        font-size: 0.875rem !important;
        line-height: 1.7 !important;
        padding: 0 0.5rem !important;
    }

    [dir="rtl"] .section-title {
        font-size: 1.75rem !important;
        line-height: 1.4 !important;
    }

    /* Prevent text overflow */
    [dir="rtl"] * {
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
}

/* Universal RTL Fixes */
[dir="rtl"] {
    direction: rtl !important;
}

[dir="rtl"] * {
    font-family: 'Cairo', sans-serif !important;
}

/* Ensure buttons are centered */
[dir="rtl"] .btn {
    text-align: center !important;
}

[dir="rtl"] .btn i {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

/* Fix form placeholders */
[dir="rtl"] input::placeholder,
[dir="rtl"] textarea::placeholder {
    text-align: right !important;
    direction: rtl !important;
}

/* Fix grid overflow */
@media (max-width: 991.98px) {
    [dir="rtl"] .row {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    [dir="rtl"] .col,
    [dir="rtl"] [class*="col-"] {
        padding-right: 12px !important;
        padding-left: 12px !important;
    }
}
