:root {
  --cream: #fbf7f0;
  --paper: #ffffff;
  --ink: #2b2220;
  --muted: #6f625c;
  --accent: #157f31; /* vert du logo (#189838), assombri pour rester lisible sur le fond crème */
  --line: #e6ddd2;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { display: flex; flex-direction: column; min-height: 100vh; margin: 0; background: var(--cream); color: var(--ink); font: 16px/1.6 var(--sans); }
h1, h2, h3, .brand { font-family: var(--serif); font-weight: 600; line-height: 1.25; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: 1800px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 64px); }
main.wrap { flex: 1; width: 100%; padding-top: 32px; padding-bottom: 64px; }

.site-header { background: var(--paper); }
.header-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 16px; padding-bottom: 16px; }
.brand { font-size: 1.4rem; color: var(--accent); text-decoration: none; margin: 0; }
/* Le visage de la fillette du logo, à côté du nom ; le logo entier est sur la page L'Atelier. */
a.brand { display: inline-flex; align-items: center; gap: 14px; font-size: 2rem; }
.brand img { display: block; width: 72px; height: 72px; border-radius: 50%; background: var(--cream); border: 1px solid var(--line); }
.user-nav { display: flex; gap: 20px; align-items: center; margin-left: auto; }
.user-nav a { color: var(--ink); text-decoration: none; }
.user-nav a:hover { color: var(--accent); }
.cart-link { display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px; border: 1px solid var(--accent); border-radius: 999px; }
/* Les rubriques sur un bandeau de la couleur de la marque. */
.main-nav { background: var(--accent); }
.main-nav ul { display: flex; flex-wrap: wrap; gap: 0 32px; margin: 0 auto; list-style: none; }
.main-nav a { display: block; padding: 12px 0 9px; border-bottom: 3px solid transparent; color: #fff; font-weight: 600; text-decoration: none; }
.main-nav a:hover, .main-nav a[aria-current] { border-bottom-color: var(--cream); }
.main-nav a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.hero { padding: 32px 0 16px; max-width: 720px; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 12px; }
.lead { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); font-size: .92rem; }
.price { font-weight: 600; color: var(--accent); }
.notice { background: var(--paper); border-left: 3px solid var(--accent); padding: 8px 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 24px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.card-link { color: inherit; text-decoration: none; }
.card h3 { font-size: 1.1rem; margin: 12px 0 4px; }
.card p { margin: 4px 0; }
.card-placeholder { aspect-ratio: 4 / 3; background: var(--line); border-radius: 6px; }

.breadcrumb { font-size: .9rem; margin-bottom: 16px; }
.product { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.product h1 { margin-top: 0; }
.variants { width: 100%; border-collapse: collapse; margin: 16px 0 8px; }
.variants th, .variants td { text-align: left; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }

.page { max-width: 720px; }
.page-logo { display: block; width: auto; height: 180px; margin: 8px 0 16px; }

.site-footer { background: var(--paper); border-top: 1px solid var(--line); padding: 32px 0; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.site-footer nav { display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 720px) {
  .product { grid-template-columns: 1fr; gap: 24px; }
  .header-top { gap: 8px 12px; padding-top: 12px; padding-bottom: 12px; }
  .brand { font-size: 1.2rem; }
  a.brand { gap: 10px; font-size: 1.45rem; }
  .brand img { width: 52px; height: 52px; }
  .page-logo { height: 120px; }
  .user-nav { gap: 12px; font-size: .95rem; }
  .cart-link { padding: 3px 10px; }
  .main-nav ul { gap: 0 20px; }
  .main-nav a { padding: 7px 0 4px; font-size: .95rem; }
}

/* Panier, commande et compte */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.badge { display: inline-block; min-width: 1.5em; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .8rem; text-align: center; }
.button { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 6px; padding: 8px 16px; font: inherit; cursor: pointer; text-decoration: none; }
.button:hover { filter: brightness(1.1); }
.button-link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; cursor: pointer; }
.qty { width: 4.5em; padding: 4px; font: inherit; }
.add-form { display: flex; gap: 8px; align-items: center; }
.flash { padding: 8px 12px; border-radius: 6px; background: var(--paper); border-left: 3px solid var(--accent); }
.flash-error { border-left-color: #b3261e; }
.cart-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.cart-table th, .cart-table td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cart-table .num { text-align: right; white-space: nowrap; }
.cart-table tfoot th { font-weight: 600; }
.cart-table .total th, .cart-table .total td { font-size: 1.1rem; font-weight: 600; }
.actions { display: flex; gap: 16px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.steps { display: flex; gap: 24px; list-style: none; padding: 0; color: var(--muted); counter-reset: step; flex-wrap: wrap; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step) ". "; }
.steps li[aria-current="step"] { color: var(--accent); font-weight: 600; }
.checkout-form fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin: 0 0 20px; background: var(--paper); }
.checkout-form legend { font-family: var(--serif); font-weight: 600; padding: 0 6px; }
.checkout-form > div, .checkout-form fieldset > div { margin-bottom: 12px; }
.checkout-form label { display: block; margin-bottom: 4px; }
.checkout-form input[type=text], .checkout-form input[type=email], .checkout-form input[type=password], .checkout-form input[type=tel], .checkout-form textarea { width: 100%; max-width: 420px; padding: 8px; font: inherit; border: 1px solid var(--line); border-radius: 6px; }
.checkout-form input[type=radio], .checkout-form input[type=checkbox] { margin-right: 6px; }
.checkout-form #id_fulfilment label { display: flex; align-items: center; }
.checkout-form .helptext { color: var(--muted); font-size: .9rem; }
/* Sur grand écran, les blocs de la commande se rangent côte à côte, sur trois colonnes au plus. */
.checkout-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(max(min(100%, 340px), calc((100% - 48px) / 3)), 1fr)); gap: 0 24px; align-items: start; }
.checkout-columns > fieldset { min-width: 0; }
.checkout-columns > .actions { grid-column: 1 / -1; }
.errorlist { color: #b3261e; list-style: none; padding: 0; margin: 0 0 4px; }
/* L'adresse et le délai de livraison ne servent qu'à Colissimo. */
.checkout-form:has(input[name=fulfilment]:checked):not(:has(input[name=fulfilment][value=colissimo]:checked)) :is(.address-fields, .delivery-fields) { display: none; }
/* Délai de livraison (standard, Noël, Nouvel An) sous le mode de remise. */
.checkout-form .delivery-fields { margin-top: 16px; }
.checkout-form .delivery-fields legend { padding: 0; margin-bottom: 8px; }
.checkout-form #id_delivery label { display: flex; align-items: baseline; }
.checkout-form #id_delivery > div { margin-bottom: 8px; }
.choice-help { display: block; color: var(--muted); font-size: .9rem; }
/* Adresses suggérées sous le champ « Adresse » (Base Adresse Nationale). */
.address-suggestions ul { list-style: none; max-width: 420px; margin: 4px 0 0; padding: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.address-suggestion { display: block; width: 100%; padding: 8px; font: inherit; color: inherit; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); cursor: pointer; }
.address-suggestions li:first-child .address-suggestion { border-top: 0; }
.address-suggestion:hover, .address-suggestion:focus { background: var(--cream); outline: none; }
.address-suggestion:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
/* Bloc de validation du récapitulatif : message pour l'atelier, conditions et bouton d'un seul tenant, aligné à
   gauche sous le total ; pleine largeur sur mobile. */
/* Récapitulatif : coordonnées et livraison l'une sous l'autre, dans la même colonne que le bloc de validation. */
.review-stack { grid-template-columns: 1fr; gap: 8px; max-width: 520px; }
.review-stack h2 { margin-bottom: 8px; }
.review-confirm { max-width: 520px; margin: 0; padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
.review-confirm textarea { max-width: none; }
.review-confirm .muted { font-size: .9rem; margin: 0 0 16px; }
.review-confirm .button { display: block; width: 100%; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px 40px; margin: 24px 0; }
.narrow { max-width: 480px; }
.address-card { border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 12px; }
.inline { display: flex; gap: 16px; }
.checkout-form fieldset fieldset { border: 0; padding: 0; margin: 0; background: none; }
.terms label { display: flex; align-items: baseline; gap: 6px; }
.pay-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.button-paypal { background: #ffc439; color: #111; }
.muted-on-dark { font-size: .85rem; opacity: .8; }

/* Panier : ce qui manque pour la livraison offerte. */
.free-shipping { margin: 12px 0 0; text-align: right; }
.free-shipping-ok strong { color: var(--accent); }

/* Pages d'erreur (404, 403, 400, 500, page expirée). */
.error-page { max-width: 640px; margin: 24px auto 0; text-align: center; }
.error-code { margin: 0; font-family: var(--serif); font-size: clamp(4rem, 14vw, 7rem); font-weight: 600; line-height: 1; color: var(--accent); }
.error-page h1 { margin-top: 8px; }
.error-page .notice { text-align: left; }
.error-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; padding: 0; margin: 0 0 24px; }
.error-links a { display: block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); text-decoration: none; }
.error-links a:hover { border-color: var(--accent); }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 20px; margin-top: 24px; }

/* Annonces de la gestion : alerte en bandeau tout en haut, nouvelle dans une fenêtre au-dessus du site assombri. */
.site-alert { background: #fdf3d4; border-bottom: 1px solid #e8c766; color: var(--ink); }
.site-alert p { margin: 0 auto; padding-top: 10px; padding-bottom: 10px; text-align: center; }
body:has(.news-overlay) { overflow: hidden; }
.news-overlay { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgb(43 34 32 / .6); backdrop-filter: blur(2px); }
.news-dialog { position: static; width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; margin: 0; padding: 24px; border: 0; border-top: 6px solid var(--accent); border-radius: 10px; background: var(--paper); color: var(--ink); box-shadow: 0 20px 50px rgb(0 0 0 / .3); }
.news-dialog:modal { position: fixed; inset: 0; height: fit-content; margin: auto; }
.news-dialog::backdrop { background: transparent; }  /* le voile est déjà celui de .news-overlay */
.news-item + .news-item { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.news-label { margin: 0; color: var(--accent); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.news-item h2 { margin: 4px 0 8px; font-size: 1.4rem; }
.news-item p:last-child { margin: 0; }
.news-actions { margin: 24px 0 0; text-align: right; }
.news-actions .button { min-width: 96px; }
