/* ============================================
   تحسين شامل للتصميم على الجوال
   Mobile Responsive Enhancements
   ============================================ */

/* ملاحظة مهمة: هذا الملف يتم تحميله بعد header.css
   لذلك القواعد هنا تتجاوز القواعد السابقة */

/* ============================================
   تحسينات عامة للجوال
   ============================================ */
@media (max-width: 768px) {
    /* تحسين الخطوط */
    html {
        font-size: 14px !important;
    }
    
    body {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }
    
    /* تحسين المسافات العامة */
    * {
        --space-xs: 0.25rem;
        --space-sm: 0.5rem;
        --space-md: 0.75rem;
        --space-lg: 1rem;
        --space-xl: 1.5rem;
        --space-2xl: 2rem;
    }
    
    /* تحسين العناوين */
    h1 {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        line-height: 1.3 !important;
        margin-bottom: 0.75rem !important;
    }
    
    h2 {
        font-size: clamp(1.3rem, 4.5vw, 1.75rem) !important;
        line-height: 1.35 !important;
        margin-bottom: 0.65rem !important;
    }
    
    h3 {
        font-size: clamp(1.15rem, 4vw, 1.5rem) !important;
        line-height: 1.4 !important;
        margin-bottom: 0.6rem !important;
    }
    
    h4 {
        font-size: clamp(1rem, 3.5vw, 1.25rem) !important;
        line-height: 1.45 !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* تحسين الحاويات */
    .container,
    .epic-container,
    .midasbuy-container {
        padding-left: clamp(0.75rem, 3vw, 1rem) !important;
        padding-right: clamp(0.75rem, 3vw, 1rem) !important;
        max-width: 100% !important;
    }
    
    /* تحسين الصفحات */
    .epic-page,
    .midasbuy-exact-page {
        padding-inline: clamp(0.75rem, 3vw, 1rem) !important;
        padding-bottom: clamp(2rem, 5vw, 3rem) !important;
    }
}

@media (max-width: 480px) {
    /* تحسين أكثر للخطوط */
    html {
        font-size: 13px !important;
    }
    
    body {
        font-size: 13px !important;
        line-height: 1.45 !important;
    }
    
    /* تقليل أكثر للمسافات */
    * {
        --space-xs: 0.2rem;
        --space-sm: 0.4rem;
        --space-md: 0.6rem;
        --space-lg: 0.85rem;
        --space-xl: 1.25rem;
        --space-2xl: 1.75rem;
    }
    
    /* تقليل أكثر للعناوين */
    h1 {
        font-size: clamp(1.35rem, 6vw, 1.75rem) !important;
    }
    
    h2 {
        font-size: clamp(1.2rem, 5.5vw, 1.6rem) !important;
    }
    
    h3 {
        font-size: clamp(1.05rem, 5vw, 1.4rem) !important;
    }
    
    h4 {
        font-size: clamp(0.95rem, 4.5vw, 1.15rem) !important;
    }
    
    /* تقليل أكثر للحاويات */
    .container,
    .epic-container,
    .midasbuy-container {
        padding-left: clamp(0.5rem, 2.5vw, 0.75rem) !important;
        padding-right: clamp(0.5rem, 2.5vw, 0.75rem) !important;
    }
    
    .epic-page,
    .midasbuy-exact-page {
        padding-inline: clamp(0.5rem, 2.5vw, 0.75rem) !important;
        padding-bottom: clamp(1.5rem, 4vw, 2.5rem) !important;
    }
}

/* ============================================
   تحسين الهيدر على الجوال
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 0.5rem 0 !important;
        min-height: auto !important;
        height: auto !important;
    }
    
    .header .container {
        padding: clamp(0.5rem, 2vw, 0.75rem) !important;
        gap: clamp(0.5rem, 1.5vw, 0.75rem) !important;
        flex-direction: column !important;
        align-items: stretch !important;
        display: flex !important;
        flex-wrap: nowrap !important;
    }
    
    /* إخفاء العناصر القديمة */
    .header .container > .header-left:not(:first-child),
    .header .container > .header-center,
    .header .container > .header-right:not(:last-child) {
        display: none !important;
    }
    
    /* صف الشعار والأزرار الرئيسية */
    .header-top-row {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        gap: clamp(0.4rem, 1.5vw, 0.6rem) !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0 !important;
        order: 1 !important;
    }
    
    /* تحسين الشعار */
    .header-left {
        display: flex !important;
        align-items: center !important;
        gap: clamp(0.4rem, 1.5vw, 0.6rem) !important;
        flex: 0 0 auto !important;
        order: 1 !important;
    }
    
    .logo-img {
        width: clamp(50px, 11vw, 65px) !important;
        max-height: clamp(50px, 11vw, 65px) !important;
        height: auto !important;
    }
    
    .logo-text {
        font-size: clamp(0.8rem, 3vw, 1rem) !important;
    }
    
    /* صف الأزرار */
    .header-actions-row {
        display: flex !important;
        align-items: center !important;
        gap: clamp(0.35rem, 1.2vw, 0.5rem) !important;
        flex: 0 0 auto !important;
        order: 2 !important;
        flex-wrap: nowrap !important;
    }
    
    /* تحسين الأزرار */
    .header-icon-btn {
        width: clamp(36px, 8vw, 40px) !important;
        height: clamp(36px, 8vw, 40px) !important;
        font-size: clamp(0.9rem, 2.5vw, 1.1rem) !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
        min-width: clamp(36px, 8vw, 40px) !important;
    }
    
    .header-right {
        display: flex !important;
        align-items: center !important;
        gap: clamp(0.35rem, 1.2vw, 0.5rem) !important;
        flex: 0 0 auto !important;
        flex-wrap: nowrap !important;
    }
    
    .header-center {
        display: none !important;
    }
    
    /* إخفاء الأزرار القديمة إذا كانت موجودة */
    .header-left > .menu-toggle,
    .header-left > .theme-toggle-btn,
    .header-left > .language-toggle-btn {
        display: none !important;
    }
    
    /* تحسين القائمة المدمجة */
    .compact-menu {
        width: min(75%, 280px) !important;
        max-width: 280px !important;
        min-width: 240px !important;
    }
    
    .compact-menu-header {
        padding: clamp(0.75rem, 2vw, 1rem) clamp(0.65rem, 1.8vw, 0.85rem) !important;
    }
    
    .compact-avatar {
        width: clamp(32px, 7vw, 36px) !important;
        height: clamp(32px, 7vw, 36px) !important;
        font-size: clamp(0.85rem, 2vw, 0.95rem) !important;
    }
    
    .compact-username {
        font-size: clamp(0.8rem, 2.2vw, 0.9rem) !important;
    }
    
    .compact-user-id {
        font-size: clamp(0.7rem, 1.8vw, 0.75rem) !important;
    }
    
    .compact-nav-item {
        padding: clamp(0.6rem, 1.8vw, 0.75rem) clamp(0.65rem, 2vw, 0.85rem) !important;
        font-size: clamp(0.8rem, 2.2vw, 0.9rem) !important;
        margin-bottom: 0.3rem !important;
    }
    
    .compact-nav-item i {
        width: clamp(18px, 4.5vw, 20px) !important;
        font-size: clamp(0.85rem, 2vw, 0.95rem) !important;
    }
    
    .compact-menu-footer {
        padding: clamp(0.6rem, 1.5vw, 0.75rem) !important;
        gap: clamp(0.4rem, 1.2vw, 0.5rem) !important;
    }
    
    .compact-footer-btn {
        padding: clamp(0.5rem, 1.5vw, 0.6rem) clamp(0.55rem, 1.8vw, 0.65rem) !important;
        font-size: clamp(0.7rem, 1.8vw, 0.8rem) !important;
    }
    
    .notification-badge {
        width: clamp(14px, 3.5vw, 16px) !important;
        height: clamp(14px, 3.5vw, 16px) !important;
        font-size: clamp(0.6rem, 1.5vw, 0.7rem) !important;
        top: -4px !important;
        right: -4px !important;
    }
}

