/* ==========================================================
   Zélie Fleurie — Composants de la vitrine (phase 2)
   Dépend de tokens.css et zelie.css. Design system validé.
   ========================================================== */

/* ---------- En-tête de page intérieure (affiche courte) ---------- */
.affiche-page {
  position: relative;
  padding-block: var(--e-4) var(--e-6);
}
.affiche-page__grille {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: var(--e-3) var(--e-5);
  align-items: end;
  /* Réserve la place de la fleur adhésive, en haut à droite. */
  padding-right: clamp(3.5rem, 7vw, 6.5rem);
}
.affiche-page__titre {
  font-size: var(--d-m);
  text-transform: uppercase;
  color: var(--rose);
  text-shadow: .045em .05em 0 var(--cerise);
  overflow-wrap: anywhere;
}
.affiche-page .ariane { padding-top: 0; margin-bottom: var(--e-3); }
.affiche-page__chapeau { font-size: var(--t-2); line-height: 1.45; }
.affiche-page__fleur {
  --taille: clamp(3rem, 6vw, 5rem);
  position: absolute; right: 0; top: -.5rem;
  rotate: 16deg;
}
@media (max-width: 48rem) {
  .affiche-page__grille { grid-template-columns: 1fr; padding-right: 3rem; }
  .affiche-page__fleur { --taille: 2.75rem; top: -1.5rem; }
}
.apres-festons { padding-top: calc(var(--festons) + var(--e-5)); }
.corps-page { padding-block: calc(var(--festons) + var(--e-5)) var(--e-7); }
.corps-page > .conteneur > * + * { margin-top: var(--e-5); }

/* ---------- Encarts ---------- */
.encart {
  border: var(--trait) solid var(--vert-profond);
  background: #fff;
  color: var(--encre);
  padding: var(--e-3);
  box-shadow: var(--decalage) var(--decalage) 0 var(--rose);
}
.encart > * + * { margin-top: var(--e-1); }
.encart h2, .encart h3 {
  font-family: var(--font-serif); font-weight: 400; font-stretch: 100%;
  font-size: var(--t-3); line-height: 1.15; text-transform: none; color: var(--vert);
}
/* Fonctionnalité pas encore ouverte en ligne */
.encart--bientot { background: var(--anis); box-shadow: var(--decalage) var(--decalage) 0 var(--vert-profond); }
.encart--bientot h2, .encart--bientot h3 { color: var(--encre); }
.encart--erreur { border-color: var(--cerise-fonce); box-shadow: var(--decalage) var(--decalage) 0 var(--cerise-fonce); }

/* Contenu provisoire à faire confirmer par la cliente */
.provisoire {
  position: relative;
  outline: var(--trait) dashed var(--cerise-fonce);
  outline-offset: .4rem;
}
.provisoire::before {
  content: "Contenu provisoire, à confirmer";
  display: block;
  width: fit-content;
  margin-bottom: var(--e-1);
  background: var(--cerise-fonce); color: #fff;
  font-family: var(--font-texte); font-size: var(--t-0); font-weight: 700; font-stretch: 100%;
  letter-spacing: 0; text-transform: none; text-shadow: none; line-height: 1.3;
  padding: .15rem .5rem;
}
.sur-fonce .provisoire { outline-color: var(--anis); }

/* ---------- Choix radio en tuiles (tailles, retrait, créneaux) ---------- */
.groupe-choix { border: 0; padding: 0; margin: 0; min-width: 0; }
.groupe-choix legend { margin-bottom: var(--e-2); padding: 0; }
.groupe-choix__liste {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--choix-min, 7.5rem), 1fr));
  gap: var(--e-1);
}
.choix {
  position: relative;
  display: grid; gap: .15rem; align-content: start;
  padding: .75rem .9rem;
  border: var(--trait) solid var(--encre);
  background: #fff;
  cursor: pointer;
}
.choix input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: inherit; }
.choix__nom { font-weight: 700; }
.choix__detail { font-size: var(--t-0); }
.choix:hover { box-shadow: var(--decalage) var(--decalage) 0 var(--rose); }
.choix:has(input:checked) {
  background: var(--vert); color: var(--papier); border-color: var(--vert);
  box-shadow: var(--decalage) var(--decalage) 0 var(--cerise);
}
.choix:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 3px; }
.choix--indispo {
  cursor: not-allowed; border-style: dashed; background: transparent;
  color: color-mix(in srgb, var(--encre) 70%, transparent);
}
.choix--indispo .choix__nom { text-decoration: line-through; }
.choix--indispo:hover { box-shadow: none; }
/* Option prévue mais pas encore ouverte : pointillés, sans rature */
.choix--bientot { cursor: default; border-style: dashed; background: transparent; }
.choix--bientot:hover { box-shadow: none; }

