/* Estilos del carrusel de anuncios - Contraparte Ads Manager */

.cpa-rotador {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.cpa-rotador-slides {
    position: relative;
    width: 100%;
}

.cpa-rotador .cpa-slide {
    display: none;
    width: 100%;
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.cpa-rotador .cpa-slide.cpa-activo {
    display: block;
    opacity: 1;
}

.cpa-rotador .cpa-slide img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.cpa-rotador .cpa-slide a {
    display: block;
}

/* Flechas de navegación */
.cpa-rotador .cpa-flecha {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s ease;
}

.cpa-rotador .cpa-flecha:hover {
    background: rgba(0, 0, 0, 0.7);
}

.cpa-rotador .cpa-flecha-izq { left: 6px; }
.cpa-rotador .cpa-flecha-der { right: 6px; }

/* Puntos indicadores */
.cpa-rotador .cpa-puntos {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 6px;
    z-index: 2;
}

.cpa-rotador .cpa-punto {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 0, 0, 0.2);
    cursor: pointer;
    padding: 0;
}

.cpa-rotador .cpa-punto.cpa-punto-activo {
    background: #fff;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}

/* Imagen predeterminada (respaldo): sin flechas ni puntos, no son necesarios con una sola imagen */
.cpa-rotador.cpa-imagen-defecto .cpa-flecha,
.cpa-rotador.cpa-imagen-defecto .cpa-puntos {
    display: none;
}

/* ============================================================
 * MODO GRID
 * ============================================================ */

.cpa-grid {
    display: grid;
    grid-template-columns: repeat(var(--cpa-columnas, 3), 1fr);
    gap: 8px;
    width: 100%;
}

.cpa-grid-celda {
    overflow: hidden;
    border-radius: 4px;
    height: var(--cpa-alto, 120px);
}

.cpa-grid-celda a {
    display: block;
    width: 100%;
    height: 100%;
}

.cpa-grid-celda img {
    width: 100%;
    height: 100%;
    object-fit: cover;      /* recorta al centro manteniendo proporción */
    object-position: center;
    display: block;
    transition: opacity 0.2s ease;
}

.cpa-grid-celda:hover img {
    opacity: 0.9;
}

/* En móvil, reducir a 2 columnas si hay 3 o más configuradas */
@media (max-width: 600px) {
    .cpa-grid {
        grid-template-columns: repeat(
            min(var(--cpa-columnas, 3), 2),
            1fr
        );
    }
}