@media (max-width: 480px) {
    .header {
        min-height: auto !important;
        height: auto !important;
    }
    
    .header .container {
        padding: clamp(0.4rem, 1.8vw, 0.6rem) !important;
        gap: clamp(0.4rem, 1.2vw, 0.6rem) !important;
    }
    
    .header-top-row {
        gap: clamp(0.3rem, 1.2vw, 0.5rem);
    }
    
    .logo-img {
        width: clamp(45px, 10vw, 55px) !important;
        max-height: clamp(45px, 10vw, 55px) !important;
    }
    
    .header-icon-btn {
        width: clamp(32px, 7.5vw, 36px) !important;
        height: clamp(32px, 7.5vw, 36px) !important;
        font-size: clamp(0.85rem, 2.2vw, 1rem) !important;
    }
    
    .header-actions-row,
    .header-right {
        gap: clamp(0.3rem, 1vw, 0.4rem);
    }
    
    .compact-menu {
        width: min(80%, 260px) !important;
        min-width: 220px !important;
    }
}

/* ============================================
   تحسين البطاقات والعناصر على الجوال
   ============================================ */
@media (max-width: 768px) {
    /* بطاقات الألعاب */
    .games-grid,
    .featured-grid,
    .popular-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 30vw, 180px), 1fr)) !important;
        gap: clamp(0.75rem, 2vw, 1rem) !important;
    }
    
    .game-card,
    .featured-card,
    .popular-card {
        border-radius: clamp(16px, 3.5vw, 20px) !important;
        padding: clamp(0.75rem, 2vw, 1rem) !important;
    }
    
    .game-image,
    .featured-card img,
    .popular-card img {
        height: clamp(120px, 25vw, 160px) !important;
        border-radius: clamp(12px, 2.5vw, 16px) !important;
    }
    
    .game-title,
    .featured-card-content h3,
    .popular-card-title {
        font-size: clamp(0.9rem, 2.5vw, 1.1rem) !important;
        margin-bottom: clamp(0.4rem, 1vw, 0.5rem) !important;
    }
    
    .game-price,
    .featured-card-content .price {
        font-size: clamp(0.85rem, 2.2vw, 1rem) !important;
    }
    
    .game-btn,
    .btn-buy {
        padding: clamp(0.6rem, 1.8vw, 0.75rem) clamp(1rem, 2.5vw, 1.25rem) !important;
        font-size: clamp(0.8rem, 2.2vw, 0.95rem) !important;
        border-radius: clamp(10px, 2.2vw, 12px) !important;
    }
    
    /* بطاقات الخدمات */
    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(clamp(150px, 32vw, 200px), 1fr)) !important;
        gap: clamp(0.75rem, 2vw, 1rem) !important;
    }
    
    .service-card {
        padding: clamp(1rem, 2.5vw, 1.5rem) !important;
        border-radius: clamp(16px, 3.5vw, 20px) !important;
    }
    
    .service-icon {
        font-size: clamp(2rem, 5vw, 2.5rem) !important;
        margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem) !important;
    }
    
    .service-title {
        font-size: clamp(1rem, 2.8vw, 1.2rem) !important;
        margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem) !important;
    }
    
    .service-description {
        font-size: clamp(0.85rem, 2.2vw, 0.95rem) !important;
        line-height: 1.5 !important;
        margin-bottom: clamp(0.75rem, 2vw, 1rem) !important;
    }
    
    /* قائمة الألعاب */
    .games-list {
        gap: clamp(0.6rem, 1.8vw, 0.85rem) !important;
        padding: clamp(0.75rem, 2vw, 1rem) !important;
    }
    
    .game-item {
        border-radius: clamp(14px, 3vw, 18px) !important;
    }
    
    .game-img-box {
        border-radius: clamp(12px, 2.5vw, 16px) 0 0 0 !important;
    }
    
    .game-name {
        padding: clamp(0.5rem, 1.5vw, 0.65rem) !important;
    }
    
    .game-name-text {
        font-size: clamp(0.8rem, 2.2vw, 0.95rem) !important;
    }
    
    /* البانر */
    .hero-banner,
    .banner-slider {
        min-height: clamp(200px, 40vw, 280px) !important;
        border-radius: clamp(16px, 3.5vw, 24px) !important;
        margin: clamp(0.75rem, 2vw, 1.25rem) 0 !important;
    }
    
    .hero-slide,
    .banner-slide {
        min-height: clamp(200px, 40vw, 280px) !important;
        padding: clamp(1.5rem, 4vw, 2rem) !important;
    }
    
    .hero-content,
    .banner-content {
        padding: clamp(1.25rem, 3.5vw, 1.75rem) !important;
        border-radius: clamp(14px, 3vw, 20px) !important;
    }
    
    .hero-title,
    .banner-main-text {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        margin-bottom: clamp(0.5rem, 1.5vw, 0.75rem) !important;
    }
    
    .hero-description,
    .banner-top-text {
        font-size: clamp(0.85rem, 2.5vw, 1rem) !important;
        margin-bottom: clamp(0.75rem, 2vw, 1rem) !important;
    }
    
    .hero-buttons {
        gap: clamp(0.5rem, 1.5vw, 0.75rem) !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    
    .hero-btn {
        width: 100% !important;
        max-width: 100% !important;
        padding: clamp(0.75rem, 2vw, 0.9rem) clamp(1.25rem, 3vw, 1.5rem) !important;
        font-size: clamp(0.9rem, 2.5vw, 1rem) !important;
        border-radius: clamp(12px, 2.8vw, 16px) !important;
    }
}