/* ---------- Formulaires : blocs, grilles et erreurs ---------- */
.formulaire { display: grid; gap: var(--e-5); }
.bloc { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: var(--e-3); }
.bloc > legend, .bloc__titre {
  font-family: var(--font-serif); font-weight: 400; font-stretch: 100%;
  font-size: var(--t-4); line-height: 1.1; text-transform: none;
  color: var(--vert); margin-bottom: var(--e-1); padding: 0;
}
.champs-2 { display: grid; gap: var(--e-3); grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.formulaire .champ + .champ { margin-top: 0; }
.champ__requis { color: var(--cerise-fonce); }
.erreurs-formulaire {
  border: var(--trait) solid var(--cerise-fonce);
  background: #fff;
  padding: var(--e-2) var(--e-3);
}
.erreurs-formulaire > p { font-weight: 700; color: var(--cerise-fonce); }
.erreurs-formulaire ul { margin: .3rem 0 0; padding-left: 1.2rem; }

/* ---------- Étapes de commande (vraie séquence) ---------- */
.etapes {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  list-style: none; padding: 0; margin: 0;
  counter-reset: etape; font-weight: 700;
}
.etapes li { display: flex; align-items: center; gap: .5rem; counter-increment: etape; opacity: .75; }
.etapes li::before {
  content: counter(etape);
  display: inline-grid; place-items: center;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  border: var(--trait) solid currentColor; font-size: var(--t-0);
}
.etapes [aria-current="step"] { opacity: 1; }
.etapes [aria-current="step"]::before { background: var(--rose); color: var(--vert-profond); border-color: var(--rose); }
.etapes .faite { opacity: 1; }
.etapes .faite::before { content: "✓"; background: var(--anis); color: var(--encre); border-color: var(--anis); }

/* ---------- Récapitulatif ---------- */
.recap {
  border: 3px solid var(--vert);
  background: #fff;
  padding: var(--e-3);
}
.recap__titre {
  font-family: var(--font-serif); font-weight: 400; font-stretch: 100%;
  font-size: var(--t-4); text-transform: none; line-height: 1.1; color: var(--vert);
  margin-bottom: var(--e-2);
}
.recap__lignes { list-style: none; padding: 0; margin: 0; }
.recap__ligne {
  display: flex; justify-content: space-between; gap: var(--e-2);
  padding-block: .55rem;
  border-bottom: 1px solid color-mix(in srgb, var(--vert) 25%, transparent);
}
.recap__ligne small { display: block; opacity: .85; }
.recap__ligne > :last-child { white-space: nowrap; font-weight: 700; }
.recap__total {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--e-2);
  margin-top: var(--e-2);
  font-family: var(--font-serif); font-size: var(--t-3);
}
.recap__note { font-size: var(--t-0); margin-top: var(--e-2); }
.recap .bouton { margin-top: var(--e-3); }

