/* Responsive Utilities for Sintrix Technology Website */

/* Fix para overflow horizontal */
* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

body {
    margin: 0;
    padding: 0;
}

/* Preloader responsivo - FIX PRINCIPAL */
#preloader {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow: hidden !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    box-sizing: border-box !important;
}

.loader {
    position: relative;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box;
}

.scanner {
    max-width: 100% !important;
    overflow: hidden !important;
    word-wrap: break-word;
    box-sizing: border-box;
}

.scanner::after {
    max-width: 100% !important;
    overflow: hidden !important;
}

@media (max-width: 768px) {
    #preloader {
        width: 100vw !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        overflow-y: hidden !important;
    }
    
    .scanner {
        font-size: 1.5rem !important;
        max-width: 90vw !important;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .scanner {
        font-size: 1.2rem !important;
        max-width: 80vw !important;
    }
}

/* Containers responsivos */
@media (max-width: 640px) {
    .container {
        max-width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .container {
        max-width: 640px;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 768px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (min-width: 1025px) {
    .container {
        max-width: 1200px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Navigation básica - responsividade está no style.css */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Nota: CSS responsivo do menu está no style.css para evitar conflitos */

/* Hero section responsiva */
@media (max-width: 768px) {
    .hero {
        min-height: 80vh;
        padding: 80px 0 40px;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin: 1rem 0;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .hero-stats {
        margin-top: 2rem;
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0;
        padding: 0;
        box-sizing: border-box;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-left: 0;
        scroll-padding-right: 0;
        -webkit-overflow-scrolling: touch;
    }

    .hero-stats::-webkit-scrollbar {
        height: 6px;
    }

    .hero-stats::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 999px;
    }
    
    .hero-stats .stat-item {
        text-align: center;
        margin-bottom: 0;
        justify-content: center;
        padding: 1rem;
        box-sizing: border-box;
        flex: 0 0 100%;
        min-width: 100%;
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    .hero-stats .stat-item:not(:last-child)::after {
        display: none;
    }

    .hero-stats .stat-label {
        white-space: normal;
        line-height: 1.2;
    }
}

@media (max-width: 480px) {
    .hero-stats .stat-item {
        flex: 0 0 100%;
        min-width: 100%;
    }
}

/* About section responsiva */
@media (max-width: 1023px) {
    .about-container {
        flex-direction: column;
        gap: 2rem;
    }
    
    .about-content {
        text-align: center;
    }
}

/* Services grid responsiva */
@media (max-width: 768px) {
    .trust-section .tech-logos {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.75rem;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0.25rem 0.25rem 0.5rem;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .trust-section .tech-logos::-webkit-scrollbar {
        height: 6px;
    }

    .trust-section .tech-logos::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 999px;
    }

    .trust-section .tech-item {
        flex: 0 0 calc(50% - 0.5rem);
        min-width: calc(50% - 0.5rem);
        scroll-snap-align: center;
        padding: 0.5rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .trust-section .tech-item {
        flex: 0 0 75%;
        min-width: 75%;
    }
}

/* Solutions section responsiva */
@media (max-width: 768px) {
    .main-solutions {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .solution-compact {
        padding: 1rem;
    }
    
    .infra-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .main-solutions {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .infra-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Contact section responsiva */
@media (max-width: 1023px) {
    .contact-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .contact-form {
        order: 2;
    }
    
    .contact-info {
        order: 1;
    }
}

/* Footer responsivo */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* Botões responsivos */
@media (max-width: 480px) {
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1.5rem;
    }
}

/* Cards responsivos */
@media (max-width: 768px) {
    .highlight-item,
    .service-card,
    .solution-compact,
    .infra-item {
        margin-bottom: 1rem;
    }
}

/* Animações responsivas */
@media (max-width: 768px) {
    [data-aos] {
        animation-duration: 0.6s !important;
    }
}

/* Text sizes responsivos */
@media (max-width: 480px) {
    .section-title {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    .section-subtitle {
        font-size: 0.875rem;
    }
    
    .section-description {
        font-size: 0.9rem;
    }
}

/* Forms responsivos */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    input, select, textarea {
        font-size: 16px; /* Evita zoom no iOS */
    }
}

/* Spacing responsivo */
@media (max-width: 768px) {
    section {
        padding: 3rem 0;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
}

/* Images responsivas */
img {
    max-width: 100%;
    height: auto;
}

/* PRELOADER FIX FINAL - PRIORIDADE MÁXIMA */
#preloader {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    overflow-x: hidden !important;
    overflow-y: hidden !important;
    box-sizing: border-box !important;
    z-index: 9999 !important;
}

#preloader .loader {
    max-width: 100% !important;
    overflow: hidden !important;
}

#preloader .scanner {
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Overflow responsivo */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }
    
    #preloader {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        overflow: hidden !important;
    }
}

/* Benefits Section Responsive */
@media (max-width: 968px) {
    .benefits-modern {
        padding: 60px 0;
    }
    
    .section-intro {
        margin-bottom: 40px;
        padding: 0 15px;
    }
    
    .benefit-row,
    .benefit-row.reverse {
        grid-template-columns: 1fr !important;
        gap: 30px;
        margin-bottom: 50px;
        padding: 0 15px;
    }
    
    .benefit-row.reverse .benefit-visual {
        order: 0 !important;
    }
    
    .benefit-icon-large {
        width: 100px !important;
        height: 100px !important;
    }
    
    .benefit-icon-large i {
        font-size: 42px !important;
    }
    
    .benefit-content {
        text-align: center;
    }
    
    .benefit-highlights {
        align-items: center;
    }
    
    .highlight-item {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .benefits-modern {
        padding: 40px 0;
    }
    
    .benefit-icon-large {
        width: 80px !important;
        height: 80px !important;
    }
    
    .benefit-icon-large i {
        font-size: 36px !important;
    }
    
    .benefit-row {
        margin-bottom: 40px;
    }
}