@media (max-width: 480px) {
    .games-grid,
    .featured-grid,
    .popular-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 28vw, 160px), 1fr)) !important;
        gap: clamp(0.6rem, 1.8vw, 0.85rem) !important;
    }
    
    .game-card,
    .featured-card,
    .popular-card {
        padding: clamp(0.65rem, 1.8vw, 0.85rem) !important;
    }
    
    .game-image,
    .featured-card img,
    .popular-card img {
        height: clamp(100px, 22vw, 140px) !important;
    }
    
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: clamp(0.65rem, 1.8vw, 0.85rem) !important;
    }
    
    .service-card {
        padding: clamp(0.85rem, 2.2vw, 1.25rem) !important;
    }
}

/* ============================================
   تحسين الأزرار والنماذج على الجوال
   ============================================ */
@media (max-width: 768px) {
    /* الأزرار العامة */
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-success,
    .btn-warning,
    .btn-error {
        padding: clamp(0.7rem, 2vw, 0.85rem) clamp(1.25rem, 3vw, 1.5rem) !important;
        font-size: clamp(0.85rem, 2.3vw, 0.95rem) !important;
        border-radius: clamp(10px, 2.5vw, 12px) !important;
        min-height: 44px !important; /* للوصول السهل */
    }
    
    /* النماذج */
    .form-group {
        margin-bottom: clamp(1rem, 2.5vw, 1.25rem) !important;
    }
    
    .form-label {
        font-size: clamp(0.85rem, 2.3vw, 0.95rem) !important;
        margin-bottom: clamp(0.4rem, 1.2vw, 0.5rem) !important;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: clamp(0.75rem, 2vw, 0.85rem) clamp(1rem, 2.5vw, 1.15rem) !important;
        font-size: clamp(0.9rem, 2.5vw, 1rem) !important;
        border-radius: clamp(10px, 2.5vw, 12px) !important;
        min-height: 44px !important; /* للوصول السهل */
    }
    
    .form-textarea {
        min-height: clamp(100px, 25vw, 120px) !important;
    }
    
    /* نماذج الشحن */
    .mobile-form-card {
        padding: clamp(1.25rem, 3vw, 1.75rem) !important;
        border-radius: clamp(16px, 3.5vw, 20px) !important;
        gap: clamp(1rem, 2.5vw, 1.25rem) !important;
    }
    
    .mobile-form-card label {
        font-size: clamp(0.85rem, 2.3vw, 0.95rem) !important;
        margin-bottom: clamp(0.4rem, 1.2vw, 0.5rem) !important;
    }
    
    .mobile-form-card input,
    .mobile-form-card select {
        padding: clamp(0.7rem, 2vw, 0.8rem) clamp(0.9rem, 2.5vw, 1.1rem) !important;
        font-size: clamp(0.85rem, 2.3vw, 0.95rem) !important;
        border-radius: clamp(10px, 2.5vw, 12px) !important;
        min-height: 44px !important;
    }
    
    .mobile-form-card .submit-btn {
        width: 100% !important;
        padding: clamp(0.75rem, 2vw, 0.85rem) clamp(1.25rem, 3vw, 1.5rem) !important;
        font-size: clamp(0.9rem, 2.5vw, 1rem) !important;
        border-radius: clamp(12px, 2.8vw, 16px) !important;
        min-height: 48px !important;
    }
    
    /* شرائح المشغلين */
    .operator-chips {
        padding: clamp(1rem, 2.5vw, 1.25rem) !important;
        border-radius: clamp(14px, 3vw, 18px) !important;
        gap: clamp(0.6rem, 1.8vw, 0.85rem) !important;
    }
    
    .operator-chip {
        padding: clamp(0.6rem, 1.8vw, 0.75rem) clamp(0.9rem, 2.5vw, 1.2rem) !important;
        font-size: clamp(0.8rem, 2.2vw, 0.9rem) !important;
        border-radius: clamp(20px, 4.5vw, 24px) !important;
    }
}

