/* ============================================
   LISTES PERSONNALISÉES d'un produit (police, gravure…) — js/option-lists.js
   Fiche produit (product.html) et aperçu rapide (shop.html).
   Liste courte = boutons à toucher ; longue = liste déroulante ;
   texte = champ avec compteur. 16 px minimum : en dessous, l'iPhone
   zoome sur la page quand on touche le champ.
   ============================================ */
.opt-lists { display: flex; flex-direction: column; gap: 22px; }
.opt-lists:empty { display: none; }
.opt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.opt-title { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; line-height: 1.35; }
.opt-optional {
  font-size: 11.5px; font-weight: 500; color: var(--ink-soft);
  padding: 2px 8px; border: 1px solid var(--line); border-radius: 100px; white-space: nowrap;
}
.opt-done { width: 17px; height: 17px; flex-shrink: 0; color: #16a34a; opacity: 0; transform: scale(.6); transition: opacity .18s ease, transform .18s ease; }
.opt-field.is-done .opt-done { opacity: 1; transform: none; }
.opt-hint { font-size: 13px; line-height: 1.45; color: var(--ink-soft); margin: -3px 0 10px; }
.opt-control { position: relative; max-width: 460px; }
.opt-input {
  display: block; width: 100%; height: 50px; margin: 0; padding: 0 16px;
  font-family: inherit; font-size: 16px; font-weight: 500; line-height: 1.2; color: var(--ink);
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.opt-input::placeholder { color: var(--ink-soft); font-weight: 400; opacity: .85; }
.opt-input:hover { border-color: var(--ink-faint); }
.opt-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(10, 10, 10, .1); }
select.opt-input { padding-right: 46px; cursor: pointer; text-overflow: ellipsis; }
select.opt-input.is-empty { color: var(--ink-soft); font-weight: 400; }
select.opt-input option { color: var(--ink); font-weight: 400; }
.opt-chevron {
  position: absolute; right: 16px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  color: var(--ink-soft); pointer-events: none;
}
.opt-control.is-text .opt-input { padding-right: 64px; }
.opt-count {
  position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums;
  pointer-events: none; opacity: 0; transition: opacity .15s ease;
}
.opt-control.is-text:focus-within .opt-count,
.opt-field.is-done .opt-count { opacity: 1; }
.opt-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-pill {
  min-height: 44px; padding: 10px 16px; margin: 0;
  font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.2; color: var(--ink); text-align: center;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px;
  cursor: pointer; transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.opt-pill:hover { border-color: var(--ink-3); }
.opt-pill.selected { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.opt-pill:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.opt-error { display: none; margin-top: 7px; font-size: 13px; font-weight: 500; color: #c62828; }
.opt-field.has-error .opt-error { display: block; }
.opt-field.has-error .opt-input,
.opt-field.has-error .opt-pill { border-color: #c62828; }
.opt-field.has-error .opt-input:focus { box-shadow: 0 0 0 3px rgba(198, 40, 40, .15); }
@media (max-width: 640px) {
  .opt-control { max-width: none; }
}
body.shop-dark-mode .opt-input,
body.shop-dark-mode .opt-pill { background: #18181b; border-color: #3f3f46; color: #fafafa; }
body.shop-dark-mode .opt-pill.selected { background: #fafafa; color: #0a0a0a; border-color: #fafafa; }
body.shop-dark-mode .opt-input:focus { border-color: #fafafa; box-shadow: 0 0 0 3px rgba(250, 250, 250, .15); }
/* Thème Classique (sombre) : mêmes couleurs que ses boutons de taille */
body.theme-classic .opt-title { color: var(--t-text); }
body.theme-classic .opt-input,
body.theme-classic .opt-pill { background: var(--t-surface); border-color: var(--t-border); color: var(--t-text); }
body.theme-classic .opt-pill.selected,
body.theme-classic .opt-input:focus { border-color: var(--t-accent); background: var(--t-surface-high); }
