/* ==========================================================
   AD DEALERS MAP - CSS PROPRE (Divi 5)
   - Desktop: Catégories en 2 colonnes AU DESSUS, puis Continent/Pays/Reset sur 1 ligne
   - Tablette portrait + mobile: tout en 1 colonne
   - Ne casse pas Leaflet
========================================================== */
/* ------------------------------
   FILTRES - Desktop
------------------------------ */
.ad-dealers-filters {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  grid-template-areas:
    "cats cats cats"
    "cont country reset";
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
  padding-left: 0px !important;
  padding-right: 0px !important;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0px !important;
  padding-right: 0px !important;
}
/* Assigne les zones via l'ordre HTML actuel */
.ad-dealers-filters .ad-field:nth-child(1) {
  grid-area: cats;
}
.ad-dealers-filters .ad-field:nth-child(2) {
  grid-area: cont;
}
.ad-dealers-filters .ad-field:nth-child(3) {
  grid-area: country;
}
.ad-dealers-filters .ad-field:nth-child(4) {
  grid-area: reset;
}
.ad-field label {
  font-weight: 600;
  margin-bottom: 6px;
}
.ad-field select {
  min-height: 40px;
  padding: 6px 10px;
  width: 100%;
}
/* Catégories: 2 colonnes */
.ad-cats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 15px !important;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, .15);
  border-radius: 14px;
  background: rgba(0, 0, 0, .02);
}
/* Items catégories */
.ad-cat {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  line-height: 1.15;
}
.ad-cat input {
  margin: 2px 5px 0 0;
}
.ad-cat-pin {
  width: 18px;
  height: 24px;
  flex: 0 0 auto;
  margin-top: 1px;
}
.ad-cat-label {
  font-size: 13px;
}
/* Reset -> icône */
.ad-actions {
  display: flex;
  justify-content: flex-end;
}
#ad-filter-reset {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  line-height: 0;
}
#ad-filter-reset::before {
  content: "";
  width: 22px;
  height: 22px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
  background-image: url("https://dardelet.eu/wp-content/themes/dardelet/noun-round-arrow.svg");
}
#ad-filter-reset:active {
  transform: translateY(1px);
}
/* ------------------------------
   CARTE - Safe Leaflet
------------------------------ */
#ad-dealers-map {
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  border-radius: 16px;
  overflow: hidden;
  background: #e9ecef;
  /* Desktop */
  height: 650px;
  min-height: 650px;
}
/* Divi: img{max-width:100%} casse Leaflet */
#ad-dealers-map .leaflet-container img {
  max-width: none !important;
}
/* Controls visibles */
#ad-dealers-map .leaflet-control {
  z-index: 1000 !important;
}
/* Popup */
.ad-popup-wrap {
  width: 320px;
}
.ad-popup-title {
  font-weight: 700;
  margin-bottom: 6px;
  font-size: 24px;
}
.ad-popup-meta {
  font-size: 12px;
  opacity: .75;
  margin-bottom: 0px !important;
}
.ad-popup-body {
  max-height: 220px;
  overflow: auto;
  padding-right: 8px;
}
.ad-cat-pin img {
  width: 13px !important;
  height: 18px !important;
  display: inline !important;
  margin: 0 4px 0 3px !important;
}
/* ------------------------------
   Tablette portrait + mobile
   => layout 2e capture
------------------------------ */
@media (max-width: 980px) {
  .ad-dealers-filters {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "cats"
      "cont"
      "country"
      "reset" !important;
  }
  .ad-cats {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr !important; /* 1 colonne */
  }
  .ad-actions {
    justify-content: flex-start !important;
  }
  /* Le champ Catégories prend toute la largeur */
  .ad-dealers-filters .ad-field:first-child {
    width: 100%;
  }
}
/* Mobile confort - CARTE PLEINE HAUTEUR */
@media (max-width: 768px) {
  #ad-dealers-map {
    height: 90vh !important; /* Prend 90% de la hauteur de l'écran */
    min-height: 500px !important;
    max-height: 90vh !important;
  }
  
  /* Masquer les boutons +/- sur mobile */
  #ad-dealers-map .leaflet-control-zoom {
    display: none !important;
  }
}

/* Très petits écrans (iPhone SE, etc.) */
@media (max-width: 380px) {
  #ad-dealers-map {
    height: 85vh !important;
    min-height: 450px !important;
  }
}

/* ==========================================================
   FILTRES contenus + CARTE full width
   (sans modifier le PHP)
========================================================== */
/* Leaflet doit remplir le conteneur */
#ad-dealers-map .leaflet-container {
  width: 100%;
  height: 100%;
}
#ad-dealers-map {
  transform: translateZ(0);
}
.SearcheRev {
  color: #ff6b00;
  font-weight: 700;
  font-style: italic;
  background-color: rgba(255, 107, 0, 0.05);
  padding: 12px;
  border-left: 4px solid #ff6b00;
  display: block;
  margin: 15px 0;
}