/* ── mod-trust ───────────────────────────────────────────── */
/* v2.18.0 — refonte pro du badge :
   · max-width 44% → calc(100% - 16px). Le 44% écrasait les enfants flex
     (le badge a besoin de ~70px, 44% d'une card 145px = 64px) : « Fiable »
     disparaissait, seul le score survivait.
   · .vdm-trust-dot existait dans le markup depuis le début mais n'avait
     AUCUN style — un span invisible qui consommait un gap. La voilà.
   · flex-shrink:0 sur dot + score : le texte est le seul à pouvoir céder,
     avec ellipsis, jamais la pastille ni le chiffre.
   · text-overflow sur le badge : filet de sécurité, plus jamais de
     contenu écrasé illisible. */
.vdm-trust-badge {
  position: absolute;
  max-width: calc(100% - 16px);
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 20px;
  font-size: 9.5px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: none; line-height: 1.4;
}
/* ── Position configurable (v2.19.0) — 4 coins ──────────────────
   Défaut br. Les décalages d'évitement gèrent la cohabitation :
   · bl percute la catégorie → on remonte le badge au-dessus d'elle
   · tl percute le badge Vedette → on descend sous lui
   Ainsi aucune combinaison ne superpose deux badges. */
.vdm-trust--pos-br { bottom: 8px; right: 8px; }
.vdm-trust--pos-bl { bottom: 8px; left: 8px; }
.vdm-trust--pos-tr { top: 8px; right: 8px; }
.vdm-trust--pos-tl { top: 8px; left: 8px; }
/* Évitement catégorie (elle vit en bas-gauche) : si Fiable est aussi
   en bas-gauche, on le pose au-dessus d'elle (~28px de haut de card). */
.vdm-card-media .vdm-card-cat ~ .vdm-trust--pos-bl,
.vdm-crs-track .vdm-card-cat ~ .vdm-trust--pos-bl,
.vdm-crs-grid  .vdm-card-cat ~ .vdm-trust--pos-bl { bottom: 34px; }
/* Évitement Vedette (haut-gauche) : si Fiable est en haut-gauche, on le
   descend sous le badge Vedette. */
.vdm-card-media .vdm-card-badge ~ .vdm-trust--pos-tl,
.vdm-crs-track .vdm-card-badge ~ .vdm-trust--pos-tl,
.vdm-crs-grid  .vdm-card-badge ~ .vdm-trust--pos-tl { top: 34px; }
.vdm-trust-badge .vdm-trust-dot {
  width: 6px; height: 6px; border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
  box-shadow: 0 0 0 2px rgba(255,255,255,.35);
}
.vdm-trust-badge > span:not(.vdm-trust-dot):not(.vdm-trust-score) {
  overflow: hidden; text-overflow: ellipsis;
}
.vdm-trust--green  .vdm-trust-badge, .vdm-trust-badge.vdm-trust--green  { background:rgba(29,158,117,.82); color:#fff; }
.vdm-trust--orange .vdm-trust-badge, .vdm-trust-badge.vdm-trust--orange { background:rgba(200,140,0,.85);  color:#fff; }
.vdm-trust--red    .vdm-trust-badge, .vdm-trust-badge.vdm-trust--red    { background:rgba(200,50,50,.82);  color:#fff; }
.vdm-trust-badge .vdm-trust-score { opacity:.7; font-size:8.5px; flex-shrink:0; }

/* Dot sur le pin */
.vdm-trust-pin-dot {
  position: absolute; bottom: 2px; right: -2px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid #fff;
  pointer-events: none; z-index: 2;
}
.vdm-trust-pin--green  { background: #1D9E75; }
.vdm-trust-pin--orange { background: #d4a017; }
.vdm-trust-pin--red    { background: #e03030; }

/* Dans le popup */
.vdm-trust-pop {
  padding: 5px 10px; border-radius: 8px;
  font-size: 11px; margin-bottom: 6px; line-height: 1.4;
}
.vdm-trust-pop--green  { background:#e8f7ee; color:#1a6b3a; border:1px solid #b3dfc3; }
.vdm-trust-pop--orange { background:#fff8e6; color:#6b4c00; border:1px solid #ffd966; }
.vdm-trust-pop--red    { background:#fff0ef; color:#a32d2d; border:1px solid #ffd0d0; }

/* ── Mobile : badge compacté — la compaction reste (police, padding),
   l'étranglement part. v2.18.0 : le max-width:42% de cette règle, plus
   spécifique que la base, aurait re-serré le badge qu'on vient de
   libérer. En compact le badge a besoin de ~69px : avec la catégorie à
   38% ça tient sur toutes les largeurs (card 145px : 55+69+12 = 136). ── */
@media(max-width:600px){
  /* v2.19.0 — plus de bottom/right ici : la position est portée par les
     classes .vdm-trust--pos-* (sinon ce sélecteur, plus spécifique,
     rabattait tout en bas-droite quel que soit le réglage). On ne garde
     que la compaction visuelle. */
  .vdm-crs-track .vdm-trust-badge,
  .vdm-crs-grid .vdm-trust-badge{max-width:calc(100% - 12px);font-size:8.5px;padding:2px 6px;gap:3px;}
  .vdm-trust-badge .vdm-trust-dot{width:5px;height:5px;box-shadow:0 0 0 1.5px rgba(255,255,255,.35);}
}

/* Perf mobile v2.19.0 : voir map.css — flou coupé sur le badge répété. */
@media (max-width: 600px) {
  .vdm-trust-badge { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
}
