/* Couleurs par élément — Maison Drabiec. Additif : ne restyle que ses
   propres éléments (.mdscp-*) + masque les champs texte natifs habillés. */

.mdscp-hidden { display: none !important; }
.mdscp-no-scroll { overflow: hidden; }

.mdscp-panel { margin: .75rem 0 1rem; }
.mdscp-panel__title { font-weight: 600; margin: 0 0 .25rem; }
.mdscp-panel__price-note { font-size: .8125rem; color: #664d03; background: #fff3cd; border: 1px solid #ffe69c; border-radius: .375rem; padding: .375rem .625rem; margin: 0 0 .625rem; }
.mdscp-panel__hint { font-size: .8125rem; color: #6c757d; margin: .5rem 0 0; }

.mdscp-cart-note { font-size: .8125rem; color: #842029; background: #f8d7da; border: 1px solid #f5c2c7; border-radius: .375rem; padding: .375rem .625rem; margin: .5rem 0 0; }

.mdscp-mismatch { margin-top: .625rem; padding: .625rem; border: 1px solid #ffe69c; background: #fff3cd; border-radius: .5rem; }
.mdscp-mismatch__text { font-size: .875rem; margin: 0 0 .5rem; }
.mdscp-mismatch__btn { margin-right: .5rem; margin-bottom: .25rem; }

/* Depuis la 1.1.6 cette feuille est servie AVANT le bundle du thème (elle
   n'est plus fusionnée dedans) : toute règle portant sur un élément qui a
   aussi une classe Bootstrap (.btn…) doit gagner par SPÉCIFICITÉ, pas par
   ordre. Bootstrap 5 : `.btn { padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x) }`. */
.btn.mdscp-cancel { padding-left: 0; --bs-btn-padding-x: 0; }

/* Diagnostic à la demande (?mdscp_debug=1) — jamais visible en usage normal. */
.mdscp-debug { font-size: .75rem; white-space: pre-wrap; background: #f1f3f5; border: 1px dashed #adb5bd; border-radius: .375rem; padding: .5rem; margin: .5rem 0; color: #343a40; }

.mdscp-toggle { width: 100%; }

.mdscp-recap { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .5rem; }
.mdscp-chip {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .25rem .625rem; border: 1px solid #dee2e6; border-radius: 999px;
  font-size: .8125rem; background: #fff;
}

/* Aperçu recolorable (3 vues à onglets) */
.mdscp-preview { margin: 0 0 .875rem; }
.mdscp-preview__tabs { display: flex; gap: .25rem; margin-bottom: .5rem; }
.mdscp-preview__tab {
  flex: 1; border: 1px solid #dee2e6; background: #f8f9fa; border-radius: .375rem;
  padding: .375rem .5rem; cursor: pointer; font: inherit; min-height: 40px;
}
.mdscp-preview__tab--active { background: #0d6efd; color: #fff; border-color: #0d6efd; }
.mdscp-preview__stage {
  display: flex; align-items: center; justify-content: center;
  background: #fbfbfb; border: 1px solid #eee; border-radius: .5rem;
  padding: .5rem; min-height: 180px;
}
.mdscp-preview__canvas { max-width: 100%; height: auto; max-height: 320px; image-rendering: auto; }
.mdscp-preview__note { font-size: .75rem; color: #6c757d; margin: .375rem 0 0; text-align: center; }

.mdscp-rows { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .75rem; }
.mdscp-row {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .5rem .75rem; border: 1px solid #dee2e6; border-radius: .5rem; background: #fff;
}
.mdscp-row__name { font-weight: 600; }
.mdscp-row__pick {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid #ced4da; border-radius: .375rem; background: #f8f9fa;
  padding: .375rem .75rem; cursor: pointer; font: inherit;
}
.mdscp-row__pick:hover { background: #e9ecef; }
.mdscp-row__empty { color: #6c757d; }

.mdscp-validate { width: 100%; }

/* Pastilles */
.mdscp-swatch {
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .2); flex: none; display: inline-block;
}
.mdscp-swatch--multi {
  background: conic-gradient(#e53935, #fb8c00, #fdd835, #43a047, #1e88e5, #8e24aa, #e53935);
}

/* Superposition de choix */
.mdscp-overlay {
  position: fixed; inset: 0; z-index: 1050;
  background: rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.mdscp-sheet {
  background: #fff; border-radius: .75rem; width: min(34rem, 100%);
  max-height: min(80vh, 40rem); display: flex; flex-direction: column;
  padding: 1rem; box-shadow: 0 1rem 3rem rgba(0, 0, 0, .25);
}
.mdscp-sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5rem; }
.mdscp-sheet__close {
  border: 0; background: none; font-size: 1.125rem; cursor: pointer;
  padding: .25rem .5rem; line-height: 1; color: #6c757d;
}
.mdscp-sheet__search {
  width: 100%; padding: .5rem .75rem; border: 1px solid #ced4da;
  border-radius: .375rem; margin-bottom: .375rem; font: inherit;
}
.mdscp-sheet__note { font-size: .8125rem; color: #6c757d; margin: 0 0 .5rem; }
.mdscp-sheet__grid {
  overflow-y: auto; display: grid; gap: .375rem;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}
.mdscp-color {
  display: flex; align-items: center; gap: .5rem;
  border: 1px solid #dee2e6; border-radius: .5rem; background: #fff;
  padding: .375rem .5rem; cursor: pointer; font: inherit; text-align: left;
  min-height: 44px; /* cible tactile recommandée */
}
.mdscp-color:hover { border-color: #0d6efd; background: #f0f6ff; }
.mdscp-color--current { border-color: #0d6efd; box-shadow: 0 0 0 2px rgba(13, 110, 253, .35); }
.mdscp-color__name { font-size: .8125rem; line-height: 1.15; }
.mdscp-row__pick { min-height: 44px; }

/* Mobile : la superposition devient une feuille en bas d'écran */
@media (max-width: 575.98px) {
  .mdscp-overlay { align-items: flex-end; padding: 0; }
  .mdscp-sheet {
    border-radius: .75rem .75rem 0 0; width: 100%; max-height: 85vh;
  }
  .mdscp-row { flex-wrap: wrap; }
  .mdscp-row__pick { width: 100%; justify-content: center; }
}
