/* =============================================================================
 * OPMR Martinique — CSS global (complète DSFR).
 * Le thème de base est DSFR (couleurs, typo, composants).
 * Ici, on ajoute les spécificités du comparateur.
 * ============================================================================= */

:root {
  --opmr-green: #00a95f;
  --opmr-red:   #e1000f;
  --opmr-caribbean: #009099;
  --opmr-palette-accent: var(--opmr-caribbean);
}

/* ─── Îlots React : placeholder pendant hydration ──────────────────────── */
.opmr-island {
  min-height: 120px;
  position: relative;
}
.opmr-island__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--background-alt-grey);
  border-radius: 8px;
  color: var(--text-mention-grey);
}
.opmr-island[data-hydrated="true"] .opmr-island__placeholder {
  display: none;
}

/* ─── Indicateur de prix : code couleur bas/moyen/haut ─────────────────── */
.opmr-price-tag {
  display: inline-flex;
  align-items: baseline;
  font-weight: 700;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.opmr-price-tag__currency {
  font-size: 0.875em;
  margin-left: 0.1em;
  opacity: 0.85;
}
.opmr-price-tag--best { color: var(--opmr-green); }
.opmr-price-tag--high { color: var(--opmr-red); }
.opmr-price-tag--promo {
  text-decoration: line-through;
  opacity: 0.6;
  font-weight: 400;
}

/* ─── Badge BQP (Bouclier Qualité Prix) ────────────────────────────────── */
.opmr-badge-bqp {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  background: var(--opmr-caribbean);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
}

/* ─── Card PdV / produit ───────────────────────────────────────────────── */
.opmr-card {
  background: #fff;
  border: 1px solid var(--border-default-grey);
  border-radius: 8px;
  padding: 1rem;
  transition: box-shadow 120ms ease-out;
}
.opmr-card:hover,
.opmr-card:focus-within {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ─── Tables comparatif ────────────────────────────────────────────────── */
.opmr-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.opmr-compare-table th,
.opmr-compare-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-default-grey);
  text-align: left;
}
.opmr-compare-table th {
  background: var(--background-alt-grey);
  font-weight: 700;
  position: sticky;
  top: 0;
}
.opmr-compare-table td.opmr-col-price {
  text-align: right;
  font-weight: 600;
}
.opmr-compare-table tr.opmr-row--best td {
  background: rgba(0, 169, 95, 0.08);
}

/* ─── Cartes MapLibre wrappers ─────────────────────────────────────────── */
.opmr-map-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-default-grey);
}
.opmr-map-wrapper .maplibregl-popup {
  max-width: 280px;
  font-size: 0.875rem;
}

/* ─── Dashboard qualité ────────────────────────────────────────────────── */
.opmr-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.opmr-kpi {
  background: #fff;
  border: 1px solid var(--border-default-grey);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
}
.opmr-kpi__value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--opmr-caribbean);
  font-variant-numeric: tabular-nums;
}
.opmr-kpi__label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--text-mention-grey);
}

/* ─── Respect de prefers-reduced-motion (RGAA) ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Focus visible renforcé (RGAA 10.7) ───────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
