/* ===============================
   CARTE INTERACTIVE ESTIVAREILLES
   =============================== */

/* Carte */
#map {
    border: 2px solid #ccc;
    border-radius: 8px;
}

/* ------------------------------
   Filtres (catégories)
   ------------------------------ */

/* Container des filtres */
.poi-filter {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px !important;
  justify-content: center !important;
  max-width: 650px;
  margin: 0 auto 10px auto !important;
  overflow-x: auto;           /* scroll horizontal si trop de boutons */
  scrollbar-width: thin;
}
.poi-filter::-webkit-scrollbar {
  height: 6px;
}
.poi-filter::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* Boutons */
.filter-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  
  width: 100% !important;
  white-space: normal !important;
  word-break: break-word !important;

  background: #f5f5f5 !important;
  border: 1px solid #ccc !important;
  border-radius: 16px !important;
  padding: 6px 12px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #333 !important;

  min-height: 42px !important;
  flex-shrink: 0; /* important pour le scroll horizontal */
}

.filter-btn.active {
  background: #0073aa !important;
  color: #fff !important;
  border-color: #0073aa !important;
}

/* ------------------------------
   Galerie (popup)
   ------------------------------ */
.poi-gallery {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.poi-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: 0 0 3px rgba(0,0,0,.3);
    border-radius: 4px;
}
.poi-thumb:hover {
    border-color: #0073aa;
}

/* ------------------------------
   Lightbox (images plein écran)
   ------------------------------ */
#lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

/* Image */
#lightbox-overlay img {
    max-width: 90%;
    max-height: 70%;
    border: 4px solid #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}

/* zone de contrôle */
.lightbox-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

/* croix */
#lightbox-close {
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    background: rgba(0,0,0,0.6);
    border-radius: 50%;
    padding: 8px 12px;
    line-height: 1;
    transition: background 0.2s;
}
#lightbox-close:hover {
    background: rgba(0,0,0,0.9);
}

/* flèches */
.lightbox-btn {
    background: rgba(0,0,0,0.6);
    border: none;
    color: #fff;
    font-size: 26px;
    padding: 10px 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}
.lightbox-btn:hover {
    background: rgba(0,0,0,0.9);
}

/* ------------------------------
   Label permanent au-dessus du pin
   ------------------------------ */
.leaflet-tooltip.poi-label {
    background: rgba(255,255,255,0.8);
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
    font-size: 12px;
    font-weight: bold;
    color: #222;
    padding: 2px 6px;
}

/* ------------------------------
   Popups : texte long + bouton itinéraire
   ------------------------------ */
.leaflet-popup-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    font-size: 14px;
    line-height: 1.4em;
}

/* Bouton itinéraire - style soft */
.poi-maps-btn {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 14px;
    background: #f5f5f5;     /* gris clair comme les filtres */
    color: #333 !important;  /* texte foncé */
    border: 1px solid #ccc;  /* contour fin */
    border-radius: 16px;     /* arrondi doux */
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.2s ease;
}
.poi-maps-btn:hover {
    background: #e0e0e0;  /* un peu plus foncé au survol */
    border-color: #999;
}

/* ✅ Popups adaptées mobile */
.leaflet-popup-content-wrapper {
    max-width: 280px;     /* largeur max */
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.3);
}

.leaflet-popup-content {
    max-height: 220px;    /* limite hauteur */
    overflow-y: auto;     /* scroll interne si trop de texte */
    -webkit-overflow-scrolling: touch;
}

/* Bouton fermer (gros ❌ facile à cliquer) */
.leaflet-popup-close-button {
    font-size: 20px !important;
    top: 6px !important;
    right: 6px !important;
    color: #333 !important;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    text-align: center;
    line-height: 26px;
}
.leaflet-popup-close-button:hover {
    background: #eee;
}

/* 📱 Mobile encore plus compact */
@media (max-width: 480px) {
  .leaflet-popup-content-wrapper {
      max-width: 240px;
  }
  .leaflet-popup-content {
      font-size: 15px;
  }
}

/* Agrandir et améliorer la croix de fermeture dans les popups Leaflet */
.leaflet-popup-close-button {
    font-size: 22px !important;   /* taille plus grande */
    width: 28px !important;
    height: 28px !important;
    line-height: 26px !important;
    color: #333 !important;       /* couleur sobre */
    background: #fff !important;  /* fond blanc rond */
    border: 1px solid #ccc !important;
    border-radius: 50% !important;
    top: 6px !important;
    right: 6px !important;
    text-align: center !important;
    transition: all 0.2s ease;
    z-index: 9999 !important;
}

.leaflet-popup-close-button:hover {
    background: #f0f0f0 !important;
    border-color: #999 !important;
    color: #000 !important;
}
