/* =====================================================================
   STYLES COMMUNS
   Dépend de base.css (palette fixe) et seasons.css (accents).
   Aucune couleur en dur ici : uniquement des variables.
   ===================================================================== */

/* ---------- Réinitialisation douce ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police-texte);
  font-size: var(--taille-base);
  line-height: var(--interligne);
  font-kerning: normal;
  hanging-punctuation: first;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 {
  font-family: var(--police-titre);
  font-weight: 500;
  font-variation-settings: "SOFT" 100;
  line-height: 1.15;
  margin: 0 0 var(--espace-2);
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); letter-spacing: -.01em; }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); }
p { margin: 0 0 var(--espace-2); text-wrap: pretty; max-width: var(--largeur-texte); }
ul, ol { padding-left: 1.2em; }
a { color: var(--feuillage); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); text-decoration-thickness: 2px; }
strong { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--structure); margin: var(--espace-4) 0; }

/* Focus visible sur tout élément interactif */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--rayon-s);
}

.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;
}
.lien-evitement {
  position: absolute; left: var(--espace-2); top: -4rem; z-index: 100;
  background: var(--feuillage); color: var(--fond); padding: .75rem 1.25rem;
  border-radius: var(--rayon-pilule); text-decoration: none;
}
.lien-evitement:focus { top: var(--espace-2); color: var(--fond); }

/* ---------- Structure générale ---------- */
.site {
  min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom)); /* place de la barre du bas */
}
main {
  display: block;
  max-width: var(--largeur-page);
  margin: 0 auto;
  padding: var(--espace-3) var(--espace-2) var(--espace-5);
  min-height: 70vh;
}
.section { margin-block: var(--espace-5); }
.section:first-child { margin-top: var(--espace-2); }
.surtitre {
  font-family: var(--police-texte);
  font-size: var(--t-petit);
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--encre-douce);
  margin-bottom: var(--espace-1);
}
.chapo { font-size: 1.25rem; max-width: 34rem; }
.discret { color: var(--encre-douce); }
.pile > * + * { margin-top: var(--espace-2); }

/* ---------- Barre supérieure ---------- */
.entete {
  position: sticky; top: 0; z-index: 30;
  background: var(--fond);
  border-bottom: 1px solid var(--structure);
  min-height: 64px; /* hauteur réservée : pas de décalage à l'injection */
}
.entete__interieur {
  display: flex; align-items: center; gap: var(--espace-1);
  max-width: calc(var(--largeur-page) + 20rem);
  margin: 0 auto; padding: .5rem var(--espace-2);
  min-height: 64px;
}
.marque {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--encre); text-decoration: none; margin-right: auto;
  min-height: var(--cible);
}
.marque:hover { color: var(--encre); }
.entete__actions { display: flex; align-items: center; gap: .25rem; }

.bouton-icone {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-width: var(--cible); min-height: var(--cible);
  padding: 0 .6rem;
  background: transparent; border: 0; border-radius: var(--rayon-pilule);
  color: var(--encre); text-decoration: none; cursor: pointer;
}
.bouton-icone:hover { background: var(--accent-surface); color: var(--encre); }
.bouton-icone svg { width: 24px; height: 24px; }
.bouton-icone .libelle-large { display: none; }
.pastille-compteur {
  display: inline-grid; place-items: center;
  min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem;
  border-radius: var(--rayon-pilule);
  background: var(--accent); color: var(--fond);
  font-size: .95rem; font-weight: 600; line-height: 1;
}
.pastille-compteur[hidden] { display: none; }

/* Recherche globale */
.recherche-globale { display: none; }
.recherche-globale form, .champ-recherche {
  display: flex; align-items: center;
  background: var(--fond-2); border: 1px solid var(--structure);
  border-radius: var(--rayon-pilule); padding-left: 1rem;
}
.recherche-globale input, .champ-recherche input {
  border: 0; background: transparent; min-height: var(--cible); flex: 1; min-width: 0;
  padding: 0 .5rem 0 0;
}
.recherche-globale input:focus, .champ-recherche input:focus { outline: none; }
.recherche-globale form:focus-within, .champ-recherche:focus-within {
  outline: 3px solid var(--focus); outline-offset: 2px;
}
.recherche-mobile {
  border-top: 1px solid var(--structure);
  padding: .75rem var(--espace-2);
  background: var(--fond);
}
.recherche-mobile[hidden] { display: none; }

