/* Structure principale du slideshow */
a.prev,.next{
    text-decoration: none!important;
}

.prev, .next{
    border-radius: .25rem;
}

.nav-previous,
.nav-next {
  max-width: 100%;
}

.nav-previous,
.nav-next {
  max-width: 45%;
}

.nav-previous a,
.nav-next a {
  text-decoration: none;
  color: var(--primary);
  transition: color 0.2s ease;
}

a.modal-next ,
a.modal-prev {
  text-decoration: none;
}

.nav-previous a:hover,
.nav-next a:hover {
  color: var(--primary);
}


.custom-gallery-slideshow {
    background: var(--bg-gallery);
    border-radius: 0.25rem;
    position: relative;
    max-width: 1000px;
    padding: 1rem;
    margin: 0 auto;
    overflow: hidden;
}

.custom-gallery-slideshow img {
    /* border-radius: 0.25rem; */
  }

.slide {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.slide.active {
    display: block;
    opacity: 1;
}

.slide.no-transition {
    transition: none;
}

.slideshow-container {
    position: relative;
    margin-bottom: 20px;
    min-height: 200px;
}

.slide img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 700px;
    object-fit: contain;
}

/* Légendes des images */
.caption {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    text-align: center;
}

/* Boutons de navigation */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    background: rgba(0, 0, 0, 0.3);
    user-select: none;
    transition: 0.3s ease;
    z-index: 2;
}

.next {
    right: 0;
}

.prev {
    left: 0;
}

.prev:hover, .next:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Points de navigation */
.dots {
    text-align: center;
    padding: 10px 0;
}

.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 4px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: 0.3s ease;
}

.dot.active, .dot:hover {
    background-color: #717171;
}

/* Container des miniatures */
.thumbnails-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    margin-top: 10px;
}

/* Style des miniatures */
.thumbnail {
    flex: 0 0 auto;
    width: 100px;
    height: 100px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail.active {
    opacity: 1;
    border-color: #0073aa;
}

.thumbnail:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Styles de la modal/lightbox */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    margin: auto;
}

.modal-caption {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1;
    line-height: 1;
}

.modal-prev, .modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    transition: 0.3s ease;
}

.modal-prev {
    left: 0;
}

.modal-next {
    right: 0;
}

.modal-close:hover,
.modal-prev:hover,
.modal-next:hover {
    color: #999;
    background: rgba(0, 0, 0, 0.8);
}

/* Animation fade */
.fade {
    animation-name: fade;
    animation-duration: 1.5s;
}

@keyframes fade {
    from {opacity: .4}
    to {opacity: 1}
}

/* Scrollbar personnalisée pour les miniatures */
.thumbnails-container::-webkit-scrollbar {
    height: 6px;
}

.thumbnails-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.thumbnails-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.thumbnails-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Styles responsive */
@media screen and (max-width: 768px) {
    .prev, .next,
    .modal-prev, .modal-next {
        padding: 8px;
        font-size: 18px;
    }

    .thumbnail {
        width: 70px;
        height: 70px;
    }

    .dot {
        height: 8px;
        width: 8px;
        margin: 0 3px;
    }

    .modal-content {
        width: 95%;
        height: 95%;
    }

    .modal-caption {
        font-size: 14px;
        padding: 8px;
    }
}