.chantier-recent {
    margin: 0 5vw;
}

.chantier-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 2rem; /* espace supplémentaire */
}

.chantier-item {
    cursor: pointer;
    position: relative;
    width: 20vw;   /* taille fixe comme tu voulais */
    height: 20vw;  /* carré */
    border-radius: 20px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.chantier-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.chantier-item h4 {
    position: absolute;
    padding: 0.5vw;
    top: 2vh;
    left: 2vh;
    margin: 0 !important;
    color: #2B2B2B;
    background-color: #FFFFFF;
    border-radius: 10px;
    font-size: 1vw;
}

.chantier-item h3 {
    font-size: 1vw;
    position: absolute;
    padding: 0.5vw;
    bottom: 2vh;
    left: 2vh;
    margin: 0 !important;
    font-family: "Display-Bold";
    color: #2B2B2B;
    background-color: #FFFFFF;
    border-radius: 10px;
    border-top-left-radius: 0px;
}

.chantier-item p {
    position: absolute;
    padding: 0.5vw;
    bottom: 6vh;
    left: 2vh;
    margin: 0 !important;
    font-family: "Display";
    color: #2B2B2B;
    background-color: #FFFFFF;
    z-index: 1;
    border-radius: 10px;
    border-bottom-left-radius: 0px;
}

.chantier-item .rond-fleche {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 2vw;
    height: 2vw;
    background-color: #FFFFFF;
    position: absolute;
    right: 1vw;
    top: 1vw;
    border-radius: 50%;
}

.chantier-item .rond-fleche .fleche {
    width: 1vw;
    height: 1vw;
    border-radius: 0px;
}

.chantier-item:hover {
    box-shadow: 1px 1.5px 5px black;
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .chantier-item {
        width: 40vw;
        height: 40vw;
    }

    .chantier-item h4,
    .chantier-item h3,
    .chantier-item p {
        font-size: 1.5vw;
    }

    .chantier-item .rond-fleche {
        width: 4vw;
        height: 4vw;
    }

    .chantier-item .rond-fleche .fleche {
        width: 2vw;
        height: 2vw;
    }
}

@media (max-width: 600px) {
    .chantier-item {
        width: 80vw;
        height: 80vw;
    }

    .chantier-item h4,
    .chantier-item h3,
    .chantier-item p {
        font-size: 3vw;
    }

    .chantier-item .rond-fleche {
        width: 8vw;
        height: 8vw;
    }

    .chantier-item .rond-fleche .fleche {
        width: 4vw;
        height: 4vw;
    }
}

.chantier-tous{
    margin-top: 5vh!important;
}


.map-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

.map-base {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.map-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

.map-base {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
}

.map-item {
    cursor: pointer;
    position: absolute; /* essentiel pour placement sur la map */
    width: 12vw;
    height: 12vw;
    border-radius: 20px;
    overflow: visible;
    transition: box-shadow 0.2s ease;
}

.map-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.map-item h4 {
    position: absolute;
    padding: 0.5vw;
    top: 2vh;
    left: 2vh;
    margin: 0 !important;
    color: #2B2B2B;
    background-color: #FFFFFF;
    border-radius: 10px;
    font-size: 0.8vw;
}

.map-item h3 {
    font-size: 0.8vw;
    position: absolute;
    padding: 0.5vw;
    bottom: 2vh;
    left: 2vh;
    margin: 0 !important;
    font-family: "Display-Bold";
    color: #2B2B2B;
    background-color: #FFFFFF;
    border-radius: 10px;
}

.map-item p {
    position: absolute;
    padding: 0.5vw;
    bottom: 6vh;
    left: 2vh;
    margin: 0 !important;
    font-family: "Display";
    color: #2B2B2B;
    background-color: #FFFFFF;
    z-index: 1;
    border-radius: 10px;
    border-bottom-left-radius: 0px;
}

.map-item .rond-fleche {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 2vw;
    height: 2vw;
    background-color: #FFFFFF;
    position: absolute;
    right: 1vw;
    top: 1vw;
    border-radius: 50%;
}

.map-item .rond-fleche .fleche {
    width: 1vw;
    height: 1vw;
    border-radius: 0px;
}

.map-item:hover {
    box-shadow: 1px 1.5px 5px black;
}

.map-item .marker {
    width: 1.5vw;
    height: 2vw;
    position: absolute;
    bottom: -1vw;
    left: 50%;
    transform: translateX(-50%);
}

.pop-up{
    display: none;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    width: 30vw;
    height: 80vh;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    border-radius: 25px;
    border: solid black 1px;
    img{
        border-radius: 25px;
        width: 100%;
        height: 50vh;
    }
    .ville{
        position: absolute;
        bottom: 1vh;
        left: 2vh;
        background-color: white;
        color: #2B2B2B;
        padding: 0.8vw;
        border-radius: 15px;
    }
}

#angers {
    top: 16%;
    left: 51%;
}

#nueil_les_aubiers_ {
    top: 72%;
    left: 40%;
}

#saumur {
    top: 43%;
    left: 73%;
}

#faye_danjou {
    top: 41%;
    left: 50%;
}

#beaupreau {
    top: 48%;
    left: 29%;
}


section{
    display: flex;
    flex-direction: column;
    gap: 5vh;
}

section h2{
    margin-left: 5%;
}
/* === SECTION GLOBALE === */
.avant-apres-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 chantiers par ligne */
    gap: 2rem;
    padding: 2rem 5rem;
    box-sizing: border-box;
}