/* Menu « La maison » */
.menu-maison { position: relative; }
.menu-maison__liste {
  position: absolute; right: 0; top: calc(100% + .5rem);
  min-width: 16rem; list-style: none; margin: 0; padding: .5rem;
  background: var(--fond); border: 1px solid var(--structure);
  border-radius: var(--rayon-m);
  box-shadow: 0 12px 30px -18px color-mix(in srgb, var(--encre) 45%, transparent);
}
.menu-maison__liste[hidden] { display: none; }
.menu-maison__liste a {
  display: flex; align-items: center; min-height: var(--cible);
  padding: .25rem .9rem; border-radius: var(--rayon-s);
  color: var(--encre); text-decoration: none;
}
.menu-maison__liste a:hover { background: var(--accent-surface); }
.menu-maison__liste .separateur { border-top: 1px solid var(--structure); margin: .4rem .5rem; }

/* ---------- Navigation principale : barre du bas (mobile) ---------- */
.nav-principale {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--fond);
  border-top: 1px solid var(--structure);
  padding-bottom: env(safe-area-inset-bottom);
  min-height: 72px;
}
.nav-principale ul {
  display: flex; justify-content: space-between;
  list-style: none; margin: 0 auto; padding: 0 .25rem; max-width: 36rem;
}
.nav-principale li { flex: 1 1 auto; }
.nav-principale a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem;
  min-height: 68px; min-width: var(--cible); padding: .35rem .1rem;
  color: var(--encre-douce); text-decoration: none;
  font-size: .9375rem; line-height: 1.15; text-align: center; white-space: nowrap;
  border-radius: var(--rayon-m);
}
/* Seule exception à la règle des 17 px : les libellés de la barre d'onglets
   sur les téléphones de moins de 420 px (15 px, toujours accompagnés d'une icône).
   Au-delà, ils passent à 17 px. Documenté dans le README. */
@media (min-width: 420px) { .nav-principale a { font-size: var(--t-petit); } }
.nav-principale svg { width: 26px; height: 26px; }
.nav-principale a:hover { color: var(--encre); }
.nav-principale a[aria-current="page"] { color: var(--encre); font-weight: 600; }
.nav-principale a[aria-current="page"] .nav-icone {
  background: var(--accent-surface-2); color: var(--accent);
}
.nav-icone {
  display: grid; place-items: center; width: 3.25rem; height: 2rem;
  border-radius: var(--rayon-pilule);
  transition: background-color var(--duree) var(--courbe);
}

/* ---------- Tablette & bureau : navigation latérale ---------- */
@media (min-width: 900px) {
  .site {
    padding-bottom: 0;
    display: grid;
    grid-template-columns: 14.5rem 1fr;
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "entete entete" "nav contenu" "nav pied";
  }
  .entete { grid-area: entete; }
  .nav-principale {
    grid-area: nav;
    position: sticky; top: 64px; bottom: auto;
    align-self: start;
    height: calc(100dvh - 64px);
    border-top: 0; border-right: 1px solid var(--structure);
    padding: var(--espace-3) var(--espace-2);
  }
  .nav-principale ul { flex-direction: column; gap: .35rem; padding: 0; }
  .nav-principale a {
    flex-direction: row; justify-content: flex-start; gap: .75rem;
    min-height: 52px; padding: .35rem .5rem; font-size: 1.125rem; text-align: left;
  }
  .nav-icone { width: 2.75rem; height: 2.25rem; }
  main { grid-area: contenu; width: 100%; padding: var(--espace-4) var(--espace-4) var(--espace-5); }
  .pied { grid-area: pied; }
  .recherche-globale { display: block; flex: 0 1 22rem; margin-right: var(--espace-1); }
  .bouton-recherche-mobile { display: none; }
  .bouton-icone .libelle-large { display: inline; }
}

