/*
 * Dérives — styles du module (wizard, cards, fiche annonce, catalogue).
 * Plugin Rider Dérives, enqueue via rider-derives.php.
 * Les variables Bootstrap viennent du thème actif (parent Understrap).
 */

:root {
  --dm-ink: #0c2b33;
  --dm-ink-soft: #5a747b;
  --dm-line: #e4dfd3;
  --dm-teal: #0e8f8f;
  --dm-coral: #ef6a4d;
}

/* Widget Mondial Relay (sélection du point relais) dans le modal */
.dm-mr-widget {
  min-height: 420px;
}

/* Vignettes sous le carousel de la fiche annonce */
.dm-thumbs-nav {
  margin-bottom: .5rem;
}
.dm-thumb-nav {
  width: 64px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
  background: none;
  cursor: pointer;
  opacity: .7;
  transition: opacity .15s, border-color .15s;
}
.dm-thumb-nav img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.dm-thumb-nav:hover {
  opacity: 1;
}
.dm-thumb-nav.active {
  opacity: 1;
  border-color: var(--dm-teal);
}

/* Bouton de marque (on n'override pas le primary Bootstrap pour éviter le build SCSS) */
/* Variant Bootstrap : on pilote les variables --bs-btn-* (sinon le .btn de base,
   chargé après derives.css, repasse le fond en transparent). .btn.btn-derive a
   une spécificité supérieure à .btn, donc gagne quel que soit l'ordre. */
.btn.btn-derive {
  --bs-btn-bg: var(--dm-coral);
  --bs-btn-border-color: var(--dm-coral);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: #e25b3e;
  --bs-btn-hover-border-color: #e25b3e;
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #e25b3e;
  --bs-btn-active-border-color: #e25b3e;
  --bs-btn-active-color: #fff;
  --bs-btn-disabled-bg: var(--dm-coral);
  --bs-btn-disabled-border-color: var(--dm-coral);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-opacity: 0.55;
  font-weight: 700;
}

/* Pastille prix imposé */
.dm-price {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  background: var(--dm-coral);
  color: #fff;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  line-height: 1;
}
.dm-price small { font-size: 10px; font-weight: 600; text-transform: uppercase; opacity: .9; }

/* Wizard */
.dm-wizard { max-width: 620px; margin-inline: auto; }
.dm-eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 600; color: var(--dm-ink-soft); }

/* Cards de choix : boutons stylés en cartes sélectionnables */
.dm-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; width: 100%; padding: 18px 12px;
  background: #fff; border: 1.5px solid var(--dm-line); border-radius: 12px;
  color: var(--dm-ink); cursor: pointer; font-weight: 600;
  transition: border-color .15s ease;
}
.dm-opt:hover { border-color: var(--dm-teal); }
.dm-opt.active { border-color: var(--dm-teal); box-shadow: inset 0 0 0 1.5px var(--dm-teal); }
.dm-opt .dm-board { width: 48px; height: 80px; color: var(--dm-ink); }
.dm-opt.active .dm-board { color: var(--dm-teal); }
.dm-board .board { fill: none; stroke: var(--dm-line); stroke-width: 3; }
.dm-board .slot { fill: var(--dm-line); }
.dm-board .on { fill: currentColor; }

/* Photo de tail cliquable : hotspots sur chaque boîtier, surlignage du choisi */
.dm-board-photo { position: relative; max-width: 300px; margin: 0 auto; }
.dm-board-photo img { width: 100%; display: block; }
.dm-spot {
  position: absolute; width: 15%; height: 22%; padding: 0;
  border: none; background: transparent; border-radius: 40px; cursor: pointer;
  transition: box-shadow .12s ease, background .12s ease;
}
.dm-spot:hover { background: rgba(14, 143, 143, .12); box-shadow: inset 0 0 0 2px rgba(14, 143, 143, .55); }
.dm-spot.active { background: rgba(14, 143, 143, .22); box-shadow: 0 0 0 3px var(--dm-teal), 0 0 16px rgba(14, 143, 143, .55); }

/* Logos de systèmes (PNG transparents) + libellés texte (US Box, Inconnu) */
.dm-logo-wrap { display: flex; align-items: center; justify-content: center; height: 40px; }
/* Hauteurs réglées par logo pour un rendu homogène (les proportions diffèrent). */
.dm-logo { width: auto; max-width: 100%; object-fit: contain; }
.dm-logo--fcs { height: 18px; }
.dm-logo--fcs2 { height: 34px; }
.dm-logo--futures { height: 26px; }
.dm-logo-txt { font-weight: 700; font-size: 17px; color: var(--dm-ink); }
.dm-opt.active .dm-logo-txt { color: var(--dm-teal); }

/* Catalogue : résultats de recherche */
.dm-results { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.dm-result {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; text-align: left; padding: 10px 14px;
  background: #fff; border: 1.5px solid var(--dm-line); border-radius: 10px;
  color: var(--dm-ink); cursor: pointer; transition: border-color .15s ease;
}
.dm-result:hover { border-color: var(--dm-teal); }
.dm-result-name { font-weight: 700; }
.dm-result-meta { font-size: 12px; color: var(--dm-ink-soft); text-transform: capitalize; }
.dm-skip-cat { color: var(--dm-ink-soft); text-decoration: underline; }

/* Catalogue : carte du modèle confirmé */
.dm-model-card { border: 1.5px solid var(--dm-teal); border-radius: 12px; padding: 14px 16px; }
.dm-model-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dm-model-card .list-group-item { background: transparent; }

/* Miniatures photos */
.dm-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.dm-thumb { position: relative; width: 80px; height: 80px; border-radius: 10px; overflow: hidden; border: 1px solid var(--dm-line); }
.dm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dm-thumb button {
  position: absolute; top: 2px; right: 2px; width: 22px; height: 22px;
  border: none; border-radius: 50%; background: rgba(12,43,51,.85); color: #fff; line-height: 1; cursor: pointer;
}

.dm-check {
  width: 56px; height: 56px; border-radius: 50%; background: var(--dm-teal); color: #fff;
  font-size: 28px; display: flex; align-items: center; justify-content: center; margin-inline: auto;
}

/* Fiche annonce */
.dm-gallery img { width: 100%; height: 420px; object-fit: contain; background: #f5f3ec; border-radius: 12px; }
.dm-card-img { aspect-ratio: 4/3; object-fit: cover; }
.dm-card-noimg { aspect-ratio: 4/3; background: #eee5d6; display: block; }

@media (prefers-reduced-motion: reduce) { .progress-bar { transition: none; } }
