/* ========================================
   COJOS ADS - FRONTEND STYLES
   Estilos para banners publicitarios
   ======================================== */

/* Contenedor principal del banner */
.cojos-ad-wrapper {
    position: sticky;
    top: 20px;
    z-index: 100;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0 0 20px 0;
    transition: all 0.3s ease;
}

.cojos-ad-wrapper:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Link del banner */
.cojos-ad-link {
    display: block;
    text-decoration: none;
    outline: none;
}

.cojos-ad-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Imagen del banner */
.cojos-ad-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border: none;
    transition: opacity 0.3s ease;
}

.cojos-ad-link:hover .cojos-ad-image {
    opacity: 0.92;
}

/* Label "Publicidad" */
.cojos-ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    font-weight: 600;
    z-index: 10;
}

/* Placeholder cuando no hay banners */
.cojos-ad-empty {
    background: white;
    border: 2px dashed #ddd;
    box-shadow: none;
}

.cojos-ad-empty:hover {
    transform: none;
    box-shadow: none;
}

.cojos-ad-placeholder {
    padding: 40px 20px;
    text-align: center;
}

.cojos-ad-placeholder-text {
    margin: 0;
    color: #999;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .cojos-ad-wrapper {
        margin: 15px 0;
        border-radius: 6px;
    }
    
    .cojos-ad-label {
        font-size: 9px;
        padding: 3px 8px;
        top: 6px;
        right: 6px;
    }
    
    .cojos-ad-placeholder {
        padding: 30px 15px;
    }
    
    .cojos-ad-placeholder-text {
        font-size: 13px;
    }
}

@media screen and (max-width: 600px) {
    .cojos-ad-wrapper {
        margin: 10px 0;
    }
    
    .cojos-ad-placeholder {
        padding: 25px 10px;
    }
}

/* Animación de carga */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cojos-ad-wrapper {
    animation: fadeIn 0.4s ease-out;
}

/* Accesibilidad */
.cojos-ad-link:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 3px;
}

/* Para impresión: ocultar banners */
@media print {
    .cojos-ad-wrapper {
        display: none !important;
    }
}
/* Eliminar espacios en blanco de widgets con banner */
.widget:has(.cojos-ad-wrapper) p:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.widget:has(.cojos-ad-wrapper) {
    padding-top: 0 !important;
}