@media (max-width: 480px) {
    .btn,
    .btn-primary,
    .btn-secondary {
        padding: clamp(0.65rem, 1.8vw, 0.75rem) clamp(1rem, 2.5vw, 1.25rem) !important;
        font-size: clamp(0.8rem, 2.2vw, 0.9rem) !important;
    }
    
    .form-input,
    .form-select {
        padding: clamp(0.7rem, 1.8vw, 0.8rem) clamp(0.9rem, 2.2vw, 1rem) !important;
        font-size: clamp(0.85rem, 2.2vw, 0.95rem) !important;
    }
}

/* ============================================
   تحسين الجداول على الجوال
   ============================================ */
@media (max-width: 768px) {
    .table-wrapper {
        border-radius: clamp(14px, 3vw, 18px) !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .table {
        font-size: clamp(0.8rem, 2.2vw, 0.9rem) !important;
        min-width: 600px !important; /* للتمرير الأفقي */
    }
    
    .table th,
    .table td {
        padding: clamp(0.6rem, 1.8vw, 0.75rem) clamp(0.75rem, 2vw, 1rem) !important;
        font-size: clamp(0.8rem, 2.2vw, 0.9rem) !important;
    }
    
    .table th {
        font-size: clamp(0.85rem, 2.3vw, 0.95rem) !important;
    }
}

/* ============================================
   تحسين الفوتر على الجوال
   ============================================ */
@media (max-width: 768px) {
    .footer {
        padding: clamp(2rem, 5vw, 2.5rem) 0 clamp(1rem, 2.5vw, 1.5rem) 0 !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: clamp(1.5rem, 4vw, 2rem) !important;
        text-align: center !important;
    }
    
    .footer-section {
        text-align: center !important;
    }
    
    .footer-title {
        font-size: clamp(1.3rem, 4vw, 1.6rem) !important;
        justify-content: center !important;
        margin-bottom: clamp(0.75rem, 2vw, 1rem) !important;
    }
    
    .footer-subtitle {
        font-size: clamp(1rem, 3vw, 1.2rem) !important;
        justify-content: center !important;
        margin-bottom: clamp(0.75rem, 2vw, 1rem) !important;
    }
    
    .footer-description {
        font-size: clamp(0.85rem, 2.3vw, 0.95rem) !important;
        line-height: 1.6 !important;
    }
    
    .footer-links {
        gap: clamp(0.4rem, 1.2vw, 0.5rem) !important;
    }
    
    .footer-links a {
        padding: clamp(0.5rem, 1.5vw, 0.6rem) 0 !important;
        font-size: clamp(0.85rem, 2.3vw, 0.95rem) !important;
        justify-content: center !important;
    }
    
    .footer-social {
        justify-content: center !important;
        gap: clamp(0.6rem, 1.8vw, 0.75rem) !important;
    }
    
    .social-link {
        width: clamp(38px, 9vw, 42px) !important;
        height: clamp(38px, 9vw, 42px) !important;
        font-size: clamp(1rem, 2.5vw, 1.1rem) !important;
    }
    
    .footer-bottom {
        font-size: clamp(0.8rem, 2.2vw, 0.9rem) !important;
        padding-top: clamp(1.25rem, 3vw, 1.5rem) !important;
    }
}

/* ============================================
   تحسين العناوين والأقسام على الجوال
   ============================================ */
@media (max-width: 768px) {
    .section-title {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        margin-bottom: clamp(1rem, 2.5vw, 1.25rem) !important;
        text-align: center !important;
    }
    
    .section-subtitle {
        font-size: clamp(0.85rem, 2.5vw, 1rem) !important;
        margin-bottom: clamp(1rem, 2.5vw, 1.25rem) !important;
        text-align: center !important;
    }
    
    .section-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: clamp(0.75rem, 2vw, 1rem) !important;
        margin-bottom: clamp(1.25rem, 3vw, 1.5rem) !important;
    }
    
    .section-title-box {
        text-align: center !important;
    }
    
    .show-more-btn {
        padding: clamp(0.6rem, 1.8vw, 0.7rem) clamp(1rem, 2.5vw, 1.2rem) !important;
        font-size: clamp(0.8rem, 2.2vw, 0.9rem) !important;
        border-radius: clamp(16px, 3.5vw, 20px) !important;
    }
}

