/* PdV — Explorer les cyclistes v1.0 */
.pdvx {
  --pdvx-brand: #c439b4;
  --pdvx-deep: #5c349b;
  --pdvx-ink: #1f1b2d;
  --pdvx-muted: #6b6680;
  --pdvx-line: #e7e3ef;
  --pdvx-soft: #f6f3fa;
  --pdvx-radius: 10px;
  color: var(--pdvx-ink);
  font-family: inherit;
  line-height: 1.4;
  background: #fff;
}
.pdvx *, .pdvx *::before, .pdvx *::after { box-sizing: border-box; }
.pdvx [hidden] { display: none !important; }

/* ---------- compteur en surimpression sur la carte */
.pdvx-badge { position: absolute; top: 14px; left: 14px; z-index: 800; pointer-events: none; max-width: calc(100% - 80px);
  background: #fff; border-radius: 12px; padding: 10px 16px 11px; box-shadow: 0 4px 18px rgba(31,27,45,.18); }
.pdvx-badge .pdvx-total { font-size: 36px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--pdvx-brand); font-variant-numeric: tabular-nums; }
.pdvx-badge span { font-size: 16px; font-weight: 600; color: var(--pdvx-ink); }
.pdvx-matchline { display: block; margin-top: 4px; font-style: normal; font-size: 13px; color: var(--pdvx-muted); }
.pdvx-matchline b { color: var(--pdvx-deep); font-variant-numeric: tabular-nums; }
.is-all .pdvx-matchline { display: none; }
.pdvx-mcount { display: none; margin: 0 0 10px; font-size: 15px; color: var(--pdvx-ink); }
.pdvx-mcount .pdvx-total { font-size: 22px; font-weight: 800; color: var(--pdvx-brand); font-variant-numeric: tabular-nums; }
.pdvx-mcount .pdvx-matchline { display: inline; margin: 0; font-size: 14px; }
.pdvx-mcount.is-all .pdvx-matchline { display: none; }

