/* =======================================
   Mobile Horizontal Scroll Fix
   ======================================= */

/* Prevent horizontal scrolling globally */
html, body {
    max-width: 100% !important;
    overflow-x: hidden !important;
    position: relative !important;
}

/* Main wrapper to contain everything */
#main-wrapper {
    overflow-x: hidden !important;
    position: relative !important;
    width: 100% !important;
}

/* Fix for all sections */
section {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    position: relative !important;
}

/* Container fixes */
.container {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    overflow-x: hidden !important;
}

/* Fix absolute positioned elements */
*[class*="absolute"] {
    max-width: 100vw !important;
}

/* Fix transform elements that might cause overflow */
*[class*="translate-x"] {
    max-width: 100% !important;
}

/* Mobile specific fixes */
@media (max-width: 768px) {
    /* Reset any negative margins */
    * {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Allow controlled margins */
    .container > * {
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    /* Fix grid and flex containers */
    .grid, .flex {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Fix images and media */
    img, video, iframe {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Fix cards and rounded elements */
    .rounded-full, .rounded-2xl, .rounded-3xl {
        max-width: calc(100vw - 2rem) !important;
    }
    
    /* Fix the WhatsApp button position */
    a[href^="https://wa.me"] {
        right: 1rem !important;
        bottom: 1.5rem !important;
    }
    
    /* Fix popup width */
    #newsletter-popup .max-w-lg {
        max-width: calc(100vw - 2rem) !important;
        margin: 0 1rem !important;
    }
    
    /* Prevent decorative elements from causing overflow */
    .bg-pink-200.rounded-full.filter,
    .bg-purple-200.rounded-full.filter {
        max-width: 200px !important;
        max-height: 200px !important;
    }
}

/* Extra safety for smaller devices */
@media (max-width: 480px) {
    /* Even stricter controls for very small screens */
    body {
        width: 100vw !important;
    }
    
    /* Ensure nothing can escape viewport */
    * {
        max-width: 100vw !important;
    }
    
    /* Fix any elements with fixed widths */
    [class*="w-96"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    [class*="w-72"] {
        width: 80% !important;
        max-width: 80% !important;
    }
    
    /* Adjust padding for very small screens */
    .px-4 {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    .p-8 {
        padding: 1.5rem !important;
    }
}