/* ==========================================================
   Zélie Fleurie — Base & composants de la vitrine
   Dépend de tokens.css
   ========================================================== */

/* ---------- Reset léger ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
img, svg, picture { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

body {
  min-height: 100vh;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--font-texte);
  font-size: var(--t-1);
  line-height: 1.55;
  font-optical-sizing: auto;
  overflow-x: clip;
}

/* ---------- Typographie ---------- */
.affiche,
h1, h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-stretch: 75%;
  line-height: .9;
  letter-spacing: -.01em;
  text-wrap: balance;
}
h3 { font-family: var(--font-serif); font-weight: 400; line-height: 1.15; }
p { text-wrap: pretty; max-width: var(--lecture); }
.chapeau { font-size: var(--t-2); line-height: 1.45; }

a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: .2em; }
a:hover { text-decoration-style: wavy; text-decoration-thickness: 1.5px; }

/* ---------- Accessibilité ---------- */
:root { --focus: var(--cerise-fonce); }
.sur-fonce { --focus: var(--anis); }
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.lien-evitement {
  position: absolute; left: var(--e-2); top: -10rem; z-index: 100;
  background: var(--anis); color: var(--encre);
  padding: var(--e-1) var(--e-2); font-weight: 700;
}
.lien-evitement:focus { top: var(--e-2); }
.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Mise en page ---------- */
.conteneur {
  width: 100%;
  max-width: var(--largeur);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}
.section { padding-block: var(--e-7); position: relative; }
.fond-vert   { background: var(--vert);         color: var(--papier); }
.fond-profond{ background: var(--vert-profond); color: var(--papier); }
.fond-rose   { background: var(--rose);         color: var(--vert-profond); }
.fond-cerise { background: var(--cerise-fonce); color: var(--papier); }
.fond-papier { background: var(--papier);       color: var(--encre); }

/* Festons de store : bord inférieur festonné d'une section colorée */
.festons { position: relative; z-index: 1; }
.festons::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 100%;
  height: var(--festons);
  background: radial-gradient(circle at 50% 0, var(--fond-festons, var(--vert)) calc(var(--festons) - .5px), transparent var(--festons)) 0 0 / calc(var(--festons) * 2) var(--festons) repeat-x;
  pointer-events: none;
}

/* ---------- Fleurs adhésives (motif de la vitrine) ---------- */
.fleur {
  --petales: var(--capucine);
  --coeur: var(--papier);
  width: var(--taille, 6rem);
  aspect-ratio: 1;
  color: var(--petales);
  flex: none;
  pointer-events: none;
}
.fleur--rose     { --petales: var(--rose);    --coeur: var(--cerise); }
.fleur--anis     { --petales: var(--anis);    --coeur: var(--capucine); }
.fleur--capucine { --petales: var(--capucine);--coeur: var(--papier); }
.fleur--cerise   { --petales: var(--cerise);  --coeur: var(--rose); }
.fleur--papier   { --petales: var(--papier);  --coeur: var(--anis); }

/* ---------- Boutons ---------- */
.bouton {
  --fond: var(--rose);
  --texte: var(--vert-profond);
  --ombre: var(--cerise);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 3.25rem;
  padding: .8rem 1.5rem;
  background: var(--fond);
  color: var(--texte);
  border: var(--trait) solid var(--vert-profond);
  box-shadow: var(--decalage) var(--decalage) 0 var(--ombre);
  font-family: var(--font-texte);
  font-size: var(--t-1);
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  transition: transform .12s ease-out, box-shadow .12s ease-out;
}
.bouton:hover { text-decoration: none; transform: translate(-1px, -1px); box-shadow: calc(var(--decalage) + 2px) calc(var(--decalage) + 2px) 0 var(--ombre); }
.bouton:active { transform: translate(var(--decalage), var(--decalage)); box-shadow: 0 0 0 var(--ombre); }
.bouton[disabled], .bouton[aria-disabled="true"] {
  --fond: transparent; --texte: currentColor;
  box-shadow: none; transform: none; cursor: not-allowed; opacity: .6;
  border-style: dashed;
}
.bouton--vert { --fond: var(--vert); --texte: var(--papier); }
.bouton--ligne {
  --fond: transparent; --texte: currentColor;
  border-color: currentColor; box-shadow: none;
}
.bouton--ligne:hover { box-shadow: var(--decalage) var(--decalage) 0 currentColor; }
.bouton--large { width: 100%; min-height: 3.75rem; font-size: var(--t-2); }