/* ---------- Fil d'Ariane ---------- */
.ariane ol {
  display: flex; flex-wrap: wrap; gap: .25rem .5rem;
  list-style: none; padding: 0; margin: 0 0 var(--espace-3);
  font-size: var(--t-petit); color: var(--encre-douce);
}
.ariane li + li::before { content: "›"; margin-right: .5rem; color: var(--encre-douce); }
.ariane a { color: var(--encre-douce); display: inline-block; padding-block: .6rem; }
.ariane [aria-current="page"] { color: var(--encre); padding-block: .6rem; display: inline-block; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .6rem 1.5rem;
  border-radius: var(--rayon-pilule);
  border: 2px solid var(--accent);
  background: var(--accent); color: var(--fond);
  font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background-color var(--duree) var(--courbe), border-color var(--duree) var(--courbe), transform var(--duree) var(--courbe);
}
.bouton:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--fond); }
.bouton:active { transform: translateY(1px); }
.bouton svg { width: 20px; height: 20px; }
.bouton--secondaire { background: transparent; color: var(--feuillage); border-color: var(--feuillage); }
.bouton--secondaire:hover { background: var(--feuillage); color: var(--fond); border-color: var(--feuillage); }
.bouton--discret { background: transparent; color: var(--feuillage); border-color: transparent; padding-inline: .75rem; }
.bouton--discret:hover { background: var(--feuillage-voile); border-color: transparent; color: var(--feuillage); }
.bouton[disabled], .bouton[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.groupe-boutons { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* ---------- Étiquettes & pastilles ---------- */
.etiquette {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .15rem .75rem .15rem .55rem;
  border-radius: var(--rayon-pilule);
  font-size: var(--t-petit); font-weight: 600; line-height: 1.6;
  background: var(--fond-2); color: var(--encre);
  border: 1px solid var(--structure);
}
.etiquette svg { width: 16px; height: 16px; flex: none; }
.etiquette--saison { background: var(--accent-surface-2); color: var(--accent); border-color: transparent; }
.etiquette--verifier { background: transparent; color: var(--encre-douce); border-style: dashed; font-weight: 400; }
.etiquette--local { background: var(--accent-surface); color: var(--accent-2); border-color: transparent; }
.liste-etiquettes { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: 0 0 var(--espace-2); }

.souligne-saison {
  background-image: linear-gradient(var(--accent-motif), var(--accent-motif));
  background-size: 100% .28em; background-position: 0 88%; background-repeat: no-repeat;
  padding-inline: .05em;
}

/* ---------- Surfaces & blocs ---------- */
.bloc {
  background: var(--fond-2);
  border-radius: var(--rayon-l);
  padding: var(--espace-3);
}
.bloc--saison { background: var(--accent-surface); }
.bloc--organique { border-radius: 2.25rem 3.5rem 2rem 4rem / 2.5rem 2rem 3.5rem 2.25rem; }
.bloc--sombre { background: var(--feuillage); color: var(--fond); }
.bloc--sombre a { color: var(--accent-2-sombre); }
.bloc--sombre .accent { color: var(--accent-sombre); }
.bloc--bordure { background: transparent; border: 1px solid var(--structure); }

.motif-saison { color: var(--accent-motif); }
.motif-saison svg { width: 100%; height: auto; }

/* ---------- Photo (emplacement réutilisable) ---------- */
.photo {
  position: relative; margin: 0;
  aspect-ratio: var(--ratio, 4 / 5);
  border-radius: var(--rayon-l);
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--structure) 45%, transparent) 14px 15px),
    var(--fond-2);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo__brief {
  position: absolute; left: .75rem; right: .75rem; bottom: .75rem;
  display: flex; gap: .5rem; align-items: flex-start;
  padding: .6rem .8rem;
  background: var(--fond); color: var(--encre-douce);
  border-radius: var(--rayon-m);
  font-size: var(--t-petit); line-height: 1.4;
}
.photo__brief svg { width: 20px; height: 20px; flex: none; margin-top: .1rem; color: var(--encre-douce); }
.photo__illu { position: absolute; inset: 12% 15% 30%; color: var(--accent-motif); opacity: .85; }
.photo__illu svg { width: 100%; height: 100%; }

