/* Optimizaciones de compresión vertical para móviles */

/* Reducir drásticamente el espaciado vertical en móviles */
@media (max-width: 768px) {
    /* Reset de márgenes y padding verticales */
    * {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    
    /* Espaciado mínimo entre elementos */
    h1, h2, h3, h4, h5, h6 {
        margin-bottom: 4px !important;
    }
    
    p, div, section, article {
        margin-bottom: 3px !important;
    }
    
    /* Reducir padding de contenedores */
    .container, .main-content {
        padding-top: 2px !important;
        padding-bottom: 2px !important;
    }
    
    /* Comprimir secciones */
    section {
        margin-bottom: 5px !important;
        padding: 2px 0 !important;
    }
    
    /* Reducir altura de imágenes */
    .ad-image-container {
        height: 60px !important;
    }
    
    /* Comprimir contenido de tarjetas */
    .ad-content {
        padding: 3px !important;
    }
    
    /* Reducir altura de botones */
    .btn, .hero-btn {
        height: 20px !important;
        padding: 2px 4px !important;
        font-size: 8px !important;
    }
    
    /* Comprimir header */
    .header {
        padding: 0 !important;
    }
    
    .header-top {
        padding: 2px 0 !important;
    }
    
    /* Comprimir footer */
    .footer {
        padding: 2px 0 !important;
    }
    
    .footer-main {
        gap: 3px !important;
    }
    
    .footer-section {
        margin-bottom: 2px !important;
    }
    
    .footer-section h3 {
        margin-bottom: 2px !important;
        font-size: 8px !important;
    }
    
    .footer-section ul li {
        margin-bottom: 1px !important;
    }
    
    .footer-section ul li a {
        font-size: 7px !important;
    }
}

/* Optimizaciones para móviles pequeños */
@media (max-width: 480px) {
    /* Comprimir aún más */
    h1, h2, h3, h4, h5, h6 {
        margin-bottom: 2px !important;
        font-size: 0.9em !important;
    }
    
    p, div, section, article {
        margin-bottom: 1px !important;
    }
    
    section {
        margin-bottom: 2px !important;
        padding: 1px 0 !important;
    }
    
    .ad-image-container {
        height: 40px !important;
    }
    
    .ad-content {
        padding: 1px !important;
    }
    
    .ad-title {
        font-size: 0.6rem !important;
        line-height: 1 !important;
        margin-bottom: 1px !important;
    }
    
    .ad-price {
        font-size: 0.7rem !important;
        margin-bottom: 1px !important;
    }
    
    .ad-meta-item {
        font-size: 0.5rem !important;
    }
    
    .btn, .hero-btn {
        height: 16px !important;
        padding: 1px 2px !important;
        font-size: 6px !important;
    }
    
    .header-top {
        padding: 1px 0 !important;
    }
    
    .footer {
        padding: 1px 0 !important;
    }
    
    .footer-main {
        gap: 1px !important;
    }
    
    .footer-section {
        margin-bottom: 1px !important;
    }
    
    .footer-section h3 {
        margin-bottom: 1px !important;
        font-size: 6px !important;
    }
    
    .footer-section ul li {
        margin-bottom: 0 !important;
    }
    
    .footer-section ul li a {
        font-size: 5px !important;
    }
}

/* Optimizaciones para móviles muy pequeños */
@media (max-width: 360px) {
    /* Compresión máxima */
    h1, h2, h3, h4, h5, h6 {
        margin-bottom: 1px !important;
        font-size: 0.8em !important;
    }
    
    p, div, section, article {
        margin-bottom: 0 !important;
    }
    
    section {
        margin-bottom: 1px !important;
        padding: 0 !important;
    }
    
    .ad-image-container {
        height: 30px !important;
    }
    
    .ad-content {
        padding: 0 !important;
    }
    
    .ad-title {
        font-size: 0.5rem !important;
        line-height: 0.9 !important;
        margin-bottom: 0 !important;
    }
    
    .ad-price {
        font-size: 0.6rem !important;
        margin-bottom: 0 !important;
    }
    
    .ad-meta-item {
        font-size: 0.4rem !important;
    }
    
    .btn, .hero-btn {
        height: 14px !important;
        padding: 0 1px !important;
        font-size: 5px !important;
    }
    
    .header-top {
        padding: 0 !important;
    }
    
    .footer {
        padding: 0 !important;
    }
    
    .footer-main {
        gap: 0 !important;
    }
    
    .footer-section {
        margin-bottom: 0 !important;
    }
    
    .footer-section h3 {
        margin-bottom: 0 !important;
        font-size: 5px !important;
    }
    
    .footer-section ul li a {
        font-size: 4px !important;
    }
}

/* Eliminar elementos innecesarios en móviles */
@media (max-width: 768px) {
    /* Ocultar elementos que consumen espacio vertical */
    .nav-container,
    .footer-legal,
    .newsletter-form,
    .adsense-banner-header {
        display: none !important;
    }
    
    /* Reducir opacidad de elementos secundarios */
    .hero-subtitle,
    .ad-meta-item,
    .footer-section ul li a {
        opacity: 0.8;
    }
}

/* Optimizaciones de texto para móviles */
@media (max-width: 768px) {
    /* Reducir altura de línea */
    body {
        line-height: 1.2 !important;
    }
    
    /* Comprimir texto */
    .hero-title {
        line-height: 1 !important;
    }
    
    .hero-subtitle {
        line-height: 1.1 !important;
    }
    
    .ad-title {
        line-height: 1 !important;
    }
    
    /* Reducir espaciado entre letras */
    .btn, .hero-btn {
        letter-spacing: -0.5px !important;
    }
}

/* Optimizaciones de grid para móviles */
@media (max-width: 768px) {
    .ads-grid {
        gap: 1px !important;
    }
    
    .ad-card {
        margin-bottom: 1px !important;
    }
}

/* Eliminar scroll horizontal */
@media (max-width: 768px) {
    body {
        overflow-x: hidden !important;
    }
    
    .container, .main-content {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }
}
