/* ============================================
   OTIMIZAÇÕES AVANÇADAS PARA MOBILE
   ============================================ */

/* Mobile First - Breakpoints */
@media (max-width: 480px) {
    /* Smartphones pequenos */
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-headline {
        font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
        line-height: 1.2 !important;
        margin-bottom: var(--spacing-md) !important;
    }
    
    .hero-subheadline {
        font-size: clamp(0.875rem, 4vw, 1rem) !important;
        margin-bottom: var(--spacing-lg) !important;
    }
    
    .hero {
        padding: calc(var(--spacing-2xl) + 30px) 0 var(--spacing-lg) !important;
    }
    
    .hero-actions {
        gap: var(--spacing-sm) !important;
    }
    
    .cta-primary-hero,
    .cta-secondary-hero {
        font-size: 0.9375rem !important;
        padding: 14px 20px !important;
    }
    
    /* Formulário mobile pequeno */
    .contact-form {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .form-row {
        flex-direction: column !important;
        gap: var(--spacing-md) !important;
    }
    
    .form-group {
        width: 100% !important;
        margin-bottom: var(--spacing-md) !important;
    }
    
    /* Cards mobile pequeno */
    .feature-card,
    .problem-card,
    .solution-card {
        margin-bottom: var(--spacing-md);
    }
    
    .floating-card {
        min-width: 100px !important;
        padding: var(--spacing-xs) !important;
        font-size: 0.75rem !important;
    }
    
    .floating-card .stat-number {
        font-size: 1.25rem !important;
    }
}

@media (max-width: 768px) {
    /* Tablets e smartphones grandes */
    
    /* Melhorar performance mobile */
    * {
        -webkit-tap-highlight-color: rgba(255, 107, 53, 0.2);
    }
    
    /* Header mobile otimizado */
    .header {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .navbar {
        padding: var(--spacing-sm) 0;
        min-height: 60px;
    }
    
    .logo-image {
        height: 50px;
        max-width: 180px;
    }
    
    /* Menu mobile melhorado */
    .menu-toggle {
        width: 44px;
        height: 44px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1001;
    }
    
    .menu-toggle span {
        width: 24px;
        height: 3px;
        background: var(--text-primary);
        border-radius: 2px;
        transition: var(--transition);
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    .nav-menu {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: var(--spacing-lg);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-menu li {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-link {
        display: block;
        padding: 16px 20px;
        font-size: 1rem;
        width: 100%;
        text-align: left;
    }
    
    /* Hero mobile otimizado */
    .hero-content {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-xl) !important;
    }
    
    .hero-text {
        order: 1;
        text-align: center;
    }
    
    .hero-visual {
        order: 2;
    }
    
    .hero-headline {
        font-size: clamp(2rem, 7vw, 3rem);
        line-height: 1.15;
    }
    
    .hero-image-wrapper {
        max-width: 100%;
        margin: 0 auto;
    }
    
    .machine-image {
        max-width: 100%;
        height: auto;
    }
    
    /* Cards flutuantes mobile - reposicionar */
    .floating-card {
        position: relative !important;
        transform: none !important;
        margin: var(--spacing-sm) 0;
        width: 100%;
        max-width: 200px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .stat-card-1,
    .stat-card-2,
    .stat-card-3 {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }
    
    /* Formulário mobile otimizado */
    .contact-form {
        width: 100%;
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .form-row {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .form-group {
        width: 100%;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select {
        width: 100%;
        min-height: 50px;
        font-size: 16px; /* Previne zoom no iOS */
        padding: 14px 16px;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    select {
        background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23404040' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 16px center;
        padding-right: 40px;
    }
    
    button[type="submit"],
    .cta-primary {
        width: 100%;
        min-height: 52px;
        font-size: 1rem;
        font-weight: 600;
        padding: 16px 24px;
        border-radius: 12px;
    }
    
    /* Seções mobile */
    section {
        padding: var(--spacing-2xl) 0;
        scroll-margin-top: 60px;
    }
    
    .section-title {
        font-size: clamp(1.75rem, 6vw, 2.25rem);
        line-height: 1.2;
        margin-bottom: var(--spacing-md);
    }
    
    /* Grids mobile - uma coluna */
    .features-grid,
    .testimonials-grid,
    .problems-grid,
    .solution-grid,
    .about-specs-grid {
        grid-template-columns: 1fr !important;
        gap: var(--spacing-md);
    }
    
    /* Cards mobile */
    .feature-card,
    .problem-card,
    .solution-card {
        width: 100%;
        margin-bottom: var(--spacing-md);
    }
    
    .feature-card-inner,
    .problem-card-inner,
    .solution-card-inner {
        padding: var(--spacing-lg);
    }
    
    /* Tabela mobile - scroll horizontal */
    .comparison-table {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: var(--spacing-lg) 0;
    }
    
    .comparison-table table {
        min-width: 600px;
    }
    
    /* FAQ mobile */
    .faq-item {
        margin-bottom: var(--spacing-md);
    }
    
    .faq-question-btn {
        width: 100%;
        padding: var(--spacing-md);
        text-align: left;
        min-height: 56px;
    }
    
    /* Footer mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
        text-align: center;
    }
    
    .footer-section {
        margin-bottom: var(--spacing-lg);
    }
    
    /* Botão flutuante mobile */
    .floating-button-wrapper {
        bottom: 20px;
        right: 20px;
    }
    
    .floating-button {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        padding: 0;
    }
    
    .floating-button-text {
        display: none;
    }
    
    /* Pop-up mobile */
    .promo-popup-content {
        width: 95%;
        max-width: 95%;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .promo-popup-body {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    /* Vídeo mobile */
    .video-modal-content {
        width: 95%;
        max-width: 95%;
        padding: var(--spacing-sm);
    }
    
    /* Imagens responsivas */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Melhorar scroll suave */
    html {
        scroll-behavior: smooth;
    }
    
    /* Reduzir animações pesadas em mobile */
    .floating-card,
    .stat-card-1,
    .stat-card-2,
    .stat-card-3 {
        animation: none !important;
    }
    
    /* Otimizar performance */
    .hero-background,
    .solution-background {
        will-change: auto;
    }
}

/* Mobile Landscape */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: calc(var(--spacing-xl) + 30px) 0 var(--spacing-lg) !important;
        min-height: auto !important;
    }
    
    .hero-content {
        gap: var(--spacing-md) !important;
    }
    
    .nav-menu {
        max-height: calc(100vh - 60px);
    }
}

/* Touch devices - melhorar área de toque */
@media (hover: none) and (pointer: coarse) {
    button,
    a,
    .nav-link,
    .faq-question-btn,
    .promo-popup-close {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remover hover effects em touch */
    *:hover {
        transform: none !important;
    }
}

/* Performance mobile - reduzir animações */
@media (max-width: 768px) and (prefers-reduced-motion: no-preference) {
    * {
        animation-duration: 0.3s !important;
        transition-duration: 0.2s !important;
    }
}

/* Melhorar legibilidade mobile */
@media (max-width: 768px) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
    
    p, li, span {
        line-height: 1.6;
    }
    
    h1, h2, h3 {
        line-height: 1.2;
    }
    
    /* Melhorar scroll em mobile */
    body {
        overflow-x: hidden;
    }
    
    /* Garantir que imagens não quebrem layout */
    img {
        max-width: 100%;
        height: auto;
        display: block;
    }
    
    /* Melhorar botões de ação */
    .cta-primary,
    .cta-secondary,
    .cta-primary-hero,
    .cta-secondary-hero {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(255, 107, 53, 0.3);
    }
    
    /* Melhorar área de toque em links */
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        padding: 8px 0;
    }
    
    /* Otimizar tabelas para mobile */
    table {
        width: 100%;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Melhorar carrosséis mobile */
    .carousel-track,
    .logos-carousel,
    .countries-carousel {
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
    }
}

