/* =======================================================================
   franck-used-cars-gallery — galerie photos VO (Swiper)
   Tokens --fucg-* émis par le renderer (aperçu builder) et le Twig (front).
   ======================================================================= */
.franck-used-cars-gallery {
    --fucg-main-radius: 12px;
    --fucg-thumb-radius: 6px;
    --fucg-side-radius: 20px;
    --fucg-gap: 12px;
    --fucg-side-width: 28%;
    --fucg-main-aspect: 4 / 3;
    --fucg-side-aspect: 4 / 3;
    --fucg-accent: var(--theme-button-bg, var(--maurin-primary, #1cb359));
    width: 100%;
}
.franck-used-cars-gallery * { box-sizing: border-box; }

/* ---- Rangée du haut : grande image + panneau droit ---- */
.franck-used-cars-gallery .fucg-top {
    display: flex;
    gap: var(--fucg-gap);
    align-items: stretch;
}
.franck-used-cars-gallery .fucg-main-wrap {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}
.franck-used-cars-gallery .fucg-side {
    flex: 0 0 var(--fucg-side-width);
    display: flex;
    flex-direction: column;
    gap: var(--fucg-gap);
    min-width: 0;
}
.franck-used-cars-gallery[data-show-side="0"] .fucg-side { display: none; }
.franck-used-cars-gallery[data-show-side="0"] .fucg-main-wrap { flex-basis: 100%; }
@media (max-width: 767.98px) {
    .franck-used-cars-gallery .fucg-side { display: none; }
}

/* ---- Grande image (Swiper main + mock) ---- */
.franck-used-cars-gallery .fucg-main { border-radius: var(--fucg-main-radius); overflow: hidden; }
.franck-used-cars-gallery .fucg-img {
    position: relative;
    aspect-ratio: var(--fucg-main-aspect, 4 / 3);
    overflow: hidden;
    border-radius: var(--fucg-main-radius);
    background: #f1f1ef;
}
.franck-used-cars-gallery .fucg-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Panneau droit : 2 miniatures statiques ---- */
.franck-used-cars-gallery .fucg-side-thumb {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: var(--fucg-side-radius);
    overflow: hidden;
    cursor: pointer;
    background: #f1f1ef;
}
.franck-used-cars-gallery .fucg-side-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* ---- Bande de miniatures (Swiper thumbs) ---- */
.franck-used-cars-gallery .fucg-thumbs { margin-top: var(--fucg-gap); overflow: hidden; }
.franck-used-cars-gallery .fucg-thumbs .swiper-slide { width: 124px; }
.franck-used-cars-gallery .fucg-thumbs .swiper-slide img {
    width: 100%; height: 96px; object-fit: cover;
    border-radius: var(--fucg-thumb-radius);
    opacity: .56; cursor: pointer; transition: opacity .2s;
    display: block;
}
.franck-used-cars-gallery .fucg-thumbs .swiper-slide-thumb-active img,
.franck-used-cars-gallery .fucg-thumbs .swiper-slide:hover img { opacity: 1; }

/* ---- Bande de miniatures (aperçu builder, statique) ---- */
.franck-used-cars-gallery .fucg-thumbs-static {
    display: flex; gap: 8px; margin-top: var(--fucg-gap); overflow: hidden;
}
.franck-used-cars-gallery .fucg-thumbs-static .fucg-tmb { flex: 0 0 124px; }
.franck-used-cars-gallery .fucg-thumbs-static .fucg-tmb img {
    width: 100%; height: 96px; object-fit: cover;
    border-radius: var(--fucg-thumb-radius); opacity: .56; display: block;
}
.franck-used-cars-gallery .fucg-thumbs-static .fucg-tmb.is-active img { opacity: 1; }

/* ---- Boutons favori / zoom ---- */
.franck-used-cars-gallery .fucg-fav {
    display: none !important;
}
.franck-used-cars-gallery .fucg-zoom {
    position: absolute; bottom: 12px; right: 12px; z-index: 3;
    width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.5);
    border: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
}

/* ---- Flèches de navigation (main) ---- */
.franck-used-cars-gallery .fucg-prev,
.franck-used-cars-gallery .fucg-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) !important;
    z-index: 10;
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;
    aspect-ratio: 1 / 1 !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 9999px !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
    cursor: pointer;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    color: #212221 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    transition: color .2s ease, background-color .2s ease, transform .18s ease, box-shadow .18s ease !important;
}
.franck-used-cars-gallery .fucg-prev::after,
.franck-used-cars-gallery .fucg-next::after {
    display: none !important;
    content: none !important;
}
.franck-used-cars-gallery .fucg-prev svg,
.franck-used-cars-gallery .fucg-next svg {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    max-width: 20px !important;
    max-height: 20px !important;
    display: block !important;
    flex-shrink: 0 !important;
    margin: auto !important;
}
.franck-used-cars-gallery .fucg-prev { left: 16px !important; }
.franck-used-cars-gallery .fucg-next { right: 16px !important; }
.franck-used-cars-gallery .fucg-prev:hover,
.franck-used-cars-gallery .fucg-next:hover {
    color: var(--fucg-accent) !important;
    background: #ffffff !important;
    transform: translateY(-50%) scale(1.08) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25) !important;
}
.franck-used-cars-gallery .fucg-prev.swiper-button-disabled,
.franck-used-cars-gallery .fucg-next.swiper-button-disabled {
    opacity: .35 !important;
    cursor: default !important;
    pointer-events: none !important;
}

@media (max-width: 767.98px) {
    .franck-used-cars-gallery .fucg-prev,
    .franck-used-cars-gallery .fucg-next {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        max-width: 44px !important;
        max-height: 44px !important;
    }
    .franck-used-cars-gallery .fucg-prev svg,
    .franck-used-cars-gallery .fucg-next svg {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        min-height: 18px !important;
        max-width: 18px !important;
        max-height: 18px !important;
    }
    .franck-used-cars-gallery .fucg-prev { left: 10px !important; }
    .franck-used-cars-gallery .fucg-next { right: 10px !important; }
}

/* ---- Lightbox plein écran ---- */
.fucg-modal {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.85); padding: 40px 0;
}
.fucg-modal.is-open { display: block; }
.fucg-modal .fucg-modal-swiper {
    width: 92%; max-width: 1100px; height: 85vh; margin: auto;
}
.fucg-modal .swiper-slide { display: flex; align-items: center; justify-content: center; }
.fucg-modal .swiper-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 12px; }
.fucg-modal .fucg-modal-close {
    position: absolute; top: 18px; right: 22px; z-index: 2;
    width: 36px; height: 36px; border-radius: 50%; background: #fff; border: none;
    font-size: 18px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    aspect-ratio: 1 / 1 !important; flex-shrink: 0 !important; box-sizing: border-box !important;
}
.fucg-modal .fucg-modal-prev,
.fucg-modal .fucg-modal-next {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 38px; height: 38px; border-radius: 50%; background: #fff; border: none;
    cursor: pointer; color: #222; display: inline-flex; align-items: center; justify-content: center;
    aspect-ratio: 1 / 1 !important; flex-shrink: 0 !important; box-sizing: border-box !important;
    padding: 0 !important;
}
.fucg-modal .fucg-modal-prev svg,
.fucg-modal .fucg-modal-next svg {
    width: 14px !important; height: 14px !important; display: block !important; flex-shrink: 0 !important; margin: auto !important;
}
.fucg-modal .fucg-modal-prev { left: 16px; }
.fucg-modal .fucg-modal-next { right: 16px; }
