/* ===== language.css - Enhanced Global Multi-Language Support Styles (UPDATED FOR PRODUCTS PAGE) ===== */

/* ===== LANGUAGE LOADING OVERLAY (ENHANCED FOR ALL PAGES) ===== */
.language-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(5, 84, 64, 0.95), rgba(232, 136, 36, 0.85));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.language-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 350px;
    padding: 2.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(5, 84, 64, 0.3);
}

.loading-content .loading-spinner {
    margin: 0 auto 1.5rem;
}

.loading-spinner .spinner {
    width: 70px;
    height: 70px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid #E88824;
    border-right: 5px solid #ffffff;
    border-radius: 50%;
    animation: language-spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
    position: relative;
}

.loading-spinner .spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid transparent;
    border-top: 3px solid rgba(232, 136, 36, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: language-spin-reverse 0.8s linear infinite;
}

.loading-content h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    animation: language-pulse 2s ease-in-out infinite alternate;
}

.loading-content p {
    font-size: 1rem;
    font-weight: 400;
    margin: 0;
    opacity: 0.9;
    animation: language-fade 1.8s ease-in-out infinite alternate;
}

@keyframes language-spin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

@keyframes language-spin-reverse {
    0% { transform: translate(-50%, -50%) rotate(360deg); }
    100% { transform: translate(-50%, -50%) rotate(0deg); }
}

@keyframes language-pulse {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 1; transform: scale(1.02); }
}

@keyframes language-fade {
    0% { opacity: 0.6; }
    100% { opacity: 0.9; }
}

/* ===== LANGUAGE SELECTOR ENHANCEMENTS (GLOBAL) ===== */
.language-select {
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid transparent;
}

.language-select:focus {
    transform: scale(1.03);
    box-shadow: 0 0 20px rgba(232, 136, 36, 0.4) !important;
    border-color: #E88824;
}

.language-select:hover {
    transform: scale(1.01);
    box-shadow: 0 5px 15px rgba(5, 84, 64, 0.2);
}

.language-select.loading {
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
}

.language-select.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 35px;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(5, 84, 64, 0.3);
    border-top: 2px solid #055440;
    border-radius: 50%;
    animation: language-spin 1s linear infinite;
    transform: translateY(-50%);
}

.language-select-mobile.loading::after {
    right: 30px;
    width: 16px;
    height: 16px;
}