.lien-fort {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* ---------- Formulaires ---------- */
.champ { display: grid; gap: .4rem; }
.champ + .champ { margin-top: var(--e-3); }
.champ__label { font-weight: 700; }
.champ__aide { font-size: var(--t-0); opacity: .8; }
.champ__erreur { font-size: var(--t-0); font-weight: 700; color: var(--cerise-fonce); }
.saisie {
  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;
}
.saisie:focus-visible { outline-offset: 0; box-shadow: var(--decalage) var(--decalage) 0 var(--rose); }
textarea.saisie { resize: vertical; min-height: 6.5rem; }
.saisie[aria-invalid="true"] { border-color: var(--cerise-fonce); }

/* ---------- Messages ---------- */
.messages { display: grid; gap: var(--e-1); margin-block: var(--e-3); }
.message {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .85rem 1rem;
  border: var(--trait) solid var(--encre);
  background: #fff;
  font-weight: 600;
}
.message::before { content: ""; flex: none; width: .9rem; height: .9rem; margin-top: .3em; border-radius: 50%; background: var(--vert); }
.message--error::before { background: var(--cerise-fonce); }
.message--warning::before { background: var(--capucine); }

/* ---------- Bandeau d'annonce ---------- */
.annonce {
  background: var(--anis); color: var(--encre);
  text-align: center; font-weight: 700; font-size: var(--t-0);
  padding: .55rem var(--gouttiere);
}
.annonce p { max-width: none; }

/* ---------- En-tête ---------- */
.entete { position: relative; z-index: 20; }
.entete__barre {
  display: flex; align-items: center; gap: var(--e-3);
  padding-block: var(--e-2);
}
.entete__logo { flex: none; display: block; width: clamp(3.75rem, 7vw, 5.5rem); }
.entete__logo img { width: 100%; height: auto; }
.nav { margin-left: auto; }
.nav__liste { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; }
.nav__lien {
  font-weight: 700;
  font-stretch: 87.5%;
  font-size: var(--t-2);
  text-decoration: none;
  padding-block: .25rem;
}
.nav__lien:hover, .nav__lien[aria-current="page"] {
  text-decoration: underline wavy var(--rose) 2px;
  text-underline-offset: .3em;
}
.panier-lien {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: var(--t-2); font-stretch: 87.5%;
  text-decoration: none;
}
.panier-lien__compte {
  display: inline-grid; place-items: center;
  min-width: 1.9rem; height: 1.9rem; padding-inline: .35rem;
  border-radius: 999px;
  background: var(--rose); color: var(--vert-profond);
  font-size: var(--t-0); font-weight: 800; font-stretch: 100%;
}
.menu-bouton {
  display: none;
  margin-left: auto;
  background: transparent; border: var(--trait) solid currentColor;
  padding: .5rem .9rem; font-weight: 700;
}

@media (max-width: 60rem) {
  .js .menu-bouton { display: inline-flex; }
  .js .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--vert); padding: var(--e-3) var(--gouttiere) var(--e-5);
    border-top: var(--trait) solid var(--rose);
  }
  .js .nav[data-ouvert] { display: block; }
  .js .nav__liste { flex-direction: column; gap: var(--e-1); }
  .js .nav__lien { font-size: var(--t-4); font-stretch: 75%; font-weight: 800; }
  .entete__barre { flex-wrap: wrap; }
  .js .panier-lien { order: 2; }
  .js .menu-bouton { order: 3; margin-left: 0; }
  .js .panier-lien { margin-left: auto; }
}

