/**
 * DFZ Carousel - Styles front-end
 */

/* ========================================
   WRAPPER PRINCIPAL
   ======================================== */

.dfz-carousel-wrapper {
    position: relative;
    width: 100%;
    margin: 2rem 0;
}

.dfz-carousel-wrapper.swiper-initialized {
    opacity: 1;
}

/* ========================================
   SWIPER CONTAINER
   ======================================== */

.dfz-carousel-wrapper .swiper {
    width: 100%;
    overflow: hidden;
}

.dfz-carousel-wrapper .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

/* ========================================
   SLIDES
   ======================================== */

.dfz-carousel-wrapper .swiper-slide {
    height: auto;
    display: flex;
    flex-direction: column;
}

.dfz-carousel-wrapper .swiper-slide-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Mode hauteur fixe */
.dfz-carousel-wrapper.height-fixed .swiper-slide {
    height: var(--carousel-height, 400px);
}

.dfz-carousel-wrapper.height-fixed .swiper-slide-content {
    overflow: hidden;
}

/* Mode hauteur auto : égaliser les slides */
.dfz-carousel-wrapper.height-auto .swiper {
    height: auto;
}

.dfz-carousel-wrapper.height-auto .swiper-wrapper {
    align-items: stretch;
}

/* ========================================
   ALIGNEMENT VERTICAL
   ======================================== */

/* Stretch (défaut) - déjà géré ci-dessus */

/* Centré verticalement */
.dfz-carousel-wrapper.valign-center .swiper-slide {
    display: flex;
    align-items: center;
}

.dfz-carousel-wrapper.valign-center .swiper-slide-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

/* Aligné en haut */
.dfz-carousel-wrapper.valign-top .swiper-slide {
    display: flex;
    align-items: flex-start;
}

.dfz-carousel-wrapper.valign-top .swiper-slide-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
}

/* Aligné en bas */
.dfz-carousel-wrapper.valign-bottom .swiper-slide {
    display: flex;
    align-items: flex-end;
}

.dfz-carousel-wrapper.valign-bottom .swiper-slide-content {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: 100%;
}

/* Support images pleine hauteur */
.dfz-carousel-wrapper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========================================
   NAVIGATION (FLÈCHES)
   ======================================== */

.dfz-carousel-wrapper .swiper-button-prev,
.dfz-carousel-wrapper .swiper-button-next {
    width: 44px;
    height: 44px;
    background: transparent;
    color: #fff;
    transition: all 0.3s ease;
}

.dfz-carousel-wrapper .swiper-button-prev:after,
.dfz-carousel-wrapper .swiper-button-next:after {
    font-size: 30px;
    font-weight: bold;
}

.dfz-carousel-wrapper .swiper-button-prev:hover,
.dfz-carousel-wrapper .swiper-button-next:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.dfz-carousel-wrapper .swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Position intérieur (défaut) */
.dfz-carousel-wrapper.nav-inside .swiper-button-prev {
    left: 10px;
}

.dfz-carousel-wrapper.nav-inside .swiper-button-next {
    right: 10px;
}

/* Position extérieur */
.dfz-carousel-wrapper.nav-outside {
    padding: 0 60px;
}

.dfz-carousel-wrapper.nav-outside .swiper-button-prev {
    left: 0;
}

.dfz-carousel-wrapper.nav-outside .swiper-button-next {
    right: 0;
}

/* Mobile : toujours intérieur */
@media (max-width: 767px) {
    .dfz-carousel-wrapper.nav-outside {
        padding: 0;
    }

    .dfz-carousel-wrapper.nav-outside .swiper-button-prev {
        left: 10px;
    }

    .dfz-carousel-wrapper.nav-outside .swiper-button-next {
        right: 10px;
    }
}

/* ========================================
   PAGINATION (BULLETS)
   ======================================== */

.dfz-carousel-wrapper .swiper-pagination {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    z-index: 10;
}

.dfz-carousel-wrapper.pagination-top .swiper-pagination-top {
    position: absolute;
    top: 20px;
    bottom: auto;
}

.dfz-carousel-wrapper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: #333;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.dfz-carousel-wrapper .swiper-pagination-bullet-active {
    opacity: 1;
    background: #333;
    transform: scale(1.2);
}

.dfz-carousel-wrapper .swiper-pagination-bullet:hover {
    opacity: 0.7;
}

/* ========================================
   EFFETS DE TRANSITION
   ======================================== */

/* Fade */
.dfz-carousel-wrapper .swiper-fade .swiper-slide {
    pointer-events: none;
}

.dfz-carousel-wrapper .swiper-fade .swiper-slide-active {
    pointer-events: auto;
}

/* Coverflow - ajuster la largeur des slides */
.dfz-carousel-wrapper .swiper-coverflow .swiper-slide {
    width: 300px;
}

/* Cards - ajuster le wrapper pour l'effet de pile */
.dfz-carousel-wrapper .swiper-cards {
    overflow: visible;
}

.dfz-carousel-wrapper .swiper-cards .swiper-slide {
    border-radius: 8px;
    overflow: hidden;
}

/* Cube - s'assurer que le conteneur a de la perspective */
.dfz-carousel-wrapper .swiper-cube {
    perspective: 1200px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 767px) {
    .dfz-carousel-wrapper .swiper-button-prev,
    .dfz-carousel-wrapper .swiper-button-next {
        width: 36px;
        height: 36px;
    }

    .dfz-carousel-wrapper .swiper-button-prev:after,
    .dfz-carousel-wrapper .swiper-button-next:after {
        font-size: 16px;
    }
}

/* ========================================
   ÉTAT VIDE
   ======================================== */

.dfz-carousel-empty {
    padding: 2rem;
    text-align: center;
    background: #f5f5f5;
    border: 2px dashed #ccc;
    border-radius: 8px;
    color: #666;
}

/* ========================================
   ACCESSIBILITÉ
   ======================================== */

.dfz-carousel-wrapper .swiper-button-prev:focus-visible,
.dfz-carousel-wrapper .swiper-button-next:focus-visible,
.dfz-carousel-wrapper .swiper-pagination-bullet:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* ========================================
   LOADING STATE
   ======================================== */

.dfz-carousel-wrapper:not(.swiper-initialized) {
    opacity: 0;
    transition: opacity 0.3s ease;
}
