/*
 * Mobile Width Override - Fix Cut-off Issues
 * Remove problematic min-width constraints on mobile
 */

/* Remove all problematic min-width constraints on mobile */
@media screen and (max-width: 768px) {
    /* Override any element with excessive min-width */
    * {
        min-width: unset !important;
    }
    
    /* Specifically fix known problematic elements */
    .features-grid,
    .service-cards,
    .pricing-table,
    .services-grid,
    .container,
    .section,
    .row,
    .col {
        min-width: unset !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Fix grid layouts */
    .features-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    .service-cards {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    .pricing-table {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        width: 100% !important;
        margin: 0 auto !important;
        flex-wrap: wrap !important;
    }
    
    /* Fix any flexbox layouts */
    .flex-container,
    .premium-hero-flex,
    .contact-grid {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
    }
    
    /* Fix specific cards and containers */
    .feature-card,
    .service-card,
    .pricing-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        margin: 0 auto 20px auto !important;
    }
    
    /* Fix images and media */
    .service-icon {
        width: 120px !important;
        height: 120px !important;
        max-width: 120px !important;
        min-width: unset !important;
    }
    
    .service-image {
        width: 100% !important;
        height: 150px !important;
        max-width: 100% !important;
        min-width: unset !important;
    }
    
    /* Fix navigation and header */
    .navbar,
    .nav-menu {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
    }
    
    /* Fix footer layout */
    .footer-content {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
    }
    
    /* Force proper container behavior */
    .container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }
    
    /* Fix any tables */
    table {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
    
    /* Fix gallery and sliders */
    .gallery-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
    }
    
    .swiper-container,
    .gallery-slider {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        overflow: hidden !important;
    }
    
    /* Fix form elements */
    .form-group,
    .form-control,
    input,
    textarea,
    select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        box-sizing: border-box !important;
    }
    
    /* Fix buttons */
    .btn,
    .premium-btn,
    .premium-contact-btn {
        width: 100% !important;
        max-width: 300px !important;
        min-width: unset !important;
        margin: 0 auto !important;
        box-sizing: border-box !important;
    }
    
    /* Fix testimonials */
    .testimonial-slider,
    .testimonial-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
    }
    
    /* Fix sections */
    section {
        width: 100% !important;
        max-width: 100% !important;
        min-width: unset !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow: hidden !important;
    }
    
    /* Force no horizontal overflow */
    html {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    body {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
        position: relative !important;
    }
}

/* Small mobile devices - even more restrictive */
@media screen and (max-width: 480px) {
    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr !important;
    }
    
    .service-icon {
        width: 100px !important;
        height: 100px !important;
    }
    
    .premium-btn,
    .premium-contact-btn {
        max-width: 100% !important;
        font-size: 0.95rem !important;
    }
}

/* Debug helper - shows viewport width */
@media screen and (max-width: 768px) {
    body::before {
        content: "Mobile View: " attr(data-width) "px";
        position: fixed;
        top: 0;
        right: 0;
        background: rgba(0,0,0,0.8);
        color: white;
        padding: 5px 10px;
        font-size: 12px;
        z-index: 9999;
        border-radius: 0 0 0 5px;
        display: none; /* Remove this line to show debug info */
    }
}