/* ==========================================
   RESPONSIVE FIXES - Mobile First
   Corrections pour éviter le débordement horizontal
   ========================================== */

/* Reset global */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* Container responsive */
.container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

@media (min-width: 768px) {
    .container {
        max-width: 1200px !important;
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* Navigation responsive */
.nav-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    box-sizing: border-box !important;
}

.navbar {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

/* Sections responsive */
section {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

/* Images responsive */
img {
    max-width: 100% !important;
    height: auto !important;
}

/* Rows et colonnes responsive */
.row {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

[class*="col-"] {
    width: 100% !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
}

/* Hero section responsive */
.hero {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.hero-content {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Services, Portfolio responsive */
.services-grid,
.portfolio-grid {
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Footer responsive */
footer {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

/* Mobile specific (< 768px) */
@media (max-width: 767px) {
    /* Réduire les paddings sur mobile */
    .section-padding {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Titres responsive */
    h1 {
        font-size: 2rem !important;
        line-height: 1.2 !important;
    }
    
    h2 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    /* Boutons responsive */
    .btn {
        padding: 0.75rem 1.5rem !important;
        font-size: 0.9rem !important;
        white-space: nowrap !important;
    }
    
    /* Cards responsive */
    .service-card,
    .portfolio-item,
    .blog-card {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Grid responsive */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Forms responsive */
    input,
    textarea,
    select {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Tables responsive */
    table {
        width: 100% !important;
        display: block !important;
        overflow-x: auto !important;
    }
}

/* Desktop (≥ 768px) */
@media (min-width: 768px) {
    .container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* Corrections spécifiques éléments qui débordent souvent */
.animated-shapes,
.shape,
.background-shape {
    max-width: 100vw !important;
    overflow: hidden !important;
}

/* Slider/Carousel responsive */
.slider,
.carousel {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Video responsive */
.video-container {
    width: 100% !important;
    max-width: 100% !important;
}

.video-wrapper {
    width: 100% !important;
    position: relative !important;
    padding-bottom: 56.25% !important; /* 16:9 aspect ratio */
    height: 0 !important;
}

.video-wrapper iframe {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
}

video {
    max-width: 100% !important;
    height: auto !important;
}

/* Prevent horizontal scroll */
.no-scroll-x {
    overflow-x: hidden !important;
}

/* Utility classes */
.mobile-hide {
    display: none !important;
}

@media (min-width: 768px) {
    .mobile-hide {
        display: block !important;
    }
    
    .desktop-hide {
        display: none !important;
    }
}

/* Text wrapping */
.text-wrap {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
}

/* Flexbox responsive */
.flex-container {
    display: flex !important;
    flex-wrap: wrap !important;
    width: 100% !important;
}

.flex-item {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

/* Debug helper (à retirer en production) */
.debug-overflow * {
    outline: 1px solid red !important;
}