/* ===== LANGUAGE CHANGE ANIMATIONS (ENHANCED) ===== */
.language-fade-out {
    opacity: 0;
    transform: translateY(-15px) scale(0.98);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.language-fade-in {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s;
}

/* ===== FONT ADJUSTMENTS FOR DIFFERENT LANGUAGES (NO RTL CHANGES) ===== */
.lang-ar {
    font-family: 'Segoe UI', 'Tahoma', 'Arial', sans-serif;
    line-height: 1.8;
    /* No direction changes - keeping LTR */
}

.lang-zh {
    font-family: 'Noto Sans SC', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
    line-height: 1.7;
}

.lang-fr {
    font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

.lang-es {
    font-family: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

.lang-en {
    font-family: 'Inter', 'Space Grotesk', sans-serif;
    line-height: 1.6;
}

/* ===== PRODUCTS PAGE SPECIFIC LANGUAGE STYLES ===== */
.lang-ar .page-title,
.lang-zh .page-title {
    font-size: clamp(2rem, 7vw, 3.8rem);
    line-height: 1.2;
}

.lang-ar .section-title,
.lang-zh .section-title {
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    line-height: 1.3;
}

.lang-ar .product-name,
.lang-zh .product-name {
    font-size: clamp(0.85rem, 2vw, 1rem);
    line-height: 1.4;
    font-weight: 500;
}

.lang-ar .category-filter-btn,
.lang-zh .category-filter-btn {
    font-size: 0.9rem;
    padding: 10px 16px;
    line-height: 1.3;
}

.lang-ar .enquiry-btn,
.lang-zh .enquiry-btn {
    font-size: 0.85rem;
    padding: 8px 14px;
    line-height: 1.3;
}

.lang-ar .product-meta,
.lang-zh .product-meta {
    font-size: 0.9rem;
    line-height: 1.4;
}

.lang-ar .results-count,
.lang-zh .results-count {
    font-size: 0.95rem;
    line-height: 1.3;
}

.lang-ar .category-info h4,
.lang-zh .category-info h4 {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.4;
    font-weight: 600;
}

.lang-ar .featured-badge,
.lang-zh .featured-badge {
    font-size: 0.8rem;
    padding: 4px 8px;
}

/* ===== RESPONSIVE TEXT SCALING FOR DIFFERENT LANGUAGES ===== */
.lang-ar .hero-title,
.lang-zh .hero-title,
.lang-ar .services-hero-title,
.lang-zh .services-hero-title {
    font-size: clamp(2rem, 7vw, 3.8rem);
    line-height: 1.2;
}

.lang-ar .section-title,
.lang-zh .section-title {
    font-size: clamp(1.8rem, 4.5vw, 2.8rem);
    line-height: 1.3;
}

.lang-ar .product-name,
.lang-zh .product-name {
    font-size: clamp(0.85rem, 2vw, 1rem);
    line-height: 1.4;
    font-weight: 500;
}

.lang-ar .service-card h4,
.lang-zh .service-card h4,
.lang-ar .main-service-card h3,
.lang-zh .main-service-card h3 {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.4;
    font-weight: 600;
}

.lang-ar .filter-btn,
.lang-zh .filter-btn {
    font-size: 0.9rem;
    padding: 10px 16px;
    line-height: 1.3;
}

/* ===== MOBILE LANGUAGE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .lang-ar .hero-title,
    .lang-zh .hero-title,
    .lang-ar .services-hero-title,
    .lang-zh .services-hero-title,
    .lang-ar .page-title,
    .lang-zh .page-title {
        font-size: clamp(1.8rem, 6vw, 2.5rem);
        line-height: 1.2;
    }
    
    .lang-ar .filter-btn,
    .lang-zh .filter-btn,
    .lang-ar .category-filter-btn,
    .lang-zh .category-filter-btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    .lang-ar .mobile-faq-title,
    .lang-zh .mobile-faq-title {
        font-size: 0.95rem;
        line-height: 1.3;
    }
    
    .lang-ar .newsletter-text h3,
    .lang-zh .newsletter-text h3 {
        font-size: clamp(1.2rem, 4vw, 1.8rem);
    }
    
    .lang-ar .service-features li,
    .lang-zh .service-features li {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .lang-ar .search-input,
    .lang-zh .search-input {
        font-size: 0.9rem;
        padding: 10px 45px 10px 15px;
    }

    .lang-ar .product-description,
    .lang-zh .product-description {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .lang-ar .stat-label,
    .lang-zh .stat-label {
        font-size: 0.8rem;
        line-height: 1.2;
    }
}

/* ===== TRANSLATION SUCCESS NOTIFICATION (ENHANCED) ===== */
.language-success-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, #055440, #E88824);
    color: white;
    padding: 1.2rem 1.8rem;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(5, 84, 64, 0.4);
    z-index: 9998;
    opacity: 0;
    transform: translateX(400px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 350px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(232, 136, 36, 0.3);
}

.language-success-notification.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.language-success-notification i {
    font-size: 1.4rem;
    color: #E88824;
    animation: language-success-bounce 0.6s ease;
}

.language-success-notification .close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.8;
    transition: all 0.3s ease;
    padding: 0.2rem;
    border-radius: 50%;
}

.language-success-notification .close-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

@keyframes language-success-bounce {
    0%, 20%, 50%, 80%, 100% { transform: scale(1); }
    40% { transform: scale(1.2); }
    60% { transform: scale(1.1); }
}

/* ===== ERROR NOTIFICATION (ENHANCED) ===== */
.language-error-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 1.2rem 1.8rem;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(220, 53, 69, 0.4);
    z-index: 9998;
    opacity: 0;
    transform: translateX(400px) scale(0.9);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 350px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(248, 215, 218, 0.3);
}

.language-error-notification.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.language-error-notification i {
    font-size: 1.4rem;
    color: #f8d7da;
    animation: language-error-shake 0.6s ease;
}

@keyframes language-error-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
    20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* ===== LANGUAGE BUTTON ACTIVE STATE (ENHANCED) ===== */
.language-select option:checked,
.language-select-mobile option:checked {
    background: linear-gradient(135deg, #055440, #E88824);
    color: white;
    font-weight: 600;
}

/* ===== SMOOTH CONTENT TRANSITIONS (ENHANCED) ===== */
.translating {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.translated {
    opacity: 1;
    pointer-events: auto;
    transition: opacity 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.1s;
}

.language-changing {
    transition: all 0.3s ease !important;
}

.language-changing .hero-title,
.language-changing .services-hero-title,
.language-changing .page-title,
.language-changing .section-title,
.language-changing .product-name,
.language-changing .service-card h4 {
    transform: scale(0.99);
    opacity: 0.9;
}

/* ===== LANGUAGE SELECTOR ICON ANIMATIONS (ENHANCED) ===== */
.language-select::before {
    content: '🌐';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.language-select:hover::before,
.language-select:focus::before {
    opacity: 1;
    transform: translateY(-50%) scale(1.2) rotate(10deg);
}

.language-select-mobile::before {
    content: '🌐';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 1;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.language-select-mobile:focus::before {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

/* ===== ACCESSIBILITY IMPROVEMENTS (ENHANCED) ===== */
.language-select:focus,
.language-select-mobile:focus {
    outline: 3px solid #E88824;
    outline-offset: 3px;
    box-shadow: 0 0 0 6px rgba(232, 136, 36, 0.2);
}

/* Focus indicators for keyboard navigation */
.language-select:focus-visible,
.language-select-mobile:focus-visible {
    outline: 3px solid #E88824;
    outline-offset: 2px;
}

/* ===== HIGH CONTRAST MODE SUPPORT ===== */
@media (prefers-contrast: high) {
    .language-loading-overlay {
        background: rgba(0, 0, 0, 0.95);
        backdrop-filter: none;
    }
    
    .loading-content {
        background: rgba(255, 255, 255, 0.2);
        border: 2px solid #ffffff;
    }
    
    .language-success-notification {
        background: #055440;
        border: 3px solid #E88824;
    }
    
    .language-error-notification {
        background: #dc3545;
        border: 3px solid #ffffff;
    }
    
    .language-select:focus,
    .language-select-mobile:focus {
        outline: 4px solid #ffffff;
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.3);
    }
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
    .loading-spinner .spinner,
    .loading-spinner .spinner::after {
        animation: none;
    }
    
    .loading-content h4,
    .loading-content p {
        animation: none;
    }
    
    .language-fade-out,
    .language-fade-in,
    .translating,
    .translated {
        transition: none;
    }
    
    .language-success-notification,
    .language-error-notification {
        transition: opacity 0.2s ease;
        transform: none;
    }
    
    .language-success-notification.show,
    .language-error-notification.show {
        transform: none;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .language-loading-overlay,
    .language-success-notification,
    .language-error-notification,
    .language-select::before,
    .language-select-mobile::before {
        display: none !important;
    }
    
    .language-select,
    .language-select-mobile {
        border: 1px solid #000;
        background: white;
    }
}

/* ===== MOBILE LANGUAGE SELECTOR IMPROVEMENTS (ENHANCED) ===== */
@media (max-width: 991.98px) {
    .mobile-language-section .language-select-mobile {
        padding-left: 30px;
        background-image: none;
        position: relative;
        min-height: 44px; /* Improved touch target */
    }
    
    .mobile-language-section {
        position: relative;
    }
    
    .mobile-language-section::before {
        content: '🌐';
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.9rem;
        z-index: 2;
        pointer-events: none;
        opacity: 0.8;
    }
}

/* ===== CONTENT PRESERVATION DURING TRANSLATION (ENHANCED) ===== */
.preserve-layout {
    min-height: 1.4em;
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
}

.preserve-layout::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent 25%, 
        rgba(5, 84, 64, 0.1) 50%, 
        transparent 75%
    );
    animation: language-shimmer 2s infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

.preserve-layout.loading::after {
    opacity: 1;
}

@keyframes language-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== LANGUAGE SPECIFIC BUTTON ADJUSTMENTS (ENHANCED) ===== */
.lang-ar .btn,
.lang-zh .btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    min-height: 44px;
}

.lang-ar .filter-btn,
.lang-zh .filter-btn {
    padding: 10px 18px;
    font-size: 0.85rem;
    min-height: 40px;
}

.lang-ar .enquiry-btn,
.lang-zh .enquiry-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    min-height: 36px;
}

.lang-ar .service-cta-btn,
.lang-zh .service-cta-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
    min-height: 44px;
}

.lang-ar .category-filter-btn,
.lang-zh .category-filter-btn {
    padding: 10px 16px;
    font-size: 0.85rem;
    min-height: 40px;
}

.lang-ar .reset-filters-btn,
.lang-zh .reset-filters-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
    min-height: 36px;
}

/* ===== MOBILE RESPONSIVE LANGUAGE ADJUSTMENTS (ENHANCED) ===== */
@media (max-width: 576px) {
    .lang-ar .navbar-nav .nav-link,
    .lang-zh .navbar-nav .nav-link {
        font-size: 0.8rem;
        padding: 12px 10px;
        min-height: 44px;
    }
    
    .lang-ar .category-name,
    .lang-zh .category-name {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .lang-ar .stat-label,
    .lang-zh .stat-label {
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    .lang-ar .mobile-faq-title,
    .lang-zh .mobile-faq-title {
        font-size: 0.9rem;
        line-height: 1.3;
        padding: 0.5rem 0;
    }
    
    .lang-ar .additional-service-card h4,
    .lang-zh .additional-service-card h4 {
        font-size: 1rem;
        line-height: 1.3;
    }

    .lang-ar .search-input,
    .lang-zh .search-input {
        font-size: 0.85rem;
        padding: 8px 40px 8px 12px;
    }

    .lang-ar .pagination-link,
    .lang-zh .pagination-link {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .lang-ar .no-results-content h3,
    .lang-zh .no-results-content h3 {
        font-size: 1.2rem;
        line-height: 1.3;
    }

    .lang-ar .product-footer .enquiry-btn,
    .lang-zh .product-footer .enquiry-btn {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}

/* ===== GTRANSLATE INTEGRATION STYLES ===== */
.gtranslate_wrapper {
    position: absolute;
    top: -9999px;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.gtranslate {
    transition: all 0.3s ease;
}

.gtranslate.translating {
    opacity: 0.7;
    transform: scale(0.99);
}

.gtranslate.translated {
    opacity: 1;
    transform: scale(1);
}

/* ===== CROSS-PAGE LANGUAGE SYNCHRONIZATION INDICATORS ===== */
.language-sync-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #055440, #E88824);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.8rem;
    z-index: 9997;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.language-sync-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

.language-sync-indicator i {
    margin-right: 0.5rem;
    animation: language-spin 1s linear infinite;
}

/* ===== PRODUCTS PAGE SPECIFIC LANGUAGE STYLES ===== */
.products-page .lang-ar .page-hero-section .page-title,
.products-page .lang-zh .page-hero-section .page-title {
    font-size: clamp(2.2rem, 8vw, 4rem);
    line-height: 1.1;
}

.products-page .lang-ar .page-subtitle,
.products-page .lang-zh .page-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    line-height: 1.5;
}

.products-page .lang-ar .hero-badge span,
.products-page .lang-zh .hero-badge span {
    font-size: 0.9rem;
    font-weight: 500;
}

.products-page .lang-ar .products-header-content .section-title,
.products-page .lang-zh .products-header-content .section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    line-height: 1.2;
}

.products-page .lang-ar .category-info,
.products-page .lang-zh .category-info {
    padding: 1.5rem;
}

.products-page .lang-ar .category-info h4,
.products-page .lang-zh .category-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.products-page .lang-ar .category-info p,
.products-page .lang-zh .category-info p {
    font-size: 0.85rem;
    line-height: 1.4;
}

.products-page .lang-ar .product-description,
.products-page .lang-zh .product-description {
    font-size: 0.9rem;
    line-height: 1.5;
}

.products-page .lang-ar .cta-text h3,
.products-page .lang-zh .cta-text h3 {
    font-size: clamp(1.3rem, 4vw, 2rem);
    line-height: 1.3;
}

.products-page .lang-ar .cta-text p,
.products-page .lang-zh .cta-text p {
    font-size: 0.95rem;
    line-height: 1.4;
}

/* ===== SERVICES PAGE SPECIFIC LANGUAGE STYLES ===== */
.services-hero-title .gradient-text {
    background: linear-gradient(135deg, #E88824, #055440);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lang-ar .services-hero-description,
.lang-zh .services-hero-description {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    line-height: 1.6;
}

.lang-ar .process-step h4,
.lang-zh .process-step h4 {
    font-size: 1.1rem;
    line-height: 1.4;
}

.lang-ar .additional-service-card h4,
.lang-zh .additional-service-card h4 {
    font-size: 1.05rem;
    line-height: 1.3;
    margin-bottom: 1rem;
}

/* ===== MODAL LANGUAGE ADJUSTMENTS ===== */
.lang-ar .modal-title,
.lang-zh .modal-title {
    font-size: 1.1rem;
    line-height: 1.3;
}

.lang-ar .form-label,
.lang-zh .form-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.lang-ar .form-control,
.lang-zh .form-control {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

.lang-ar .form-select,
.lang-zh .form-select {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}

/* ===== FALLBACK STYLES ===== */
.no-translate {
    transform: none !important;
    transition: none !important;
    opacity: 1 !important;
}

/* Ensure all language-related animations work smoothly */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== LOADING STATE IMPROVEMENTS ===== */
.language-loading {
    position: relative;
    overflow: hidden;
}

.language-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(232, 136, 36, 0.1),
        transparent
    );
    animation: language-loading-sweep 1.5s infinite;
}

@keyframes language-loading-sweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.language-optimized {
    will-change: transform, opacity;
    backface-visibility: hidden;
    perspective: 1000px;
}

.language-gpu-accelerated {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* ===== PRODUCTS PAGE RESPONSIVE BREAKPOINTS ===== */
@media (max-width: 1199.98px) {
    .lang-ar .category-filter-btn,
    .lang-zh .category-filter-btn {
        font-size: 0.8rem;
        padding: 8px 14px;
    }
}

@media (max-width: 991.98px) {
    .lang-ar .page-title,
    .lang-zh .page-title {
        font-size: clamp(1.8rem, 7vw, 2.8rem);
    }
    
    .lang-ar .category-filter-btn,
    .lang-zh .category-filter-btn {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}

@media (max-width: 767.98px) {
    .lang-ar .hero-badge span,
    .lang-zh .hero-badge span {
        font-size: 0.8rem;
    }
    
    .lang-ar .stat-number,
    .lang-zh .stat-number {
        font-size: 1.5rem;
    }
    
    .lang-ar .stat-label,
    .lang-zh .stat-label {
        font-size: 0.75rem;
    }
}

/* ===== ENHANCED TABLET SUPPORT ===== */
@media (min-width: 768px) and (max-width: 1024px) {
    .lang-ar .page-title,
    .lang-zh .page-title {
        font-size: clamp(2rem, 6vw, 3.2rem);
    }
    
    .lang-ar .section-title,
    .lang-zh .section-title {
        font-size: clamp(1.6rem, 4vw, 2.2rem);
    }
    
    .lang-ar .category-filter-btn,
    .lang-zh .category-filter-btn {
        font-size: 0.85rem;
        padding: 9px 15px;
    }
}

/* ===== END OF ENHANCED LANGUAGE.CSS ===== */