/* ---------- Fil d'Ariane ---------- */
.ariane { font-size: var(--t-0); padding-block: var(--e-3) 0; }
.ariane ol { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; }
.ariane li + li::before { content: "/"; margin-right: .4rem; opacity: .5; }
.ariane a { text-decoration: none; font-weight: 600; }
.ariane a:hover { text-decoration: underline wavy; }

/* ---------- Tuiles produit (photo tirée sur papier coloré) ---------- */
.tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--e-5) var(--e-4);
}
.tuile { position: relative; display: grid; gap: .6rem; align-content: start; }
.tuile__tirage {
  --tirage: var(--rose);
  position: relative;
  background: var(--tirage);
  padding: .75rem;
}
.tuile:nth-child(3n+2) .tuile__tirage { --tirage: var(--anis); }
.tuile:nth-child(3n) .tuile__tirage { --tirage: var(--capucine); }
.tuile__image {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  background: var(--rose-pale);
}
.tuile__vide {
  aspect-ratio: 4 / 5;
  display: grid; place-items: center; align-content: center; gap: var(--e-2);
  background: var(--papier);
  color: var(--vert);
  font-weight: 600; font-size: var(--t-0);
  text-align: center;
}
.tuile__vide .fleur { --taille: 40%; }
.tuile__nom { font-size: var(--t-3); }
.tuile__nom a { text-decoration: none; }
.tuile__nom a::after { content: ""; position: absolute; inset: 0; }
.tuile:hover .tuile__nom a { text-decoration: underline wavy 2px; text-underline-offset: .18em; }
.tuile__prix { font-weight: 700; font-size: var(--t-1); }
.tuile__etat {
  position: absolute; left: 1.5rem; top: 1.5rem;
  background: var(--encre); color: var(--papier);
  padding: .25rem .65rem; font-size: var(--t-0); font-weight: 700;
}
.tuile--epuise .tuile__image { filter: grayscale(.85); opacity: .75; }

/* Grille éditoriale : la première création prend plus de place
   dès qu'il y en a au moins quatre. */
@media (min-width: 56rem) {
  .tuiles--editorial { grid-template-columns: repeat(3, 1fr); }
  .tuiles--editorial:has(> :nth-child(4)) > :first-child {
    grid-column: span 2; grid-row: span 2;
  }
  .tuiles--editorial:has(> :nth-child(4)) > :first-child .tuile__image,
  .tuiles--editorial:has(> :nth-child(4)) > :first-child .tuile__vide { aspect-ratio: 5 / 4.6; }
  .tuiles--editorial:has(> :nth-child(4)) > :first-child .tuile__nom { font-size: var(--t-5); }
}

/* ---------- Pied de page ---------- */
.pied { position: relative; padding-block: var(--e-6) var(--e-4); }
.pied__frise {
  position: absolute; left: 0; right: 0; top: 0; translate: 0 -55%;
  display: flex; justify-content: center; gap: clamp(.5rem, 3vw, 2.5rem);
  overflow: hidden;
}
.pied__frise .fleur { --taille: clamp(2.75rem, 6vw, 4.5rem); filter: drop-shadow(3px 3px 0 var(--vert-profond)); }
.pied__frise .fleur:nth-child(odd) { rotate: 18deg; translate: 0 .6rem; }
.pied__grille {
  display: grid; gap: var(--e-5);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  padding-top: var(--e-4);
}
.pied__logo { width: 6.5rem; }
.pied h2 {
  font-size: var(--t-3);
  color: var(--rose);
  margin-bottom: var(--e-2);
}
.pied ul { list-style: none; padding: 0; display: grid; gap: .35rem; }
.pied a { text-decoration: none; font-weight: 600; }
.pied a:hover { text-decoration: underline wavy var(--rose); }
.horaires { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1.25rem; }
.horaires dt { font-weight: 700; }
.pied__bas {
  margin-top: var(--e-6); padding-top: var(--e-3);
  border-top: var(--trait) solid color-mix(in srgb, var(--papier) 30%, transparent);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--e-2);
  font-size: var(--t-0);
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
