/* Configurateur d'édition sur mesure (#16). S'ajoute à style-atterrissage.css,
   qui porte déjà les variables, l'en-tête, les boutons et le pied de page. */

/* ===== Texte réservé aux lecteurs d'écran ===== */
.texte-masque {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ===== Fil de retour (même rendu que la fiche du jeu) ===== */
#fil-retour {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem 1.5rem 0;
}

#fil-retour a {
  color: var(--texte-attenue);
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.2s ease;
}

#fil-retour a:hover,
#fil-retour a:focus-visible {
  color: var(--accent);
}

.configurateur-jeu {
  display: block;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

.configurateur-grille {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: start;
}

/* ===== Aperçu : jaquette + calques ===== */
#apercu-edition {
  position: sticky;
  top: 6rem;
  margin: 0;
  border: 2px solid var(--bordure);
  border-radius: 10px;
  overflow: hidden;
  background: var(--fond-carte);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

#apercu-edition[data-edition="deluxe"] {
  border-color: #b8c4d6;
  box-shadow: 0 0 0 1px #b8c4d6, 0 10px 30px rgba(184, 196, 214, 0.18);
}

#apercu-edition[data-edition="collector"] {
  border-color: #e0b44c;
  box-shadow: 0 0 0 1px #e0b44c, 0 10px 34px rgba(224, 180, 76, 0.28);
}

.apercu-jaquette {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(160deg, #2a1c10, #12151c);
}

.apercu-jaquette img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.apercu-bandeau {
  position: absolute;
  top: 1rem;
  left: 0;
  padding: 0.35rem 1rem 0.35rem 0.9rem;
  border-radius: 0 4px 4px 0;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  background: rgba(13, 17, 23, 0.85);
  color: var(--texte);
}

#apercu-edition[data-edition="deluxe"] .apercu-bandeau {
  background: linear-gradient(90deg, #8d99ab, #dfe6f0);
  color: #10141a;
}

#apercu-edition[data-edition="collector"] .apercu-bandeau {
  background: linear-gradient(90deg, #b07d1a, #f3d27a);
  color: #1a1200;
}

.apercu-plateforme {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  background: rgba(13, 17, 23, 0.85);
  color: var(--texte);
}

.apercu-extras {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.apercu-extras li {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  animation: apparition-extra 0.25s ease-out;
}

.apercu-extras li[hidden] {
  display: none;
}

@keyframes apparition-extra {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#apercu-edition figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem 1.2rem;
  border-top: 1px solid var(--bordure);
  color: var(--texte-attenue);
  font-size: 0.92rem;
  min-height: 3.2rem;
}

/* L'aperçu se glisse dans le panier (#17) : prise visible */
#apercu-edition[draggable="true"] {
  cursor: grab;
}

#apercu-edition[draggable="true"]:active {
  cursor: grabbing;
}

.poignee-glisser {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent-clair);
  font-size: 0.82rem;
  font-weight: 700;
}

.poignee-glisser::before {
  content: "⠿";
  font-size: 1.1rem;
  line-height: 1;
}

.formulaire-ajouter-panier {
  margin-top: 1rem;
}

.formulaire-ajouter-panier .bouton {
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

/* ===== Formulaire : trois familles d'options ===== */
.famille-options {
  border: 0;
  margin: 0 0 1.6rem;
  padding: 0;
}

.famille-options legend {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.famille-numero {
  display: inline-grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--accent);
  color: #1a1200;
  font-size: 0.9rem;
}

.legende-precision {
  color: var(--texte-attenue);
  font-size: 0.85rem;
  font-weight: 400;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--fond-carte);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.option:hover {
  border-color: var(--accent-fonce);
}

.option:has(input:checked) {
  border-color: var(--accent);
  background: #241a10;
}

.option input {
  margin-top: 0.3rem;
  accent-color: var(--accent);
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.option input:focus-visible {
  outline: 2px solid var(--accent-clair);
  outline-offset: 3px;
}

.option-texte {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.option-nom {
  font-weight: 700;
}

.option-description {
  color: var(--texte-attenue);
  font-size: 0.88rem;
}

.option-supplement {
  font-weight: 700;
  color: var(--accent-clair);
  white-space: nowrap;
}

.options-en-ligne {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.option-compacte {
  margin-bottom: 0;
  padding: 0.6rem 1rem;
  align-items: center;
}

.option-compacte input {
  margin-top: 0;
}

/* ===== Total et actions ===== */
.configurateur-total {
  border-top: 1px solid var(--bordure);
  padding-top: 1.2rem;
}

.total-ligne {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-weight: 600;
}

#prix-compose {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}

.total-detail {
  color: var(--texte-attenue);
  font-size: 0.85rem;
  min-height: 1.2em;
}

.total-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.total-actions [hidden] {
  display: none;
}

.total-actions button {
  font: inherit;
  cursor: pointer;
}

.total-actions .bouton {
  border: 0;
}

.bouton-secondaire {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--bordure);
  color: var(--texte);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.8rem 1.6rem;
  border-radius: 4px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.bouton-secondaire:hover,
.bouton-secondaire:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.bouton:focus-visible,
.bouton-secondaire:focus-visible {
  outline: 2px solid var(--accent-clair);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .apercu-extras li {
    animation: none;
  }

  #apercu-edition,
  .option {
    transition: none;
  }
}

@media (max-width: 900px) {
  .configurateur-grille {
    grid-template-columns: 1fr;
  }

  #apercu-edition {
    position: relative;
    top: 0;
  }
}
