/* =========================================================
   GALERIE PRODUITS
========================================================= */

.product-gallery {
    padding: 40px 0 110px;
    background: #ffffff;
}

.gallery-header {
    margin-bottom: 35px;
}

.carousel-wrapper {
    position: relative;
}

.product-carousel {
    display: flex;
    gap: 18px;

    overflow-x: auto;

    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;

    scrollbar-width: none;

    padding: 5px 2px 15px;
}

.product-carousel::-webkit-scrollbar {
    display: none;
}


/* ---------------------------------------------------------
   IMAGES
--------------------------------------------------------- */

.gallery-item {
    flex: 0 0 calc((100% - 36px) / 3);

    height: 260px;

    padding: 0;
    border: 0;

    border-radius: 22px;

    overflow: hidden;

    background: #f5f5f5;

    cursor: pointer;

    scroll-snap-align: start;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.08);

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);

    box-shadow:
        0 18px 40px rgba(0, 0, 0, 0.14);
}

.gallery-item img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform 0.45s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}


/* ---------------------------------------------------------
   BOUTONS CARROUSEL
--------------------------------------------------------- */

.carousel-btn {
    position: absolute;

    top: 50%;

    width: 46px;
    height: 46px;

    display: grid;
    place-items: center;

    transform: translateY(-50%);

    border: 0;
    border-radius: 50%;

    background: #ffffff;

    color: var(--dark);

    font-size: 1.2rem;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.15);

    z-index: 5;

    transition:
        background 0.25s ease,
        color 0.25s ease,
        transform 0.25s ease;
}

.carousel-btn:hover {
    background: var(--orange);
    color: #ffffff;

    transform:
        translateY(-50%)
        scale(1.08);
}

.carousel-prev {
    left: -23px;
}

.carousel-next {
    right: -23px;
}


/* =========================================================
   LIGHTBOX
========================================================= */

.lightbox {
    position: fixed;
    inset: 0;

    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 40px;

    background:
        rgba(0, 0, 0, 0.88);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.3s ease,
        visibility 0.3s ease;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: min(1100px, 90vw);
    max-height: 85vh;

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 14px;

    box-shadow:
        0 25px 80px rgba(0, 0, 0, 0.5);
}


/* ---------------------------------------------------------
   FERMER
--------------------------------------------------------- */

.lightbox-close {
    position: absolute;

    top: 25px;
    right: 30px;

    width: 48px;
    height: 48px;

    border: 0;
    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.12);

    color: #ffffff;

    font-size: 2rem;
    line-height: 1;

    transition:
        background 0.25s ease,
        transform 0.25s ease;
}

.lightbox-close:hover {
    background: var(--orange);
    transform: rotate(90deg);
}


/* ---------------------------------------------------------
   NAVIGATION LIGHTBOX
--------------------------------------------------------- */

.lightbox-nav {
    position: absolute;

    top: 50%;

    width: 52px;
    height: 52px;

    display: grid;
    place-items: center;

    transform: translateY(-50%);

    border: 0;
    border-radius: 50%;

    background:
        rgba(255, 255, 255, 0.12);

    color: #ffffff;

    font-size: 1.35rem;

    transition:
        background 0.25s ease,
        transform 0.25s ease;
}

.lightbox-nav:hover {
    background: var(--orange);

    transform:
        translateY(-50%)
        scale(1.08);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1000px) {

    .gallery-item {
        flex-basis:
            calc((100% - 18px) / 2);

        height: 240px;
    }

}

@media (max-width: 700px) {

    .product-gallery {
        padding-bottom: 80px;
    }

    .carousel-wrapper {
        padding: 0 46px;
    }

    .product-carousel {
        gap: 0;
        overflow-x: hidden;
    }

    .gallery-item {
        flex: 0 0 100%;

        height: 220px;

        border-radius: 18px;

        scroll-snap-align: center;
    }

    .gallery-item img {
        width: 100%;
        height: 100%;

        object-fit: cover;
    }

    .carousel-btn {
        display: grid;

        width: 40px;
        height: 40px;

        top: 50%;

        transform: translateY(-50%);
    }

    .carousel-prev {
        left: 0;
    }

    .carousel-next {
        right: 0;
    }

    .lightbox {
        padding: 20px;
    }

    .lightbox-nav {
        width: 44px;
        height: 44px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

}