/* Estilos para los anuncios en el frontend */

/* Contenedores generales */
.smart-ad-container {
    margin: 20px auto;
    text-align: center;
    position: relative;
    display: block;
}

.smart-ad-container img {
    max-width: 100%;
    width: 100%;
    height: auto;
    border-radius: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    object-fit: cover;
    min-height: 150px;
    max-height: 400px;
}

.smart-ad-container .smart-ad-link {
    display: inline-block;
    text-decoration: none;
    border: none;
}

.smart-ad-container .smart-ad-link:hover img {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Anuncios en el header */
.smart-ads-header-container {
    text-align: center;
    padding: 10px 0;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.smart-ads-header-container .smart-ad-container {
    margin: 0 auto;
    max-width: 728px;
}

.smart-ads-header-container img {
    max-height: 200px;
    min-height: 80px;
    object-fit: cover;
    width: 100%;
}

/* Anuncios en el footer */
.smart-ads-footer-container {
    text-align: center;
    padding: 20px 0;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin-top: 40px;
}

.smart-ads-footer-container .smart-ad-container {
    margin: 0 auto;
    max-width: 970px;
}

.smart-ads-footer-container img {
    max-height: 250px;
    min-height: 100px;
    object-fit: cover;
    width: 100%;
}

/* Anuncios en el body/homepage */
.smart-ads-body-container {
    margin: 30px auto;
    padding: 20px;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    width: 100%;
    clear: both;
    overflow: hidden;
}

.smart-ads-body-container img {
    max-height: 300px;
    min-height: 120px;
    object-fit: cover;
    width: 100%;
}

.smart-ads-body-container::before {
    content: 'Publicidad';
    display: block;
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    text-align: center;
}

/* Prevenir múltiples anuncios consecutivos en body */
.smart-ads-body-container + .smart-ads-body-container {
    display: none;
}

/* Widget de sidebar */
.smart-ads-widget-container {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.smart-ads-widget-container .smart-ad-container {
    margin: 15px 0;
    width: 100%;
}

.smart-ads-widget-container img {
    max-height: none;
    min-height: auto;
    object-fit: cover;
    max-width: 100%;
    width: 100%;
    height: auto;
    aspect-ratio: 4/3;
}

.widget .smart-ads-widget-container .smart-ad-container {
    margin: 10px auto;
}

/* Evitar múltiples widgets consecutivos */
.widget.smart_ads_widget + .widget.smart_ads_widget .smart-ads-widget-container {
    margin-top: 5px;
}

/* Espaciado entre anuncios en sidebar */
.smart-ads-widget-container .smart-ad-container + .smart-ad-container {
    margin-top: 20px;
}

/* === ESTILOS UNIVERSALES PARA TODAS LAS ZONAS === */

/* Clases base para orientaciones */
.smart-ad-orientation-auto img {
    width: 100%;
    height: auto;
    max-width: 100%;
}

.smart-ad-orientation-horizontal img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.smart-ad-orientation-vertical img {
    height: auto;
    object-fit: cover;
}

.smart-ad-orientation-square img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* Opciones de visualización */
.smart-ad-responsive {
    transition: all 0.3s ease;
}

.smart-ad-fit-container {
    max-width: 100%;
    overflow: hidden;
}

.smart-ad-center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* === ESTILOS ESPECÍFICOS POR ZONA === */

/* HEADER - Orientaciones */
.smart-ad-zone-header.smart-ad-orientation-horizontal {
    max-width: 728px;
    margin: 0 auto;
}

.smart-ad-zone-header.smart-ad-orientation-horizontal img {
    max-height: 120px;
}

.smart-ad-zone-header.smart-ad-orientation-vertical {
    max-width: 200px;
    float: left;
    margin-right: 20px;
}

.smart-ad-zone-header.smart-ad-orientation-vertical img {
    max-height: 500px;
}

.smart-ad-zone-header.smart-ad-orientation-square {
    max-width: 300px;
    margin: 0 auto;
}

/* FOOTER - Orientaciones */
.smart-ad-zone-footer.smart-ad-orientation-horizontal {
    max-width: 970px;
    margin: 0 auto;
}

.smart-ad-zone-footer.smart-ad-orientation-horizontal img {
    max-height: 300px;
}

.smart-ad-zone-footer.smart-ad-orientation-vertical {
    max-width: 300px;
    margin: 0 auto;
}

.smart-ad-zone-footer.smart-ad-orientation-vertical img {
    max-height: 600px;
}

.smart-ad-zone-footer.smart-ad-orientation-square {
    max-width: 400px;
    margin: 0 auto;
}

/* BODY - Orientaciones */
.smart-ad-zone-body.smart-ad-orientation-horizontal {
    max-width: 600px;
    margin: 20px auto;
}

.smart-ad-zone-body.smart-ad-orientation-horizontal img {
    max-height: 250px;
}

.smart-ad-zone-body.smart-ad-orientation-vertical {
    max-width: 200px;
    margin: 20px auto;
}

.smart-ad-zone-body.smart-ad-orientation-vertical img {
    max-height: 600px;
}

.smart-ad-zone-body.smart-ad-orientation-square {
    max-width: 350px;
    margin: 20px auto;
}

/* SIDEBAR - Orientaciones */
.smart-ad-zone-sidebar.smart-ad-orientation-horizontal {
    width: 100%;
}

.smart-ad-zone-sidebar.smart-ad-orientation-horizontal img {
    width: 100%;
    max-height: 200px;
}

.smart-ad-zone-sidebar.smart-ad-orientation-vertical {
    max-width: 250px;
    margin: 0 auto;
}

.smart-ad-zone-sidebar.smart-ad-orientation-vertical img {
    width: 100%;
    min-height: 300px;
}

.smart-ad-zone-sidebar.smart-ad-orientation-square {
    max-width: 250px;
    margin: 0 auto;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    /* Header responsive */
    .smart-ad-responsive.smart-ad-zone-header.smart-ad-orientation-horizontal img {
        max-height: 80px;
    }
    
    .smart-ad-responsive.smart-ad-zone-header.smart-ad-orientation-vertical {
        max-width: 150px;
    }
    
    .smart-ad-responsive.smart-ad-zone-header.smart-ad-orientation-square {
        max-width: 200px;
    }
    
    /* Footer responsive */
    .smart-ad-responsive.smart-ad-zone-footer.smart-ad-orientation-horizontal img {
        max-height: 200px;
    }
    
    .smart-ad-responsive.smart-ad-zone-footer.smart-ad-orientation-vertical {
        max-width: 200px;
    }
    
    .smart-ad-responsive.smart-ad-zone-footer.smart-ad-orientation-square {
        max-width: 300px;
    }
    
    /* Body responsive */
    .smart-ad-responsive.smart-ad-zone-body.smart-ad-orientation-horizontal {
        max-width: 100%;
    }
    
    .smart-ad-responsive.smart-ad-zone-body.smart-ad-orientation-horizontal img {
        max-height: 150px;
    }
    
    .smart-ad-responsive.smart-ad-zone-body.smart-ad-orientation-vertical {
        max-width: 150px;
    }
    
    .smart-ad-responsive.smart-ad-zone-body.smart-ad-orientation-square {
        max-width: 250px;
    }
    
    /* Sidebar responsive */
    .smart-ad-responsive.smart-ad-zone-sidebar.smart-ad-orientation-vertical {
        max-width: 200px;
    }
    
    .smart-ad-responsive.smart-ad-zone-sidebar.smart-ad-orientation-vertical img {
        min-height: 200px;
    }
    
    .smart-ad-responsive.smart-ad-zone-sidebar.smart-ad-orientation-horizontal img {
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    /* Forzar orientación horizontal en móviles para mejor UX */
    .smart-ad-responsive.smart-ad-orientation-auto,
    .smart-ad-responsive.smart-ad-orientation-vertical {
        width: 100%;
    }
    
    .smart-ad-responsive.smart-ad-orientation-auto img,
    .smart-ad-responsive.smart-ad-orientation-vertical img {
        width: 100%;
        max-height: 120px;
        object-fit: cover;
    }
    
    /* Header móvil */
    .smart-ad-responsive.smart-ad-zone-header img {
        max-height: 60px;
    }
    
    /* Footer móvil */
    .smart-ad-responsive.smart-ad-zone-footer img {
        max-height: 100px;
    }
    
    /* Body móvil */
    .smart-ad-responsive.smart-ad-zone-body img {
        max-height: 100px;
    }
    
    /* Sidebar móvil */
    .smart-ad-responsive.smart-ad-zone-sidebar img {
        max-height: 80px;
    }
}

/* Shortcode container */
.smart-ads-shortcode-container {
    text-align: center;
    margin: 20px 0;
}

.smart-ads-shortcode-container .smart-ad-container {
    display: inline-block;
    margin: 10px;
    vertical-align: top;
}

/* Responsive para diferentes tamaños */
@media (max-width: 768px) {
    .smart-ads-header-container .smart-ad-container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .smart-ads-footer-container .smart-ad-container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .smart-ads-body-container {
        margin: 20px 10px;
        max-width: calc(100% - 20px);
    }
    
    /* Ajustar tamaños de imagen en móvil */
    .smart-ad-container[data-zone="header"] img {
        max-width: 320px;
        height: auto;
    }
    
    .smart-ad-container[data-zone="footer"] img {
        max-width: 320px;
        height: auto;
    }
}

@media (max-width: 480px) {
    .smart-ads-header-container,
    .smart-ads-footer-container {
        padding: 10px 0;
    }
    
    .smart-ads-body-container {
        margin: 15px 5px;
        padding: 15px;
    }
    
    .smart-ads-body-container::before {
        font-size: 11px;
        margin-bottom: 8px;
    }
}

/* Animaciones sutiles */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smart-ad-container {
    animation: fadeIn 0.5s ease-out;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .smart-ads-header-container,
    .smart-ads-footer-container {
        background-color: #2d3748;
        border-color: #4a5568;
    }
    
    .smart-ads-body-container {
        background-color: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .smart-ads-body-container::before {
        color: #a0aec0;
    }
}

/* Estilos específicos por zona */
.smart-ad-container[data-zone="sidebar"] {
    margin: 15px auto;
    max-width: 300px;
}

.smart-ad-container[data-zone="header"] {
    margin: 10px auto;
}

.smart-ad-container[data-zone="footer"] {
    margin: 10px auto;
}

.smart-ad-container[data-zone="body"] {
    margin: 20px auto;
    max-width: 400px;
}

/* Accesibilidad */
.smart-ad-link:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.smart-ad-link:focus img {
    transform: scale(1.02);
}

/* Lazy loading específico */
.smart-ad-lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    background-color: #f8f9fa;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.smart-ad-lazy.loaded {
    opacity: 1;
    background: none;
    animation: none;
    min-height: auto;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Lazy loading skeleton por zona */
.smart-ad-lazy[data-zone="header"] {
    min-height: 90px;
    max-width: 728px;
}

.smart-ad-lazy[data-zone="footer"] {
    min-height: 120px;
    max-width: 970px;
}

.smart-ad-lazy[data-zone="sidebar"] {
    min-height: 200px;
    max-width: 300px;
}

.smart-ad-lazy[data-zone="body"] {
    min-height: 200px;
    max-width: 400px;
}

/* Compatibilidad con AMP */
.amp-ad .smart-ad-container {
    margin: 15px auto;
}

.amp-ad amp-img {
    border-radius: 4px;
}

/* Optimizaciones para móvil */
.mobile-optimized.smart-ad-container {
    margin: 10px auto;
    max-width: 100%;
}

.mobile-optimized .smart-ad-image {
    max-width: 100% !important;
    height: auto !important;
}

.tablet-optimized.smart-ad-container {
    margin: 15px auto;
}

.desktop-optimized.smart-ad-container {
    margin: 20px auto;
}

/* Mejoras de accesibilidad */
.high-contrast-mode .smart-ad-container {
    border: 2px solid #000;
    background-color: #fff;
}

.high-contrast-mode .smart-ad-link:focus {
    outline: 3px solid #ff0;
    outline-offset: 2px;
}

.reduced-motion .smart-ad-container {
    transition: none !important;
    animation: none !important;
}

.reduced-motion .smart-ad-lazy {
    animation: none !important;
    background-image: none !important;
}

/* Alineaciones específicas del bloque de Gutenberg */
.align-left .smart-ads-gutenberg-block {
    text-align: left;
}

.align-left .smart-ad-container {
    margin-left: 0;
    margin-right: auto;
}

.align-right .smart-ads-gutenberg-block {
    text-align: right;
}

.align-right .smart-ad-container {
    margin-left: auto;
    margin-right: 0;
}

.align-center .smart-ads-gutenberg-block {
    text-align: center;
}

/* Soporte para diferentes densidades de pantalla */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .smart-ad-container img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Prefers-reduced-data para conexiones lentas */
@media (prefers-reduced-data: reduce) {
    .smart-ad-lazy {
        background-image: none;
        animation: none;
    }
    
    .smart-ad-container img {
        image-rendering: optimizeSpeed;
    }
}

/* === LAYOUT CLASSES FOR ZONE CONFIGURATION === */

/* Layout Containers */
.smart-ads-layout-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-start;
    justify-content: center;
}

.smart-ads-layout-vertical {
    display: block;
}

.smart-ads-layout-vertical .smart-ad-container {
    margin-bottom: 15px;
}

.smart-ads-layout-horizontal .smart-ad-container {
    flex: 0 0 auto;
    margin-bottom: 0;
    max-width: 400px;
    min-width: 200px;
}

.smart-ads-layout-horizontal .smart-ad-container img {
    max-width: 100%;
    width: 100%;
    max-height: 250px;
    min-height: 120px;
    object-fit: cover;
}

/* Widget Layout Overrides */
.smart-ads-widget-container.smart-ads-layout-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
}

.smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container {
    flex: 1 1 auto;
    max-width: none;
    min-width: 0;
    width: auto;
}

.smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container img {
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: none;
    min-height: auto;
    object-fit: cover;
    aspect-ratio: 1/1;
}

/* Configuraciones específicas para número de anuncios en widget horizontal */
.smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:only-child {
    flex-basis: 100%;
}

.smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(2),
.smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(2) ~ .smart-ad-container {
    flex-basis: calc(50% - 2.5px);
}

.smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(3),
.smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(3) ~ .smart-ad-container {
    flex-basis: calc(33.333% - 3.33px);
}

.smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(4),
.smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(4) ~ .smart-ad-container {
    flex-basis: calc(25% - 3.75px);
}

/* Adaptación para sidebars estrechos */
@media screen and (max-width: 1200px) {
    .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(3),
    .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(3) ~ .smart-ad-container,
    .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(4),
    .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(4) ~ .smart-ad-container {
        flex-basis: calc(50% - 2.5px);
    }
}

/* Para widgets muy estrechos */
.widget[style*="width"] .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container {
    flex-basis: 100% !important;
    margin-bottom: 5px;
}

.widget[style*="width"] .smart-ads-widget-container.smart-ads-layout-horizontal {
    flex-direction: column;
}

/* Detección automática de ancho de widget */
@container (max-width: 200px) {
    .smart-ads-widget-container.smart-ads-layout-horizontal {
        flex-direction: column;
    }
    
    .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container {
        flex-basis: 100% !important;
        margin-bottom: 5px;
    }
}

@container (max-width: 300px) {
    .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(3),
    .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(3) ~ .smart-ad-container,
    .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(4),
    .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container:first-child:nth-last-child(4) ~ .smart-ad-container {
        flex-basis: 100% !important;
        margin-bottom: 5px;
    }
    
    .smart-ads-widget-container.smart-ads-layout-horizontal {
        flex-direction: column;
    }
}

/* Fallback para navegadores sin soporte de container queries */
.widget-area[style*="max-width: 200px"] .smart-ads-widget-container.smart-ads-layout-horizontal,
.sidebar[style*="max-width: 200px"] .smart-ads-widget-container.smart-ads-layout-horizontal,
.widget[class*="narrow"] .smart-ads-widget-container.smart-ads-layout-horizontal {
    flex-direction: column;
}

.widget-area[style*="max-width: 200px"] .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container,
.sidebar[style*="max-width: 200px"] .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container,
.widget[class*="narrow"] .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container {
    flex-basis: 100% !important;
    margin-bottom: 5px;
}

/* Clases de adaptación automática por JavaScript */
.smart-ads-widget-container.force-vertical {
    flex-direction: column !important;
}

.smart-ads-widget-container.force-vertical .smart-ad-container {
    flex-basis: 100% !important;
    margin-bottom: 8px;
}

.smart-ads-widget-container.force-two-column .smart-ad-container:first-child:nth-last-child(n+3),
.smart-ads-widget-container.force-two-column .smart-ad-container:first-child:nth-last-child(n+3) ~ .smart-ad-container {
    flex-basis: calc(50% - 2.5px) !important;
}

.smart-ads-widget-container.force-single-column {
    flex-direction: column !important;
}

.smart-ads-widget-container.force-single-column .smart-ad-container {
    flex-basis: 100% !important;
    margin-bottom: 5px;
}

/* Estilos específicos para items del widget */
.smart-ads-widget-container .smart-ad-item {
    display: block;
    margin-bottom: 10px;
}

.smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-item {
    display: inline-block;
    margin-bottom: 0;
}

.smart-ads-widget-container.force-vertical .smart-ad-item {
    display: block !important;
    width: 100% !important;
    margin-bottom: 8px !important;
}

.smart-ads-widget-container.force-two-column .smart-ad-item:nth-child(odd) {
    margin-right: 5px;
}

.smart-ads-widget-container.force-two-column .smart-ad-item:nth-child(even) {
    margin-left: 5px;
}

/* Ensure images adapt properly in widgets */
.smart-ads-widget-container img {
    transition: all 0.3s ease;
}

.smart-ads-widget-container.force-vertical img {
    aspect-ratio: 4/3 !important;
    width: 100% !important;
}

.smart-ads-widget-container.smart-ads-layout-vertical {
    display: block;
}

.smart-ads-widget-container.smart-ads-layout-vertical .smart-ad-container {
    margin-bottom: 10px;
}

.smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container {
    flex: 0 0 auto;
    margin-bottom: 0;
}

/* Header Layout */
.smart-ads-header-container.smart-ads-layout-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

/* Footer Layout */
.smart-ads-footer-container.smart-ads-layout-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

/* Body Layout */
.smart-ads-body-container.smart-ads-layout-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    max-width: 95%;
}

.smart-ads-body-container.smart-ads-layout-horizontal .smart-ad-container {
    flex: 1 1 300px;
    margin: 0;
    max-width: 400px;
    min-width: 250px;
}

/* Responsive Layout Adjustments */
@media screen and (max-width: 768px) {
    .smart-ads-layout-horizontal {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .smart-ads-layout-horizontal .smart-ad-container {
        max-width: 100%;
    }
    
    .smart-ads-layout-horizontal .smart-ad-container img {
        max-width: 100%;
        max-height: 250px;
        min-height: 120px;
    }
    
    .smart-ads-widget-container.smart-ads-layout-horizontal {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container {
        max-width: 100%;
        min-width: auto;
        flex-basis: 100% !important;
        margin-bottom: 8px;
    }
    
    .smart-ads-widget-container.smart-ads-layout-horizontal .smart-ad-container img {
        max-width: 100%;
        max-height: 200px;
        min-height: 100px;
        aspect-ratio: 4/3;
    }
    
    .smart-ads-header-container.smart-ads-layout-horizontal,
    .smart-ads-footer-container.smart-ads-layout-horizontal {
        flex-direction: column;
        gap: 10px;
    }
    
    .smart-ads-body-container.smart-ads-layout-horizontal {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

@media screen and (max-width: 480px) {
    .smart-ads-layout-horizontal {
        gap: 8px;
    }
    
    .smart-ads-widget-container.smart-ads-layout-horizontal {
        gap: 5px;
    }
    
    .smart-ad-container img {
        max-height: 200px !important;
        min-height: 80px !important;
    }
    
    .smart-ads-header-container img {
        max-height: 120px !important;
        min-height: 60px !important;
    }
    
    .smart-ads-footer-container img {
        max-height: 150px !important;
        min-height: 80px !important;
    }
    
    .smart-ads-body-container img {
        max-height: 180px !important;
        min-height: 90px !important;
    }
    
    .smart-ads-widget-container img {
        max-height: 160px !important;
        min-height: 70px !important;
    }
    
    .smart-ads-body-container {
        max-width: 95%;
        padding: 15px;
    }
}

/* Configuraciones adicionales para mejor adaptación */
.smart-ad-container {
    position: relative;
    overflow: hidden;
}

.smart-ads-layout-horizontal .smart-ad-container {
    flex-grow: 1;
    flex-shrink: 1;
}

.smart-ads-body-container.smart-ads-layout-horizontal .smart-ad-container {
    flex-basis: calc(33.333% - 15px);
}

@media screen and (max-width: 900px) {
    .smart-ads-body-container.smart-ads-layout-horizontal .smart-ad-container {
        flex-basis: calc(50% - 10px);
    }
}

@media screen and (max-width: 600px) {
    .smart-ads-body-container.smart-ads-layout-horizontal .smart-ad-container {
        flex-basis: 100%;
    }
}
