/* Atelier Commande — thème provisoire (à aligner sur la nouvelle DA : il suffit de changer les variables) */
:root {
  --bg: #f7f3ec;
  --surface: #ffffff;
  --ink: #16130f;
  --muted: #6d655a;
  --line: #e6dfd3;
  --accent: #b8402b;
  --accent-ink: #ffffff;
  --ok: #2f7d4f;
  --radius: 14px;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 1px 2px rgba(22, 19, 15, .06), 0 6px 24px rgba(22, 19, 15, .06);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* Hero */
.hero { background: var(--ink); color: #f4efe6; padding: 56px 16px 40px; }
.hero__inner { max-width: 1080px; margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: 12px; opacity: .7; margin: 0 0 8px; }
.hero h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(40px, 8vw, 72px); line-height: 1; margin: 0 0 14px; letter-spacing: -.01em; }
.hero__lead { max-width: 520px; margin: 0 0 20px; color: #d9d2c5; font-size: 17px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 14px; color: #d9d2c5; }
.hero__meta a { color: #fff; text-decoration: none; font-weight: 600; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.pill--open { background: #2f7d4f; color: #fff; }
.pill--closed { background: #57504a; color: #fff; }
.notice { margin: 18px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; }
.notice--soft { background: rgba(255,255,255,.1); font-weight: 500; }

/* Mode */
.mode { display: flex; gap: 6px; max-width: 1080px; margin: -22px auto 0; padding: 0 16px; position: relative; }
.mode__btn { flex: 1; max-width: 200px; padding: 12px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; font-weight: 600; color: var(--muted); box-shadow: var(--shadow); }
.mode__btn.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Catégories */
.cats { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 14px 16px; background: rgba(247, 243, 236, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: none; padding: 7px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.cats a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (min-width: 1112px) { .cats { justify-content: center; } }

/* Carte */
.menu { max-width: 1080px; margin: 0 auto; padding: 8px 16px 120px; }
.cat h2 { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin: 32px 0 14px; }
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card.is-out { opacity: .55; cursor: default; }
.card__img { position: relative; flex: none; width: 104px; height: 104px; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #efe6d8, #e2d4bf); }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__ph { display: grid; place-items: center; width: 100%; height: 100%; font-family: var(--font-display); font-size: 40px; color: rgba(22,19,15,.25); }
.tag { position: absolute; left: 6px; top: 6px; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; text-transform: uppercase; letter-spacing: .04em; }
.tag--hot { background: var(--accent); color: #fff; }
.card__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.card h3 { font-size: 16px; margin: 2px 0 4px; line-height: 1.25; }
.card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ico { font-size: 13px; margin-left: 2px; }
.card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; padding-top: 8px; }
.add { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 22px; line-height: 1; }
.out { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; }

/* Pied de page */
.foot { background: var(--ink); color: #d9d2c5; padding: 40px 16px 120px; display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .foot { grid-template-columns: repeat(3, 1fr); padding-left: max(16px, calc(50% - 540px)); padding-right: max(16px, calc(50% - 540px)); } }
.foot h2 { font-family: var(--font-display); color: #fff; font-weight: 600; margin: 0 0 8px; }
.foot h3 { color: #fff; font-size: 14px; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 10px; }
.foot a { color: #fff; }
.hours { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.hours li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.legal { grid-column: 1 / -1; font-size: 13px; opacity: .7; margin: 0; }

/* Barre panier */
.cartbar { position: fixed; z-index: 10; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 12px; padding: 14px 18px; border: 0; border-radius: 99px; background: var(--accent); color: #fff; font-weight: 600; box-shadow: 0 10px 30px rgba(184, 64, 43, .35); }
.cartbar[hidden] { display: none; }
.cartbar__count { display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 99px; background: rgba(255,255,255,.22); font-size: 14px; }
.cartbar strong { margin-left: auto; }

/* Feuilles (fiche produit + panier) */
.sheet { border: 0; padding: 0; width: 100%; max-width: 560px; max-height: 92vh; margin: auto auto 0; border-radius: 20px 20px 0 0; background: var(--surface); color: var(--ink); }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 20px; } }
.sheet::backdrop { background: rgba(22, 19, 15, .5); }
.sheet__inner { padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
.sheet__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet h2 { font-family: var(--font-display); font-size: 26px; font-weight: 600; margin: 0; }
.x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 22px; line-height: 1; }
.sheet__img { margin: -20px -18px 16px; height: 220px; background: linear-gradient(135deg, #efe6d8, #e2d4bf); }
.sheet__img img { width: 100%; height: 100%; object-fit: cover; }
.desc { color: var(--muted); margin: 6px 0 4px; }
.allerg { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.opt { border: 0; margin: 16px 0 0; padding: 0; }
.opt legend { font-weight: 700; margin-bottom: 6px; }
.opt label { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.opt label span:last-child { margin-left: auto; color: var(--muted); font-size: 14px; }
.opt input { accent-color: var(--accent); width: 18px; height: 18px; }
.qty { display: flex; align-items: center; gap: 14px; margin: 18px 0; }
.qty button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-size: 20px; }
.qty output { font-weight: 700; min-width: 20px; text-align: center; }

.cta { width: 100%; padding: 15px; border: 0; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 16px; }
.cta:disabled { opacity: .6; }

.lines { list-style: none; margin: 0; padding: 0; }
.lines li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.lines .name { font-weight: 600; }
.lines .opts { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); line-height: 1; }
.empty { color: var(--muted); padding: 20px 0; text-align: center; }

.checkout fieldset { border: 0; margin: 18px 0 0; padding: 0; }
.checkout legend { font-weight: 700; margin-bottom: 8px; }
.checkout input:not([type=radio]), .checkout select, .checkout textarea { width: 100%; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; color: inherit; }
.checkout input:focus, .checkout select:focus, .checkout textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.row { display: grid; grid-template-columns: 130px 1fr; gap: 8px; }
.seg { display: flex; gap: 8px; }
.seg label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 15px; }
.seg label:has(input:checked) { border-color: var(--accent); background: #fbefec; color: var(--accent); }
.seg input { accent-color: var(--accent); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.hint.is-bad { color: var(--accent); font-weight: 600; }
.hp { position: absolute; left: -9999px; }
.totals { margin: 18px 0 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.totals div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.totals__grand { color: var(--ink) !important; font-weight: 700; font-size: 18px; }
.error { color: var(--accent); font-weight: 600; min-height: 1em; margin: 6px 0 10px; }
[hidden] { display: none !important; }

/* Page de suivi */
.track { max-width: 560px; margin: 0 auto; padding: 32px 16px 60px; }
.track h1 { font-family: var(--font-display); font-weight: 600; font-size: 34px; margin: 0 0 4px; }
.steps { list-style: none; padding: 0; margin: 24px 0; }
.steps li { display: flex; gap: 12px; align-items: center; padding: 12px 0; color: var(--muted); }
.steps li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.steps li.done { color: var(--ink); }
.steps li.done::before { background: var(--ok); border-color: var(--ok); }
.steps li.current { color: var(--ink); font-weight: 700; }
.steps li.current::before { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px rgba(184,64,43,.15); }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
