/* France Levage — styles de la carte des adhérents (WordPress)
   Requiert assets/css/tokens.css (variables --navy, --red, --mono, ...)
   et la feuille Leaflet 1.9.4. */

/* ---------- Carte adhérents ---------- */
.map-section { background: var(--bg-cream); }
.map-wrap {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  background: white;
  border-radius: var(--radius-l);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-m);
  min-height: 640px;
}
#map {
  width: 100%;
  height: 100%;
  min-height: 640px;
  background: #E8EDF3;
}
.map-side {
  position: relative; /* contain the .member-detail overlay */
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: white;
  max-height: 720px;
  overflow: hidden;
}
.map-side-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.map-side-head h3 {
  font-size: 16px;
  font-family: var(--sans);
  color: var(--navy);
}
.map-side-head .count {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.map-side-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}
.member-row {
  padding: 14px 16px;
  border-radius: var(--radius-m);
  cursor: pointer;
  transition: background .15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid transparent;
}
.member-row:hover { background: var(--bg); }
.member-row.active {
  background: rgba(21,49,94,0.05);
  border-color: rgba(21,49,94,0.15);
}
.member-row .nom {
  font-weight: 600;
  color: var(--navy);
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.member-row .pin-dot {
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  flex-shrink: 0;
}
.member-row .ville {
  font-size: 13px;
  color: var(--ink-3);
}
.member-row .flotte {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  margin-top: 4px;
}

/* Détail adhérent (panneau pleine page) */
.member-detail {
  position: absolute;
  inset: 0;
  background: white;
  display: flex;
  flex-direction: column;
  z-index: 50;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.member-detail-head {
  padding: 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.member-detail-head h3 {
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 4px;
}
.member-detail-head .ville {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2);
  transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--bg); border-color: var(--navy); color: var(--navy); }
.member-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.detail-block { display: flex; flex-direction: column; gap: 10px; }
.detail-block-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.flotte-list { display: flex; flex-direction: column; gap: 8px; }
.flotte-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-m);
}
.flotte-item .type { font-weight: 500; font-size: 14px; color: var(--ink); }
.flotte-item .detail { font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.flotte-item .count {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
}
.dept-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dept-chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 8px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  color: var(--ink-2);
  letter-spacing: 0.04em;
}
.contact-block {
  background: var(--navy);
  color: white;
  border-radius: var(--radius-m);
  padding: 18px 18px 16px;
}
.contact-block .detail-block-label { color: rgba(255,255,255,0.6); }
.contact-block .nom { font-weight: 600; margin: 6px 0 8px; }
.contact-block a { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: rgba(255,255,255,0.85); padding: 4px 0; }
.contact-block a:hover { color: white; }
.contact-block a svg { color: var(--red); }

@media (max-width: 980px) {
  .map-wrap { grid-template-columns: 1fr; grid-template-rows: 420px 460px; min-height: 0; height: auto; }
  #map { min-height: 0; height: 420px; }
  .map-side { border-left: 0; border-top: 1px solid var(--line); height: 460px; max-height: none; }
}

/* Leaflet marker */
.fl-marker {
  display: flex; align-items: center; justify-content: center;
}
.fl-marker-pin {
  width: 32px; height: 32px;
  background: var(--red);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid white;
  box-shadow: 0 4px 12px rgba(227, 6, 19, 0.4);
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease;
}
.fl-marker-pin::after {
  content: "";
  width: 8px; height: 8px;
  background: white;
  border-radius: 50%;
  transform: rotate(45deg);
}
.fl-marker:hover .fl-marker-pin,
.fl-marker.active .fl-marker-pin {
  transform: rotate(-45deg) scale(1.15);
  background: var(--navy);
}
.fl-marker.active .fl-marker-pin { box-shadow: 0 4px 16px rgba(21, 49, 94, 0.5); }

.leaflet-container { font-family: var(--sans) !important; }
.leaflet-popup-content-wrapper { border-radius: var(--radius-m) !important; }
.leaflet-popup-content { margin: 12px 14px !important; font-size: 13px !important; }
.leaflet-popup-content strong { color: var(--navy); display: block; margin-bottom: 2px; }

.map-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.map-toolbar > * { pointer-events: auto; }
.map-pill {
  background: white;
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  box-shadow: var(--shadow-s);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.map-pill .red-dot { width: 8px; height: 8px; background: var(--red); border-radius: 50%; }

/* ---------- Filtres + recherche par département ---------- */
.map-filters { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.dept-search { position: relative; display: flex; flex-direction: column; gap: 6px; }
.dept-search label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.dept-search input { width: 168px; padding: 9px 34px 9px 14px; border: 1px solid var(--line); border-radius: var(--radius-m); background: white; font-family: var(--mono); font-size: 13px; letter-spacing: 0.06em; color: var(--navy); }
.dept-search input:focus { outline: none; border-color: var(--navy-soft); box-shadow: 0 0 0 3px rgba(21,49,94,0.08); }
.dept-clear { position: absolute; right: 8px; bottom: 7px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink-3); font-size: 15px; line-height: 1; cursor: pointer; }
.dept-clear:hover { background: var(--line); color: var(--navy); }
.dept-feedback { position: absolute; top: 100%; left: 0; margin-top: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--red); white-space: nowrap; }
.dept-feedback.none { color: var(--ink-3); }

/* ---------- Légende carte ---------- */
.map-legend { position: absolute; left: 16px; bottom: 16px; z-index: 500; display: flex; flex-direction: column; gap: 6px; background: rgba(255,255,255,0.94); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 12px; box-shadow: var(--shadow-s); }
.map-legend span { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.map-legend i { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.map-legend .sw-zone { background: rgba(21,49,94,0.22); }
.map-legend .sw-pin { background: var(--red); }

.member-row .zone-line { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--navy-soft); margin-top: 6px; }
.zone-label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; color: var(--navy); margin-bottom: 10px; }
.contact-person.sep { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.14); }

@media (max-width: 640px) {
  .map-filters { flex-direction: column; align-items: stretch; }
  .dept-search input { width: 100%; }
  .map-legend { display: none; }
}

/* ---------- Pastilles de filtre (équivalent CSS du composant React) ---------- */
.fl-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.fl-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-family: var(--sans); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s ease; }
.fl-pill:hover { border-color: var(--navy-soft); }
.fl-pill.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.fl-pill .n { font-family: var(--mono); font-size: 10.5px; opacity: .7; padding: 1px 6px; background: rgba(14,24,40,.05); border-radius: 4px; }
.fl-pill.active .n { background: rgba(255,255,255,.15); }

/* ---------- Bouton devis du panneau de détail ---------- */
.member-detail .btn { display: inline-flex; align-items: center; gap: 8px; padding: 13px 20px; border-radius: var(--radius-m); font-size: 14.5px; font-weight: 600; text-decoration: none; transition: background .15s; }
.member-detail .btn-red { background: var(--red); color: #fff; }
.member-detail .btn-red:hover { background: var(--red-dark); color: #fff; }
