/* ===== RESPONSIVE MOBILE FIRST - MEJORAS EXTREMAS PARA CELULAR ===== */

@media (max-width: 768px) {
    /* === HEADER Y NAVEGACIÓN MOBILE === */
    .nav-container {
        padding: 0.75rem 1rem;
    }
    
    .logo img {
        height: 40px;
    }
    
    /* === HERO SECTION MOBILE === */
    .hero {
        height: 40vh;
        margin-top: 60px;
    }
    
    .hero-content-section {
        padding: 2.5rem 1rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* === SECCIONES GENERALES MOBILE === */
    .section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    /* === CALCULADORA MOBILE - RESULTADO ABAJO === */
    .calculator-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .calculator-result {
        order: 2;
        margin-top: 1rem;
    }
    
    .calculator-form {
        order: 1;
    }
    
    .calculator-form,
    .calculator-result {
        padding: 1.5rem;
    }
    
    .km-result {
        font-size: 2.5rem;
    }
    
    /* === CONTACTO MOBILE - INFORMACIÓN ABAJO === */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-info {
        order: 2;
        margin-top: 1rem;
    }
    
    .contact-form {
        order: 1;
    }
    
    /* === WHATSAPP FLOAT MOBILE === */
    #whatsapp-float {
        bottom: 20px;
        right: 20px;
    }
    
    #whatsapp-float img {
        width: 55px;
        height: 55px;
    }
    
    /* === OPTIMIZACIONES MÓVIL === */
    .tech-card:hover,
    .product-card:hover,
    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }
}

@media (max-width: 480px) {
    /* === MOBILE PEQUEÑO === */
    .nav-container {
        padding: 1rem;
    }
    
    .hero {
        height: 35vh;
    }
    
    .hero-content-section {
        padding: 2rem 0.75rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section {
        padding: 2.5rem 0;
    }
    
    .section-title {
        font-size: 1.6rem;
    }
    
    .tech-card,
    .product-card {
        padding: 1.25rem;
    }
    
    .calculator-form,
    .contact-form,
    .contact-info {
        padding: 1.25rem;
    }
    
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
    
    #whatsapp-float {
        bottom: 15px;
        right: 15px;
    }
    
    #whatsapp-float img {
        width: 50px;
        height: 50px;
    }
}

/* === MEJORAS ESPECÍFICAS PARA CELULAR === */

/* Evitar zoom en inputs en iOS */
@media (max-width: 768px) {
    select, input, textarea {
        font-size: 16px; /* Previene zoom en iOS */
    }
}

/* Mejorar scroll en móvil */
@media (max-width: 768px) {
    html {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* Optimizar botones para touch */
@media (max-width: 768px) {
    .btn, .filter-btn, select {
        min-height: 44px; /* Tamaño mínimo para touch */
    }
}

/* Mejorar espaciado general en móvil */
@media (max-width: 768px) {
    body {
        line-height: 1.5;
    }
    
    p, li, .desc, .status {
        line-height: 1.5;
    }
}

/* Mejorar visibilidad de estados loading */
@media (max-width: 768px) {
    .loading::after {
        width: 24px;
        height: 24px;
        margin: -12px 0 0 -12px;
    }
    
    .spinner {
        width: 32px;
        height: 32px;
    }
}

/* === CORRECCIONES DE ACCESIBILIDAD MOBILE === */
@media (max-width: 768px) {
    /* Asegurar contraste suficiente */
    .muted, .status {
        color: #6b7280 !important;
    }
    
    .help-text {
        color: #6b7280 !important;
    }
    
    /* Mejorar focus en móvil */
    button:focus-visible,
    a:focus-visible,
    select:focus-visible {
        outline: 3px solid #22c55e;
        outline-offset: 2px;
    }
}

/* === ORIENTACIÓN LANDSCAPE === */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        height: 60vh;
    }
    
    .hero-content-section {
        padding: 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .btn {
        width: auto;
        min-width: 200px;
    }
}

/* === PANTALLAS MUY PEQUEÑAS (iPhone SE, etc) === */
@media (max-width: 320px) {
    .wrap {
        padding: 0.25rem;
    }
    
    .header h1 {
        font-size: 1.3rem;
    }
    
    .card {
        padding: 0.75rem 0.5rem;
        margin: 0 0.125rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    #whatsapp-float img {
        width: 45px;
        height: 45px;
    }
}

/* Optimizar para móviles lentos */
@media (max-width: 768px) and (prefers-reduced-data: reduce) {
    .tech-card,
    .product-card {
        background: var(--white);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .hero-image {
        max-height: 50vh;
        object-fit: cover;
    }
}

/* Pantallas muy grandes */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* Mejoras de impresión */
@media print {
    .header,
    #whatsapp-float,
    .hero-buttons {
        display: none;
    }
    
    .hero {
        margin-top: 0;
        height: auto;
    }
    
    .section {
        padding: 2rem 0;
        break-inside: avoid;
    }
    
    body {
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}