/* ================================================================
   SXC ↔ Vandeto Map — pont visuel (v2.4.0)
   Harmonise les badges des modules VDM (mod-trust, mod-price-index,
   mod-freshness) sur les cards SXC (Atlas, Halo, Orbit).
   Les modules injectent leur markup natif ; ce fichier ne fait
   qu'adapter positions et contrastes — AUCUN module VDM modifié.
   Scopé .sxc-card : n'affecte jamais les vraies cards vandeto-map.
   ================================================================ */

/* ── mod-trust : « Fiable 100 » — bas-droite de l'image ──────────
   Zone libre : les badges SXC (Hot/Online) sont en haut par défaut,
   la flamme est positionnable, les Réactions sont inactives. */
.sxc-card .vdm-trust-badge{position:absolute;bottom:8px;right:8px;max-width:44%;z-index:3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
/* Si le badge catégorie SXC est actif (bas du body, pas de l'image),
   aucune collision : il vit dans .sxc-card__body, pas sur le média. */

/* ── mod-freshness : « Il y a 3h » — début du body ───────────────
   Le module fait body.insertBefore(badge, firstChild) : il arrive
   donc AVANT le badge catégorie SXC (Atlas/Halo). On l'aligne. */
.sxc-card .vdm-fresh-card-badge{display:inline-block;align-self:flex-start;margin-bottom:2px;}

/* ── mod-price-index : « ▼ 8% sous le marché » ─────────────────── */
.sxc-card .vdm-price-badge{display:block;width:fit-content;}

/* Ordre visuel dans le body (flex column) : la fraîcheur remonte en tête.
   Le badge prix-index, lui, n'a plus besoin d'order : depuis la v2.5.0 le
   prix existe et porte l'alias .vdm-card-price, donc mod-price-index se
   place tout seul juste en dessous (voir plus bas). */
.sxc-card .sxc-card__body{position:relative;}
.sxc-card .vdm-fresh-card-badge{order:-3;}

/* ── Modèle HALO (fond sombre) : contrastes ──────────────────────
   Les badges VDM sont dessinés pour fond clair ; sur Halo on passe
   en verre sombre lisible sans toucher aux couleurs sémantiques. */
.sxc-model--halo .sxc-card .vdm-fresh-card-badge,
.sxc-model--halo .sxc-card .vdm-price-badge{background:rgba(255,255,255,.10);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);}
.sxc-model--halo .sxc-card .vdm-price-badge--low{color:#7dff9e;}
.sxc-model--halo .sxc-card .vdm-price-badge--high{color:#ff9d8f;}
.sxc-model--halo .sxc-card .vdm-price-badge--mid{color:#e8e8e8;}
.sxc-model--halo .sxc-card .vdm-fresh-card--green{color:#7dff9e;}
.sxc-model--halo .sxc-card .vdm-fresh-card--orange{color:#ffd479;}
.sxc-model--halo .sxc-card .vdm-fresh-card--red{color:#ff9d8f;}

/* ── Modèle ORBIT (image pleine card, body en overlay bas) ───────
   Le body Orbit est un bandeau : fraîcheur et prix-index y tiennent
   en ligne compacte. Le trust reste sur l'image, remonté au-dessus
   du dégradé de titre. */
.sxc-model--orbit .sxc-card .vdm-trust-badge{bottom:auto;top:8px;right:8px;}
.sxc-model--orbit .sxc-card .vdm-fresh-card-badge,
.sxc-model--orbit .sxc-card .vdm-price-badge{font-size:10px;background:rgba(255,255,255,.12);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);}
.sxc-model--orbit .sxc-card .vdm-price-badge--low{color:#7dff9e;}
.sxc-model--orbit .sxc-card .vdm-price-badge--high{color:#ff9d8f;}
.sxc-model--orbit .sxc-card .vdm-price-badge--mid{color:#e8e8e8;}

/* ── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .sxc-card .vdm-trust-badge{bottom:6px;right:6px;max-width:42%;}
  .sxc-model--orbit .sxc-card .vdm-trust-badge{bottom:auto;top:6px;right:6px;}
  .sxc-card .vdm-fresh-card-badge,
  .sxc-card .vdm-price-badge{font-size:9.5px;}
}

/* ── Neutralisation de l'héritage map.css — v2.5.0 ───────────────
   map.css de vandeto-map contient des règles NON scopées :
     .vdm-card-media{padding-top:var(--vdm-ratio,64%);background:#f4f4f4;}
     .vdm-card-media img{position:absolute;inset:0;...}
   Comme on alias .sxc-card__img-wrap en .vdm-card-media, sur une page
   qui contient À LA FOIS une carte VDM et un widget SXC, ce padding-top
   s'ajoutait par-dessus le ratio interne de SXC → bande vide, image qui
   ne remplit plus. Ici on rend l'alias purement sémantique : il ne sert
   qu'à donner à mod-trust sa cible d'injection, jamais de la géométrie.
   !important assumé : on écrase une règle d'un autre plugin, à égalité
   de spécificité, sans ordre de chargement garanti. */
.sxc-card .vdm-card-media{padding-top:0 !important;background:transparent !important;}
.sxc-card .vdm-card-media > img{position:static;}

/* Le prix SXC est aliasé .vdm-card-price → mod-price-index colle
   désormais son badge JUSTE SOUS le prix (price.after(badge)) au lieu
   de le prepend en haut du body. On annule donc l'ancien order. */
.sxc-card .vdm-price-badge{order:0;margin-top:1px;margin-bottom:3px;}
