/* =========================================
   RESPONSIVE QUERIES
   ========================================= */

/* Tablets y Laptops Pequeñas (Max 1024px) */
@media (max-width: 1024px) {
    :root {
        --section-padding: 6rem 0;
    }
    .title-xl { font-size: clamp(2.5rem, 8vw, 4.5rem); }
    .title-lg { font-size: clamp(2rem, 6vw, 3.5rem); }
    .title-md { font-size: clamp(1.8rem, 5vw, 2.8rem); }
    
    .nav-container { padding: 0 4%; }
    
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr;
        gap: 2rem;
    }
}

/* Tablets (Max 992px) */
@media (max-width: 992px) {
    .nav-links {
        display: none; /* Se activará vía JS con nav-active */
    }

    .mobile-menu-btn {
        display: block;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Teléfonos Grandes (Max 768px) */
@media (max-width: 768px) {
    /* Normalizadores Móviles Globales */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    img[style*="height"] {
        max-height: 400px !important;
        object-fit: cover !important;
    }

    .section-padding { padding: 4rem 0; }
    
    /* Navbar Mobile Overlay (Cortina Descendente) */
    .nav-links {
        display: flex;
        position: fixed;
        top: -100vh; /* Empieza fuera de pantalla arriba */
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: rgba(17, 17, 17, 0.98);
        backdrop-filter: blur(25px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: all 0.8s cubic-bezier(0.85, 0, 0.15, 1);
        z-index: 1000;
        gap: 3rem;
    }
    
    .nav-links.nav-active {
        top: 0; /* Baja hasta cubrir todo */
    }
    
    .nav-links a {
        font-size: 1.8rem;
        font-weight: 800;
        letter-spacing: 2px;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }
    
    .mobile-menu-btn {
        z-index: 1001;
        position: relative;
    }

    /* Grid Adjustments */
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-brand p {
        margin: 0 auto;
    }

    /* Grids Asimétricos (Servicios) */
    [style*="grid-template-columns: 1.2fr 0.8fr"],
    [style*="grid-template-columns: 0.8fr 1.2fr"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Index Grid Fixes */
    [style*="grid-template-columns: repeat(12, 1fr)"] {
        display: flex !important;
        flex-direction: column;
        gap: 2rem;
    }

    [style*="grid-column: span"] {
        grid-column: span 12 !important;
        min-height: 450px !important;
    }
    
    [style*="left: 4rem"] {
        left: 2rem !important;
        right: 2rem !important;
        max-width: 100% !important;
    }

    /* Hero adjustments */
    header {
        padding: 140px 0 60px !important;
        text-align: center;
    }

    .parallax-bg {
        background-attachment: scroll !important; /* Disable parallax on mobile */
    }

    /* Prevent horizontal overflow from animations */
    .reveal-left { transform: translateY(40px) !important; }
    .reveal-right { transform: translateY(40px) !important; }
    
    .reveal-left.active, .reveal-right.active {
        transform: translateY(0) !important;
    }
}

/* Teléfonos Pequeños (Max 480px) */
@media (max-width: 480px) {
    .title-xl { font-size: 2.2rem; }
    .title-lg { font-size: 1.8rem; }
    .btn { width: 100%; text-align: center; }
    .nav-container .logo img { height: 40px; }
}
