/* ==========================================
   FIX OVERFLOW HORIZONTAL MOBILE
   ========================================== */

/* Empêcher tout scroll horizontal sur mobile */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100%;
        position: relative;
    }
    
    /* Hero section - Optimisé pour voir la recherche sans scroll */
    .hero {
        overflow-x: hidden;
        max-width: 100vw;
        padding: 2rem 0 1.5rem !important;
        min-height: auto !important;
    }
    
    .hero-content {
        overflow-x: hidden;
        max-width: 100%;
        box-sizing: border-box;
        padding: 1rem 0.75rem !important;
    }
    
    .hero-title {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 0.75rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.95rem !important;
        margin-bottom: 1rem !important;
        line-height: 1.4 !important;
    }
    
    .hero-search {
        margin: 1rem auto !important;
    }
    
    .hero-stats {
        margin: 1.5rem auto !important;
        padding: 0 1rem;
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
        max-width: 100%;
    }
    
    .stat-item {
        width: 100%;
        max-width: 100%;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 1rem !important;
    }
    
    .stat-content {
        text-align: left !important;
        flex: 1;
    }
    
    /* Badge hero - empêcher débordement */
    .hero-badge {
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .badge-item {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    /* Badges opensource */
    .hero-opensource-badges {
        overflow-x: hidden;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .opensource-badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
        gap: 0.2rem;
        flex-shrink: 1;
        white-space: nowrap;
    }
    
    .opensource-badge i {
        font-size: 0.7rem;
    }
    
    /* Container général */
    .container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
        overflow-x: hidden;
        box-sizing: border-box;
    }
}

/* Très petits écrans */
@media (max-width: 480px) {
    .hero {
        padding: 1.5rem 0 1rem !important;
    }
    
    .hero-content {
        padding: 0.75rem 0.5rem !important;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
        margin-bottom: 0.65rem !important;
    }
    
    .hero-subtitle {
        font-size: 0.875rem !important;
        margin-bottom: 0.875rem !important;
        padding: 0 0.25rem;
    }
    
    .hero-search {
        margin: 0.875rem auto 1rem !important;
    }
    
    .hero-stats {
        margin: 1.25rem 0 !important;
    }
    
    .opensource-badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
        gap: 0.15rem;
    }
    
    .opensource-badge i {
        font-size: 0.65rem;
    }
    
    .hero-opensource-badges {
        gap: 0.35rem;
    }
}

/* Correction spécifique pour le texte des badges */
@media (max-width: 360px) {
    .opensource-badge {
        font-size: 0.65rem;
        padding: 0.25rem 0.5rem;
    }
    
    .opensource-badge i {
        font-size: 0.6rem;
    }
}