/* ---------- mise en page */
.pdvx-body { display: grid; grid-template-columns: 270px minmax(0, 1fr) minmax(320px, 38%); align-items: start; }
.pdvx-filters { position: sticky; top: 0; max-height: 100vh; overflow-y: auto; padding: 18px 18px 30px; border-right: 1px solid var(--pdvx-line); background: #fff; }
.pdvx-results { padding: 16px 20px 40px; min-width: 0; }
.pdvx-mapwrap { position: sticky; top: 0; height: 100vh; border-left: 1px solid var(--pdvx-line); }
.pdvx-map { width: 100%; height: 100%; background: var(--pdvx-soft); }

/* ---------- filtres */
.pdvx-filters-toggle { display: none; }
.pdvx-field { display: block; border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.pdvx-field > span, .pdvx-field > legend { display: block; font-size: 13px; font-weight: 700; text-transform: none; color: var(--pdvx-ink); margin: 0 0 7px; padding: 0; }
.pdvx input[type="search"], .pdvx input[type="number"], .pdvx select {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--pdvx-line); border-radius: 8px;
  background: #fff; font: inherit; font-size: 14px; color: var(--pdvx-ink); box-shadow: none; margin: 0;
}
.pdvx input:focus, .pdvx select:focus, .pdvx button:focus-visible, .pdvx-chip input:focus-visible + span { outline: 2px solid var(--pdvx-brand); outline-offset: 1px; }
.pdvx-near { display: flex; gap: 6px; }
.pdvx-near input { flex: 1; }
.pdvx button { font: inherit; cursor: pointer; }
.pdvx-go { flex: 0 0 auto; height: 38px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--pdvx-brand); color: #fff; font-weight: 700; }
.pdvx-me { display: block; margin: 8px 0; padding: 0; border: 0; background: none; color: var(--pdvx-deep); font-size: 13px; font-weight: 600; }
.pdvx-inline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pdvx-muted); }
.pdvx-inline select { width: auto; height: 32px; }
.pdvx-near-label { margin: 8px 0 0; font-size: 13px; background: var(--pdvx-soft); border-radius: 8px; padding: 6px 8px 6px 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.pdvx-x { border: 0; background: none; font-size: 18px; line-height: 1; color: var(--pdvx-muted); padding: 0 2px; }
.pdvx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pdvx-chip { position: relative; margin: 0; }
.pdvx-chip input { position: absolute; opacity: 0; pointer-events: none; }
.pdvx-chip span { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border: 1px solid var(--pdvx-line); border-radius: 999px; font-size: 13px; background: #fff; cursor: pointer; user-select: none; transition: background .15s, border-color .15s; }
.pdvx-chip em { font-style: normal; color: var(--pdvx-muted); font-size: 12px; }
.pdvx-chip input:checked + span { background: var(--pdvx-brand); border-color: var(--pdvx-brand); color: #fff; }
.pdvx-chip input:checked + span em { color: rgba(255,255,255,.8); }
.pdvx-age { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--pdvx-muted); }
.pdvx-age input { width: 70px; }
.pdvx-bounds { margin: 0 0 16px; }
.pdvx-reset { padding: 0; border: 0; background: none; color: var(--pdvx-muted); text-decoration: underline; font-size: 13px; }

/* ---------- barre résultats */
.pdvx-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin: 0 0 14px; font-size: 13px; color: var(--pdvx-muted); }
.pdvx-bar label { display: flex; align-items: center; gap: 8px; margin: 0; }
.pdvx-bar select { width: auto; height: 34px; }
.pdvx-tabs { display: none; margin-right: auto; border: 1px solid var(--pdvx-line); border-radius: 8px; overflow: hidden; }
.pdvx-tabs button { border: 0; background: #fff; padding: 7px 16px; font-size: 14px; color: var(--pdvx-ink); }
.pdvx-tabs button.is-on { background: var(--pdvx-deep); color: #fff; }

/* ---------- cartes profil */
.pdvx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pdvx-card { position: relative; border: 1px solid var(--pdvx-line); border-radius: var(--pdvx-radius); overflow: hidden; background: #fff; transition: border-color .15s, transform .15s; }
.pdvx-card:hover { border-color: var(--pdvx-brand); transform: translateY(-2px); }
.pdvx-cardlink { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.pdvx-cardlink:hover, .pdvx-cardlink:focus { color: inherit; text-decoration: none; }
.pdvx-fav { position: absolute; top: 8px; right: 8px; z-index: 2; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.94); color: var(--pdvx-deep);
  box-shadow: 0 1px 6px rgba(31,27,45,.25); cursor: pointer; transition: transform .15s, color .15s; }
.pdvx-fav:hover { transform: scale(1.08); }
.pdvx-fav svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.pdvx-fav.is-on { color: var(--pdvx-brand); }
.pdvx-fav.is-on svg { fill: currentColor; }
.pdvx-fav.is-busy { opacity: .7; }
.pdvx-favonly { margin: 0 0 10px; }
.pdvx-photo { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--pdvx-soft); overflow: hidden; }
.pdvx-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdvx-noimg { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 34px; opacity: .5; }
.pdvx-dist { position: absolute; left: 8px; bottom: 8px; background: rgba(31,27,45,.82); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; }
.pdvx-info { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px 12px; }
.pdvx-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdvx-meta, .pdvx-place { font-size: 13px; color: var(--pdvx-muted); }
.pdvx-place { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdvx-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.pdvx-tags span { font-size: 11.5px; background: var(--pdvx-soft); color: var(--pdvx-deep); padding: 2px 7px; border-radius: 999px; }
.pdvx-loading, .pdvx-empty { grid-column: 1 / -1; color: var(--pdvx-muted); padding: 30px 0; text-align: center; }
.pdvx-more { text-align: center; padding: 22px 0 0; }
.pdvx-more button { border: 1px solid var(--pdvx-deep); background: #fff; color: var(--pdvx-deep); border-radius: 8px; padding: 10px 18px; font-weight: 600; }

/* ---------- marqueurs */
.pdvx .marker-cluster { border-radius: 50%; background-clip: padding-box; }
.pdvx .marker-cluster div { width: 30px; height: 30px; margin: 5px; border-radius: 50%; text-align: center; line-height: 30px; font-size: 12px; font-family: inherit; }
.pdvx .marker-cluster span { line-height: 30px; }
.pdvx-pin span { display: block; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; background: var(--pdvx-deep); box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.pdvx-pin-f span { background: var(--pdvx-brand); }
.pdvx-pin.pdvx-hl span, .marker-cluster.pdvx-hl div { box-shadow: 0 0 0 4px rgba(196,57,180,.45); }
.pdvx .marker-cluster-small, .pdvx .marker-cluster-medium, .pdvx .marker-cluster-large { background: rgba(196,57,180,.25); }
.pdvx .marker-cluster-small div, .pdvx .marker-cluster-medium div, .pdvx .marker-cluster-large div { background: var(--pdvx-brand); color: #fff; font-weight: 700; }
.pdvx-pop .pdvx-card { border: 0; }
.pdvx-pop .pdvx-card:hover { transform: none; }
.pdvx .leaflet-popup-content { margin: 0; width: 220px !important; }
.pdvx .leaflet-popup-content-wrapper { padding: 0; overflow: hidden; border-radius: var(--pdvx-radius); }

/* ---------- tablette : filtres repliables */
@media (max-width: 1180px) {
  .pdvx-body { grid-template-columns: minmax(0, 1fr) minmax(300px, 40%); }
  .pdvx-filters { grid-column: 1 / -1; position: static; max-height: none; overflow: visible; border-right: 0; border-bottom: 1px solid var(--pdvx-line); padding: 12px 20px; }
  .pdvx-filters-toggle { display: inline-flex; gap: 6px; align-items: center; height: 38px; padding: 0 16px; border: 1px solid var(--pdvx-deep); border-radius: 8px; background: #fff; color: var(--pdvx-deep); font-weight: 700; }
  .pdvx-form { display: none; padding-top: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 24px; }
  .pdvx-filters-open .pdvx-form { display: grid; }
}

/* ---------- mobile : liste OU carte */
@media (max-width: 820px) {
  .pdvx-hero { padding: 20px 16px 16px; }
  .pdvx-body { grid-template-columns: minmax(0, 1fr); }
  .pdvx-filters { padding: 12px 16px; }
  .pdvx-results { padding: 14px 16px 30px; }
  .pdvx-tabs { display: inline-flex; }
  .pdvx-mcount { display: block; }
  .pdvx-show-map .pdvx-mcount { display: none; }
  .pdvx-badge { top: 10px; left: 10px; padding: 8px 12px; }
  .pdvx-badge .pdvx-total { font-size: 28px; }
  .pdvx-badge span { font-size: 14px; }
  .pdvx-mapwrap { display: none; position: relative; top: 0; height: 70vh; border: 0; }
  .pdvx-show-map .pdvx-mapwrap { display: block; }
  .pdvx-show-map .pdvx-grid, .pdvx-show-map .pdvx-more, .pdvx-show-map .pdvx-empty { display: none; }
  .pdvx-show-map .pdvx-results { padding-bottom: 0; }
  .pdvx-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .pdvx-name { font-size: 14px; }
}

/* ---------- grilles légères de la home (shortcode [pdv_derniers]) */
.pdvx-home { background: transparent; }
.pdvx-home .pdvx-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.pdvx-home-sorties .pdvx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pdvx-card-sortie .pdvx-photo { aspect-ratio: 16 / 9; }
.pdvx-date { position: absolute; left: 8px; bottom: 8px; background: var(--pdvx-brand); color: #fff; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.pdvx-date.is-past { background: rgba(31,27,45,.78); font-weight: 600; }
.pdvx-card-sortie .pdvx-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pdvx-home-more { margin: 18px 0 0; text-align: center; }
.pdvx-home-more a { display: inline-block; padding: 11px 22px; border-radius: 8px; background: var(--pdvx-brand); color: #fff; font-weight: 700; text-decoration: none; }
.pdvx-home-more a:hover { background: var(--pdvx-deep); color: #fff; text-decoration: none; }
@media (max-width: 1024px) {
  .pdvx-home .pdvx-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pdvx-home-sorties .pdvx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .pdvx-home .pdvx-grid, .pdvx-home-sorties .pdvx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
