/* Business Page RTL and Layout Fixes */

/* Force Arabic Font Support */
html[dir="rtl"] * {
    font-family: 'Tajawal', 'Amiri', 'Noto Sans Arabic', Arial, sans-serif !important;
}

/* Arabic Language Support for Business Page */
html[dir="rtl"] {

    /* About Us Section RTL Support */
    .about-us-section {
        direction: rtl;
    }

    .about-us-wrapper {
        direction: rtl;
    }

    .about-us-left {
        text-align: right !important;
        direction: rtl;
    }

    .about-us-right {
        text-align: right !important;
        direction: rtl;
    }

    /* Section Headers - Right alignment for Arabic */
    .section-header {
        text-align: right !important;
        direction: rtl !important;
        width: 100% !important;
        justify-content: flex-end !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
    }

    .section-title {
        text-align: right !important;
        direction: rtl !important;
        float: right !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    /* Statistics Grid - Center alignment for Arabic */
    .stats-grid {
        direction: rtl !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        justify-items: center !important;
    }

    .stat-card {
        text-align: center !important;
        justify-content: center !important;
        align-items: center !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .stat-number {
        text-align: center !important;
    }

    .stat-label {
        text-align: center !important;
    }

    /* Stat Bars RTL Support */
    .about-us-right {
        direction: rtl !important;
    }

    .stat-bar-item {
        direction: rtl !important;
        text-align: right !important;
    }

    .stat-bar-header {
        direction: rtl !important;
        text-align: right !important;
        justify-content: flex-end !important;
        display: flex !important;
        flex-direction: row-reverse !important;
    }

    .stat-bar-number {
        text-align: right !important;
        margin-left: 10px !important;
        margin-right: 0 !important;
    }

    .stat-bar-text {
        text-align: right !important;
    }

    /* RTL Stat Bar Lines - Reverse the bars for Arabic */
    .stat-bar-line {
        transform-origin: right center !important;
        direction: rtl !important;
    }

    .stat-bar-line::before {
        left: auto !important;
        right: 0 !important;
    }

    .stat-bar-line-full {
        direction: rtl !important;
        transform-origin: right center !important;
    }

    .stat-bar-line-full::before {
        left: auto !important;
        right: 0 !important;
    }

    .stat-bar-line-medium {
        direction: rtl !important;
        transform-origin: right center !important;
    }

    .stat-bar-line-medium::before {
        left: auto !important;
        right: 0 !important;
    }

    .stat-bar-line-small {
        direction: rtl !important;
        transform-origin: right center !important;
    }

    .stat-bar-line-small::before {
        left: auto !important;
        right: 0 !important;
    }

    /* Global Presence Section RTL */
    .global-presence-section {
        direction: rtl !important;
    }

    .global-presence-wrapper {
        direction: rtl !important;
        text-align: right !important;
    }

    .global-presence-left {
        text-align: right !important;
        direction: rtl !important;
    }

    .global-description {
        text-align: right !important;
        direction: rtl !important;
    }

    .global-stats-grid {
        direction: rtl !important;
        justify-content: center !important;
    }

    .global-stat-item {
        text-align: center !important;
        direction: rtl !important;
    }

    .global-stat-number {
        text-align: center !important;
    }

    .global-stat-text h4 {
        text-align: center !important;
    }

    /* News Section RTL */
    .news-section {
        direction: rtl !important;
    }

    .news-grid {
        direction: rtl !important;
    }

    .news-card {
        text-align: right !important;
        direction: rtl !important;
    }

    .news-content {
        text-align: right !important;
        direction: rtl !important;
    }

    /* Contact Form RTL */
    .contact-section {
        direction: rtl !important;
    }

    .contact-form {
        direction: rtl !important;
    }

    .form-group {
        text-align: right !important;
    }

    .form-group label {
        text-align: right !important;
        float: right !important;
    }

    .form-group input,
    .form-group textarea {
        text-align: right !important;
        direction: rtl !important;
    }

    /* Global Map Improvements for Arabic */
    .global-map-container {
        width: 90% !important;
        max-width: 400px !important;
        margin: 0 auto !important;
    }

    .global-map {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Global Map Container Size Improvements for All Languages */
.global-map-container {
    width: 85% !important;
    max-width: 420px !important;
    margin: 0 auto !important;
}

.global-map {
    width: 110% !important;
    max-width: 110% !important;
    margin-left: -25px !important;
}

/* Mobile Global Map Improvements */
@media (max-width: 768px) {
    .global-map-container {
        width: 75% !important;
        max-width: 300px !important;
        margin: 0 auto !important;
    }

    .global-map {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Arabic specific mobile improvements */
    html[dir="rtl"] .global-map-container {
        width: 70% !important;
        max-width: 280px !important;
    }
}

@media (max-width: 480px) {
    .global-map-container {
        width: 70% !important;
        max-width: 250px !important;
    }

    .global-map {
        width: 95% !important;
        max-width: 95% !important;
    }

    /* Arabic specific small mobile improvements */
    html[dir="rtl"] .global-map-container {
        width: 65% !important;
        max-width: 230px !important;
    }
}

/* Tablet Global Map Improvements */
@media (max-width: 992px) and (min-width: 769px) {
    .global-map-container {
        width: 80% !important;
        max-width: 350px !important;
    }

    .global-map {
        width: 105% !important;
        margin-left: -15px !important;
    }

    /* Arabic specific tablet improvements */
    html[dir="rtl"] .global-map-container {
        width: 75% !important;
        max-width: 330px !important;
    }

    html[dir="rtl"] .global-map {
        margin-left: 0 !important;
    }
}

/* Large Screen Global Map Improvements */
@media (min-width: 1200px) {
    .global-map-container {
        width: 80% !important;
        max-width: 450px !important;
    }

    .global-map {
        width: 115% !important;
        margin-left: -30px !important;
    }

    /* Arabic specific large screen improvements */
    html[dir="rtl"] .global-map-container {
        width: 75% !important;
        max-width: 420px !important;
    }

    html[dir="rtl"] .global-map {
        margin-left: 0 !important;
    }
}

/* Statistics Cards Center Alignment Fix */
.stats-grid {
    display: grid;
    justify-items: center;
    align-items: center;
}

.stat-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Arabic specific stats alignment */
html[dir="rtl"] .stats-grid {
    justify-items: center;
    text-align: center;
}

html[dir="rtl"] .stat-card {
    text-align: center;
    justify-content: center;
    align-items: center;
}

html[dir="rtl"] .stat-number,
html[dir="rtl"] .stat-label {
    text-align: center;
}

/* Section Title Right Alignment for Arabic */
html[dir="rtl"] .about-us-section .section-header {
    text-align: right;
    justify-content: flex-end;
    margin-left: auto;
    margin-right: 0;
    width: 100%;
}

html[dir="rtl"] .about-us-section .section-title {
    text-align: right;
    direction: rtl;
    float: right;
    margin-left: auto;
    margin-right: 0;
}

/* Ensure proper RTL display for all text content */
html[dir="rtl"] .about-description p {
    text-align: right;
    direction: rtl;
}

/* Hero Section RTL Support */
html[dir="rtl"] .hero-section {
    direction: rtl;
}

html[dir="rtl"] .hero-content {
    text-align: center;
    direction: rtl;
}

html[dir="rtl"] .hero-title,
html[dir="rtl"] .hero-subtitle {
    text-align: center;
    direction: rtl;
}

@media(min-width:1500px) {
    [dir="rtl"].global-customers-background {
        position: absolute;
        top: 0;
        left: -382px;
        width: 100%;
        height: 100%;
        z-index: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: 169px;
    }

    [dir="rtl"] .customers-white-panel {
        margin-left: auto;
        margin-right: 10%;
    }
}

@media(min-width:1400px) and (max-width:1500) {
    [dir="rtl"].global-customers-background {
        position: absolute;
        top: 0;
        left: -257px;
        width: 100%;
        height: 100%;
        z-index: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: 169px;
    }

    [dir="rtl"] .customers-white-panel {
        margin-left: auto;
        margin-right: 10%;
    }
}

@media(min-width:1300px) and (max-width:1400) {
    [dir="rtl"].global-customers-background {
        position: absolute;
        top: 0;
        left: 72px;
        width: 87%;
        height: 100%;
        z-index: 1;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-left: 169px;
    }

    [dir="rtl"] .customers-white-panel {
        margin-left: auto;
        margin-right: 10%;
    }
}

/* RTL Brands Slider Specific Styles */
html[dir="rtl"] .brands-logos-container {
    direction: rtl !important;
    overflow: hidden !important;
}

html[dir="rtl"] .brands-logos-grid-draggable {
    direction: rtl !important;
    justify-content: flex-start !important;
    display: flex !important;
    align-items: flex-start !important;
}

html[dir="rtl"] .brand-column {
    direction: rtl !important;
}

html[dir="rtl"] .brand-logo {
    text-align: center !important;
}

/* Ensure smooth RTL transitions */
html[dir="rtl"] .brands-logos-grid-draggable:not(.dragging) {
    transition: transform 0.3s ease-out !important;
}

/* RTL cursor management */
html[dir="rtl"] .brands-logos-container:hover {
    cursor: grab !important;
}

html[dir="rtl"] .brands-logos-container.dragging,
html[dir="rtl"] .brands-logos-grid-draggable.dragging {
    cursor: grabbing !important;
}
