/* Palette tirée du logo : rose poudré + or rose */
:root {
  --bg: #f4e6e3; --card: #fffaf8; --ink: #5a3430; --muted: #9a7469;
  --accent: #b86f5f; --accent-ink: #ffffff; --line: #e6cdc6; --ok: #3f7d58; --warn: #b4501d;
}
.brand { text-align: center; padding: 4px 0 6px; }
/* Le logo JPEG a des coins noirs : on le découpe en cercle */
.brand img { width: 150px; height: 150px; object-fit: contain; display: block; margin: 0 auto; clip-path: circle(48.5%); }
.brand .script { font-family: 'Great Vibes', 'Snell Roundhand', cursive; font-size: 2.6rem; color: var(--accent); line-height: 1.1; }
.brand img:not([hidden]) + .script { display: none; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, 'Segoe UI', sans-serif; }
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 120px; }
h1 { font-size: 1.6rem; margin: 8px 0 2px; }
h2 { font-size: 1.1rem; margin: 22px 0 8px; }
.muted { color: var(--muted); font-size: .92rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 10px 0; }
.banner { border-radius: 12px; padding: 12px 14px; margin: 12px 0; background: var(--card); border: 1px solid var(--accent); }
.banner img { width: 100%; border-radius: 10px; margin-top: 8px; }
.product { display: flex; align-items: center; gap: 12px; }
.product .pic { width: 56px; height: 56px; border-radius: 10px; background: var(--line); display: grid; place-items: center; font-size: 1.6rem; object-fit: cover; flex: none; }
.product .info { flex: 1; min-width: 0; }
.product .name { font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 1.3rem; cursor: pointer; }
.stepper button:active { background: var(--line); }
.stepper span { min-width: 1.4em; text-align: center; font-weight: 600; }
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input, select { width: 100%; padding: 12px; font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.btn { display: block; width: 100%; text-align: center; text-decoration: none; padding: 14px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; cursor: pointer; margin: 8px 0; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: var(--card); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
.bar .in { max-width: 560px; margin: 0 auto; }
.bar .tot { display: flex; justify-content: space-between; font-weight: 700; }
.err { color: var(--warn); font-weight: 600; min-height: 1.2em; }
.ref { font-size: 1.8rem; font-weight: 800; letter-spacing: .06em; color: var(--accent); }
.step { display: flex; gap: 10px; align-items: flex-start; }
.step b { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: .9rem; }
.step.done { opacity: .6; }
.step.next { border: 2px solid var(--accent); }
.back { font-weight: 700; margin-bottom: 6px; }
.counter { font-weight: 700; color: var(--ink); }
.ask { margin: 24px 0 90px; text-align: center; font-size: .9rem; color: var(--muted); }
.ask a { color: var(--accent); font-weight: 700; }
.bar .hint { font-size: .8rem; color: var(--muted); text-align: center; margin-bottom: 4px; }
.vitrine { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; filter: blur(3px); opacity: .75; pointer-events: none; user-select: none; }
.vitrine .v { text-align: center; font-size: .85rem; }
.vitrine .v img, .vitrine .ph { width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: cover; background: var(--line); display: block; margin-bottom: 4px; }
.prod .chk { display: flex; gap: 8px; align-items: center; }
.prod .mini { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; margin-top: 6px; }
.btn.small { width: auto; padding: 8px 12px; margin: 0; }
.btn.file { cursor: pointer; }
.prod .top { display: flex; align-items: center; gap: 12px; }
.prod .top input[type=checkbox] { width: 28px; height: 28px; padding: 0; flex: none; accent-color: var(--accent); }
.prod .mini { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; background: var(--line); margin: 0; }
.prod .nm { flex: 1; min-width: 0; font-size: 1.1rem; }
.product .pic { width: 84px; height: 84px; }
.dirty { color: var(--accent); font-weight: 700; margin: 8px 0; }
.ask { text-align: center; }
.ask p { margin: 0 0 8px; }
.btn.wa { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 260px; margin: 8px auto; }
.btn.wa svg { width: 22px; height: 22px; fill: currentColor; flex: none; }
.ask a.btn { color: var(--accent-ink); }

/* ---------- Écrans larges (tablette et ordinateur) ---------- */
@media (min-width: 760px) {
  main.wide { max-width: 980px; padding: 28px 32px 140px; }
  .bar .in { max-width: 980px; }
  .brand img { width: 170px; height: 170px; }
  .banner img { max-height: 460px; object-fit: contain; }
  #products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
  #products .card { margin: 0; }
  #products .product { flex-direction: column; align-items: stretch; text-align: center; padding: 14px; }
  #products .product .pic { width: 100%; height: auto; aspect-ratio: 1; border-radius: 14px; object-fit: cover; }
  #products .product .stepper { justify-content: center; }
  .form { max-width: 520px; margin: 0 auto; }
  #orders, #toSend { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
  #orders .card, #toSend .card { margin: 0; }
}
@media (min-width: 1100px) {
  main.wide { max-width: 1120px; }
  .bar .in { max-width: 1120px; }
  #products { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* Navigation entre la box et les gâteaux secs */
.tabs { display: flex; gap: 8px; margin: 14px 0 4px; }
.tabs a { flex: 1; text-align: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; font-weight: 600; background: var(--card); }
.tabs a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.product .price { font-weight: 700; color: var(--accent); }
.product select.q { width: 84px; flex: none; padding: 10px; }
@media (min-width: 760px) { .tabs { max-width: 420px; } #products .product select.q { margin: 0 auto; } }

/* Admin : prix des gâteaux secs et sections */
h3 { font-size: 1rem; margin: 18px 0 6px; }
.pricebox { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; }
.pricebox input.price { width: 90px; padding: 8px 10px; }
@media (min-width: 760px) {
  #dryProducts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
  #dryProducts .card { margin: 0; }
}

/* Panier : icône en haut à droite et page récapitulative */
main { position: relative; }
.cartlink { position: fixed; top: 14px; right: 16px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--accent); text-decoration: none; z-index: 5; }
.cartlink svg { width: 24px; height: 24px; fill: currentColor; }
.cartlink .badge { position: absolute; top: -4px; right: -4px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-size: .85rem; font-weight: 700; display: grid; place-items: center; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; }
.line .stepper { flex: none; }
.line.sum { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.card.total { border: 2px solid var(--accent); font-size: 1.1rem; }
.links { display: flex; gap: 8px; flex-wrap: wrap; }
.links .btn { flex: 1; min-width: 180px; }
.btn.off { opacity: .45; pointer-events: none; }
.line > span:first-child { flex: 1; min-width: 0; }

/* Gâteau épuisé : carte grisée */
.product.soldout { opacity: .55; }
.product.soldout .pic { filter: grayscale(1); }
.product.soldout .name { color: var(--muted); }
.soldmsg { color: var(--muted); font-size: .88rem; font-style: italic; margin-top: 4px; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stockline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.stockline .btn.small { margin-left: auto; }

/* Admin : quantité prévue avec − / + */
.qtyrow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.qtyrow > span { font-weight: 600; flex: 1 1 100%; }
.qtyrow .stepper { gap: 6px; }
.qtyrow input.qty { width: 72px; text-align: center; padding: 8px 6px; }
.qtyrow .stepper .five { width: auto; padding: 0 10px; border-radius: 19px; font-size: .95rem; }
