/* doc-project | commande/v1/assets/css/components/mods.css | Définit le style de la zone de personnalisation des mods dans le bottom-sheet, avec héro, chips, slider alphabétique et modal de confirmation. | Expose: aucun | Dépend de: commande/v1/assets/css/components/mods.css, composants HTML de personnalisation | Impacte: UI de personnalisation, contraste, interactions tactiles | Tables: aucune */
/* cde/v1/assets/css/components/mods.css
 * Fonctionnalité: UI de personnalisation (ingrédients de base + ajouts + allergènes) dans le bottom-sheet.
 */

/* Hero image + CTA */
.modsHero{
  position: relative;
}
.modsHero__img{
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}
.modsHero__cta{
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  pointer-events: none; /* n'intercepte pas les tap hors boutons */
}
.modsHero__cta .btn{
  pointer-events: auto;
  box-shadow: 0 10px 26px rgba(0,0,0,.18);
}

.modsBlock{
  margin-top: 10px;
}
.modsCard + .modsCard{
  margin-top: 12px;
}
.modsCard{
  background: rgba(255,255,255,.92);
}
.modsCard .modsLabel{
  margin-top: 0;
}
.modsAllergensRow{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.modsLabel{
  margin: 0 0 6px;
  font-weight: 950;
  font-size: 14px;
  line-height: 1.35;
}
.modsHint{
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Bouton "Demandes fréquentes" : doit être perçu immédiatement comme une action */
[data-mods-freq-toggle]{
  margin-top: 6px;
  width: 100%;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid #0b2a5b;
  background: #0b2a5b;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
[data-mods-freq-toggle]:hover,
[data-mods-freq-toggle]:focus-visible{
  background: #123a77;
  border-color: #123a77;
  color: #fff;
  outline: none;
}

/* Chips spécifiques */
/*
  PROBLÈME UX:
  Les chips (ingrédients / demandes fréquentes / ajouts) manquent de contraste sur le fond des cards.
  SOLUTION:
  - On renforce le contraste uniquement DANS la zone de personnalisation (.modsBlock)
  - Liseré bleu foncé plus épais + fond légèrement bleuté
  - On garde les états (selected/removed/surcharge) lisibles et cohérents
*/
.modsBlock .chip{
  /* Liseré bleu foncé plus visible */
  border-width: 2px;
  border-style: solid;
  border-color: rgba(11, 42, 91, .75);
  /* Fond légèrement bleuté pour contraster avec la card blanche */
  background: rgba(11, 42, 91, .08);
  color: #0b2a5b;
  font-weight: 900;
}
.modsBlock .chip:focus-visible{
  outline: 3px solid rgba(11, 42, 91, .28);
  outline-offset: 2px;
}

.modsBlock .chip.is-removed{
  text-decoration: line-through;
  opacity: .72; /* un peu plus lisible tout en gardant l'état "retiré" */
}
.modsBlock .chip.is-selected{
  /* État actif très lisible */
  background: #0b2a5b;   /* bleu foncé */
  border-color: #0b2a5b;
  color: #fff;
}

.modsBlock .chip.is-surcharge{
  /*
    Chip "surcharge" (ex: emmental):
    - On conserve la teinte dorée (sémantique)
    - On renforce le contour bleu foncé (contraste)
  */
  background: rgba(255, 215, 0, .22);
  border-width: 2px;
  border-style: solid;
  border-color: rgba(11, 42, 91, .85);
  color: #0b2a5b;
}
.modsBlock .chip.is-surcharge.is-removed{
  opacity: .78;
}

.searchSmall{
  padding: 8px 10px;
  border-radius: 12px;
}
.searchSmall .search__input{
  font-weight: 800;
}

.modsAlphaSlider{
  width: 100%;
  /*
    Le zoom de lettre (bulle) remonte au-dessus du slider (top négatif).
    Sans marge supérieure dédiée, la bulle recouvre la dernière ligne de chips ingrédients.
  */
  margin: 44px 0 8px;
  overflow: visible;
}

/* A-Z : toutes les lettres sur toute la largeur */
.modsAlphaSlider__letters{
  display: flex;
  width: 100%;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none; /* permet de slider sur les lettres sans scroll */
  -webkit-tap-highlight-color: transparent;
}
.modsAlphaSlider__letters span{
  flex: 1 1 0;
  text-align: center;
  font-weight: 900;
  font-size: clamp(10px, 2.6vw, 12px);
  line-height: 1.15;
  transform-origin: center bottom;
  transition: transform .08s ease, color .08s ease, font-weight .08s ease, opacity .08s ease;
}
.modsAlphaSlider__letters span.is-empty{
  opacity: .25;
}
.modsAlphaSlider__letters span.is-active{
  transform: scale(1.45);
  font-weight: 950;
  color: #0b2a5b; /* bleu foncé */
  opacity: 1;
}

/* Track : même largeur que la rangée des lettres */
.modsAlphaSlider__track{
  position: relative;
  width: 100%;
  margin-top: 8px;
  touch-action: none; /* évite le scroll natif pendant le drag horizontal */
}

.modsAlphaSlider__range{
  width: 100%;
  height: 32px; /* zone tactile confortable */
  margin: 0;
  padding: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  touch-action: none; /* même logique sur le curseur natif */
}

/* WebKit */
.modsAlphaSlider__range::-webkit-slider-runnable-track{
  height: 6px;
  border-radius: 999px;
  background: rgba(17,17,17,.14);
}
.modsAlphaSlider__range::-webkit-slider-thumb{
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #0b2a5b;
  border: 2px solid #0b2a5b;
  margin-top: -6px; /* centre le thumb sur la track */
}

/* Firefox */
.modsAlphaSlider__range::-moz-range-track{
  height: 6px;
  border-radius: 999px;
  background: rgba(17,17,17,.14);
}
.modsAlphaSlider__range::-moz-range-thumb{
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #0b2a5b;
  border: 2px solid #0b2a5b;
}
.modsAlphaSlider__range::-moz-focus-outer{
  border: 0;
}

/* Bulle : suit le slider et se centre sur la "colonne" de la lettre */
.modsAlphaSlider__bubble{
  position: absolute;
  top: -36px;
  left: 0;
  transform: translateX(-50%);
  pointer-events: auto; /* permet de slider sur la lettre zoomée */
  touch-action: none; /* évite le scroll pendant le drag */
  min-width: 38px;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255,255,255,.98);
  border: 2px solid #0b2a5b;
  color: #0b2a5b;
  font-weight: 950;
  box-shadow: 0 10px 26px rgba(0,0,0,.14);
}

.modsRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}
.modsTotals{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap: 10px;
}
.modsTotals__label{
  color: var(--muted);
  font-weight: 900;
  font-size: 13px;
}
.modsTotals__value{
  font-weight: 950;
}

/* Modal confirmation (oui/non) — remplace alert/confirm */
.v1ConfirmModal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.v1ConfirmModal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}
.v1ConfirmModal__panel{
  position: relative;
  width: 100%;
  max-width: 520px;
  background: rgba(255,255,255,.98);
  border-radius: 16px;
  padding: 14px 14px 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
}
.v1ConfirmModal__msg{
  margin: 0 0 12px;
  font-weight: 900;
  line-height: 1.35;
}
.v1ConfirmModal__actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
