/* COFAS Supermarché — présentation validée par M. Sow (aperçu v2, 04/12/2026).
   Tailles en rem : l'agrandissement du texte du téléphone est respecté. */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { background: #FAF7F1; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #0B1D0F; min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #FBD657; outline-offset: 2px; }
[hidden] { display: none !important; }
.money, .fit { font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; font-stretch: condensed;
  font-family: "SF Pro Display", Bahnschrift, "Roboto Condensed", "Segoe UI", Arial, sans-serif; }

/* ---- disposition : un panneau à la fois sur téléphone, trois côte à côte sur grand écran ---- */
.layout { display: block; }
.panel { display: none; min-height: 100dvh; flex-direction: column; }
.panel.active { display: flex; }
@media (min-width: 1100px) {
  body { background: #e9e6df; }
  .layout { display: flex; gap: 18px; justify-content: center; padding: 18px; min-height: 100dvh; }
  .panel, .panel.active { display: flex; width: 400px; min-height: 0; height: calc(100dvh - 36px); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
}

.head { height: 5.5rem; display: flex; align-items: center; justify-content: space-between; padding: env(safe-area-inset-top) 6px 0; flex: none; }
.panel .head { height: calc(5.5rem + env(safe-area-inset-top)); }
.head h1 { color: #fff; font-size: 2.1rem; font-weight: 800; white-space: nowrap; }
.motif { width: 54px; height: 84px; display: block; border: 0; background: none; padding: 0; flex: none; position: relative; }
.motif svg { width: 54px; height: 84px; display: block; }
.motif.flip svg { transform: scaleX(-1); }
.motif.home::after { content: "‹"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2.6rem; font-weight: 900; text-shadow: 0 0 6px #000, 0 0 2px #000; }
.line { height: 6px; flex: none; }
.body { flex: 1; padding: 14px 14px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; min-height: 0; overflow-y: auto; }

.btn { border: none; border-radius: 18px; min-height: 64px; color: #fff; font-weight: 800; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center; gap: 14px; padding: 6px 12px; transition: transform .06s, box-shadow .06s; flex: none; }
.btn:active, .btn.pressed { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.35) !important; }
.btn:disabled { opacity: .5; }
.i-cam, .i-cart, .i-ticket, .i-check { width: 2.2rem; height: 2.2rem; flex: none; background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.i-cam { --ico: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.2"><rect x="2" y="6" width="20" height="14" rx="3"/><circle cx="12" cy="13" r="4"/><path d="M8 6l2-3h4l2 3"/></svg>'); }
.i-cart { --ico: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.2"><path d="M2 4h3l2.4 11h11.2L21 7H6.2"/><circle cx="9" cy="20" r="1.7"/><circle cx="18" cy="20" r="1.7"/></svg>'); }
.i-ticket { --ico: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.2"><path d="M5 2h14v20l-2.3-1.6L14.3 22 12 20.4 9.7 22l-2.4-1.6L5 22z"/><path d="M8.5 7h7M8.5 11h7M8.5 15h4"/></svg>'); }
.i-check { --ico: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="3.4"><path d="M4 12.5l5 5L20 6"/></svg>'); }

/* ---- zone « reste » : chaque couleur a son texte ---- */
.rem.warn1 { background: #FFB547 !important; }
.rem.warn2 { background: #FFB547 !important; animation: blinkO 1s steps(2) infinite; }
.rem.reached, .rem.over { background: #E53935 !important; color: #fff !important; animation: blinkR 1s steps(2) infinite; }
.rem.reached *, .rem.over * { color: #fff !important; }
@keyframes blinkR { 50% { background: #8e1c1a; } }
@keyframes blinkO { 50% { background: #c77700; } }
@media (prefers-reduced-motion: reduce) { .rem.warn2, .rem.reached, .rem.over { animation: none; } }
.alert-text { text-align: center; font-weight: 800; font-size: 1.05rem; min-height: 0; margin-top: 6px; }
.alert-text:empty { display: none; }

/* ---- Accueil vert et or ---- */
.acc { background: #0B6227; } .acc .head { background: #014B1F; } .acc .line { background: #FBD657; }
.card-cream { background: #FCEFD2; border-radius: 20px; padding: 12px 14px 14px; box-shadow: 0 5px 0 rgba(0,0,0,.2); }
.card-cream h2 { text-align: center; font-size: 1.85rem; font-weight: 800; color: #011806; }
.gold { width: 100%; border: 0; margin-top: 8px; background: linear-gradient(#FDD356,#FAC947); border-radius: 16px; padding: 4px 12px;
  color: #011806; box-shadow: 0 5px 0 #C99A20; min-height: 88px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gold:active { transform: translateY(3px); box-shadow: 0 2px 0 #C99A20; }
.gold .fit { font-size: 4rem; }
.amt { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.amt > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-radius: 12px; padding: 6px 12px; font-weight: 800; font-size: 1.2rem; white-space: nowrap; overflow: hidden; }
.amt .t { background: #fff8e6; } .amt .r { background: #BFF5BB; }
.amt .fit { font-size: 1.75rem; }
.store-lbl { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 1.7rem; font-weight: 800; }
.shop { width: 48px; height: 44px; display: inline-block; background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 44"><rect x="5" y="16" width="38" height="26" rx="2" fill="%23FBD657"/><path d="M3 6h42l2 12H1z" fill="%23fff"/><path d="M3 6h7l-1 12H1zM17 6h7v12h-8zM31 6h7l3 12h-9z" fill="%23E53935"/><rect x="9" y="24" width="10" height="9" fill="%232FA3E0"/><rect x="29" y="24" width="10" height="9" fill="%232FA3E0"/><rect x="21" y="26" width="7" height="16" fill="%231E7BC4"/></svg>') center/contain no-repeat; }
.store { border: 0; background: #FAF7F1; border-radius: 16px; padding: 12px 16px; font-size: 1.4rem; font-weight: 800; display: flex; justify-content: space-between; gap: 10px; text-align: left; box-shadow: 0 5px 0 rgba(0,0,0,.28); min-height: 56px; }
.store:active { transform: translateY(3px); }
.btn-green { background: linear-gradient(#04C75D,#007A25); box-shadow: 0 6px 0 #024603; }
.duo { display: flex; flex-direction: column; gap: 16px; }
.duo .btn { min-height: 84px; font-size: 2.1rem; justify-content: flex-start; padding-left: 30px; gap: 20px; }
.duo .btn span { width: 2.8rem; height: 2.8rem; }
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini { min-height: 48px; border: 2px solid rgba(255,255,255,.55); background: rgba(0,0,0,.15); color: #fff; border-radius: 14px; font-weight: 700; font-size: 1rem; }
.foot { margin-top: auto; background: #FDD663; border-radius: 14px; text-align: center; padding: 8px; font-weight: 700; font-size: 1.1rem; flex: none; }

/* ---- Scanner indigo ---- */
.sc { background: #21145F; } .sc .head { background: #291B6E; } .sc .line { background: #02C7BE; }
.sc .body { gap: 10px; }
.tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tr > div { background: #F7F2F1; border-radius: 14px; text-align: center; padding: 4px 8px; overflow: hidden; }
.tr small { display: block; color: #037A84; font-size: 1.15rem; font-weight: 800; }
.tr .fit { color: #0D043C; font-size: 2rem; display: block; }
.view { height: 262px; flex: none; border-radius: 16px; position: relative; overflow: hidden; background: #2b2f20; }
.view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.view .corner { position: absolute; width: 44px; height: 44px; border: 7px solid #00F703; pointer-events: none; }
.c1 { top: 24px; left: 56px; border-right: 0 !important; border-bottom: 0 !important; border-radius: 10px 0 0 0; }
.c2 { top: 24px; right: 56px; border-left: 0 !important; border-bottom: 0 !important; border-radius: 0 10px 0 0; }
.c3 { bottom: 24px; left: 56px; border-right: 0 !important; border-top: 0 !important; border-radius: 0 0 0 10px; }
.c4 { bottom: 24px; right: 56px; border-left: 0 !important; border-top: 0 !important; border-radius: 0 0 10px 0; }
.view.flash { box-shadow: inset 0 0 0 6px #00F703; }
.cam-msg { position: absolute; inset: 0; border: 0; background: rgba(0,0,0,.55); color: #fff; font-weight: 700; font-size: 1.05rem; padding: 18px 70px; line-height: 1.35; }
.tools { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.chip { border: 0; background: #F7F2F1; color: #21145F; border-radius: 14px; min-height: 52px; font-weight: 800; font-size: 1.1rem; box-shadow: 0 4px 0 #0d0640; }
.chip:active { transform: translateY(3px); box-shadow: 0 1px 0 #0d0640; }
.chip[aria-pressed="true"] { background: #02C7BE; color: #08113b; }
.prod { background: #F8F1EA; border-radius: 18px; padding: 10px 12px 12px; text-align: center; }
.prod h2 { color: #21145F; font-size: 1.8rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-teal { display: inline-block; background: #017F83; color: #fff; border-radius: 14px; padding: 2px 20px; font-size: 1.6rem; }
.pill-teal.pending { background: #B35C00; }
.src { color: #21145F; font-size: 1rem; font-weight: 700; margin-top: 2px; }
.qty { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin-top: 8px; }
.qty .btn { background: linear-gradient(#008B79,#01735D); box-shadow: 0 6px 0 #004b3c; font-size: 2.7rem; min-height: 66px; }
.qty .n { background: #FCFAF6; border-radius: 14px; font-size: 2.7rem; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 2px #e8e1d6; }
.btn-teal { background: linear-gradient(#01AC9A,#01937C); box-shadow: 0 6px 0 #016655; font-size: 1.9rem; margin-top: auto; }

/* ---- Panier jade ---- */
.pa { background: #BDE4CF; } .pa .head { background: #004942; } .pa .line { background: #FC6753; }
#cartView { overflow: hidden; }
.panel#p-panier { height: 100dvh; }
@media (min-width: 1100px) { .panel#p-panier { height: calc(100dvh - 36px); } }
.list { display: flex; flex-direction: column; gap: 10px; flex: 1 1 0; min-height: 110px; overflow-y: auto; padding-bottom: 4px; }
.empty { text-align: center; font-weight: 700; color: #004942; padding: 18px; }
.item { background: #F5F9F4; border-radius: 18px; padding: 10px 14px; box-shadow: 0 4px 0 rgba(0,0,0,.08); flex: none; }
.item .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item b { font-size: 1.4rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qp { display: inline-block; background: #CAEBD9; border-radius: 10px; padding: 2px 12px; font-size: 1.3rem; margin-top: 4px; }
.item .sub { font-size: 1.8rem; border-left: 2px solid #8CCAAA; padding-left: 14px; }
.item .meta { font-size: .9rem; color: #22513f; margin-top: 4px; }
.item .acts { display: flex; gap: 6px; margin-top: 8px; }
.item .acts button { min-height: 48px; min-width: 48px; flex: 1 1 auto; border-radius: 12px; border: 0; background: #CAEBD9; font-weight: 800; font-size: .95rem; padding: 0 6px; box-shadow: 0 3px 0 #8CCAAA; }
.item .acts button.q { flex: 0 0 48px; font-size: 1.5rem; }
.item .acts button:active { transform: translateY(2px); box-shadow: none; }
.item.pending { box-shadow: inset 0 0 0 3px #FFB547; }
.sum { background: #FBF5E6; border-radius: 18px; padding: 8px 16px; font-size: 1.5rem; font-weight: 800; flex: none; }
.sum div { display: flex; justify-content: space-between; padding: 5px 0; gap: 10px; }
.sum div + div { border-top: 2px solid #8CCAAA; }
.sum .money { font-size: 1.75rem; }
.rest { background: linear-gradient(#BFF5BB,#B6F4B4); border-radius: 18px; text-align: center; padding: 6px 12px 10px; box-shadow: 0 5px 0 rgba(0,0,0,.14); overflow: hidden; flex: none; }
.rest small { display: block; font-size: 1.8rem; font-weight: 800; }
.rest .fit { font-size: 3.3rem; display: block; }
.pa .btn { min-height: 66px; }
.btn-dark { background: linear-gradient(#026258,#023E2F); box-shadow: 0 6px 0 #01241b; }
.btn-white { background: linear-gradient(#ffffff,#f1f1ec); color: #0B1D0F; box-shadow: 0 6px 0 #7fa894; }
.btn-coral { background: linear-gradient(#FE7E6B,#E7553F); box-shadow: 0 6px 0 #a5321f; font-size: 1.9rem; }

/* ---- Vérification du ticket (dans le panneau panier) ---- */
.ticket h2 { font-size: 1.5rem; color: #004942; }
.ticket p, .ticket li { font-size: 1.05rem; line-height: 1.4; }
.card { background: #F5F9F4; border-radius: 16px; padding: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.08); flex: none; }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb { width: 96px; text-align: center; font-size: .9rem; }
.thumb img { width: 96px; height: 128px; object-fit: cover; border-radius: 10px; display: block; border: 2px solid #8CCAAA; }
.thumb button { min-height: 44px; width: 100%; margin-top: 4px; border: 0; border-radius: 10px; background: #CAEBD9; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: .95rem; }
label.f input, label.f select, .tl input { min-height: 48px; border: 2px solid #8CCAAA; border-radius: 10px; padding: 6px 10px; background: #fff; font-size: 1.1rem; width: 100%; }
.tl { display: grid; grid-template-columns: 1fr 3.2rem 5rem 5.6rem 2.8rem; gap: 6px; align-items: center; }
.tl.hd { font-weight: 800; font-size: .85rem; }
.tl input { min-height: 44px; padding: 4px 6px; font-size: 1rem; }
.tl.unsure input { border-color: #FFB547; background: #FFF4DE; }
.tl button { min-height: 44px; border: 0; border-radius: 10px; background: #f3d6d1; font-weight: 800; }
.verdict { border-radius: 16px; padding: 12px; text-align: center; font-size: 1.5rem; font-weight: 900; flex: none; }
.v-ok { background: #BFF5BB; } .v-ko { background: #E53935; color: #fff; } .v-q { background: #FFB547; }
.cmp { width: 100%; border-collapse: collapse; font-size: .95rem; background: #fff; border-radius: 12px; overflow: hidden; }
.cmp th, .cmp td { padding: 6px; border-bottom: 1px solid #d7e9df; text-align: left; vertical-align: top; }
.cmp td.n, .cmp th.n { text-align: right; white-space: nowrap; }
.cmp tr.bad td { background: #FFF1EE; }
.cmp .iss { color: #a5321f; font-weight: 700; font-size: .9rem; }
.small { font-size: .95rem; color: #22513f; }
.row-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- fenêtres de dialogue ---- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; z-index: 10; padding: 10px; }
@media (min-width: 700px) { .modal { align-items: center; } }
.sheet { background: #FAF7F1; border-radius: 22px; width: 100%; max-width: 520px; max-height: 92dvh; overflow-y: auto; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 1.5rem; margin-bottom: 10px; }
.sheet p { font-size: 1.1rem; line-height: 1.4; margin-bottom: 10px; }
.sheet label.f { margin-bottom: 10px; }
.sheet .big input { font-size: 2rem; font-weight: 900; text-align: center; }
.mbtns { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.mbtns .btn { min-height: 56px; font-size: 1.3rem; }
.btn-light { background: #e7e2d8; color: #0B1D0F; box-shadow: 0 5px 0 #b9b2a3; }
.choice { display: flex; flex-direction: column; gap: 8px; }
.choice button { min-height: 56px; border: 2px solid #8CCAAA; background: #fff; border-radius: 14px; font-size: 1.15rem; font-weight: 800; text-align: left; padding: 8px 14px; }
.choice button.sel { border-color: #004942; background: #CAEBD9; }
.warnbox { background: #FFF4DE; border: 2px solid #FFB547; border-radius: 12px; padding: 10px; font-weight: 700; margin-bottom: 10px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #0B1D0F; color: #fff; border-radius: 14px; padding: 12px 18px; font-weight: 700; z-index: 20; max-width: 92vw; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.on { opacity: 1; }
