/* CRITICAL MOBILE RESPONSIVENESS FIX - NUCLEAR OPTION */
/* This file overrides any CSS that causes horizontal scrolling on mobile */

* {
    box-sizing: border-box !important;
}

html {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
    position: relative !important;
}

/* Fix for Bootstrap modal overflow - ULTRA AGGRESSIVE */
.modal {
    padding-left: 0 !important;
    padding-right: 0 !important;
}



.modal-content {
    max-width: 100% !important;
    width: 100% !important;
}

.modal-body {
    padding: 1rem !important;
    max-width: 100% !important;
}

@media (max-width: 768px) {
    .modal-dialog {
        max-width: calc(100vw - 134px) !important;
        margin: 8.5px !important;
        width: calc(100vw - 6px) !important;
    }

    .zipcode-entry {
        padding: 20px 15px !important;
    }

    .zipcode-entry__title {
        font-size: 18px !important;
    }

    .zipcode-entry__subtitle {
        font-size: 13px !important;
    }

    /* Prevent any element from being wider than viewport - EXCEPT product containers */
    .container:not(.custom-container),
    .container-fluid:not(.custom-container) {
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Allow product grid to breathe - don't force overflow hidden */
    .row:not(.shop-wrapper .row) {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Product columns should maintain proper grid */
    .col,
    [class*="col-"] {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Fix admin dashboard cards */
    .card:not(.single-product) {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    /* Fix any fixed-width elements */
    .ec-page-wrapper {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    .ec-content-wrapper {
        padding-left: 10px !important;
        padding-right: 10px !important;
        max-width: 100vw !important;
    }

    /* Admin sidebar mobile toggle */
    .sidebar-toggle {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Ensure sidebar works on mobile */
    .ec-left-sidebar {
        z-index: 1050 !important;
    }

    .sidebar-mobile-in .ec-left-sidebar {
        transform: translateX(0) !important;
    }
}

@media (max-width: 480px) {
    .modal-dialog {
        max-width: calc(100vw - 24px) !important;
        margin: 8.5px !important;
        width: calc(100vw - 6px) !important;
    }

    .modal-body {
        padding: 0.75rem !important;
    }

    .zipcode-entry {
        padding: 15px 10px !important;
    }
}