/* ─────────────────────────────────────────
   CDI ACF Gallery for Elementor
   ───────────────────────────────────────── */

.cdi-gallery-wrapper {
    position: relative;
    width: 100%;
}

/* Navegação fora do slider */
.cdi-gallery-nav-outside {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cdi-gallery-nav-outside .cdi-gallery {
    flex: 1;
    min-width: 0;
}

/* ── Slides ── */
.cdi-gallery .swiper-slide {
    position: relative;
    overflow: hidden;
}

.cdi-gallery__img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.4s ease;
}

/* Proporção forçada */
.cdi-gallery__ratio {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.cdi-gallery__ratio .cdi-gallery__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Caption ── */
.cdi-gallery__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
}

/* ── Botões de navegação ── */
.cdi-gallery__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.2s ease;
    flex-shrink: 0;
    z-index: 10;
}

.cdi-gallery__btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
}

.cdi-gallery__btn:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Navegação dentro do slider */
.cdi-gallery-nav-inside .cdi-gallery__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.cdi-gallery-nav-inside .cdi-gallery__btn--prev {
    left: 12px;
}

.cdi-gallery-nav-inside .cdi-gallery__btn--next {
    right: 12px;
}

.cdi-gallery-nav-inside .cdi-gallery__btn:hover {
    transform: translateY(-50%) scale(1.05);
}

.cdi-gallery__btn i {
    font-size: 18px;
    color: #fff;
    line-height: 1;
}

.cdi-gallery__btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
    display: block;
}

/* ── Thumbnails ── */
.cdi-gallery-thumbs {
    margin-top: 8px;
}

.cdi-gallery-thumbs .swiper-slide {
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.cdi-gallery-thumbs .swiper-slide-thumb-active {
    opacity: 1;
}

.cdi-gallery__thumb-img {
    display: block;
    width: 100%;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

/* ── Paginação ── */
.cdi-gallery .swiper-pagination {
    position: relative;
    margin-top: 12px;
}

.cdi-gallery .swiper-pagination-bullet {
    background: #000;
    opacity: 0.4;
}

.cdi-gallery .swiper-pagination-bullet-active {
    opacity: 1;
    background: #0073aa;
}

/* ── Scrollbar ── */
.cdi-gallery .swiper-scrollbar {
    bottom: 4px;
}

/* ── Placeholder no editor ── */
.cdi-gallery__placeholder {
    text-align: center;
    padding: 40px 20px;
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 6px;
}

/* ── Acessibilidade ── */
@media (prefers-reduced-motion: reduce) {
    .cdi-gallery__img,
    .cdi-gallery__btn {
        transition: none;
    }
}