/* Charte Patisland : Josefin Sans (titres) + DM Sans (texte), encre #14110F, crème #FBF8F3, framboise #A63D5A, rose #F6E4E4 */
@import url("https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300;400;600&family=DM+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #FBF8F3;
  --card: #FFFFFF;
  --ink: #14110F;
  --muted: #5C554C;
  --line: #EBD9D9;
  --rose: #F6E4E4;
  --rose-2: #F0D5D6;
  --brand: #A63D5A;
  --brand-light: #F2A7BB;
  --ok: #2F6B4A;
  --warn: #9A5B12;
  --danger: #A12A2A;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.55;
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
}
h1, h2, h3, .title {
  font-family: "Josefin Sans", sans-serif; font-weight: 300; text-transform: uppercase;
  letter-spacing: .03em; line-height: 1.15; margin: 0;
}
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--ink); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--brand); font-weight: 600; }

/* En-tête (comme le site) */
header.top {
  position: sticky; top: 0; z-index: 20; background: var(--bg); box-shadow: 0 1px 0 var(--line);
  padding-top: env(safe-area-inset-top);
}
header.top .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
header.top .logo { height: 32px; width: auto; display: block; }
header.top .date { font-size: 13px; color: var(--muted); text-align: right; line-height: 1.3; }
.tabs { display: flex; }
.tabs button {
  flex: 1; border: 0; background: none; padding: 12px 4px; font-size: 15px; color: var(--muted);
  border-bottom: 2px solid transparent; min-height: 46px;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); font-weight: 600; }
