/* ==============================
   Layout général : Carte + Listing
============================== */
html,
body {
  height: 100%;
  margin: 0;
  overflow: auto; /* empêche la page de scroller */
}

#layout {
  display: flex;

  max-width: 1400px;
  margin: 20px auto;
  gap: 15px;
}
/* ==============================
   Boutons radio - état normal
============================== */
/* non sélectionné */
.btn-check + .btn {
  color: #333; /* texte gris foncé */
  background-color: #f8f9fa; /* fond clair */
  border-color: #ad3671; /* contour rose */
  transition: all 0.2s ease;
}

/* ==============================
   Boutons radio - état normal
============================== */
/* non sélectionné */
.btn-check + .btn {
  color: #333; /* texte gris foncé */
  background-color: #f8f9fa; /* fond clair */
  border-color: #ad3671; /* contour rose */
  transition: all 0.2s ease;
}

/* non sélectionné - hover */
.btn-check + .btn:hover {
  color: #fff; /* texte blanc au hover */
  background-color: #ad3671; /* fond rose au hover */
  border-color: #ad3671; /* contour rose */
}

/* sélectionné */
.btn-check:checked + .btn {
  color: #fff; /* texte blanc */
  background-color: #ad3671; /* fond rose */
  border-color: #ad3671; /* contour rose */
}

/* sélectionné - hover (optionnel si tu veux un effet plus clair) */
.btn-check:checked + .btn:hover {
  background-color: #c94b7f; /* rose un peu plus clair au hover */
  border-color: #c94b7f;
}

/* ==============================
   Listing à gauche
============================== */
/* Conteneur sidebar */
#listing {
  /* scroll si beaucoup de biens */
  padding: 10px;
  background-color: #fff7f9;
  border: 2px solid #ad3671;
  box-shadow: 0 4px 12px rgba(173, 54, 113, 0.1);
  margin-right: 1rem;
  border-radius: 14px;
  font-family: Arial, sans-serif;
  height: 900px;
  overflow-y: auto; /* scroll vertical */
  overflow-x: hidden; /* pas de scroll horizontal */
  scrollbar-width: none;
}

/* Card logement */

.logement-card {
  cursor: pointer;
  margin-bottom: 15px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
  width: 100%;
}

.logement-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.logement-card img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 6px;
}

.logement-card h5 {
  margin: 5px 0;
  font-size: 16px;
  font-weight: 600;
}

.logement-card p {
  margin: 0;
  font-size: 14px;
  color: #555;
}

.logement-card strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  color: #000;
}
.logement-card {
  transition:
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}

.logement-card.is-active {
  background-color: #fff3cd;
  box-shadow: 0 0 0 2px #ffc107 inset;
}

/* ==============================
   Carte à droite
============================== */
#map {
  flex: 1;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  height: 900px;
}

/* ==============================
   Popups (déjà existants)
============================== */
.leaflet-popup-custom .leaflet-popup-content-wrapper {
  padding: 0;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.leaflet-popup-custom .leaflet-popup-content {
  margin: 0;
  width: 400px;
  font-family: Arial, sans-serif;
}

.popup-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.popup-header {
  position: relative;
  height: 160px;
  overflow: hidden;
}

.popup-header img.popup-image {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.popup-price {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background-color: #ffc107;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 18px;
  color: #000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.popup-body {
  padding: 12px 15px;
}

.popup-body h3 {
  margin: 0 0 6px 0;
  font-size: 18px;
  font-weight: 700;
}

.popup-type {
  font-size: 13px;
  color: #555;
  margin-bottom: 8px;
}

.popup-body p {
  font-size: 14px;
  line-height: 1.45;
  margin: 7px 0;
  color: #333;
}

.icon {
  width: 16px;
  height: 16px;
  vertical-align: middle;
  margin-right: 6px;
}

.leaflet-marker-icon {
  cursor: pointer;
}

.leaflet-popup {
  transition: opacity 0.15s ease;
}

/* ==============================
   Hint zoom
============================== */
#ctrl-zoom-hint {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 99999;
}

#ctrl-zoom-hint.visible {
  opacity: 1;
}

.scrollable {
  padding: 0% 10%;
  position: relative;
  overflow: hidden;
  height: 800px;
}

.scrollable.showScroll::after {
  position: absolute;
  content: "";
  top: 5%;
  right: 7px;
  height: 90%;
  width: 3px;
  background: rgba(224, 224, 255, 0.3);
}

.scrollable .content-wrapper {
  width: 100%;
  height: 100%;
  padding-right: 50%;
  overflow-y: scroll;
}
.scroller {
  z-index: 5;
  cursor: pointer;
  position: absolute;
  width: 10px;
  border-radius: 5px;
  top: 0px;
  right: 3px;
  -webkit-transition: top 0.08s;
  -moz-transition: top 0.08s;
  -ms-transition: top 0.08s;
  -o-transition: top 0.08s;
  transition: top 0.08s;
}
.popup-mobile {
  width: 100%;
  max-width: 360px;
}
.leaflet-gesture-handling:after {
  color: #fff;
  font-family: Roboto, Arial, sans-serif;
  font-size: 22px;
  justify-content: center;
  display: flex;
  align-items: center;
  padding: 15px;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1001;
  pointer-events: none;
  text-align: center;
  transition: opacity 0.8s ease-in-out;
  opacity: 0;
  content: "";
}

.leaflet-gesture-handling-warning:after {
  transition-duration: 0.3s;
  opacity: 1;
}

.leaflet-gesture-handling-touch:after {
  content: attr(data-gesture-handling-touch-content);
}

.leaflet-gesture-handling-scroll:after {
  content: attr(data-gesture-handling-scroll-content);
}
@media (max-width: 768px) {
  #listing {
    display: flex;
    flex-direction: row; /* horizontal */
    overflow-x: auto; /* scroll horizontal */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding: 10px 5px; /* padding horizontal adapté */
    scrollbar-width: none;
    height: auto;
    border-radius: 0%;
    margin-top: 10px;
    max-height: 900px;
  }

  /* Cacher scrollbar sur Chrome, Edge, Safari */
  #listing::-webkit-scrollbar {
    display: none;
  }

  /* Adapter les cartes pour le scroll horizontal */
  .logement-card {
    min-width: 250px; /* largeur minimale pour chaque carte */
    flex: 0 0 auto; /* ne pas rétrécir dans le flex container */
    margin-bottom: 0; /* enlever margin vertical, on gère avec gap */
  }
  /* Cards */
  .logement-card img {
    height: 120px;
  }

  .logement-card h5 {
    font-size: 15px;
  }

  /* Popup leaflet */
  .leaflet-popup-custom .leaflet-popup-content {
    width: 280px;
    max-width: 90vw;
  }

  .leaflet-popup {
    bottom: 0 !important;
  }
  .popup-mobile {
    max-width: 279px; /* popup plus compacte sur mobile */
  }
  .popup-header img.popup-image {
    height: 140px; /* image plus petite sur mobile */
  }

  .leaflet-popup {
    margin: 0;
  }
}
