/* CORRECCIONES ESPECÍFICAS PARA MÓVIL - VECINET */
/* Fixing oversized images and boxes on mobile devices */

/* ========================================
   RESET Y CONFIGURACIÓN BÁSICA MÓVIL
======================================== */

/* Asegurar que el viewport se comporte correctamente */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* ========================================
   CORRECCIONES GENERALES RESPONSIVE
======================================== */

/* Media queries Mobile First */
@media (max-width: 768px) {
    
    /* Container adjustments */
    .container {
        padding: 0 0.75rem;
        max-width: 100%;
    }
    
    /* Hero section fixes */
    .hero {
        padding: 5rem 0 3rem;
        min-height: auto;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    /* Hero image fixes - CRÍTICO */
    .hero-image {
        order: -1;
        max-width: 100%;
        margin: 0 auto;
    }
    
    .hero-image img {
        width: 100%;
        max-width: 350px;
        height: auto;
        margin: 0 auto;
        display: block;
    }
    
    /* Logo fixes */
    .hero-logo {
        margin-bottom: 1.5rem;
    }
    
    .hero-logo-img,
    .hero-logo-fallback {
        height: 80px;
        max-width: 200px;
        width: auto;
    }
    
    /* Plans grid fixes */
    .plans-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .plan-card {
        padding: 1.5rem;
        margin: 0;
        max-width: 100%;
    }
    
    .plan-card.featured {
        transform: none;
        border-width: 3px;
    }
    
    /* Price display fixes */
    .amount {
        font-size: 2.5rem;
    }
    
    /* Coverage section fixes */
    .coverage-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .coverage-stats {
        justify-content: space-around;
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    /* Banking section fixes - MUY IMPORTANTE */
    .bank-payment-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0 0.5rem;
    }
    
    .bank-payment-card {
        padding: 1rem;
        margin: 0;
    }
    
    .bank-logo {
        width: 100%;
        height: 120px;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .bank-logo img {
        height: 100px;
        max-width: 250px;
        width: auto;
    }
    
    /* All banks container fixes - CRÍTICO PARA MÓVIL */
    .all-banks-container {
        width: 98% !important;
        min-height: 160px !important;
        padding: 1rem !important;
        margin: 0 auto 1.5rem auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        position: relative !important;
    }
    
    .payment-section-title-inside {
        position: static !important;
        margin-bottom: 1rem !important;
        text-align: center !important;
        font-size: 1.1rem !important;
        color: var(--primary-color) !important;
    }
    
    /* Logos bancarios en stack vertical para móvil */
    .main-logo {
        position: static !important;
        display: block !important;
        width: 150px !important;
        height: 60px !important;
        margin: 0.5rem auto !important;
        top: auto !important;
        left: auto !important;
        transform: none !important;
    }
    
    .main-logo img {
        height: 50px !important;
        max-width: 140px !important;
        width: auto !important;
        object-fit: contain !important;
    }
    
    .mi-vecino-logo {
        position: static !important;
        display: block !important;
        width: 120px !important;
        height: 50px !important;
        margin: 0.5rem auto !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
    }
    
    .mi-vecino-logo img {
        height: 40px !important;
        max-width: 110px !important;
        width: auto !important;
        object-fit: contain !important;
    }
    
    .guayaquil-logo {
        position: static !important;
        display: block !important;
        width: 150px !important;
        height: 60px !important;
        margin: 0.5rem auto !important;
        top: auto !important;
        right: auto !important;
        transform: none !important;
    }
    
    .guayaquil-logo img {
        height: 50px !important;
        max-width: 140px !important;
        width: auto !important;
        object-fit: contain !important;
    }
    
    /* Footer fixes - CRÍTICO */
    .footer {
        padding: 2rem 0 0 !important;
    }
    
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        text-align: center !important;
    }
    
    .footer-main {
        grid-column: 1 !important;
        margin-bottom: 1.5rem !important;
    }
    
    .footer-logo-centered {
        justify-content: center !important;
        margin-bottom: 1rem !important;
    }
    
    .footer-logo .logo-large {
        max-width: 200px !important;
        max-height: 80px !important;
        width: auto !important;
        height: auto !important;
    }
    
    .footer-section {
        text-align: center !important;
        margin-bottom: 1.5rem !important;
    }
    
    .footer-section h3 {
        font-size: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    .footer-section ul {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }
    
    .footer-section li {
        margin-bottom: 0.5rem !important;
    }
    
    .footer-contact {
        grid-column: 1 !important;
        margin-top: 1rem !important;
        padding-top: 1rem !important;
        border-top: 1px solid #e5e7eb !important;
    }
    
    .footer-contact .contact-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 1rem !important;
    }
    
    .footer-contact .contact-info p {
        justify-content: center !important;
        text-align: center !important;
    }
    
    .social-links {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    
    /* Section titles fixes */
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* Button fixes */
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    /* Navigation fixes */
    .nav-menu {
        background: rgba(255, 255, 255, 0.98);
        box-shadow: var(--shadow-lg);
    }
    
    .logo {
        height: 35px;
        width: auto;
        max-width: 120px;
    }
}

/* ========================================
   CORRECCIONES PARA MÓVILES PEQUEÑOS
======================================== */

@media (max-width: 480px) {
    
    /* Container ultra-small screens */
    .container {
        padding: 0 0.5rem;
    }
    
    /* Hero adjustments */
    .hero {
        padding: 4rem 0 2rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    /* Critical image fixes */
    .hero-image img {
        max-width: 280px;
    }
    
    .hero-logo-img,
    .hero-logo-fallback {
        height: 60px;
        max-width: 150px;
    }
    
    /* Plans ultra-compact */
    .plan-card {
        padding: 1rem;
    }
    
    .amount {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Banking ultra-compact */
    .bank-logo {
        height: 100px;
    }
    
    .bank-logo img {
        height: 80px;
        max-width: 180px;
    }
    
    /* All banks container ultra-compact */
    .all-banks-container {
        width: 99% !important;
        min-height: 140px !important;
        padding: 0.75rem !important;
    }
    
    .payment-section-title-inside {
        font-size: 1rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .main-logo {
        width: 120px !important;
        height: 50px !important;
        margin: 0.25rem auto !important;
    }
    
    .main-logo img {
        height: 40px !important;
        max-width: 110px !important;
    }
    
    .mi-vecino-logo {
        width: 100px !important;
        height: 40px !important;
        margin: 0.25rem auto !important;
    }
    
    .mi-vecino-logo img {
        height: 30px !important;
        max-width: 90px !important;
    }
    
    .guayaquil-logo {
        width: 120px !important;
        height: 50px !important;
        margin: 0.25rem auto !important;
    }
    
    .guayaquil-logo img {
        height: 40px !important;
        max-width: 110px !important;
    }
    
    /* Footer ultra-compact */
    .footer {
        padding: 1.5rem 0 0 !important;
    }
    
    .footer-content {
        gap: 1rem !important;
    }
    
    .footer-main {
        margin-bottom: 1rem !important;
    }
    
    .footer-logo .logo-large {
        max-width: 150px !important;
        max-height: 60px !important;
    }
    
    .footer-section {
        margin-bottom: 1rem !important;
    }
    
    .footer-section h3 {
        font-size: 0.9rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .footer-section ul {
        gap: 0.25rem !important;
    }
    
    .footer-section li {
        margin-bottom: 0.25rem !important;
    }
    
    .footer-section a {
        font-size: 0.85rem !important;
    }
    
    .footer-contact {
        margin-top: 0.75rem !important;
        padding-top: 0.75rem !important;
    }
    
    .footer-contact .contact-info {
        gap: 0.75rem !important;
    }
    
    .footer-contact .contact-info p {
        font-size: 0.85rem !important;
    }
    
    .social-links a {
        width: 35px !important;
        height: 35px !important;
    }
    
    /* Section titles ultra-small */
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.85rem;
    }
    
    /* Navigation ultra-compact */
    .logo {
        height: 30px;
        max-width: 100px;
    }
    
    /* Modal fixes */
    .modal-content {
        margin: 2% auto;
        width: 98%;
        padding: 0.5rem;
    }
}

/* ========================================
   CORRECCIONES ESPECÍFICAS DE IMÁGENES
======================================== */

/* Evitar que las imágenes se desborden */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Asegurar que todos los contenedores flexibles respeten el tamaño móvil */
.flex-container,
.grid-container {
    max-width: 100%;
    overflow-x: hidden;
}

/* Fix para elementos posicionados absolutamente en móvil */
@media (max-width: 768px) {
    [style*="position: absolute"] {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
    }
}

/* ========================================
   UTILIDADES ADICIONALES MÓVIL
======================================== */

/* Hide elements on mobile if needed */
.mobile-hidden {
    display: none !important;
}

/* Show only on mobile */
.mobile-only {
    display: block !important;
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
    
    .mobile-hidden {
        display: block !important;
    }
}

/* Prevent horizontal overflow */
body {
    overflow-x: hidden;
}

/* Ensure smooth scrolling on mobile */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* ========================================
   WIDGET WHATSAPP - ASEGURAR VISIBILIDAD
======================================== */

/* Forzar visibilidad del widget WhatsApp */
.whatsapp-widget {
    position: fixed !important;
    z-index: 9999 !important;
    max-width: none !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

/* Asegurar que funcione en todos los breakpoints */
@media (max-width: 768px) {
    .whatsapp-widget {
        display: block !important;
        position: fixed !important;
        z-index: 9999 !important;
    }
}

@media (max-width: 480px) {
    .whatsapp-widget {
        display: block !important;
        position: fixed !important;
        z-index: 9999 !important;
    }
}