/* === BLOC CHANTIER === */
.avant-apres {
    flex: 1 1 47%; /* ✅ prend la moitié de la largeur - le gap */
    box-sizing: border-box;
    border: 2px solid #FE9A02;
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 1.5rem;
    background-color: #fff;
}

/* === IMAGE VERTICALE === */
.avant-apres-container {
    position: relative;
    flex: 1 1 45%;
    overflow: hidden;
    border-radius: 15px;
    background-color: #f4f4f4;
    aspect-ratio: 3 / 4; /* format portrait */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Images "avant" et "après" */
.avant-apres-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.avant-apres-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* image occupe tout le cadre sans déformation */
    border-radius: 15px;
    user-select: none;
    pointer-events: none;
}

/* Pas de transition sur le clip-path */
.avant-apres-image.apres {
    clip-path: inset(0 50% 0 0);
    transition: none;
}

/* === GLISSEUR === */
.glisseur {
    position: absolute;
    top: 0;
    left: 50%;
    width: 4px;
    height: 100%;
    background-color: #FE9A02;
    cursor: ew-resize;
    z-index: 2;
}

.glisseur::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background-color: #FE9A02;
    border-radius: 50%;
    box-shadow: 0 0 0 3px #fff;
}

/* === TEXTE === */
.avant-apres .text {
    flex: 1 1 55%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.avant-apres .text h3 {
    font-size: 1.4rem;
    color: #222;
    margin: 0;
}

.avant-apres .text p {
    font-size: 1rem;
    color: #555;
    line-height: 1.4;
    margin: 0;
}

/* === BOUTON === */
.btn_orange a {
    display: inline-block;
    background-color: #FE9A02;
    color: #fff;
    font-weight: 600;
    text-align: center;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.btn_orange a:hover,
.btn_orange a:focus {
    background-color: #ffb547;
}

@media (max-width: 992px) {
    /* Chaque chantier prend toute la largeur */
    .avant-apres-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        padding: 2rem 2rem;
    }

    .avant-apres {
        flex-direction: column; /* image au-dessus du texte */
        align-items: center;
        text-align: center;
        width: 100%;
        max-width: 600px;        /* largeur max pour confort lecture */
        height: 70vh;            /* hauteur approximative 70% de la view height */
        padding: 1rem;
        gap: 1rem;
    }

    .avant-apres-container {
        flex: 1 1 auto;
        width: 100%;
        height: 70%;             /* image prend environ 70% du bloc */
        max-height: none;
        aspect-ratio: 3 / 4;     /* conserve le ratio portrait */
        margin: 0 auto;
        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .avant-apres-image {
        position: absolute;       /* nécessaire pour slider */
        width: 100%;
        height: 100%;
    }

    .avant-apres-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;        /* conserve le ratio vertical */
        border-radius: 15px;
    }

    /* Glisseur */
    .glisseur {
        height: 100%;
        top: 0;
        left: 50%;
    }

    .glisseur::before {
        width: 20px;
        height: 20px;
    }

    /* Texte */
    .avant-apres .text {
        flex: 1 1 auto;
        width: 90%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.8rem;
    }

    .avant-apres .text h3 {
        font-size: 1.5rem;
    }

    .avant-apres .text p {
        font-size: 1.1rem;
    }

    /* Bouton */
    .btn_orange a {
        font-size: 1.2rem;
        padding: 1rem 2rem;
    }
}






/* === POPUP CHANTIERS === */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow-y: auto;
}

.popup-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 20px;
    padding: 2vw;
    max-width: 60vw;
    height: fit-content;
    width: 90%;
    color: #2B2B2B;
    position: relative;
    animation: scaleIn 0.3s ease;
}

.popup-close {
    position: absolute;
    top: 1vw;
    right: 1vw;
    background: none;
    border: none;
    font-size: 2vw;
    cursor: pointer;
    color: #2B2B2B;
}

.popup-images {
    display: flex;
    flex-wrap: wrap;
    gap: 1vw;
    justify-content: center;
    margin-bottom: 1.5vw;
}

.popup-images img {
    width: 25%;
    border-radius: 10px;
    object-fit: cover;
}

.popup-text h2 {
    font-family: "Display-Bold";
    font-size: 1.5vw;
    margin-bottom: 0.5vw;
}

.popup-text p {
    font-family: "Display";
    font-size: 1vw;
    margin-bottom: 0.5vw;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}



/* === RESPONSIVE === */

/* Tablettes */
@media (max-width: 1024px) {
    .popup-content {
        max-width: 80vw;
        padding: 4vw;
    }

    .popup-close {
        font-size: 3vw;
        top: 2vw;
        right: 2vw;
    }

    .popup-images img {
        width: 40%;
    }

    .popup-text h2 {
        font-size: 3vw;
    }

    .popup-text p {
        font-size: 1.8vw;
    }
}

/* Mobiles */
@media (max-width: 600px) {
    .popup-content {
        max-width: 95vw;
        padding: 6vw 4vw;
        border-radius: 15px;
    }

    .popup-close {
        font-size: 5vw;
        top: 3vw;
        right: 3vw;
    }

    .popup-images {
        gap: 3vw;
        margin-bottom: 5vw;
    }

    .popup-images img {
        width: 80%;
    }

    .popup-text {
        text-align: left;
    }

    .popup-text h2 {
        font-size: 5vw;
        margin-bottom: 2vw;
    }

    .popup-text p {
        font-size: 3.5vw;
        margin-bottom: 2vw;
    }
}