/* ===== Understrap Carousel — Frontend Styles ===== */

.understrap-carousel-wrap {
    width: 100%;
    margin-bottom: 2rem;
}

/* ── Carousel title & description above ── */
.uc-carousel-header {
    margin-bottom: 1rem;
}
.uc-carousel-title {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 700;
    margin-bottom: 0.4rem;
    line-height: 1.2;
}
.uc-carousel-desc {
    font-size: clamp(.9rem, 1.5vw, 1.1rem);
    color: #555;
    margin: 0;
    line-height: 1.6;
}

/* ── Carousel itself ── */
.understrap-carousel {
    position: relative;
    width: 100%;
}

/* ── Transitions autonomes (sans Bootstrap JS) ── */
.understrap-carousel .carousel-inner {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* La hauteur est fixée dynamiquement par JS pour éviter les sauts */
}

.understrap-carousel .carousel-item {
    display: none;
    width: 100%;
}
.understrap-carousel .carousel-item.active {
    display: block;
}

/* Pendant la transition : les deux slides sont en position absolue dans le conteneur */
.understrap-carousel .carousel-item.uc-slide-enter-next,
.understrap-carousel .carousel-item.uc-slide-enter-prev,
.understrap-carousel .carousel-item.active.uc-slide-exit-left,
.understrap-carousel .carousel-item.active.uc-slide-exit-right {
    display: block;
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
}

.understrap-carousel .carousel-item.uc-slide-enter-next  { transform: translateX(100%); }
.understrap-carousel .carousel-item.uc-slide-enter-prev  { transform: translateX(-100%); }

.understrap-carousel .carousel-item.uc-sliding {
    transition: transform 0.35s ease;
}
.understrap-carousel .carousel-item.uc-slide-enter-next.uc-sliding,
.understrap-carousel .carousel-item.uc-slide-enter-prev.uc-sliding {
    transform: translateX(0);
}
.understrap-carousel .carousel-item.active.uc-slide-exit-left.uc-sliding  { transform: translateX(-100%); }
.understrap-carousel .carousel-item.active.uc-slide-exit-right.uc-sliding { transform: translateX(100%); }

/* ── Cadre image : hauteur fixe, contenu centré, fond blanc ── */
.understrap-carousel .uc-img-frame {
    position: relative;
    width: 100%;
    background: #ffffff;
    overflow: hidden;
    /* height définie inline via PHP */
}

/* Image entière, centrée, jamais déformée */
.understrap-carousel .uc-img-frame img.uc-slide-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    max-width: none !important;
    max-height: none !important;
}

/* ── Boutons de navigation ── */
.understrap-carousel .uc-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    color: #333;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.understrap-carousel .uc-nav-btn:hover {
    background: #f0f0f0;
    box-shadow: 0 4px 14px rgba(0,0,0,0.3);
    transform: translateY(-50%) scale(1.08);
}
.understrap-carousel .uc-nav-btn:active {
    transform: translateY(-50%) scale(0.96);
}
.understrap-carousel .uc-nav-btn svg {
    width: 20px;
    height: 20px;
    display: block;
}
.understrap-carousel .carousel-control-prev { left: 12px; }
.understrap-carousel .carousel-control-next { right: 12px; }

/* ── Indicateurs ── */
.understrap-carousel .carousel-indicators {
    position: absolute;
    bottom: 12px;
    left: 0; right: 0;
    display: flex;
    justify-content: center;
    gap: 7px;
    z-index: 10;
    margin: 0;
    padding: 0;
    list-style: none;
}
.understrap-carousel .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.9);
    background: transparent;
    cursor: pointer;
    padding: 0;
    opacity: 0.7;
    transition: opacity .2s, background .2s, transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.35);
}
.understrap-carousel .carousel-indicators button.active {
    background: #fff;
    opacity: 1;
    transform: scale(1.3);
}

/* ── Responsive ── */
@media (max-width: 576px) {
    .uc-carousel-title  { font-size: 1.2rem; }
    .uc-carousel-desc   { font-size: .9rem; }
}
