/* ============================================================================
   NUCLEAR MOBILE FIX - FORCES ALL ELEMENTS TO VIEWPORT WIDTH
   This file MUST be loaded LAST to override everything
   ============================================================================ */

/* CRITICAL: Stop ALL horizontal overflow at root level */
html {
    overflow-x: hidden !important;
    width: 100vw !important;
    max-width: 100% !important;
    position: relative !important;
}

body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Force EVERY element to respect viewport on mobile */
@media (max-width: 767px) {
    /* Universal selector - force box-sizing */
    *, *::before, *::after {
        box-sizing: border-box !important;
    }
    
    /* Main wrappers */
    #page,
    .site,
    main,
    .main-content {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* ALL sections */
    section {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* ALL containers */
    .container,
    .container-fluid,
    [class*="container"] {
        width: 100% !important;
        max-width: 100vw !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        overflow-x: hidden !important;
    }
    
    /* Hero sections */
    .hero-carousel-centered,
    .hero-section,
    [class*="hero"] {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* Hero backgrounds */
    .hero-bg-container,
    .hero-bg-slide {
        width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        overflow: hidden !important;
    }
    
    /* Hero content */
    .hero-centered-content {
        width: 100% !important;
        max-width: 100vw !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .hero-content-inner {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Services section */
    .services-section-enhanced {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .services-grid-5col {
        width: 100% !important;
        max-width: 100% !important;
        grid-template-columns: 1fr !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .service-card-lovable {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    /* Images */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Header */
    header,
    .site-header {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Navigation */
    nav,
    .nav-menu {
        max-width: 100vw !important;
    }
    
    /* Footer */
    footer,
    .site-footer {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
    
    /* Rows */
    .row,
    [class*="row"] {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Columns */
    [class*="col-"] {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
    }
    
    /* Welcome section */
    .welcome-section {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Section titles */
    .section-title-primary,
    .section-title-centered {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Approaches section */
    .approaches-section,
    .approaches-grid {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Remove ANY negative margins */
    * {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Restore margins only for text elements inside containers */
    .container * {
        margin-left: 0;
        margin-right: 0;
    }
}

/* End Nuclear Mobile Fix */