/* ============================================
   تحسين النوافذ المنبثقة على الجوال
   ============================================ */
@media (max-width: 768px) {
    .theme-popup,
    .language-popup {
        width: min(90%, 320px) !important;
        padding: clamp(1.5rem, 4vw, 2rem) !important;
        border-radius: clamp(16px, 3.5vw, 20px) !important;
    }
    
    .theme-popup h3,
    .language-popup h3 {
        font-size: clamp(1.2rem, 4vw, 1.4rem) !important;
        margin-bottom: clamp(1rem, 2.5vw, 1.25rem) !important;
    }
    
    .theme-options,
    .language-options {
        flex-direction: column !important;
        gap: clamp(0.6rem, 1.8vw, 0.75rem) !important;
    }
    
    .theme-option,
    .language-option {
        padding: clamp(0.75rem, 2vw, 0.9rem) clamp(1rem, 2.5vw, 1.25rem) !important;
        font-size: clamp(0.85rem, 2.3vw, 0.95rem) !important;
        border-radius: clamp(10px, 2.5vw, 12px) !important;
    }
}

/* ============================================
   تحسين زر الدردشة المباشرة على الجوال
   ============================================ */
@media (max-width: 768px) {
    .live-chat-btn {
        width: clamp(50px, 11vw, 56px) !important;
        height: clamp(50px, 11vw, 56px) !important;
        inset-inline-end: clamp(0.75rem, 2vw, 1rem) !important;
        bottom: clamp(0.75rem, 2vw, 1rem) !important;
    }
    
    .live-chat-btn i {
        font-size: clamp(1.2rem, 3vw, 1.5rem) !important;
    }
}