/* ---------- Formulaires ---------- */
.champ { display: grid; gap: .35rem; margin-bottom: var(--espace-2); }
.champ label, .champ legend, .libelle { font-weight: 600; }
.champ .aide { font-size: var(--t-petit); color: var(--encre-douce); margin: 0; }
input[type="text"], input[type="search"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], select, textarea {
  min-height: var(--cible);
  padding: .55rem .85rem;
  background: var(--fond); color: var(--encre);
  border: 1.5px solid color-mix(in srgb, var(--encre) 55%, var(--fond)); /* ≥ 3:1 pour les contours de champs */
  border-radius: var(--rayon-s);
  width: 100%;
}
textarea { min-height: 7rem; resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 var(--espace-3); min-width: 0; }
legend { padding: 0; margin-bottom: .5rem; font-weight: 600; }
.choix {
  display: flex; align-items: center; gap: .6rem;
  min-height: var(--cible); cursor: pointer;
}
.choix input { width: 1.35rem; height: 1.35rem; accent-color: var(--feuillage); flex: none; }
.choix-cartes { display: grid; gap: .6rem; }
.choix-carte {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .85rem 1rem; border: 1.5px solid var(--structure); border-radius: var(--rayon-m);
  cursor: pointer;
}
.choix-carte:has(input:checked) { border-color: var(--feuillage); background: var(--feuillage-voile); }
.choix-carte input { width: 1.35rem; height: 1.35rem; margin-top: .2rem; accent-color: var(--feuillage); flex: none; }
.message-erreur { color: var(--accent); font-weight: 600; }
.message-info {
  padding: var(--espace-2) var(--espace-3); border-radius: var(--rayon-m);
  background: var(--feuillage-voile); border-left: 4px solid var(--feuillage);
}

/* Sélecteur de quantité */
.quantite { display: inline-flex; align-items: center; border: 1.5px solid var(--structure); border-radius: var(--rayon-pilule); }
.quantite button {
  width: var(--cible); height: var(--cible); border: 0; background: transparent;
  border-radius: var(--rayon-pilule); cursor: pointer; font-size: 1.3rem; line-height: 1; color: var(--feuillage);
}
.quantite button:hover { background: var(--accent-surface); }
.quantite output, .quantite span { min-width: 2.2rem; text-align: center; font-weight: 600; }

/* ---------- Listes éditoriales (pas de grilles de cartes identiques) ---------- */
.liste-sobre { list-style: none; padding: 0; margin: 0; }
.liste-sobre > li { padding-block: var(--espace-2); border-bottom: 1px solid var(--structure); }
.liste-sobre > li:first-child { border-top: 1px solid var(--structure); }

/* ---------- Pied de page ---------- */
.pied {
  background: var(--feuillage); color: var(--fond);
  margin-top: var(--espace-5);
  border-radius: var(--rayon-l) var(--rayon-l) 0 0;
}
.pied__interieur { max-width: var(--largeur-page); margin: 0 auto; padding: var(--espace-4) var(--espace-2) var(--espace-4); display: grid; gap: var(--espace-3); }
.pied a { color: var(--fond); }
.pied a:hover { color: var(--accent-sombre); }
.pied h2 { font-size: 1.35rem; color: var(--fond); }
.pied .accent { color: var(--accent-sombre); }
.pied ul { list-style: none; padding: 0; margin: 0; }
.pied li a { display: inline-block; padding-block: .45rem; }
.pied__motif { color: var(--accent-2-sombre); opacity: .9; }
.pied :focus-visible { outline-color: var(--accent-sombre); }
@media (min-width: 700px) { .pied__interieur { grid-template-columns: 1.4fr 1fr 1fr; padding-inline: var(--espace-4); } }

/* ---------- Bandeau de date simulée & panneau démo ---------- */
.bandeau-demo {
  background: var(--encre); color: var(--fond);
  font-size: var(--t-petit);
}
.bandeau-demo__interieur {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  max-width: calc(var(--largeur-page) + 20rem); margin: 0 auto; padding: .4rem var(--espace-2);
}
.bandeau-demo a, .bandeau-demo button { color: var(--accent-sombre); }
.bandeau-demo label { font-weight: 600; }
.bandeau-demo select, .bandeau-demo input {
  width: auto; min-height: 40px; background: var(--encre); color: var(--fond);
  border-color: var(--structure); padding: .2rem .6rem;
}
.bandeau-demo button { background: transparent; border: 1px solid var(--accent-sombre); border-radius: var(--rayon-pilule); min-height: var(--cible); padding: 0 1rem; cursor: pointer; }
.bandeau-demo :focus-visible { outline-color: var(--accent-sombre); }

/* ---------- Divers ---------- */
.prix { font-weight: 600; font-variant-numeric: tabular-nums; }
.prix-indicatif { font-size: var(--t-petit); color: var(--encre-douce); }
.chargement { color: var(--encre-douce); min-height: 40vh; }
.gros-chiffre { font-family: var(--police-titre); font-size: clamp(3rem, 2rem + 5vw, 5.5rem); line-height: 1; font-variation-settings: "SOFT" 100; }

.apparition { animation: apparition .5s var(--courbe) both; }
@keyframes apparition { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0ms !important; }
}
