/* ═══════════════════════════════════════════════════════════════════
   COMPONENTE: PUBLICIDAD
   ═══════════════════════════════════════════════════════════════════ */

.comp-ads {
    --ads-line:  var(--color-border, #dfe3ec);
    --ads-muted: var(--color-text-muted, #6b7590);
}

.comp-ads--space-none   { padding-block: 0; }
.comp-ads--space-small  { padding-block: clamp(12px, 2vw, 20px); }
.comp-ads--space-normal { padding-block: clamp(24px, 3.5vw, 44px); }
.comp-ads--space-large  { padding-block: clamp(40px, 6vw, 80px); }

.comp-ads--bg-transparent { background: transparent; }
.comp-ads--bg-white       { background: #ffffff; }
.comp-ads--bg-alt         { background: var(--color-bg-alt, #f5f6fa); }

.comp-ads--bg-dark {
    background: var(--color-brand-primary, #405481);
    --ads-line:  rgba(255, 255, 255, 0.16);
    --ads-muted: rgba(255, 255, 255, 0.55);
}

.comp-ads__label {
    margin: 0 0 8px;
    color: var(--ads-muted);
    font-size: 0.625rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    text-align: center;
}

.comp-ads__grid {
    display: grid;
    gap: clamp(12px, 2vw, 24px);
    grid-template-columns: 1fr;
    align-items: center;
    justify-items: center;
}

@media (min-width: 600px) {
    .comp-ads--cols-2 .comp-ads__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .comp-ads--cols-3 .comp-ads__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .comp-ads--cols-4 .comp-ads__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
    .comp-ads--cols-3 .comp-ads__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .comp-ads--cols-4 .comp-ads__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.comp-ads__item {
    width: 100%;
    max-width: 100%;
    line-height: 0;
}

.comp-ads__link {
    display: block;
    line-height: 0;
    transition: opacity 200ms ease;
}

.comp-ads__link:hover { opacity: 0.88; }

.comp-ads__img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    border-radius: 4px;
}

/* Swap desktop / mobile cuando hay imagen alternativa */
.comp-ads__img--mobile { display: none; }

.comp-ads__item.has-mobile .comp-ads__img--desktop { display: none; }
.comp-ads__item.has-mobile .comp-ads__img--mobile  { display: block; }

@media (min-width: 768px) {
    .comp-ads__item.has-mobile .comp-ads__img--desktop { display: block; }
    .comp-ads__item.has-mobile .comp-ads__img--mobile  { display: none; }
}