.tabs .badge { background: var(--brand); color: #fff; padding: 1px 7px; font-size: 12px; margin-left: 4px; border-radius: 99px; }

/* Bandeau d'intro, style « hero » sombre du site */
.intro { background: var(--ink); color: var(--bg); padding: 26px 0 24px; }
.intro .eyebrow { color: var(--brand-light); }
.intro h2 { font-size: 30px; margin: 8px 0 10px; color: var(--bg); }
.intro p { color: #D9D0C2; font-size: 15px; }

.banner { border: 1px solid var(--line); background: var(--rose); padding: 12px 14px; margin: 16px 0 0; font-size: 14px; color: var(--muted); }
.banner.closed { background: #FBE9E9; border-color: #E9C3C3; color: var(--danger); font-weight: 600; }
.banner.demo { background: #fff; border-style: dashed; }

/* Produits : cartes blanches, bord rose, angles droits */
.grid { display: grid; gap: 14px; margin-top: 16px; }
.prod { display: flex; background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden; }
.prod.out { opacity: .55; }
.prod .ph { width: 116px; min-height: 116px; flex: none; position: relative; transition: width .35s ease; background: var(--rose-2) center/cover no-repeat; display: flex; align-items: center; justify-content: center; }
.prod .ph img.mark { width: 40px; opacity: .35; }
.prod .info { flex: none; width: calc(100% - 116px); min-width: 0; max-height: 1200px; transition: max-height .35s ease; padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 4px; }
.prod h3 { font-size: 17px; font-weight: 400; }
.prod .desc { color: var(--muted); font-size: 14px; }
.prod .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.price { font-weight: 600; font-size: 16px; }
.left { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ok); }
.left.low { color: var(--warn); }
.left.zero { color: var(--danger); }

.stepper { display: flex; align-items: center; border: 1px solid var(--ink); }
.stepper button { width: 40px; height: 40px; border: 0; background: #fff; font-size: 20px; line-height: 1; }
.stepper button.plus { background: var(--ink); color: var(--bg); }
.stepper button.plus:active { background: var(--brand); }
.stepper button:disabled { opacity: .3; }
.stepper span { min-width: 30px; text-align: center; font-weight: 600; }
.add { border: 2px solid var(--ink); background: var(--ink); color: var(--bg); height: 42px; padding: 0 18px; font-weight: 500; }
.add:active { background: var(--brand); border-color: var(--brand); }

/* Boutons : rectangles noirs, survol framboise (comme le site) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px;
  background: var(--ink); color: var(--bg); border: 2px solid var(--ink); font-weight: 500; font-size: 16px; text-decoration: none;
}
.btn:active { background: var(--brand); border-color: var(--brand); }
@media (hover: hover) { .btn:hover { background: var(--brand); border-color: var(--brand); } .btn.alt:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); } }
.btn:disabled { opacity: .45; }
.btn.alt { background: transparent; color: var(--ink); }
.btn.alt:active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn.ok { background: var(--ok); border-color: var(--ok); }
.btn.danger { background: transparent; color: var(--danger); border-color: #E2B9B9; }
.btn.block { width: 100%; }

.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(251,248,243,0), var(--bg) 35%); }
.cartbar .btn { width: 100%; max-width: 688px; margin: 0 auto; display: flex; justify-content: space-between; box-shadow: 0 8px 24px rgba(20,17,15,.25); }

/* Fenêtres du bas */
.sheet-bg { position: fixed; inset: 0; background: rgba(20, 17, 15, .55); z-index: 50; display: none; align-items: flex-end; justify-content: center; }
.sheet-bg.show { display: flex; }
.sheet { background: var(--bg); width: 100%; max-width: 720px; padding: 24px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow: auto; animation: up .2s ease-out; border-top: 3px solid var(--brand); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { font-size: 24px; margin: 6px 0 16px; }
.lines { background: var(--card); border: 1px solid var(--line); padding: 2px 14px; margin-bottom: 16px; }
.lines div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.lines div:last-child { border-bottom: 0; }
.lines .total { font-weight: 600; }
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 6px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], textarea, select {
  width: 100%; padding: 13px 12px; border: 1px solid #D9C6C6; border-radius: 0; background: #fff; font-size: 16px; -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--brand-light); border-color: var(--brand); }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.actions { display: flex; gap: 10px; margin-top: 18px; }
.actions > * { flex: 1; }

/* Réservations du client */
.order { background: var(--card); border: 1px solid var(--line); padding: 16px; margin-top: 14px; }
.order header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.status { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border: 1px solid currentColor; white-space: nowrap; }
.status.reserved { color: var(--brand); }
.status.picked_up { color: var(--ok); }
.status.cancelled { color: #8A8074; }
.empty { text-align: center; color: var(--muted); padding: 48px 10px; }
.empty img { width: 54px; opacity: .25; margin-bottom: 12px; }
.empty h3 { font-size: 20px; color: var(--ink); margin-bottom: 6px; }

.success { text-align: center; }
.success .check { width: 60px; height: 60px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 28px; display: grid; place-items: center; margin: 4px auto 12px; }

#toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translate(-50%, -30px); background: var(--ink); color: var(--bg); padding: 12px 18px; opacity: 0; transition: .25s; z-index: 300; max-width: 90vw; font-size: 15px; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); }
#toast.ok { background: var(--ok); }

.install { display: none; }
.install.show { display: block; }
.skeleton { height: 118px; border: 1px solid var(--line); background: linear-gradient(90deg, #F6EEE9, #FBF6F2, #F6EEE9); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
footer.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 36px 0 10px; }
footer.foot img { height: 64px; display: block; margin: 0 auto 10px; }

.status.no_show { color: var(--danger); }
.badge-warn { display:inline-block; font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color: var(--danger); border:1px solid #E2B9B9; padding:2px 6px; margin-left:6px; vertical-align:middle; }

[hidden] { display: none !important; }

/* Allergènes */
.allergens { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 2px; }
.alg { font-size: 11px; line-height: 1.2; padding: 3px 6px; background: var(--rose); color: var(--muted); white-space: nowrap; }
/* Numéro de retrait */
.orderno { margin: 14px auto 6px; border: 2px solid var(--ink); padding: 10px 14px; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.orderno span { font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.orderno strong { font-family: "Josefin Sans", sans-serif; font-weight: 300; font-size: 44px; line-height: 1.1; }
.orderno-sm { font-family: "Josefin Sans", sans-serif; font-size: 22px; font-weight: 400; color: var(--brand); margin-top: 2px; }
.no-badge { font-family: "Josefin Sans", sans-serif; font-weight: 400; font-size: 20px; background: var(--ink); color: var(--bg); padding: 2px 8px; margin-right: 8px; vertical-align: middle; }

/* Légende des allergènes : les cases occupent toute la largeur */
.allergens.legend { margin-top: 10px; gap: 6px; }
.allergens.legend .alg { flex: 1 1 auto; text-align: center; font-size: 13px; padding: 7px 8px; }

/* Choix sur un produit (ex : avec / sans sucre perlé) */
.opts { margin-top: 10px; border-top: 1px dashed var(--line, #D9CFC2); padding-top: 8px; }
.opt-title { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.optrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14px; }
.optrow .add { min-width: 0; }

/* Pays d'origine */
.origin { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 2px 5px; border: 1px solid #E5D9CC; background: #fff; font-size: 11px; color: #5A5048; width: fit-content; }
.flag { width: 16px; height: 11px; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.12); }
/* Ligne sous le titre : origine à gauche, kilocalories à droite */
.meta { display: flex; align-items: center; justify-content: space-between; gap: 4px; flex-wrap: wrap; margin: 2px 0 6px; }
.kcal { margin-left: auto; padding: 2px 5px; border: 1px solid #E5D9CC; background: #fff; font-size: 11px; color: #5A5048; white-space: nowrap; }

/* Règlement */
.rules { display: grid; gap: 8px; margin-bottom: 6px; }
.rule { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid #E5D9CC; background: #fff; font-size: 14px; line-height: 1.45; cursor: pointer; }
.rule input { flex: none; width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--brand); }
.rule:has(input:checked) { border-color: var(--brand); background: #FFF7F9; }

/* Photo agrandie au toucher : la photo glisse vers la droite et prend toute la carte */
.prod .ph[data-zoom] { cursor: zoom-in; }
.zoom-hint { position: absolute; right: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px; background: rgba(20,16,14,.62); color: #fff; font-size: 11px; line-height: 1; }
.zoom-hint svg { width: 16px; height: 16px; }
.zoom-hint b { font-weight: 500; }
.prod.zoom .ph { width: 100%; aspect-ratio: 1 / 1; min-height: 0; cursor: zoom-out; }
.prod.zoom .info { max-height: 0; overflow: hidden; }
.prod.zoom .zoom-hint b { display: inline; }
.prod.zoom .zoom-hint svg { display: none; }
.prod.zoom .zoom-hint b::before { content: "Toucher pour revenir"; }
.prod.zoom .zoom-hint b { font-size: 0; }
.prod.zoom .zoom-hint b::before { font-size: 12px; }
@media (prefers-reduced-motion: reduce) { .prod .ph, .prod .info { transition: none; } }

/* Création maison */
.origin.sig { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.origin.sig img { width: 14px; height: 14px; }

/* Liste des clients (espace école) */
.client-row { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); padding: 12px 14px; margin-bottom: 8px; font: inherit; color: inherit; cursor: pointer; }
.client-row .cr-top { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.client-row .cr-sub { font-size: 13px; color: #6F655C; margin-top: 2px; }
.rule input:disabled { opacity: 1; }

/* Rappel paiement */
.pay-note { margin: 10px 0 12px; padding: 10px 12px; background: #FFF8E6; border: 1px solid #EBD9A8; font-size: 13.5px; line-height: 1.5; color: #4A3F35; }

/* Quantité modifiable au clavier */
.stepper .qty-in { width: 52px; height: 40px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font: inherit; font-weight: 600; font-size: 16px; background: #fff; color: var(--ink); padding: 0; -moz-appearance: textfield; }
.stepper .qty-in::-webkit-outer-spin-button, .stepper .qty-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .qty-in:focus { outline: 2px solid var(--brand); outline-offset: -2px; }

/* Comment venir */
.come { margin-top: 18px; padding: 16px; background: #fff; border: 1px solid var(--line); }
.come h3 { font-size: 16px; margin: 0 0 8px; }
.come p { margin: 0; font-size: 14px; line-height: 1.5; }
.come .map { position: relative; width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--line); overflow: hidden; background: var(--rose-2); }
.come .map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Bandeau horaire */
.banner.clock { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.banner.clock.hurry { background: #FFF1E6; border-color: #F0B37E; color: #8A3B00; }
.banner.clock.late { background: #F3EFEA; color: #6F655C; }

/* Heure en haut à droite */
.clock-time { font-size: 17px; font-weight: 600; color: var(--ink); letter-spacing: .02em; }

/* Zone sensible (fiche client) */
.danger-zone { margin-top: 22px; padding: 14px; border: 1px dashed #E3B4B4; background: #FFF7F7; }

.traces { margin: 10px 0 0; padding: 8px 10px; background: #FFF8E6; border: 1px solid #EBD9A8; font-size: 13px; line-height: 1.5; color: #4A3F35; }

/* ---------- Accueil + inscription (premier passage) ---------- */
html.onboard body > :not(#welcome):not(#toast):not(script) { display: none !important; }
.welcome { position: fixed; inset: 0; z-index: 200; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.welcome.dark { background: #14110F; color: #fff; }
.welcome.light { background: var(--bg); color: var(--ink); }
.wl-in { min-height: 100%; max-width: 440px; margin: 0 auto; padding: 40px 28px calc(40px + env(safe-area-inset-bottom)); box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.wl-in .wl-logo { width: 220px; max-width: 70%; margin: 0 auto; filter: invert(1); }
.wl-k { font-family: "Josefin Sans", sans-serif; letter-spacing: .25em; color: #E8A9B9; font-size: 13px; margin: 34px 0 10px; text-transform: uppercase; }
.wl-in h1 { font-family: "Josefin Sans", sans-serif; font-weight: 300; font-size: 34px; letter-spacing: .06em; margin: 0 0 18px; text-transform: uppercase; line-height: 1.15; }
.wl-in p { font-size: 16px; line-height: 1.6; color: #E9E2DA; margin: 0; }
.wl-btn { margin-top: 30px; background: #fff; color: #14110F; border: 0; padding: 17px 0; width: 100%; font: 600 17px "DM Sans", sans-serif; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.wl-in small { color: #A79E94; margin-top: 12px; font-size: 13px; }
.sg-in { max-width: 520px; margin: 0 auto; padding: 22px 18px calc(30px + env(safe-area-inset-bottom)); }
.sg-in .sg-logo { height: 34px; }
.sg-in h2 { font-family: "Josefin Sans", sans-serif; font-weight: 300; text-transform: uppercase; letter-spacing: .06em; font-size: 26px; margin: 14px 0 4px; }
.sg-in .rules { margin-top: 6px; }
.sg-back { background: none; border: 0; color: var(--muted); font-size: 14px; padding: 6px 0; cursor: pointer; }