@media (max-width: 480px) {
    .live-chat-btn {
        width: clamp(48px, 10vw, 52px) !important;
        height: clamp(48px, 10vw, 52px) !important;
        inset-inline-end: clamp(0.6rem, 1.8vw, 0.75rem) !important;
        bottom: clamp(0.6rem, 1.8vw, 0.75rem) !important;
    }
    
    .live-chat-btn i {
        font-size: clamp(1.1rem, 2.8vw, 1.3rem) !important;
    }
}

/* ============================================
   تحسين صفحة البطاقات على الجوال
   ============================================ */
@media (max-width: 768px) {
    /* تحسين البانر */
    .banner-slider.banner-zoom-70 {
        min-height: clamp(180px, 35vw, 240px) !important;
        border-radius: clamp(14px, 3vw, 18px) !important;
        margin: clamp(0.75rem, 2vw, 1rem) 0 !important;
    }
    
    .banner-slide {
        min-height: clamp(180px, 35vw, 240px) !important;
        padding: clamp(1rem, 3vw, 1.5rem) !important;
    }
    
    .banner-content {
        padding: clamp(0.75rem, 2.5vw, 1rem) !important;
    }
    
    .banner-top-text {
        font-size: clamp(0.75rem, 2.2vw, 0.9rem) !important;
        margin-bottom: clamp(0.3rem, 1vw, 0.4rem) !important;
    }
    
    .banner-event-text {
        font-size: clamp(0.7rem, 2vw, 0.85rem) !important;
        margin-bottom: clamp(0.3rem, 1vw, 0.4rem) !important;
    }
    
    .banner-main-text {
        font-size: clamp(1.1rem, 3.5vw, 1.4rem) !important;
    }
    
    .banner-badge-top {
        font-size: clamp(0.7rem, 2vw, 0.85rem) !important;
        padding: clamp(0.3rem, 1vw, 0.4rem) clamp(0.6rem, 1.8vw, 0.8rem) !important;
        top: clamp(0.5rem, 1.5vw, 0.75rem) !important;
        inset-inline-end: clamp(0.5rem, 1.5vw, 0.75rem) !important;
    }
    
    /* تحسين صندوق البحث والفلاتر */
    .epic-toolkit {
        margin-block: clamp(1rem, 3vw, 1.5rem) !important;
        padding: clamp(1rem, 3vw, 1.5rem) !important;
        border-radius: clamp(14px, 3vw, 18px) !important;
        gap: clamp(0.75rem, 2.5vw, 1rem) !important;
    }
    
    .epic-toolkit__row {
        flex-direction: column !important;
        gap: clamp(0.75rem, 2.5vw, 1rem) !important;
        align-items: stretch !important;
    }
    
    .epic-search {
        flex: 1 1 100% !important;
        width: 100% !important;
    }
    
    .epic-search input {
        padding: clamp(0.75rem, 2vw, 0.85rem) clamp(2.5rem, 6vw, 3rem) clamp(0.75rem, 2vw, 0.85rem) clamp(1rem, 2.5vw, 1.25rem) !important;
        font-size: clamp(0.9rem, 2.5vw, 1rem) !important;
        border-radius: clamp(20px, 4.5vw, 24px) !important;
        min-height: 44px !important;
    }
    
    .epic-search button {
        width: clamp(36px, 8.5vw, 40px) !important;
        height: clamp(36px, 8.5vw, 40px) !important;
        inset-inline-end: clamp(0.4rem, 1.2vw, 0.5rem) !important;
        padding: clamp(0.5rem, 1.5vw, 0.6rem) !important;
    }
    
    .epic-search button i {
        font-size: clamp(0.9rem, 2.5vw, 1rem) !important;
    }
    
    /* تحسين شرائح الفلاتر */
    .epic-chips {
        display: flex;
        flex-wrap: wrap;
        gap: clamp(0.5rem, 1.5vw, 0.75rem) !important;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding-bottom: 0.25rem;
    }
    
    .epic-chips::-webkit-scrollbar {
        height: 4px;
    }
    
    .epic-chips::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
    }
    
    .epic-chip {
        padding: clamp(0.6rem, 1.8vw, 0.75rem) clamp(1rem, 2.5vw, 1.25rem) !important;
        font-size: clamp(0.8rem, 2.2vw, 0.9rem) !important;
        border-radius: clamp(18px, 4vw, 22px) !important;
        gap: clamp(0.4rem, 1.2vw, 0.5rem) !important;
        flex: 0 0 auto;
        white-space: nowrap;
        min-width: fit-content;
    }
    
    .epic-chip i {
        font-size: clamp(0.8rem, 2.2vw, 0.9rem) !important;
    }
    
    /* تحسين عنوان القسم */
    .section-title-box {
        margin-top: clamp(1rem, 2.5vw, 1.25rem) !important;
        margin-bottom: clamp(0.75rem, 2vw, 1rem) !important;
    }
    
    .section-title {
        font-size: clamp(1.3rem, 4vw, 1.6rem) !important;
        text-align: center !important;
    }
}

