/* Caisse Mas des Jeux · tablette (iPad, Android), tactile */
@font-face { font-family: 'Inter'; src: url(/fonts/inter.woff2) format('woff2-variations'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url(/fonts/fraunces.woff2) format('woff2-variations'); font-weight: 100 900; font-display: swap; }
:root { --ink: #1E1B2E; --ink-2: #3B3647; --muted: #6B6577; --sand: #F6EEE3; --paper: #FFFCF7; --line: #E7DACA; --rose: #E8768A; --rose-d: #C9536A; --ok: #3C6E47; --err: #8C2F4B; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overscroll-behavior: none; }
body { font: 15px/1.4 'Inter', system-ui, sans-serif; color: var(--ink); background: var(--sand); -webkit-user-select: none; user-select: none; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
input { font: inherit; -webkit-user-select: text; user-select: text; }

/* Connexion */
.login { min-height: 100%; display: grid; place-items: center; align-content: center; gap: 26px; padding: 30px; background: radial-gradient(circle at 15% 15%, #3a2f52, transparent 50%), radial-gradient(circle at 85% 90%, #5a2a3d, transparent 45%), var(--ink); color: #fff; }
.login__logo { height: 90px; } .login h1 { font: 700 2rem 'Fraunces', serif; text-align: center; margin: 0 0 18px; } .login p { text-align: center; color: #C9C2D6; margin: -10px 0 18px; }
.login__stores { display: grid; gap: 12px; width: min(560px, 92vw); }
.login__stores button { background: rgba(255, 255, 255, .08); border-radius: 18px; padding: 20px 22px; text-align: left; color: #fff; transition: background .15s; }
.login__stores button:active { background: rgba(255, 255, 255, .18); } .login__stores b { display: block; font-size: 1.2rem; } .login__stores span { color: #C9C2D6; font-size: .9rem; }
.pin-dots { display: flex; gap: 16px; justify-content: center; margin-bottom: 22px; } .pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; } .pin-dots i.on { background: #fff; }
.keypad { display: grid; grid-template-columns: repeat(3, 84px); gap: 12px; justify-content: center; }
.keypad button { height: 84px; border-radius: 50%; background: rgba(255, 255, 255, .1); color: #fff; font-size: 1.8rem; font-weight: 600; }
.keypad button:active { background: rgba(255, 255, 255, .25); } .keypad [data-k="OK"] { background: var(--rose); font-size: 1.2rem; } .keypad [data-k="C"] { font-size: 1.2rem; }
.float { display: block; text-align: center; margin-top: 18px; color: #C9C2D6; } .float input { width: 90px; padding: 8px; border-radius: 10px; border: 0; text-align: center; font-weight: 700; }
.err { color: #F4A3B1 !important; min-height: 1.2em; } .link { background: none; color: #C9C2D6; display: block; margin: 0 auto; text-decoration: underline; }

/* Application */
.app { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.top { display: flex; align-items: center; gap: 14px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--ink); color: #fff; }
.top__who b { display: block; font-size: .95rem; } .top__who span { color: #C9C2D6; font-size: .8rem; }
.top__stats { margin-left: auto; text-align: right; font-size: .8rem; color: #C9C2D6; } .top__stats b { color: #fff; font-size: 1rem; }
.top__menu { display: flex; gap: 6px; } .top__menu button { background: rgba(255, 255, 255, .08); color: #fff; border-radius: 12px; padding: 8px 10px; font-size: 1.2rem; display: flex; flex-direction: column; align-items: center; min-width: 58px; }
.top__menu button span { font-size: .66rem; color: #C9C2D6; margin-top: 2px; } .top__menu button:active { background: rgba(255, 255, 255, .2); }
.main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; min-height: 0; min-width: 0; }
.catalog { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 12px 12px 0; }
.search input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid transparent; background: #fff; font-size: 1.05rem; outline: none; } .search input:focus { border-color: var(--ink); }
.catalog { display: grid !important; grid-template-columns: 168px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 10px 12px; }
.search { grid-column: 1 / -1; }
.cat-select { display: none; }
.chips { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; padding-bottom: 14px; }
.chips button { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 12px; border-radius: 14px; background: #fff; font-weight: 600; font-size: .9rem; text-align: left; line-height: 1.2; min-height: 52px; }
.chips button i { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--ink)); flex: none; }
.chips button.on { background: var(--ink); color: #fff; } .chips button.on i { box-shadow: 0 0 0 2px #fff; }
.grid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-content: start; padding-bottom: 14px; -webkit-overflow-scrolling: touch; }
.prod { background: #fff; border-radius: 16px; padding: 8px 8px 10px; text-align: left; display: flex; flex-direction: column; gap: 4px; transition: transform .1s; position: relative; }
.prod:active { transform: scale(.96); } .prod img { width: 100%; height: 96px; object-fit: contain; mix-blend-mode: multiply; background: #F6EFE6; border-radius: 10px; }
.prod b { font-size: .82rem; line-height: 1.2; height: 2.4em; overflow: hidden; } .prod .pr { font-weight: 800; font-size: 1rem; } .prod .st { position: absolute; top: 12px; right: 12px; background: rgba(255, 255, 255, .9); border-radius: 99px; padding: 1px 7px; font-size: .7rem; font-weight: 700; }
.prod .st.low { color: var(--err); }
.cart { background: #fff; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); }
.cart__lines { flex: 1; overflow-y: auto; padding: 8px 14px; } .cart__empty { text-align: center; color: var(--muted); margin-top: 40%; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line b { font-size: .88rem; line-height: 1.25; } .line .amt { font-weight: 800; text-align: right; } .line small { color: var(--muted); }
.qty { display: flex; align-items: center; gap: 4px; } .qty button { width: 38px; height: 38px; border-radius: 10px; background: var(--sand); font-size: 1.2rem; font-weight: 700; } .qty span { min-width: 30px; text-align: center; font-weight: 800; }
.line .disc { background: none; color: var(--rose-d); font-size: .78rem; font-weight: 600; justify-self: end; }
.cart__foot { padding: 12px 14px; padding-bottom: max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.cart__total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; } .cart__total b { font: 800 2rem 'Inter', sans-serif; } .cart__total span { color: var(--muted); }
.cart__actions { display: grid; grid-template-columns: 1fr 2.2fr; gap: 8px; } .cart__actions button { height: 62px; border-radius: 16px; font-weight: 800; font-size: 1.1rem; }
.ghost { background: var(--sand); } .pay { background: var(--rose); color: #fff; } .pay:disabled { opacity: .4; }

/* Fenêtres */
.modal { position: fixed; inset: 0; background: rgba(20, 18, 31, .55); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
.modal__box { background: #fff; border-radius: 24px; width: min(620px, 100%); max-height: 92vh; overflow-y: auto; padding: 24px; position: relative; }
.modal h2 { font: 700 1.6rem 'Fraunces', serif; margin: 0 0 14px; } .modal .x { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%; background: var(--sand); font-size: 1.1rem; }
.big-total { font: 800 2.6rem 'Inter', sans-serif; margin: 0 0 16px; }
.methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.methods button { height: 86px; border-radius: 18px; background: var(--sand); font-weight: 800; font-size: 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.methods button i { font-style: normal; font-size: 1.8rem; } .methods button.on { background: var(--ink); color: #fff; }
.cash { display: grid; gap: 10px; } .cash input { width: 100%; padding: 16px; border-radius: 14px; border: 2px solid var(--line); font-size: 1.8rem; font-weight: 800; text-align: right; }
.bills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .bills button { height: 56px; border-radius: 14px; background: var(--sand); font-weight: 800; }
.change { display: flex; justify-content: space-between; font-size: 1.3rem; padding: 12px 16px; border-radius: 14px; background: #E7F3E0; color: var(--ok); font-weight: 800; }
.change.neg { background: #FBE4E8; color: var(--err); }
.split { margin: 6px 0 10px; font-size: .9rem; } .split div { display: flex; justify-content: space-between; padding: 4px 0; }
.btn-main { width: 100%; height: 64px; border-radius: 18px; background: var(--ink); color: #fff; font-weight: 800; font-size: 1.15rem; margin-top: 14px; } .btn-main:disabled { opacity: .4; }
.btn-main.rose { background: var(--rose); } .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; } .row2 .btn-main { margin-top: 10px; } .btn-sec { background: var(--sand); color: var(--ink); }
.done { text-align: center; } .done .ok { font-size: 4rem; } .done .ch { font-size: 2rem; font-weight: 800; color: var(--ok); margin: 6px 0; }
.list { display: grid; gap: 6px; } .list button, .list div { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--sand); text-align: left; gap: 10px; }
.field-pos { width: 100%; padding: 14px; border-radius: 14px; border: 2px solid var(--line); font-size: 1.1rem; margin-bottom: 10px; }
.zline { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
video.scan { width: 100%; border-radius: 16px; background: #000; aspect-ratio: 4 / 3; object-fit: cover; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 150%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; transition: transform .3s; z-index: 60; font-weight: 600; opacity: 0; }
.toast.show { transform: translate(-50%, 0); opacity: 1; } .toast.err { background: var(--err); }
.flash { animation: flash .4s; } @keyframes flash { 0% { background: #FDE2E7; } } @keyframes fade { from { opacity: 0; } }
@media (max-width: 900px) { .main { grid-template-columns: minmax(0, 1fr) 320px; } .top__menu button span { display: none; } .top__menu button { min-width: 44px; } }
@media (max-width: 900px) { .catalog { grid-template-columns: 130px minmax(0, 1fr); } .chips button { font-size: .82rem; padding: 10px; } }
@media (max-width: 700px) { .catalog { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); } .chips { display: none; } .cat-select { display: block; width: 100%; padding: 12px 14px; border-radius: 14px; border: 0; background: #fff; font: 600 16px 'Inter', sans-serif; }
  .top__who b { font-size: .82rem; } .top { gap: 8px; padding-left: 10px; padding-right: 10px; } .main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 46%; } .cart { border-left: 0; border-top: 1px solid var(--line); } .top__stats { display: none; } .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } }
