/* ========================================
   TAGHLEIF - Arabic RTL Styles
   Professional Arabic Font: Cairo & Tajawal
   ======================================== */

/* Arabic Font Family Override */
:root {
    --font-arabic: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
}

/* Apply Arabic font to all elements */
html[dir="rtl"] body,
html[dir="rtl"] * {
    font-family: var(--font-arabic);
}

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

/* ========================================
   TYPOGRAPHY ENHANCEMENTS FOR ARABIC
   ======================================== */
html[dir="rtl"] body {
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.8;
}

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-weight: 700;
    line-height: 1.4;
}

html[dir="rtl"] .hero-title {
    font-weight: 800;
    line-height: 1.3;
    font-size: clamp(2rem, 5vw, 3.5rem);
}

html[dir="rtl"] .hero-subtitle {
    font-weight: 400;
    line-height: 1.9;
}

html[dir="rtl"] .section-tag {
    letter-spacing: 0.05em;
    font-weight: 700;
}

html[dir="rtl"] .section-title {
    font-weight: 800;
    line-height: 1.3;
}

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

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

html[dir="rtl"] .nav-link::after {
    left: auto;
    right: 0;
}

html[dir="rtl"] .nav-toggle {
    order: -1;
}

/* ========================================
   HERO SECTION RTL
   ======================================== */
html[dir="rtl"] .hero-stats {
    flex-direction: row-reverse;
}

html[dir="rtl"] .stat-item {
    direction: rtl;
}

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

html[dir="rtl"] .about-content {
    padding-right: 0;
    padding-left: var(--space-lg);
}

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

html[dir="rtl"] .about-image-badge {
    right: auto;
    left: var(--space-md);
}

/* ========================================
   VISION & MISSION RTL
   ======================================== */
html[dir="rtl"] .vm-grid {
    direction: rtl;
}

html[dir="rtl"] .vm-text {
    line-height: 1.9;
}

/* ========================================
   VALUES SECTION RTL
   ======================================== */
html[dir="rtl"] .values-grid {
    direction: rtl;
}

html[dir="rtl"] .value-text {
    line-height: 1.8;
}

/* ========================================
   FACILITY SECTION RTL
   ======================================== */
html[dir="rtl"] .facility-stats {
    direction: rtl;
}

html[dir="rtl"] .facility-features {
    direction: rtl;
}

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

/* ========================================
   INFRASTRUCTURE SECTION RTL
   ======================================== */
html[dir="rtl"] .infra-grid {
    direction: rtl;
}

html[dir="rtl"] .infra-card p {
    line-height: 1.8;
}

/* ========================================
   GMP SECTION RTL
   ======================================== */
html[dir="rtl"] .gmp-wrapper {
    direction: rtl;
}

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

/* Fix GMP list item alignment */
html[dir="rtl"] .gmp-list li>*:last-child {
    flex: 1;
    text-align: right;
}

html[dir="rtl"] .gmp-check {
    margin-left: 0;
    margin-right: 0;
    flex-shrink: 0;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

html[dir="rtl"] .gmp-intro {
    line-height: 1.9;
}

/* ========================================
   PRODUCTS SECTION RTL
   ======================================== */
html[dir="rtl"] .products-showcase {
    direction: rtl;
}

html[dir="rtl"] .sizes-grid {
    direction: rtl;
}

html[dir="rtl"] .features-list {
    direction: rtl;
}

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

/* Fix feature item content alignment for RTL */
html[dir="rtl"] .feature-item>div:last-child {
    flex: 1;
    text-align: right;
}

html[dir="rtl"] .feature-item h5 {
    text-align: right;
    margin-bottom: var(--space-xs);
}

html[dir="rtl"] .feature-item p {
    text-align: right;
    line-height: 1.7;
}

html[dir="rtl"] .feature-icon {
    margin-left: 0;
    margin-right: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

html[dir="rtl"] .materials-grid {
    direction: rtl;
}

/* ========================================
   CERTIFICATIONS SECTION RTL
   ======================================== */
html[dir="rtl"] .certs-grid {
    direction: rtl;
}

html[dir="rtl"] .commitment-items {
    direction: rtl;
}

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

/* ========================================
   WHY US SECTION RTL
   ======================================== */
html[dir="rtl"] .why-grid {
    direction: rtl;
}

html[dir="rtl"] .why-card p {
    line-height: 1.8;
}

html[dir="rtl"] .why-number {
    font-family: 'Inter', sans-serif;
}

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

html[dir="rtl"] .contact-details {
    direction: rtl;
}

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

/* Fix contact item alignment */
html[dir="rtl"] .contact-item>div:last-child {
    flex: 1;
    text-align: right;
}

html[dir="rtl"] .contact-item h5 {
    text-align: right;
}

html[dir="rtl"] .contact-item p {
    text-align: right;
}

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

html[dir="rtl"] .contact-form {
    direction: rtl;
}

html[dir="rtl"] .form-group label {
    text-align: right;
}

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

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

html[dir="rtl"] .btn-submit svg {
    margin-right: var(--space-xs);
    margin-left: 0;
    transform: scaleX(-1);
}

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

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

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

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

html[dir="rtl"] .newsletter-form input {
    text-align: right;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

html[dir="rtl"] .newsletter-form button {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

html[dir="rtl"] .footer-bottom {
    direction: rtl;
}

/* ========================================
   ENHANCED MOBILE RESPONSIVENESS
   ======================================== */
@media (max-width: 1024px) {
    html[dir="rtl"] .values-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    html[dir="rtl"] .infra-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    html[dir="rtl"] .nav-container {
        flex-direction: row;
        justify-content: space-between;
    }

    /* Mobile Navigation for RTL - matching main styles */
    html[dir="rtl"] .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        width: 100%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh;
        /* Premium gradient background matching website colors */
        background: linear-gradient(180deg, var(--color-dark) 0%, var(--color-dark-2) 100%);
        flex-direction: column;
        align-items: stretch;
        padding: 100px var(--space-md) var(--space-md);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
        z-index: 999;
        gap: var(--space-xs);
    }

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

    /* RTL Mobile nav links - premium style */
    html[dir="rtl"] .nav-link {
        color: var(--color-white);
        font-weight: 500;
        padding: var(--space-md);
        text-align: right;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: var(--radius-md);
        transition: all 0.3s ease;
    }

    html[dir="rtl"] .nav-link:hover {
        background: rgba(0, 212, 255, 0.1);
        color: var(--color-accent);
    }

    html[dir="rtl"] .nav-toggle {
        display: flex;
        order: 0;
    }

    html[dir="rtl"] .hero-title {
        font-size: clamp(1.75rem, 4vw, 2.5rem);
    }

    html[dir="rtl"] .hero-stats {
        flex-direction: column;
        gap: var(--space-md);
    }

    html[dir="rtl"] .stat-divider {
        display: none;
    }

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

    html[dir="rtl"] .about-content {
        padding-left: 0;
        order: 1;
    }

    html[dir="rtl"] .about-image {
        order: 2;
    }

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

    html[dir="rtl"] .values-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

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

    html[dir="rtl"] .gmp-content {
        order: 1;
    }

    html[dir="rtl"] .gmp-image {
        order: 2;
    }

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

    html[dir="rtl"] .certs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    html[dir="rtl"] .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    html[dir="rtl"] .footer-links,
    html[dir="rtl"] .footer-newsletter {
        text-align: center;
    }
}

@media (max-width: 480px) {
    html[dir="rtl"] .hero-title {
        font-size: 1.5rem;
    }

    html[dir="rtl"] .hero-subtitle {
        font-size: 0.95rem;
    }

    html[dir="rtl"] .section-title {
        font-size: 1.5rem;
    }

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

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

    html[dir="rtl"] .sizes-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    html[dir="rtl"] .materials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    html[dir="rtl"] .facility-features {
        flex-direction: column;
        align-items: center;
    }

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

/* ========================================
   ANIMATIONS ADJUSTMENTS
   ======================================== */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

html[dir="rtl"] .animate-reveal {
    animation-name: slideInFromRight;
}

/* ========================================
   LTR ELEMENTS (Numbers, Emails, etc.)
   ======================================== */
html[dir="rtl"] [dir="ltr"] {
    direction: ltr;
    unicode-bidi: embed;
}

html[dir="rtl"] .cert-number {
    font-family: 'Inter', sans-serif;
    direction: ltr;
}

html[dir="rtl"] .stat-number {
    font-family: 'Inter', sans-serif;
}

html[dir="rtl"] .facility-stat-number {
    font-family: 'Cairo', sans-serif;
}

html[dir="rtl"] .counter {
    font-family: 'Inter', sans-serif;
}

html[dir="rtl"] .material-percent {
    font-family: 'Inter', sans-serif;
    direction: ltr;
}

/* ========================================
   FORM INPUT PLACEHOLDERS
   ======================================== */
html[dir="rtl"] input::placeholder,
html[dir="rtl"] textarea::placeholder {
    text-align: right;
}

/* ========================================
   SCROLL BEHAVIOR
   ======================================== */
html[dir="rtl"] .hero-scroll span {
    font-weight: 500;
}

/* ========================================
   ADDITIONAL POLISH
   ======================================== */
html[dir="rtl"] p {
    line-height: 1.9;
}

html[dir="rtl"] strong {
    font-weight: 700;
}

html[dir="rtl"] .about-text {
    line-height: 2;
}

html[dir="rtl"] .vm-card {
    text-align: center;
}

html[dir="rtl"] .value-card {
    text-align: center;
}

html[dir="rtl"] .infra-card {
    text-align: center;
}

html[dir="rtl"] .cert-card {
    text-align: center;
}

html[dir="rtl"] .why-card {
    text-align: center;
}