@media (max-width: 480px) {
    .banner-slider.banner-zoom-70 {
        min-height: clamp(160px, 32vw, 200px) !important;
    }
    
    .banner-slide {
        min-height: clamp(160px, 32vw, 200px) !important;
        padding: clamp(0.85rem, 2.5vw, 1.25rem) !important;
    }
    
    .banner-main-text {
        font-size: clamp(1rem, 3.2vw, 1.25rem) !important;
    }
    
    .epic-toolkit {
        padding: clamp(0.85rem, 2.5vw, 1.25rem) !important;
        gap: clamp(0.65rem, 2vw, 0.85rem) !important;
    }
    
    .epic-search input {
        padding: clamp(0.7rem, 1.8vw, 0.8rem) clamp(2.25rem, 5.5vw, 2.75rem) clamp(0.7rem, 1.8vw, 0.8rem) clamp(0.9rem, 2.2vw, 1.1rem) !important;
        font-size: clamp(0.85rem, 2.2vw, 0.95rem) !important;
    }
    
    .epic-chip {
        padding: clamp(0.55rem, 1.6vw, 0.7rem) clamp(0.9rem, 2.2vw, 1.1rem) !important;
        font-size: clamp(0.75rem, 2vw, 0.85rem) !important;
    }
}

/* ============================================
   تحسينات إضافية للجوال
   ============================================ */
