/**
 * CoworkingHub — Map CSS (Leaflet overrides + marker styles)
 * @package     com_pixcwh
 */

/* ========================================================================
   Contenitore mappa nel singolo annuncio
   ======================================================================== */

#cwh-leaflet-map {
  width: 100%;
  height: 350px;
  border-radius: 8px;
  z-index: 1;
  margin: 16px 0;
}

/* ========================================================================
   Mappa fullscreen (view Map)
   ======================================================================== */

#cwh-map-fullscreen {
  width: 100%;
  height: calc(100vh - 80px);
  z-index: 1;
}

.cwh-map-page {
  padding: 0 !important;
  overflow: hidden;
}

/* ========================================================================
   Header mappa fullscreen
   ======================================================================== */

.cwh-map-header {
  position: relative;
  z-index: 500;
  background: #fff;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  height: 56px;
}

/* ========================================================================
   Marker personalizzati (DivIcon)
   ======================================================================== */

.cwh-marker {
  width: 32px;
  height: 40px;
  position: relative;
}

.cwh-marker svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.cwh-marker--featured svg {
  filter: drop-shadow(0 0 4px #f0a500) drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.cwh-marker--desk     { color: #43a047; }
.cwh-marker--room     { color: #fb8c00; }
.cwh-marker--office   { color: #8e24aa; }
.cwh-marker--meeting  { color: #00acc1; }

/* ========================================================================
   Popup Leaflet
   ======================================================================== */

.leaflet-popup-content-wrapper {
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.leaflet-popup-content {
  margin: 0;
  width: 240px !important;
}

/* Popup semplice (singolo annuncio): solo testo → serve padding,
   altrimenti il reset sopra lo lascia attaccato ai bordi */
.cwh-popup-simple {
  padding: 10px 14px;
}

.cwh-popup-card {
  width: 240px;
}

.cwh-popup-card__img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}

.cwh-popup-card__img-placeholder {
  width: 100%;
  height: 130px;
  background: #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
}

.cwh-popup-card__body {
  padding: 10px 12px 12px;
}

.cwh-popup-card__title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #212529;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cwh-popup-card__price {
  font-size: 1rem;
  font-weight: 700;
  color: #1565c0;
  margin-bottom: 8px;
}

.cwh-popup-card__link {
  display: block;
  text-align: center;
  padding: 6px 0;
  background: #1565c0;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}

.cwh-popup-card__link:hover {
  background: #0d47a1;
  color: #fff;
}

.leaflet-popup-close-button {
  top: 8px !important;
  right: 8px !important;
  width: 20px;
  height: 20px;
  font-size: 14px;
  background: rgba(255,255,255,0.9) !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================================================
   Cluster personalizzato
   ======================================================================== */

.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-clip: padding-box;
}

.marker-cluster-small {
  background-color: rgba(67, 160, 71, 0.6);
}
.marker-cluster-small div {
  background-color: rgba(67, 160, 71, 0.9);
  color: #fff;
  font-weight: 700;
}

.marker-cluster-medium {
  background-color: rgba(251, 140, 0, 0.6);
}
.marker-cluster-medium div {
  background-color: rgba(251, 140, 0, 0.9);
  color: #fff;
  font-weight: 700;
}

.marker-cluster-large {
  background-color: rgba(229, 57, 53, 0.6);
}
.marker-cluster-large div {
  background-color: rgba(229, 57, 53, 0.9);
  color: #fff;
  font-weight: 700;
}

.marker-cluster div {
  width: 30px;
  height: 30px;
  margin-left: 5px;
  margin-top: 5px;
  text-align: center;
  border-radius: 15px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-cluster {
  background-clip: padding-box;
  border-radius: 20px;
}
