/* Commerce advert stage — left tiles · center carousel · right tiles */
.cp-ads {
    --cp-ads-h: 148px;
    --cp-ads-orange: var(--cp-orange, #f1780f);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    padding: 0;
}

.cp-ads__col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    min-width: 0;
}

.cp-ads__hero {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    height: var(--cp-ads-h);
    max-height: var(--cp-ads-h);
    isolation: isolate;
    background:
        linear-gradient(135deg, #1a2330 0%, #2c3e50 55%, rgba(246, 139, 30, 0.35) 100%);
    box-shadow:
        inset 0 3px 0 0 var(--cp-ads-orange),
        inset 0 -3px 0 0 var(--cp-ads-orange);
}

.cp-ads__track {
    position: relative;
    width: 100%;
    height: 100%;
}

.cp-ads__slide {
    position: absolute;
    inset: 0;
    display: block;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.45s ease;
    text-decoration: none;
    color: #fff;
}

.cp-ads__slide.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.cp-ads__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #1a2330;
}

.cp-ads__media[hidden],
.cp-ads__media.is-broken {
    display: none;
}

.cp-ads__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 42%, rgba(12, 18, 28, 0.7) 100%);
    pointer-events: none;
}

.cp-ads__cta {
    position: absolute;
    left: 0.85rem;
    bottom: 0.85rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.95rem;
    border-radius: 999px;
    background: var(--cp-ads-orange);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(241, 120, 15, 0.35);
}

.cp-ads__label {
    position: absolute;
    left: 0.85rem;
    top: 0.7rem;
    z-index: 2;
    max-width: calc(100% - 4.5rem);
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cp-ads__count {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 3;
    padding: 0.18rem 0.45rem;
    border-radius: 999px;
    background: rgba(12, 18, 28, 0.62);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
}

.cp-ads__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 1.7rem;
    height: 1.7rem;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    cursor: pointer;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
    opacity: 0.9;
}

.cp-ads__nav:hover {
    opacity: 1;
    color: var(--cp-ads-orange);
}

.cp-ads__nav--prev { left: 0.25rem; }
.cp-ads__nav--next { right: 0.25rem; }

.cp-ads__dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.45rem;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 0.32rem;
    pointer-events: none;
}

.cp-ads__dot {
    pointer-events: auto;
    width: 0.35rem;
    height: 0.35rem;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.cp-ads__dot.is-active {
    width: 1.05rem;
    background: var(--cp-ads-orange);
}

.cp-ads__tile {
    position: relative;
    display: block;
    min-height: 88px;
    height: 88px;
    border-radius: 12px;
    overflow: hidden;
    background:
        linear-gradient(135deg, #1a2330 0%, #243447 70%, rgba(246, 139, 30, 0.28) 100%);
    text-decoration: none;
    color: #fff;
}

.cp-ads__badge {
    position: absolute;
    top: 0.4rem;
    left: 0.4rem;
    z-index: 2;
    font-size: 0.52rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.16rem 0.4rem;
    border-radius: 5px;
    background: rgba(20, 28, 38, 0.72);
    color: #fff;
}

.cp-ads__tile-title {
    position: absolute;
    left: 0.5rem;
    right: 2.1rem;
    bottom: 0.45rem;
    z-index: 2;
    margin: 0;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.cp-ads__tile-shade {
    position: absolute;
    inset: auto 0 0;
    height: 55%;
    background: linear-gradient(180deg, transparent, rgba(12, 18, 28, 0.62));
    pointer-events: none;
}

.cp-ads__go {
    position: absolute;
    right: 0.4rem;
    bottom: 0.4rem;
    z-index: 2;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: var(--cp-ads-orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.58rem;
    box-shadow: 0 2px 8px rgba(241, 120, 15, 0.4);
}

.cp-ads__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

/* Desktop stage — 2 | hero | 2 */
@media (min-width: 768px) {
    .cp-ads {
        --cp-ads-h: 220px;
        margin-bottom: 1rem;
    }

    .cp-ads--stage,
    .cp-ads--stage-partial {
        display: grid;
        grid-template-columns: minmax(7.5rem, 0.92fr) minmax(0, 2.35fr) minmax(7.5rem, 0.92fr);
        gap: 0.55rem;
        align-items: stretch;
        height: var(--cp-ads-h);
    }

    .cp-ads--stage-partial:not(:has(.cp-ads__col--left)) {
        grid-template-columns: minmax(0, 2.35fr) minmax(7.5rem, 0.92fr);
    }

    .cp-ads--stage-partial:not(:has(.cp-ads__col--right)) {
        grid-template-columns: minmax(7.5rem, 0.92fr) minmax(0, 2.35fr);
    }

    .cp-ads--stage .cp-ads__col,
    .cp-ads--stage-partial .cp-ads__col {
        display: grid;
        grid-template-columns: none;
        grid-template-rows: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        height: 100%;
        min-height: 0;
    }

    .cp-ads--stage .cp-ads__hero,
    .cp-ads--stage-partial .cp-ads__hero,
    .cp-ads--hero .cp-ads__hero {
        height: 100%;
        max-height: none;
        min-height: 0;
    }

    .cp-ads--stage .cp-ads__tile,
    .cp-ads--stage-partial .cp-ads__tile {
        height: auto;
        min-height: 0;
    }

    .cp-ads--hero {
        display: block;
        height: var(--cp-ads-h);
    }

    .cp-ads--hero .cp-ads__hero {
        height: var(--cp-ads-h);
        max-height: var(--cp-ads-h);
    }

    .cp-ads--banners .cp-ads__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .cp-ads--banners .cp-ads__tile {
        height: 120px;
    }
}

@media (min-width: 1200px) {
    .cp-ads {
        --cp-ads-h: 260px;
    }

    .cp-ads--stage,
    .cp-ads--stage-partial {
        gap: 0.65rem;
        grid-template-columns: minmax(9rem, 0.88fr) minmax(0, 2.4fr) minmax(9rem, 0.88fr);
    }

    .cp-ads--stage-partial:not(:has(.cp-ads__col--left)) {
        grid-template-columns: minmax(0, 2.4fr) minmax(9rem, 0.88fr);
    }

    .cp-ads--stage-partial:not(:has(.cp-ads__col--right)) {
        grid-template-columns: minmax(9rem, 0.88fr) minmax(0, 2.4fr);
    }

    .cp-ads__cta {
        font-size: 0.8rem;
        padding: 0.48rem 1.05rem;
    }

    .cp-ads__go {
        width: 1.55rem;
        height: 1.55rem;
    }
}

@media (min-width: 1500px) {
    .cp-ads {
        --cp-ads-h: 280px;
    }
}
