/* --- ID 307: mapbox - annonce display --- */
/*********************************
 * HOME — MAPBOX (HomerentAI)
 * Desktop: popup in-map (moderne)
 * Mobile: card sous la map (style Airbnb)
 *********************************/

:root{
  --hr-blue:#4C6FFF;
  --hr-text:#1f2a44;
  --hr-muted:#6b778c;
  --hr-border:rgba(148,163,184,.35);
  --hr-shadow:0 18px 50px rgba(15,23,42,.18);
  --hr-shadow-strong:0 22px 70px rgba(15,23,42,.22);
}

/* ===== Cadre map ===== */
.hp-map.homerentai-home-map,
.widget .hp-map.homerentai-home-map{
  border-radius: 28px !important;
  overflow: hidden !important;
  background: #0b1020 !important;
  box-shadow: var(--hr-shadow) !important;
  border: 0 !important;
  outline: 0 !important;
}

.hp-map.homerentai-home-map .mapboxgl-canvas-container,
.hp-map.homerentai-home-map .mapboxgl-canvas{
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  outline: 0 !important;
}

/* Hauteur cohérente (desktop) */
.hp-map.homerentai-home-map{
  height: 420px !important;
  max-height: 52vh !important;
}

/* ===== Popup Mapbox (desktop/tablet) ===== */
.hp-map.homerentai-home-map .mapboxgl-popup{
  z-index: 50;
}

/* IMPORTANT: Mapbox met souvent max-width inline: 240px -> on override en desktop */
@media (min-width: 641px){
  .hp-map.homerentai-home-map .mapboxgl-popup{
    max-width: none !important;
  }
  .hp-map.homerentai-home-map .mapboxgl-popup-content{
    width: 420px !important;     /* taille fixe desktop */
    max-width: 420px !important;
    min-width: 420px !important;
  }
}

/* Style popup content */
.hp-map.homerentai-home-map .mapboxgl-popup-content{
  background: #fff !important;
  border: 1px solid var(--hr-border) !important;
  border-radius: 18px !important;
  padding: 0 !important;
  box-shadow: var(--hr-shadow-strong) !important;
  overflow: hidden !important;
}

/* Tip */
.hp-map.homerentai-home-map .mapboxgl-popup-tip{
  border-top-color: #fff !important;
  border-bottom-color: #fff !important;
}

/* Close button (desktop) */
.hp-map.homerentai-home-map .mapboxgl-popup-close-button{
  width: 32px !important;
  height: 32px !important;
  right: 10px !important;
  top: 10px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.9) !important;
  border: 1px solid var(--hr-border) !important;
  color: #2b3447 !important;
  font-size: 18px !important;
  line-height: 30px !important;
  box-shadow: 0 12px 30px rgba(15,23,42,.18) !important;
}

/* ===== Card interne (desktop) ===== */
.hp-map.homerentai-home-map .hr-mapcard{
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 14px;
  align-items: center;
  width: 100%;
}

.hp-map.homerentai-home-map .hr-mapcard__thumb{
  width: 130px;
  height: 96px;
  border-radius: 16px;
  background: #eef2f7;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.25);
}

