body { font-family: sans-serif; max-width: 1100px; margin: auto; padding: 1rem; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.produit { border: 1px solid #ddd; border-radius: 8px; padding: 1rem; }
.prix { font-weight: bold; color: #2a7; }
.erreur { color: #c0392b; background: #fdecea; padding: .5rem .8rem; border-radius: 6px; }
.aide   { display: block; color: #777; margin: -.3rem 0 .8rem; }
.aide.ok { color: #2a7; }

/* ===== Palette & typographie ===== */
:root {
  --ecru:      #f7f1e8;
  --avoine:    #e9dfcf;
  --lin:       #fffdf9;
  --brun:      #4a3b2f;
  --brun-doux: #7a6a5c;
  --terre:     #b5643c;
  --sapin:     #3f5b4a;
  --sapin-f:   #2f4538;
  --ombre:     0 2px 4px rgba(74,59,47,.06), 0 8px 24px rgba(74,59,47,.08);
  --rayon:     14px;
  --titre:     "Fraunces", Georgia, serif;
  --texte:     "Nunito", system-ui, sans-serif;
}

/* ===== Fond tricoté ===== */
body {
  margin: 0;
  font-family: var(--texte);
  color: var(--brun);
  line-height: 1.6;
  background-color: var(--ecru);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12' viewBox='0 0 16 12'%3E%3Cpath d='M2 1.5 L8 10 L14 1.5' fill='none' stroke='%23e3d6c2' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

main, body > h1, body > .grille, body > table, body > p, body > form, body > a {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  box-sizing: border-box;
}

/* ===== Navigation ===== */
nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem;
  padding: .9rem max(1.25rem, calc((100% - 1100px) / 2 + 1.25rem));
  background: rgba(255,253,249,.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--avoine);
  font-size: .95rem;
}
nav a { color: var(--brun); text-decoration: none; font-weight: 600; }
nav a:hover { color: var(--terre); }
nav form { margin: 0; }

/* ===== Titres ===== */
h1, h2 { font-family: var(--titre); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin: 2.5rem auto 1.5rem; }
h1::after {
  content: ""; display: block; width: 64px; height: 3px; margin-top: .6rem;
  background: var(--terre); border-radius: 2px;
}

/* ===== Bannière d'accueil ===== */
.hero {
  max-width: 1100px; margin: 2rem auto 0; padding: 3.5rem 2rem;
  box-sizing: border-box; border-radius: var(--rayon);
  background: linear-gradient(135deg, var(--sapin) 0%, var(--sapin-f) 100%);
  color: var(--ecru); box-shadow: var(--ombre);
}
.hero h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 .5rem; }
.hero p  { margin: 0; max-width: 34rem; opacity: .9; font-size: 1.1rem; }

/* ===== Catalogue ===== */
.grille {
  display: grid; gap: 1.5rem; padding-bottom: 3rem;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.produit {
  background: var(--lin); border-radius: var(--rayon); padding: 1.4rem;
  box-shadow: var(--ombre); border: 1px solid var(--avoine);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex; flex-direction: column;
}
.produit:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(74,59,47,.14); }
.produit h2 { font-size: 1.25rem; margin: 0 0 .3rem; }
.produit a {
  margin-top: auto; align-self: flex-start;
  color: var(--sapin); font-weight: 700; text-decoration: none;
  border-bottom: 2px solid transparent;
}
.produit a:hover { border-color: var(--terre); }

.prix { font-family: var(--titre); font-size: 1.3rem; font-weight: 600; color: var(--terre); margin: .2rem 0 1rem; }
.categorie {
  display: inline-block; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  background: var(--avoine); color: var(--brun-doux); padding: .2rem .7rem; border-radius: 99px;
}
.rupture { color: var(--brun-doux); font-style: italic; }

/* ===== Boutons ===== */
button {
  font: inherit; font-weight: 700; cursor: pointer;
  background: var(--sapin); color: var(--ecru);
  border: none; border-radius: 99px; padding: .65rem 1.4rem;
  transition: background .2s ease, transform .1s ease;
}
button:hover  { background: var(--sapin-f); }
button:active { transform: scale(.97); }
nav button, td button {
  background: transparent; color: var(--brun-doux); padding: .3rem .8rem;
  border: 1px solid var(--avoine);
}
nav button:hover, td button:hover { background: var(--avoine); color: var(--brun); }

/* ===== Formulaires ===== */
form label { display: block; font-weight: 600; margin-bottom: .9rem; }
input[type=email], input[type=password], input[type=text], input[type=number] {
  display: block; width: 100%; max-width: 420px; box-sizing: border-box; margin-top: .3rem;
  font: inherit; padding: .65rem .9rem;
  background: var(--lin); color: var(--brun);
  border: 1.5px solid var(--avoine); border-radius: 10px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input[type=number] { display: inline-block; width: 5rem; margin-right: .5rem; }
input:focus { outline: none; border-color: var(--sapin); box-shadow: 0 0 0 3px rgba(63,91,74,.15); }

.erreur { color: #9b3a1f; background: #f8e6dc; border-left: 4px solid var(--terre); padding: .6rem .9rem; border-radius: 6px; }
.aide    { display: block; color: var(--brun-doux); margin: -.5rem 0 .9rem; font-size: .9rem; }
.aide.ok { color: var(--sapin); }

/* ===== Panier ===== */
table {
  width: 100%; border-collapse: collapse; background: var(--lin);
  border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre);
}
th { text-align: left; background: var(--avoine); font-weight: 700; }
th, td { padding: .8rem 1rem; }
tr + tr td { border-top: 1px solid var(--avoine); }

/* ===== Mobile ===== */
@media (max-width: 600px) {
  .hero { margin: 1rem; padding: 2.2rem 1.4rem; }
  th, td { padding: .6rem; font-size: .9rem; }
}

/* ===== Images produits ===== */
.vignette {
  display: block; margin: -1.4rem -1.4rem 1rem; border-bottom: none !important;
  aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: var(--rayon) var(--rayon) 0 0; background: var(--avoine);
}
.vignette img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s ease;
}
.produit:hover .vignette img { transform: scale(1.05); }

.vignette-vide {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 3rem;
  background: repeating-linear-gradient(45deg, var(--avoine) 0 10px, #e2d6c3 10px 20px);
}

/* ===== Fiche produit ===== */
.fiche {
  max-width: 1100px; margin: 0 auto 3rem; padding: 0 1.25rem; box-sizing: border-box;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; align-items: start;
}
.fiche-image {
  aspect-ratio: 4 / 5; border-radius: var(--rayon); overflow: hidden;
  box-shadow: var(--ombre); background: var(--avoine);
}
.fiche-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fiche-infos .prix { font-size: 1.8rem; }

@media (max-width: 760px) {
  .fiche { grid-template-columns: 1fr; gap: 1.5rem; }
}
nav a.bouton-jeu {
  background: var(--terre); color: #fff; text-decoration: none;
  padding: .3rem .9rem; border-radius: 99px; font-weight: 700;
}
nav a.bouton-jeu:hover { filter: brightness(1.1); }