/* ---------- Pastilles d'état ---------- */
.pastille {
  display: inline-block;
  padding: .1rem .55rem;
  font-size: var(--t-0); font-weight: 700; line-height: 1.5;
  background: var(--rose-pale); color: var(--encre);
  border: 1.5px solid var(--encre);
  white-space: nowrap;
}
.pastille--ok { background: var(--anis); }
.pastille--alerte { background: #fff; color: var(--cerise-fonce); border-color: var(--cerise-fonce); }
.pastille--neutre { background: #fff; }

/* ---------- Filtres de rayon ---------- */
.filtres { display: flex; flex-wrap: wrap; gap: var(--e-1); list-style: none; padding: 0; margin: 0 0 var(--e-5); }
.filtres a {
  display: inline-flex; align-items: baseline; gap: .4rem;
  padding: .5rem .9rem;
  border: var(--trait) solid var(--vert-profond);
  background: #fff;
  font-weight: 700; text-decoration: none;
}
.filtres a:hover { box-shadow: var(--decalage) var(--decalage) 0 var(--rose); text-decoration: none; }
.filtres a[aria-current="page"] {
  background: var(--vert); color: var(--papier); border-color: var(--vert);
  box-shadow: var(--decalage) var(--decalage) 0 var(--cerise);
}
.filtres small { font-weight: 600; opacity: .85; }

/* ---------- Chargement ---------- */
.chargement { display: inline-flex; align-items: center; gap: .6rem; font-weight: 600; }
.chargement::before {
  content: ""; width: 1.1rem; height: 1.1rem; flex: none;
  border: 3px solid var(--rose); border-top-color: var(--vert);
  border-radius: 50%;
  animation: zf-tourne .8s linear infinite;
}
@keyframes zf-tourne { to { rotate: 360deg; } }

/* ---------- Contenu éditorial (pages d'info, mentions) ---------- */
.texte-long { max-width: 44rem; }
.texte-long > * + * { margin-top: var(--e-2); }
.texte-long h2 {
  font-size: var(--d-s); color: var(--vert); text-transform: uppercase;
}
.texte-long > h2:not(:first-child) { margin-top: var(--e-6); }
.texte-long h3 { font-size: var(--t-3); color: var(--vert); margin-top: var(--e-4); }
.texte-long ul { padding-left: 1.2rem; }
.texte-long li + li { margin-top: .3rem; }
.a-completer {
  background: var(--rose-pale);
  border-bottom: 2px dashed var(--cerise-fonce);
  padding-inline: .25rem;
  font-weight: 600;
}

/* ---------- Deux colonnes (contenu + aside) ---------- */
.deux-colonnes {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--e-5) var(--e-6);
  align-items: start;
}
.deux-colonnes > aside { position: sticky; top: var(--e-3); }
@media (max-width: 56rem) {
  .deux-colonnes { grid-template-columns: 1fr; }
  .deux-colonnes > aside { position: static; }
}

/* ---------- Liste à rubriques (infos pratiques, contact) ---------- */
.rubriques { display: grid; gap: var(--e-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.rubrique { border-top: 3px solid var(--vert); padding-top: var(--e-2); }
.rubrique h2, .rubrique h3 {
  font-family: var(--font-serif); font-weight: 400; font-stretch: 100%;
  font-size: var(--t-3); text-transform: none; line-height: 1.15; color: var(--vert);
  margin-bottom: var(--e-1);
}
.rubrique > * + * { margin-top: var(--e-1); }

/* ---------- Champs Django rendus tels quels dans .champ ---------- */
.champ :is(input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
           input[type="number"], input[type="url"], input[type="password"], select, textarea) {
  width: 100%;
  padding: .75rem .9rem;
  background: #fff;
  border: var(--trait) solid var(--encre);
  border-radius: 0;
  font-size: var(--t-1);
  line-height: 1.4;
}
.champ :is(input, select, textarea):focus-visible { outline-offset: 0; box-shadow: var(--decalage) var(--decalage) 0 var(--rose); }
.champ textarea { resize: vertical; min-height: 6.5rem; }
.champ [aria-invalid="true"] { border-color: var(--cerise-fonce); box-shadow: var(--decalage) var(--decalage) 0 color-mix(in srgb, var(--cerise-fonce) 35%, transparent); }
.champ--erreur .champ__label { color: var(--cerise-fonce); }

/* ---------- Pied de page : liens légaux ---------- */
.pied .pied__legal { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; }
.pied .pied__legal a { font-weight: 500; }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-2); margin-top: var(--e-6); font-weight: 700; }
.pagination a { text-decoration: none; }

/* ---------- États vides ---------- */
.vide {
  display: flex; align-items: center; gap: var(--e-3);
  padding: var(--e-4);
  border: var(--trait) dashed var(--vert);
  background: #fff;
  font-size: var(--t-2);
}
.vide > div > * + * { margin-top: var(--e-1); }
.vide .fleur { --taille: 4rem; }
@media (max-width: 30rem) { .vide { flex-direction: column; align-items: flex-start; } }
.catalogue__compte { font-weight: 700; margin-bottom: var(--e-3); }

/* ---------- Erreur serveur (page autonome) ---------- */
.erreur-serveur { min-height: 100vh; display: grid; align-items: center; padding-block: var(--e-6); }
.erreur-serveur .conteneur > * + * { margin-top: var(--e-3); }
.erreur-serveur__logo { width: 6rem; }

/* Plages horaires insécables */
.plage { white-space: nowrap; }

/* Catalogue : deux colonnes sur mobile */
@media (max-width: 40rem) {
  .tuiles--catalogue { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e-4) var(--e-2); }
  .tuiles--catalogue .tuile__tirage { padding: .4rem; }
  .tuiles--catalogue .tuile__nom { font-size: var(--t-2); }
  .tuiles--catalogue .tuile__prix { font-size: var(--t-0); }
  .tuiles--catalogue .tuile__etat { left: .75rem; top: .75rem; }
}

/* ---------- Notification après une action (ajout au panier…) ---------- */
.notification {
  padding: .8rem 1rem;
  border: var(--trait) solid var(--vert-profond);
  background: var(--anis); color: var(--encre);
  font-weight: 700;
  box-shadow: var(--decalage) var(--decalage) 0 var(--vert-profond);
}
.notification--erreur { background: #fff; border-color: var(--cerise-fonce); color: var(--cerise-fonce); box-shadow: var(--decalage) var(--decalage) 0 var(--cerise-fonce); }
.operation__erreur { margin-top: var(--e-1); font-weight: 700; color: var(--cerise-fonce); }

/* ---------- Facture côté client ---------- */
.facture-client { margin-top: var(--e-5); border-top: 3px solid var(--vert); padding-top: var(--e-2); }
.facture-client__titre { font-family: var(--font-serif); font-weight: 400; font-stretch: 100%; text-transform: none; font-size: var(--t-3); line-height: 1.15; color: var(--vert); margin-bottom: var(--e-1); }
.facture-client__liste { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.facture-client__liste li { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; }
.facture-client__form { gap: var(--e-2); max-width: 32rem; }