.hp-map.homerentai-home-map .hr-mapcard__thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hp-map.homerentai-home-map .hr-mapcard__meta{
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hp-map.homerentai-home-map .hr-mapcard__city{
  font-size: 13px;
  color: var(--hr-muted);
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hp-map.homerentai-home-map .hr-mapcard__title{
  font-size: 18px;
  font-weight: 700;
  color: var(--hr-text);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hp-map.homerentai-home-map .hr-mapcard__cta{
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 2px solid var(--hr-blue);
  color: var(--hr-blue);
  background: #fff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  width: max-content;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

.hp-map.homerentai-home-map .hr-mapcard__cta:hover{
  background: rgba(76,111,255,.06);
  box-shadow: 0 16px 40px rgba(76,111,255,.22);
  transform: translateY(-1px);
}

/* Animation apparition (desktop) */
.hp-map.homerentai-home-map .mapboxgl-popup{
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.hp-map.homerentai-home-map .mapboxgl-popup.is-enhanced{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===== Same popup skin for search maps (classic + advanced) ===== */
.hp-map.hr-map-popup-skin .mapboxgl-popup{
  z-index: 50;
}

@media (min-width: 641px){
  .hp-map.hr-map-popup-skin .mapboxgl-popup{
    max-width: none !important;
  }
  .hp-map.hr-map-popup-skin .mapboxgl-popup-content{
    width: 420px !important;
    max-width: 420px !important;
    min-width: 420px !important;
  }
}

.hp-map.hr-map-popup-skin .mapboxgl-popup-content{
  background: #fff !important;
  border: 1px solid var(--hr-border) !important;
  border-radius: 18px !important;
  padding: 0 !important;
  box-shadow: var(--hr-shadow-strong) !important;
  overflow: hidden !important;
}

.hp-map.hr-map-popup-skin .mapboxgl-popup-tip{
  border-top-color: #fff !important;
  border-bottom-color: #fff !important;
}

.hp-map.hr-map-popup-skin .mapboxgl-popup-close-button{
  width: 32px !important;
  height: 32px !important;
  right: 10px !important;
  top: 10px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,.9) !important;
  border: 1px solid var(--hr-border) !important;
  color: #2b3447 !important;
  font-size: 18px !important;
  line-height: 30px !important;
  box-shadow: 0 12px 30px rgba(15,23,42,.18) !important;
}

.hp-map.hr-map-popup-skin .hr-mapcard{
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 12px;
  padding: 14px;
  align-items: center;
  width: 100%;
}

.hp-map.hr-map-popup-skin .hr-mapcard__thumb{
  width: 130px;
  height: 96px;
  border-radius: 16px;
  background: #eef2f7;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.25);
}

.hp-map.hr-map-popup-skin .hr-mapcard__thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hp-map.hr-map-popup-skin .hr-mapcard__meta{
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hp-map.hr-map-popup-skin .hr-mapcard__city{
  font-size: 13px;
  color: var(--hr-muted);
  display: flex;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hp-map.hr-map-popup-skin .hr-mapcard__title{
  font-size: 18px;
  font-weight: 700;
  color: var(--hr-text);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.hp-map.hr-map-popup-skin .hr-mapcard__cta{
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 2px solid var(--hr-blue);
  color: var(--hr-blue);
  background: #fff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  width: max-content;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

.hp-map.hr-map-popup-skin .hr-mapcard__cta:hover{
  background: rgba(76,111,255,.06);
  box-shadow: 0 16px 40px rgba(76,111,255,.22);
  transform: translateY(-1px);
}

.hp-map.hr-map-popup-skin .mapboxgl-popup{
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.hp-map.hr-map-popup-skin .mapboxgl-popup.is-enhanced{
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ===== MOBILE: on n'utilise plus la popup dans la map ===== */
@media (max-width: 640px){
  /* On masque la popup Mapbox (on la garde pour récupérer son contenu en JS) */
  .hp-map.homerentai-home-map .mapboxgl-popup{
    display: none !important;
  }
  .hp-map.hr-map-popup-skin .mapboxgl-popup{
    display: none !important;
  }
}

/* ===== Mobile sheet (card sous la map) ===== */
.hr-mobile-sheet{
  display: none;
  margin-top: 14px;
}

@media (max-width: 640px){
  .hr-mobile-sheet{
    display: block;
  }

  .hr-mobile-sheet__card{
    position: relative;
    background: #fff;
    border: 1px solid var(--hr-border);
    border-radius: 18px;
    box-shadow: var(--hr-shadow-strong);
    overflow: hidden;
    padding: 12px;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }

  .hr-mobile-sheet.is-open .hr-mobile-sheet__card{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .hr-mobile-sheet__close{
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--hr-border);
    background: rgba(255,255,255,.95);
    box-shadow: 0 12px 30px rgba(15,23,42,.14);
    color: #2b3447;
    font-size: 20px;
    line-height: 32px;
    padding: 0;
    cursor: pointer;
  }

  /* Layout de la card mobile */
  .hr-mobile-sheet .hr-mapcard{
    padding: 6px 2px 2px 2px;
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 10px;
    align-items: center;
  }

  .hr-mobile-sheet .hr-mapcard__thumb{
    width: 88px;
    height: 70px;
    border-radius: 14px;
  }

  .hr-mobile-sheet .hr-mapcard__city{
    font-size: 12px;
  }

  /* Titre plus petit + clamp 2 lignes */
  .hr-mobile-sheet .hr-mapcard__title{
    font-size: 16px;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .hr-mobile-sheet .hr-mapcard__cta{
    margin-top: 6px;
    padding: 8px 12px;
    font-size: 14px;
  }
}













