/**
 * Responsive fixes for Bus Stops Australia theme
 * Removes horizontal scrollbars and fixes layout issues
 */

/* Fix horizontal overflow issues */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
    width: 100%;
    padding: 0;
    margin: 0;
}

#page, .site {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    padding: 0;
    margin: 0;
}

/* Fix container width issues */
.container {
    width: 100%;
    max-width: 100% !important;
    box-sizing: border-box;
    overflow-x: hidden;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Fix search form responsiveness */
.search-form {
    box-sizing: border-box;
    width: 100%;
    padding: 2rem 1rem;
    max-width: 100% !important;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767px) {
    .search-col {
        width: 100%;
        min-width: 100%;
    }
    
    .search-select {
        max-width: 100%;
    }
    
    .search-button {
        max-width: 100%;
    }
    
    .search-section .container,
    .browse-section .container,
    .popular-section .container,
    .faq-section .container {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .hero-content {
        padding-left: 1rem;
        padding-right: 1rem;
        box-sizing: border-box;
    }
    
    .card-grid {
        grid-template-columns: 1fr !important;
        padding: 0 !important;
    }
}

/* Fix for any absolute positioned elements that might cause overflow */
.site-header, 
.site-footer,
.hero-section,
.search-section,
.browse-section,
.popular-section,
.faq-section {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Fix search form layout */
.search-row {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

/* Fix for any potential overflow issues */
.site-main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Fix for any inline styles that might be causing overflow */
[style*="width"] {
    max-width: 100% !important;
    box-sizing: border-box;
}

/* Fix for images */
img {
    max-width: 100%;
    height: auto;
}
