/* ── Vandeto Map · mod-real-cost ─────────────────────────────
   v1.2.0 — badge temps + distance, responsive jusqu'à 6 colonnes.

   Contrainte : la carte d'annonce peut descendre à ~160 px de large
   (grille 6 colonnes desktop). Rien ne doit déborder ni forcer la
   largeur de la carte. D'où :
     · min-width: 0 sur tous les conteneurs flex
     · la méta (km / durée / pointe) sur sa propre ligne, qui wrappe
     · les montants en clamp() pour se resserrer sans casser
     · aucune largeur fixe, aucun white-space: nowrap sur le texte long
   ──────────────────────────────────────────────────────────── */

.vdm-rc {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  margin: 6px 0 2px;
  padding: 7px 9px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(17,21,28,.045), rgba(17,21,28,.02));
  border: 1px solid rgba(17,21,28,.08);
  line-height: 1.25;
}

/* ── Ligne principale : icône + montant ─────────────────── */
.vdm-rc-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size:11px;font-size:clamp(11px, 1.5vw, 12px);
  font-weight: 600;
  color: #4b5563;
  letter-spacing: -.1px;
}

.vdm-rc-head svg { flex: 0 0 auto; color: #6b7280; }

.vdm-rc-amt {
  font-size:12px;font-size:clamp(12px, 1.7vw, 13.5px);
  font-weight: 800;
  color: #11151c;
  letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vdm-rc-ar {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
}

/* ── Ligne méta : distance · durée · pointe ─────────────── */
.vdm-rc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.vdm-rc-dist,
.vdm-rc-dur {
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(17,21,28,.07);
  font-size: 10px;
  font-weight: 700;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Marqueur heure de pointe ───────────────────────────── */
.vdm-rc-rush {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px 1px 5px;
  border-radius: 999px;
  background: rgba(255,23,0,.09);
  color: #ff1700;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1px;
  white-space: nowrap;
}

.vdm-rc-rush svg { flex: 0 0 auto; }

/* ── Prix de référence heure creuse ─────────────────────── */
/* L'honnêteté du module tient dans cette ligne : quand le prix est
   majoré, on montre ce que le même trajet coûterait hors pointe.
   L'utilisateur voit l'écart, il n'a pas à le deviner. */
.vdm-rc-alt {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 600;
  color: #6b7280;
  font-variant-numeric: tabular-nums;
}

/* ── Total « pour récupérer » ───────────────────────────── */
.vdm-rc-total {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size:12px;font-size:clamp(12px, 1.7vw, 13.5px);
  font-weight: 800;
  color: #11151c;
  letter-spacing: -.3px;
  font-variant-numeric: tabular-nums;
}

.vdm-rc-total::first-letter { color: #ff1700; }

/* ── Marqueur « estimation » (repli hors OSRM) ──────────── */
.vdm-rc.is-est .vdm-rc-dist::after {
  content: "≈";
  margin-left: 3px;
  opacity: .55;
}

/* Liseré discret quand une majoration s'applique. */
.vdm-rc.is-surged {
  border-color: rgba(255,23,0,.16);
  background: linear-gradient(180deg, rgba(255,23,0,.045), rgba(17,21,28,.02));
}

/* ── Variante popup ─────────────────────────────────────── */
.vdm-rc-pop {
  margin: 8px 0 0;
  width: 100%;
}

/* ── Bascule heure creuse / maintenant ──────────────────── */
.vdm-rc-when {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(17,21,28,.05);
  border: 1px solid rgba(17,21,28,.08);
  min-width: 0;
}

.vdm-rc-when-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 5px 12px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.vdm-rc-when-btn:hover { color: #11151c; }

.vdm-rc-when-btn.is-on {
  background: #fff;
  color: #11151c;
  box-shadow: 0 1px 2px rgba(17,21,28,.1);
}

.vdm-rc-when-btn:focus { outline: 2px solid #ff1700; outline-offset: 2px; }
.vdm-rc-when-btn:focus:not(:focus-visible) { outline: none; }
.vdm-rc-when-btn:focus-visible { outline: 2px solid #ff1700; outline-offset: 2px; }

.vdm-rc-when-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,23,0,.08);
  color: #ff1700;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1px;
  white-space: nowrap;
}

.vdm-rc-when-note svg { flex: 0 0 auto; }

/* ── Sélecteur de tri ───────────────────────────────────── */
.vdm-rc-sort {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: rgba(17,21,28,.05);
  border: 1px solid rgba(17,21,28,.08);
  min-width: 0;
}

.vdm-rc-sort-lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: #6b7280;
}

.vdm-rc-sort-sel {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: #fff;
  border-radius: 999px;
  padding: 5px 26px 5px 11px;
  font-size: 12px;
  font-weight: 700;
  color: #11151c;
  cursor: pointer;
  max-width: 100%;
  box-shadow: 0 1px 2px rgba(17,21,28,.08);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%2311151c' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 11px;
}

.vdm-rc-sort-sel:focus { outline: 2px solid #ff1700; outline-offset: 2px; }
.vdm-rc-sort-sel:focus:not(:focus-visible) { outline: none; }
.vdm-rc-sort-sel:focus-visible { outline: 2px solid #ff1700; outline-offset: 2px; }

/* ── Cartes étroites (5-6 colonnes desktop) ─────────────── */
/* En dessous de ~200 px de carte, « aller-retour » et la durée
   passent à la trappe : on garde le montant, la distance et le
   marqueur de pointe, qui sont l'information utile. */
/* Contexte de mesure : on interroge la largeur RÉELLE de la carte, pas
   celle de la fenêtre. C'est le seul moyen fiable de gérer 1 à 6
   colonnes, puisqu'une carte de 160 px peut exister sur un écran de
   1920 px. `inline-size` ne contient que la largeur : aucun impact sur
   la hauteur ni sur le flux vertical de la carte.
   Navigateurs sans container queries : tout reste affiché, et le
   dépassement est absorbé par les ellipsis et le flex-wrap ci-dessus. */
.vdm-card-body { container-type: inline-size; container-name: vdmcard; }

@container vdmcard (max-width: 200px) {
  .vdm-rc-ar,
  .vdm-rc-dur { display: none; }
}

@container vdmcard (max-width: 150px) {
  .vdm-rc-alt { white-space: normal; }
  .vdm-rc { padding: 6px 7px; }
}

/* v2.32.0 — Les contrôles vivent désormais dans .vdm-nb-toolbar, une
   ligne unique à défilement horizontal natif. Ils ne prennent donc
   plus toute la largeur en mobile : ils gardent leur taille propre
   et le débordement est absorbé par le scroll. */
@media (max-width: 640px) {
  .vdm-rc { padding: 6px 8px; gap: 3px; }
  .vdm-rc-total { font-size: 12.5px; }

  .vdm-rc-when,
  .vdm-rc-sort {
    margin-left: 0;
    margin-top: 0;
    width: auto;
    justify-content: flex-start;
  }
  .vdm-rc-when-btn { flex: 0 0 auto; padding: 6px 12px; text-align: center; }
  .vdm-rc-sort-sel { flex: 0 0 auto; }
  .vdm-rc-when-note { margin-top: 0; }
}

/* ── Accessibilité : mouvement réduit ───────────────────── */
@media (prefers-reduced-motion: reduce) {
  .vdm-rc-when-btn { transition: none; }
}

/* ── v2.0.0 — forfait, hors de portée, repère livraison ──────
   Pastille « forfait » : signale que le prix ne dépend PAS de la distance
   (gbaka, ticket de métro). Sans elle, l'utilisateur croit à une erreur en
   voyant le même montant pour 3 km et pour 12 km. */
.vdm-rc-flat {
  display: inline-block;
  padding: 1px 6px;
  border: 1px solid rgba(17, 21, 28, .12);
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .01em;
  color: #6b7280;
  white-space: nowrap;
}

/* Hors de portée : ton neutre, surtout pas alarmiste — ce n'est pas une
   erreur, juste une information. */
.vdm-rc-amt--far {
  color: #6b7280;
  font-weight: 650;
}

.vdm-rc-alt--deliv {
  color: #6b7280;
}

/* ════════════════════════════════════════════════════════════════
   v2.32.0 — Segment + tri compactés (hauteur commune : 32 px)
   ════════════════════════════════════════════════════════════════ */
.vdm-rc-when{
  height:32px;padding:2px;gap:2px;
  background:#f2f3f5;border:0;
}
.vdm-rc-when-btn{
  padding:0 12px;height:28px;
  font-size:11.5px;font-weight:600;color:#8a8f98;
}
.vdm-rc-when-btn.is-on{
  background:#fff;color:#11151c;font-weight:700;
  box-shadow:0 1px 2px rgba(17,21,28,.09);
}
.vdm-rc-when-note{
  height:32px;padding:0 11px;
  font-size:10.5px;font-weight:700;
}

/* Le tri devient une pilule autonome : le libellé « TRIER » tombe
   en mobile (l'icône du chevron et la valeur suffisent) et revient
   en desktop, où la place ne manque pas. */
.vdm-rc-sort{
  height:32px;padding:0 4px 0 11px;gap:6px;
  background:#fff;border:1px solid rgba(17,21,28,.09);
}
.vdm-rc-sort-lbl{font-size:10.5px;letter-spacing:.3px;color:#8a8f98;}
.vdm-rc-sort-sel{
  height:26px;padding:0 24px 0 6px;
  font-size:11.5px;font-weight:700;
  background-color:transparent;box-shadow:none;
}
@media (max-width: 900px){
  .vdm-rc-sort-lbl{display:none;}
  .vdm-rc-sort{padding:0 4px 0 8px;}
  .vdm-rc-sort-sel{padding-left:8px;}
}