@media (max-width: 768px) {
    /* إصلاح iOS Safari - منع الشاشة البيضاء عند فتح الكيبورد */
    html {
        height: -webkit-fill-available !important;
        min-height: -webkit-fill-available !important;
        min-height: calc(var(--vh, 1vh) * 100) !important;
        background-color: var(--bg-color) !important;
        background-attachment: fixed !important;
    }
    
    body {
        min-height: 100vh !important;
        min-height: calc(var(--vh, 1vh) * 100) !important;
        min-height: -webkit-fill-available !important;
        background-color: var(--bg-color) !important;
        background-attachment: fixed !important;
        background-size: cover !important;
    }
    
    /* إصلاح iOS Safari - التأكد من أن body::before و body::after يغطيان الشاشة دائماً */
    body::before,
    body::after {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        height: calc(var(--vh, 1vh) * 100) !important;
        height: -webkit-fill-available !important;
    }
    
    /* إصلاح iOS Safari - التأكد من أن جميع العناصر الرئيسية لديها background */
    .main,
    main,
    .container,
    .epic-container {
        background-color: transparent !important;
    }
    
    /* منع التكبير التلقائي في حقول الإدخال */
    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="tel"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important; /* يمنع التكبير التلقائي على iOS */
    }
    
    /* تحسين التمرير */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* تحسين الأداء */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* تحسين المسافات بين العناصر */
    .epic-grid,
    .games-grid,
    .services-grid {
        gap: clamp(0.75rem, 2vw, 1rem) !important;
    }
    
    /* تحسين البطاقات */
    .epic-card,
    .glass-panel {
        border-radius: clamp(16px, 3.5vw, 20px) !important;
        padding: clamp(1rem, 2.5vw, 1.5rem) !important;
    }
}

/* ============================================
   تحسينات خاصة للشاشات الصغيرة جداً
   ============================================ */
@media (max-width: 360px) {
    html {
        font-size: 12px !important;
    }
    
    .container,
    .epic-container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .header {
        min-height: 52px !important;
        height: 52px !important;
    }
    
    .logo-img {
        width: 45px !important;
        max-height: 45px !important;
    }
    
    .header-icon-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.85rem !important;
    }
}

/* ============================================
   تحسينات للوضع الأفقي على الجوال
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        min-height: 50px !important;
        height: 50px !important;
    }
    
    .logo-img {
        width: 50px !important;
        max-height: 50px !important;
    }
    
    .hero-banner,
    .banner-slider {
        min-height: clamp(180px, 35vw, 240px) !important;
    }
}

