/**
 * Mobile Responsive Fixes
 * Prevents horizontal scroll and text overflow on mobile devices
 */

/* Prevent horizontal overflow on all pages */
html {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
}

/* Ensure all containers respect viewport width */
* {
    box-sizing: border-box;
}

/* Fix container overflow on mobile */
@media screen and (max-width: 768px) {
    .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }
    
    /* Fix section padding */
    .section {
        padding-left: 0 !important;
        padding-right: 0 !important;
        overflow-x: hidden;
    }
    
    /* Fix hero section on mobile */
    .hero,
    .drone-hero {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Fix heading sizes on mobile */
    h1, .hero-title {
        font-size: clamp(1.75rem, 5vw, 2.5rem) !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    h2, .section-title {
        font-size: clamp(1.5rem, 4vw, 2rem) !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    h3 {
        font-size: clamp(1.25rem, 3.5vw, 1.75rem) !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix paragraph text */
    p {
        font-size: clamp(0.875rem, 2.5vw, 1rem) !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Fix button sizes */
    .btn {
        font-size: 0.875rem !important;
        padding: 0.75rem 1.25rem !important;
        white-space: normal;
        word-wrap: break-word;
    }
    
    /* Fix stats display */
    .hero-stats {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        justify-content: center !important;
    }
    
    .hero-stat {
        font-size: 0.75rem !important;
        white-space: nowrap;
    }
    
    /* Fix grid layouts */
    .servicos-grid,
    .portfolio-grid,
    .benefits-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Fix cards */
    .servico-card,
    .portfolio-item,
    .benefit-card {
        margin-bottom: 1rem;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Fix images */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix video containers */
    .video-container,
    iframe {
        max-width: 100%;
    }
    
    /* Fix FAQ accordion */
    .faq-item {
        width: 100% !important;
        overflow: hidden;
    }
    
    .faq-question {
        font-size: 0.875rem !important;
        padding: 1rem !important;
        word-wrap: break-word;
    }
    
    .faq-answer p {
        font-size: 0.875rem !important;
        word-wrap: break-word;
    }
    
    /* Fix hero content on Agro/Máquinas pages */
    .agro-hero-content,
    .maquinas-hero-content {
        padding: 1rem !important;
    }
    
    .agro-hero-content h1,
    .maquinas-hero-content h1 {
        font-size: clamp(1.5rem, 4vw, 2rem) !important;
        line-height: 1.2 !important;
    }
    
    /* Fix gradient text on mobile */
    .gradient-text {
        display: block;
        font-size: clamp(1.75rem, 5vw, 2.5rem) !important;
    }
    
    /* Fix WhatsApp floating button on mobile */
    .whatsapp-float {
        bottom: 20px !important;
        right: 20px !important;
        width: 50px !important;
        height: 50px !important;
    }
    
    .whatsapp-float .whatsapp-text {
        display: none !important;
    }
    
    /* Fix footer on mobile */
    .footer-content {
        flex-direction: column !important;
        gap: 2rem !important;
    }
    
    .footer-col {
        width: 100% !important;
        text-align: center;
    }
    
    /* Fix tables on mobile */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Fix equipamentos section on Máquinas Pesadas page */
    .equipamentos-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .equipamento-item {
        font-size: 0.75rem !important;
        padding: 0.75rem 0.5rem !important;
    }
    
    /* Fix highlighted sections */
    .equipamentos-destaque,
    .experiencia-destaque {
        font-size: 1rem !important;
        padding: 1rem !important;
        margin: 1rem 0 !important;
    }
    
    /* Hide line breaks on mobile for cleaner text */
    br.hide-mobile {
        display: none;
    }
}

/* Extra small devices (phones in portrait, less than 375px) */
@media screen and (max-width: 375px) {
    .container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    h1, .hero-title {
        font-size: 1.5rem !important;
    }
    
    h2, .section-title {
        font-size: 1.25rem !important;
    }
    
    .btn {
        font-size: 0.75rem !important;
        padding: 0.625rem 1rem !important;
    }
    
    .hero-stat {
        font-size: 0.625rem !important;
    }
}
