/* fixed_style.css - Mobile Fixes */

/* 1. Prevent horizontal scroll and maintain correct body sizes */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

/* 2. Fix the flex alignment and widths of components on mobile */
@media (max-width: 991px) {
    .container, .hero-grid-wrapper, .hero-content {
        max-width: 100% !important;
        box-sizing: border-box;
    }

    .hero-electrician-card {
        max-width: 100% !important;
        width: 100% !important;
        padding: 1.5rem !important;
        box-sizing: border-box;
    }

    /* AI Widget sidebar tab design is now handled in style.css */

    /* 4. Fix fixed width tables or calc cards leaking in width */
    .calc-home-grid {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .calc-home-inputs, .calc-home-result {
        width: 100% !important;
        box-sizing: border-box;
        overflow: hidden;
    }
}

/* Make sure all inputs don't expand off screen on mobile */
input, select, textarea {
    max-width: 100%;
    box-sizing: border-box;
}

/* Gallery and modal fixes for mobile */
.modal-content {
    max-width: 95% !important;
    margin: 1rem auto;
    box-sizing: border-box;
}

.gallery-grid {
    grid-template-columns: 1fr;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}
