.chantier-recent {
  margin: 0 5vw;

  .uk-slider-items {
    display: flex !important;
    flex-wrap: nowrap !important;

    > li {
      flex: 0 0 auto !important;
    }
  }

  .chantier-list {
    gap: 2rem;
  }

  .chantier-item {
    cursor: pointer;
    position: relative;
    width: 20vw;
    height: 20vw;
    border-radius: 20px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;

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

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

    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: 0;
    }

    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: 0;
    }

    .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%;

      .fleche {
        width: 1vw;
        height: 1vw;
        border-radius: 0;
      }
    }

    &:hover {
      box-shadow: 1px 1.5px 5px black;
    }
  }
}

@media (max-width: 1200px) {
  .chantier-recent {
    .chantier-item {
      width: 40vw;
      height: 40vw;

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

      .rond-fleche {
        width: 4vw;
        height: 4vw;

        .fleche {
          width: 2vw;
          height: 2vw;
        }
      }
    }
  }
}

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

      h4,
      h3,
      p {
        font-size: 4vw;
        padding: 2vw;
      }

      .rond-fleche {
        width: 10vw;
        height: 10vw;

        .fleche {
          width: 4vw;
          height: 4vw;
        }
      }
    }
  }
}

/* =========================
   MODAL CHANTIER - CENTRE
   50vw x 70vh
   ========================= */

.chantier-modal .uk-modal-dialog.chantier-modal__dialog{
  width: 50vw;
  max-width: 900px;
  height: 70vh;
  margin: auto;
  border-radius: 18px;
  overflow: hidden;
  background: #ffffff;
  padding: 22px;
  display: flex;
  flex-direction: column;
}

/* Bloque le scroll page: UIKit le fait deja, mais on renforce au cas ou */
.uk-modal-page{
  overflow: hidden !important;
}

/* Header */
.chantier-modal__header{
  padding-bottom: 14px;
}

.chantier-modal__title{
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: #111;
}

.chantier-modal__city{
  margin: 6px 0 0 0;
  font-size: 14px;
  color: rgba(0,0,0,0.6);
}

/* Slider prend le reste */
.chantier-modal__slider{
  flex: 1;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f3f3;
  position: relative;
}

/* Images */
#chantier-modal-images{
  height: 100%;
}

#chantier-modal-images li{
  height: 100%;
}

#chantier-modal-images .uk-panel{
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
}

#chantier-modal-images img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Flèches */
.chantier-modal__nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  background: rgba(0,0,0,0.55);
  border-radius: 999px;
  padding: 12px;
}

.chantier-modal__nav--prev{ left: 12px; }
.chantier-modal__nav--next{ right: 12px; }

/* Dotnav */
.chantier-modal__slider .uk-dotnav{
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  margin: 0;
}

/* Footer */
.chantier-modal__footer{
  padding-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.chantier-modal__cta{
  border-radius: 12px;
  padding: 12px 16px;
}

/* Responsive */
@media (max-width: 960px){
  .chantier-modal .uk-modal-dialog.chantier-modal__dialog{
    width: 92vw;
    height: 78vh;
    padding: 18px;
  }

  .chantier-modal__title{
    font-size: 22px;
  }
}



.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;
        width: fit-content !important;
        padding: 1rem 2rem !important;
    }
}






/* === 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;
    }
}