/* Galerie page d'accueil — carrousel (3 / 2 / 1 visibles) + popup plein écran (même principe que logiciels) */

.home_gallery_section {
    padding: 3rem 1.5rem 4rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.home_gallery_section .features_container {
    max-width: min(100%, 1600px);
    margin: 0 auto;
}

.home_gallery_section .section_title {
    display: block;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2rem;
}

.home_gallery_row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
}

.home_gallery_viewport {
    flex: 1;
    overflow: hidden;
    border-radius: 12px;
    min-width: 0;
}

.home_gallery_track {
    display: flex;
    gap: 16px;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.home_gallery_card {
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #e2e8f0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}

.home_gallery_card img {
    display: block;
    width: 100%;
    height: 420px;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.home_gallery_card img:hover {
    transform: scale(1.03);
}

.home_gallery_nav {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    background: #f33428;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.home_gallery_nav:hover {
    background: #d6281f;
    transform: scale(1.05);
}

.home_gallery_nav:focus-visible {
    outline: 2px solid #f33428;
    outline-offset: 2px;
}

.home_gallery_dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.home_gallery_dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.2);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.home_gallery_dot.is-active {
    background: #f33428;
    transform: scale(1.2);
}

@media (max-width: 992px) {
    .home_gallery_card img {
        height: 360px;
    }
}

@media (max-width: 600px) {
    .home_gallery_row {
        gap: 0.5rem;
    }

    .home_gallery_nav {
        width: 40px;
        height: 40px;
        font-size: 0.95rem;
    }

    .home_gallery_card img {
        height: min(72vw, 420px);
    }
}

/* Popup galerie accueil (réutilise la logique des pages logiciels) */
#home-gallery-slide-popup.slide_popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#home-gallery-slide-popup .slide_popup_overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

#home-gallery-slide-popup .slide_popup_container {
    position: relative;
    width: 90%;
    max-width: 1400px;
    height: 90vh;
    max-height: 900px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#home-gallery-slide-popup .slide_popup_close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 10002;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#home-gallery-slide-popup .slide_popup_close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

#home-gallery-slide-popup .slide_popup_prev,
#home-gallery-slide-popup .slide_popup_next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 10002;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#home-gallery-slide-popup .slide_popup_prev {
    left: 20px;
}

#home-gallery-slide-popup .slide_popup_next {
    right: 20px;
}

#home-gallery-slide-popup .slide_popup_prev:hover,
#home-gallery-slide-popup .slide_popup_next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

#home-gallery-slide-popup .slide_popup_content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

#home-gallery-slide-popup .slide_popup_image_container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#home-gallery-slide-popup .slide_popup_slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

#home-gallery-slide-popup .slide_popup_slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
}

#home-gallery-slide-popup .slide_popup_slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

#home-gallery-slide-popup .slide_popup_counter {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    z-index: 10002;
    backdrop-filter: blur(10px);
}

#home-gallery-slide-popup .slide_popup_dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10002;
    background: rgba(0, 0, 0, 0.6);
    padding: 15px 20px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
}

#home-gallery-slide-popup .slide_popup_dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

#home-gallery-slide-popup .slide_popup_dot.active {
    background: white;
    transform: scale(1.3);
}

#home-gallery-slide-popup .slide_popup_dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

@media (max-width: 768px) {
    #home-gallery-slide-popup .slide_popup_container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    #home-gallery-slide-popup .slide_popup_close {
        top: 70px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    #home-gallery-slide-popup .slide_popup_prev,
    #home-gallery-slide-popup .slide_popup_next {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    #home-gallery-slide-popup .slide_popup_prev {
        left: 10px;
    }

    #home-gallery-slide-popup .slide_popup_next {
        right: 10px;
    }

    #home-gallery-slide-popup .slide_popup_counter {
        top: 70px;
        left: 10px;
        padding: 8px 16px;
        font-size: 14px;
    }

    #home-gallery-slide-popup .slide_popup_dots {
        bottom: 70px;
        padding: 12px 16px;
        gap: 8px;
    }

    #home-gallery-slide-popup .slide_popup_dot {
        width: 10px;
        height: 10px;
    }
}
