:root {
  --brand: #0f7a4f;
  --brand-2: #129862;
  --on-brand: #fff;
  --tint: color-mix(in oklab, var(--brand) 10%, #fff);
  --tint-2: color-mix(in oklab, var(--brand) 20%, #fff);
  --brand-deep: color-mix(in oklab, var(--brand) 82%, #000);
  --paper: #f4f3ee;
  --card: #fff;
  --ink: #15171c;
  --ink-2: #41454d;
  --mute: #6d7178;
  --line: #e5e3da;
  --line-2: #efede6;
  --danger: #c5302b;
  --save: #b4410f;
  --r-lg: 24px;
  --r: 16px;
  --r-sm: 11px;
  --shadow: 0 1px 2px rgb(20 20 15 / 4%), 0 8px 24px -14px rgb(20 20 15 / 16%);
  --shadow-up: 0 2px 4px rgb(20 20 15 / 5%), 0 18px 36px -18px rgb(20 20 15 / 28%);
  --display: 'Bricolage Grotesque', 'Onest', system-ui, sans-serif;
  --body: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --top-h: 72px;
  --depts-h: 54px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: clamp(16px, 2.2vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
s { color: var(--mute); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }
.i { flex: none; display: block; }
.muted { color: var(--mute); font-size: 14px; }
.link { color: var(--brand-deep); font-weight: 600; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }

.btn-main { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px; border-radius: 14px; background: var(--brand); color: var(--on-brand); font-weight: 650; transition: background .15s, transform .15s var(--ease); }
.btn-main:hover { background: var(--brand-deep); }
.btn-main:active { transform: scale(.98); }
.btn-main.wide { display: flex; width: 100%; }
.btn-main.wide b, .btn-main.grow b { margin-inline-start: auto; font: 700 16px var(--display); }
.btn-main.wide:has(> span + b), .btn-main.grow:has(> span + b) { justify-content: space-between; }
.btn-main.grow { flex: 1; }
.btn-main.xl { min-height: 56px; font-size: 16.5px; }
.btn-main .i { animation: none; }
.btn-main:disabled .i { animation: spin 1s linear infinite; }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost.danger { color: var(--danger); }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--paper); }
.icon-btn:hover { background: var(--line); }
@keyframes spin { to { transform: rotate(360deg); } }

/* En-tête */
.top { position: sticky; top: 0; z-index: 40; background: var(--card); border-bottom: 1px solid var(--line-2); }
.top-in { display: flex; align-items: center; gap: 24px; height: var(--top-h); padding: 0 var(--gutter); }
.logo { display: flex; align-items: center; gap: 12px; min-width: 0; flex: none; max-width: 260px; }
.logo img { width: 44px; height: 44px; border-radius: 13px; object-fit: cover; flex: none; }
.logo-txt { display: flex; flex-direction: column; min-width: 0; }
.logo-txt b { font: 700 16.5px/1.15 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.logo-txt small { display: flex; align-items: center; gap: 5px; color: var(--mute); font-size: 12px; font-weight: 500; }
.logo-txt small i { width: 7px; height: 7px; border-radius: 50%; background: #a8a8a0; }
.logo-txt small.on i { background: #1c9b5f; }
.search { position: relative; display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; max-width: 680px; margin: 0 auto; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--paper); border: 1.5px solid transparent; transition: border-color .15s, background .15s; cursor: text; color: var(--mute); }
.search:focus-within { background: var(--card); border-color: var(--brand); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--ink); font-size: 15px; }
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--mute); }
.search kbd { padding: 2px 8px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); color: var(--mute); font: 500 12px var(--body); }
.search:focus-within kbd { display: none; }
.search-x { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--line); color: var(--ink); }
.top-nav { display: flex; align-items: center; gap: 4px; flex: none; }
.nav-btn { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 12px; font-weight: 550; font-size: 14px; }
.nav-btn:hover { background: var(--paper); }
.nav-cart { position: relative; display: flex; align-items: center; gap: 8px; height: 46px; min-width: 46px; justify-content: center; margin-inline-start: 6px; padding: 0 14px; border-radius: 14px; background: var(--ink); color: #fff; font: 700 14.5px var(--display); }
.nav-cart em { position: absolute; top: -6px; inset-inline-end: -6px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--brand); color: var(--on-brand); font: 700 12px var(--body); border: 2px solid var(--card); }
.nav-cart.bump { animation: bump .32s var(--ease); }
@keyframes bump { 40% { transform: scale(1.09); } }

.depts { position: sticky; top: var(--top-h); z-index: 35; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.depts-in { display: flex; gap: 6px; height: var(--depts-h); align-items: center; padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
.depts-in::-webkit-scrollbar { display: none; }
.depts button { flex: none; height: 36px; padding: 0 15px; border-radius: 18px; font-weight: 550; font-size: 14px; color: var(--ink-2); transition: background .15s, color .15s; }
.depts button:hover { background: var(--line); }
.depts button.on { background: var(--ink); color: #fff; }

/* Accueil */
.hero-wrap { padding: 2px var(--gutter) 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px; }
.hero-img { display: block; border-radius: var(--r-lg); overflow: hidden; height: clamp(190px, 19vw, 280px); background: var(--line); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.hero-side { display: grid; gap: 12px; grid-auto-rows: 1fr; }
.bento { display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--card); position: relative; }
.bento .i { position: absolute; top: 18px; inset-inline-end: 18px; opacity: .85; }
.bento h2 { font: 700 21px/1.1 var(--display); letter-spacing: -.02em; }
.bento p { color: var(--mute); font-size: 13.5px; }
.b-brand { background: var(--brand); color: var(--on-brand); }
.b-brand p { color: inherit; opacity: .85; }

.tiles-wrap { padding: 16px 0 0; }
.tiles { display: flex; gap: 10px; padding: 0 var(--gutter) 4px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.tiles::-webkit-scrollbar { display: none; }
.tile { flex: 1 0 122px; max-width: 178px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px 9px; border-radius: 18px; background: var(--card); border: 1.5px solid transparent; scroll-snap-align: start; transition: transform .18s var(--ease), border-color .15s; }
.tile:hover { transform: translateY(-2px); }
.tile.on { border-color: var(--brand); background: var(--tint); }
.tile-img { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 5px; border-radius: 50%; overflow: hidden; background: var(--paper); color: var(--mute); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-name { font-weight: 600; font-size: 13.5px; line-height: 1.2; text-align: center; }
.tile-n { color: var(--mute); font-size: 12px; }

/* Structure */
.layout { display: grid; grid-template-columns: 256px minmax(0, 1fr) 344px; gap: 20px; align-items: start; padding: 20px var(--gutter) 40px; }

/* Filtres */
.filters { position: sticky; top: calc(var(--top-h) + var(--depts-h) + 8px); max-height: calc(100vh - var(--top-h) - var(--depts-h) - 24px); display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
.filters-scroll { overflow-y: auto; padding: 4px 18px 18px; scrollbar-width: thin; }
.sheet-head, .sheet-foot { display: none; }
.fblock { padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.fblock:last-child { border-bottom: 0; }
.fblock h3 { margin-bottom: 10px; font: 700 15px var(--display); letter-spacing: -.01em; }
.fgroup { margin: 10px 0 2px; color: var(--mute); font-size: 12px; font-weight: 600; }
.fgroup:first-child { margin-top: 0; }
#f-flags { display: grid; gap: 2px; }
.toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; font-size: 14px; font-weight: 500; text-align: start; }
.toggle span { flex: 1; }
.toggle em, .check em { color: var(--mute); font: 500 12.5px var(--body); }
.toggle i { position: relative; width: 34px; height: 20px; border-radius: 10px; background: var(--line); transition: background .15s; flex: none; }
.toggle i::after { content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 25%); transition: transform .18s var(--ease); }
.toggle.on i { background: var(--brand); }
.toggle.on i::after { transform: translateX(14px); }
.check { display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: 14px; cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .lb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check.off { opacity: .42; }
.box { display: grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1.5px solid #cfccc1; color: transparent; transition: background .12s, border-color .12s; }
.check:hover .box { border-color: var(--brand); }
.check input:checked + .box, .opts .on .box { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.check input:focus-visible + .box { outline: 2px solid var(--brand); outline-offset: 2px; }
.mini-q { width: 100%; height: 36px; margin-bottom: 6px; padding: 0 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-size: 13.5px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills button { padding: 5px 11px; border-radius: 16px; border: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.pills button:hover { border-color: var(--ink); }
.pills button.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.hist { display: flex; align-items: flex-end; gap: 2px; height: 44px; margin-bottom: -1px; }
.hist i { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; background: var(--line); transition: height .2s var(--ease), background .12s; }
.hist i.in { background: var(--tint-2); }
.range { position: relative; height: 22px; }
.range::before { content: ''; position: absolute; top: 9px; left: 0; right: 0; height: 4px; border-radius: 2px; background: var(--line); }
.range-fill { position: absolute; top: 9px; height: 4px; border-radius: 2px; background: var(--brand); }
.range input { position: absolute; top: 0; left: 0; width: 100%; height: 22px; margin: 0; background: none; -webkit-appearance: none; appearance: none; pointer-events: none; }
.range input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); box-shadow: 0 1px 4px rgb(0 0 0 / 22%); pointer-events: auto; cursor: grab; }
.range input::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); pointer-events: auto; cursor: grab; }
.range-vals { display: flex; justify-content: space-between; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }

/* Résultats */
.results { min-width: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 10px; flex-wrap: wrap; }
.tb-left { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.tb-left h1 { font: 700 26px/1.1 var(--display); letter-spacing: -.025em; }
.tb-left span { color: var(--mute); font-size: 13.5px; white-space: nowrap; }
.tb-right { display: flex; align-items: center; gap: 8px; }
.tb-filter { display: none; align-items: center; gap: 8px; height: 40px; padding: 0 13px; border-radius: 12px; background: var(--card); font-weight: 600; font-size: 14px; }
.tb-filter em { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: var(--brand); color: var(--on-brand); font: 700 11.5px var(--body); }
.sort { position: relative; display: flex; align-items: center; height: 40px; border-radius: 12px; background: var(--card); }
.sort .i { position: absolute; inset-inline-end: 11px; pointer-events: none; color: var(--mute); }
.sort select { height: 100%; padding: 0 32px 0 13px; border: 0; background: none; -webkit-appearance: none; appearance: none; font-size: 14px; font-weight: 550; cursor: pointer; border-radius: 12px; max-width: 190px; }
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--card); }
.seg button { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; color: var(--mute); }
.seg button.on { background: var(--paper); color: var(--ink); }
.active { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.active:not(:empty) { margin-bottom: 12px; }
.active button:not(.link) { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px 5px 12px; border-radius: 16px; background: var(--tint); color: var(--brand-deep); font-size: 13px; font-weight: 600; }
.active button:not(.link):hover { background: var(--tint-2); }
.active .link { margin-inline-start: 6px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(186px, 1fr)); gap: 12px; }
.card { position: relative; display: flex; flex-direction: column; border-radius: 20px; background: var(--card); overflow: hidden; transition: box-shadow .22s var(--ease), transform .22s var(--ease); animation: rise .34s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.card:hover { box-shadow: var(--shadow-up); transform: translateY(-2px); }
.card-img { position: relative; display: block; aspect-ratio: 1; padding: 14px; background: #fff; }
.card-img img { width: 100%; height: 100%; object-fit: contain; transition: transform .35s var(--ease); }
.card:hover .card-img img { transform: scale(1.04); }
.flag { position: absolute; inset-inline-start: 10px; top: 10px; padding: 3px 9px; border-radius: 9px; background: var(--save); color: #fff; font: 700 13px var(--display); }
.fav { position: absolute; top: 8px; inset-inline-end: 8px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgb(255 255 255 / 86%); color: #9b9a92; transition: color .15s, transform .15s var(--ease); }
.fav:hover { color: var(--danger); transform: scale(1.08); }
.fav.on { color: var(--danger); }
.fav.on .i { fill: currentColor; }
.card-body { display: flex; flex-direction: column; flex: 1; gap: 3px; padding: 2px 14px 13px; }
.brand { color: var(--mute); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-weight: 550; font-size: 14.5px; line-height: 1.28; min-height: 2.56em; }
.name:hover { color: var(--brand-deep); }
.vchips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.vchips button, .vchips a { max-width: 100%; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 12px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vchips button:hover { border-color: var(--ink); }
.vchips button.on { border-color: var(--brand); background: var(--tint); color: var(--brand-deep); }
.vsize { margin-top: 6px; color: var(--mute); font-size: 12.5px; }
.card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; min-height: 52px; }
.prices { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; overflow: hidden; }
.price { font: 700 19px var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price.is-promo { color: var(--save); }
.prices s { font-size: 12.5px; }
.unit { color: var(--mute); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot { flex: none; }
.add { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--brand); color: var(--on-brand); transition: transform .15s var(--ease), background .15s; }
.add:hover { background: var(--brand-deep); transform: scale(1.06); }
.add:active { transform: scale(.94); }
.step { display: flex; align-items: center; height: 42px; border-radius: 14px; background: var(--brand); color: var(--on-brand); animation: pop .2s var(--ease); }
@keyframes pop { from { transform: scale(.86); } }
.step button { display: grid; place-items: center; width: 34px; height: 100%; color: inherit; }
.step output { min-width: 20px; text-align: center; font: 700 15px var(--display); font-variant-numeric: tabular-nums; }
.step.small { height: 32px; border-radius: 10px; background: var(--paper); color: var(--ink); animation: none; }
.step.small button { width: 30px; }
.step.small output { font-size: 14px; }
.step.large { height: 54px; border-radius: 14px; background: var(--paper); color: var(--ink); animation: none; }
.step.large button { width: 46px; }

.grid.is-list { grid-template-columns: 1fr; gap: 8px; }
.is-list .card { flex-direction: row; align-items: center; }
.is-list .card-img { flex: none; width: 96px; height: 96px; padding: 8px; }
.is-list .card-body { padding: 10px 14px 10px 4px; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; }
.is-list .brand, .is-list .name, .is-list .vchips, .is-list .vsize { grid-column: 1; }
.is-list .name { min-height: 0; -webkit-line-clamp: 1; line-clamp: 1; }
.is-list .card-foot { grid-column: 2; grid-row: 1 / span 3; align-items: center; margin: 0; padding: 0; gap: 18px; }
.is-list .prices { text-align: end; }
.is-list .fav { position: static; order: 3; margin-inline-end: 8px; flex: none; }

.empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 64px 20px; border-radius: var(--r-lg); background: var(--card); text-align: center; color: var(--mute); }
.empty h3 { color: var(--ink); font: 700 20px var(--display); }
.empty .btn-main { margin-top: 10px; }

/* Panier */
.cart { position: sticky; top: calc(var(--top-h) + var(--depts-h) + 8px); max-height: calc(100vh - var(--top-h) - var(--depts-h) - 24px); display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--card); overflow: hidden; }
.cart-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 10px; }
.cart-head > div { display: flex; align-items: center; gap: 10px; }
.cart-head h2, .co-side h2 { display: flex; align-items: center; gap: 8px; font: 700 20px var(--display); letter-spacing: -.02em; }
.cart-head em, .co-side h2 em { display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; background: var(--paper); font: 700 13px var(--body); }
.only-drawer { display: none; }
.cart-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 26px 42px; text-align: center; color: var(--mute); }
.cart-empty b { color: var(--ink); font: 700 16px var(--display); }
.cart-empty p { font-size: 13.5px; }
.mode { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 0 18px 8px; padding: 3px; border-radius: 12px; background: var(--paper); }
.mode button { display: flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.mode button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 10%); }
.mode.big { margin: 0 0 16px; }
.mode.big button { height: 48px; font-size: 14.5px; }
.zone { position: relative; display: flex; align-items: center; gap: 8px; margin: 0 18px 8px; height: 40px; padding: 0 11px; border-radius: 11px; border: 1px solid var(--line); color: var(--mute); }
.zone select { flex: 1; min-width: 0; height: 100%; border: 0; background: none; -webkit-appearance: none; appearance: none; color: var(--ink); font-size: 13.5px; font-weight: 550; cursor: pointer; }
.lines { flex: 1; min-height: 60px; overflow-y: auto; padding: 0 18px; scrollbar-width: thin; }
.line { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.line:last-child { border-bottom: 0; }
.line img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; flex: none; }
.line-main { flex: 1; min-width: 0; }
.line-name { font-weight: 550; font-size: 13.5px; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.line-sub { color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 5px; }
.line-foot b, .tight .line > b { font: 700 15px var(--display); white-space: nowrap; }
.tight .line { align-items: center; padding: 8px 0; }
.tight .line img { width: 44px; height: 44px; }
.cart-sum { display: grid; gap: 7px; padding: 14px 18px 18px; border-top: 1px solid var(--line-2); }
.sum-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-2); }
.sum-row b { font-weight: 600; color: var(--ink); }
.sum-row.save, .sum-row.save b { color: var(--save); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 6px; font: 700 18px var(--display); }
.sum-total b { font-size: 26px; letter-spacing: -.02em; }
.cart-sum .btn-main { margin-top: 5px; }
.reassure { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--mute); font-size: 12px; text-align: center; }

.foot { display: flex; align-items: center; gap: 28px; padding: 26px var(--gutter) 36px; color: var(--mute); font-size: 13.5px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.foot b { color: var(--ink); font: 700 16px var(--display); }
.foot p, .foot a { display: inline-flex; align-items: center; gap: 6px; margin-inline-end: 14px; }
.foot-soc { display: flex; gap: 4px; }
.foot-soc a { margin: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--ink); }
.foot-soc a:hover { background: var(--line); }
.foot small { margin-inline-start: auto; }

.cartbar { display: none; }
.scrim { position: fixed; inset: 0; z-index: 50; background: rgb(15 16 18 / 45%); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }

/* Fiche produit et dialogues */
.modal-back { position: fixed; inset: 0; z-index: 60; background: rgb(15 16 18 / 48%); animation: fade .2s; }
.sheet { position: fixed; z-index: 61; inset: 5vh 0 auto; margin: 0 auto; width: min(900px, calc(100vw - 32px)); max-height: 90vh; display: grid; grid-template-columns: 5fr 6fr; border-radius: 26px; background: var(--card); overflow: hidden; animation: sheet .28s var(--ease); outline: none; }
@keyframes sheet { from { opacity: 0; transform: translateY(16px) scale(.985); } }
.sheet-x { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; }
.sheet-img { position: relative; display: grid; place-items: center; padding: 28px; background: #fff; border-inline-end: 1px solid var(--line-2); min-height: 280px; }
.sheet-img img { width: 100%; max-height: 74vh; object-fit: contain; }
.sheet-info { max-height: 90vh; min-height: 0; overflow-y: auto; padding: 28px 26px 0; scrollbar-width: thin; }
.sheet-info h2 { padding-inline-end: 34px; font: 700 27px/1.12 var(--display); letter-spacing: -.025em; }
.desc { margin-top: 8px; color: var(--ink-2); font-size: 14.5px; }
.sheet-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.sheet-price .price { font-size: 30px; }
.sheet-block { margin-top: 20px; }
.sheet-block h3 { margin-bottom: 8px; font: 700 15px var(--display); }
.sheet-block h3 small { color: var(--mute); font: 500 12.5px var(--body); }
.sheet-block textarea, .field textarea, .field input { width: 100%; padding: 12px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 16px; resize: vertical; transition: border-color .15s; }
.sheet-block textarea:focus, .field textarea:focus, .field input:focus { border-color: var(--brand); }
.vlist { display: grid; gap: 6px; }
.vlist button { display: flex; align-items: center; gap: 10px; padding-block: 8px; padding-inline: 8px 14px; border-radius: 13px; border: 1.5px solid var(--line); text-align: start; font-size: 14px; font-weight: 550; }
.vlist button span { flex: 1; min-width: 0; }
.vlist img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }
.vlist b { font: 700 16px var(--display); }
.vlist .on { border-color: var(--brand); background: var(--tint); }
.opts { display: grid; gap: 4px; }
.opts button { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 2px; font-size: 14px; text-align: start; }
.opts span:nth-child(2) { flex: 1; }
.sheet-cta { position: sticky; bottom: 0; display: flex; gap: 10px; margin: 20px -26px 0; padding: 14px 26px 20px; background: var(--card); border-top: 1px solid var(--line-2); z-index: 1; }
.sheet-cta .btn-main { min-height: 54px; padding: 0 18px; }
.rel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rel a { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 12px; background: var(--paper); font-size: 12.5px; }
.rel img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 8px; margin-bottom: 4px; }
.rel span { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.25; }
.rel b { font: 700 14px var(--display); }
.dialog { position: fixed; z-index: 61; inset: 12vh 0 auto; margin: 0 auto; width: min(460px, calc(100vw - 32px)); padding: 28px; border-radius: 24px; background: var(--card); animation: sheet .26s var(--ease); }
.dialog h2 { font: 700 26px var(--display); letter-spacing: -.02em; }
.dialog .muted { margin: 4px 0 16px; }

/* Formulaires */
.field { display: block; margin-top: 12px; }
.field > span { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 600; }
.field small { color: var(--mute); font-weight: 400; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.phone { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.phone:focus-within { border-color: var(--brand); }
.phone em { padding: 0 2px 0 13px; font-style: normal; font-weight: 600; color: var(--ink-2); font-size: 15px; }
.phone input { border: 0; }
.auth .btn-main { margin-top: 14px; }
.auth-sent { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 11px 13px; border-radius: 12px; background: var(--tint); font-size: 14px; }
.otp { letter-spacing: .5em; text-align: center; font: 700 26px var(--display) !important; }
.pick, .days { display: flex; flex-wrap: wrap; gap: 8px; }
.pick button, .days button { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 14px; border-radius: 13px; border: 1.5px solid var(--line); font-size: 14px; text-align: start; }
.pick small, .days small { color: var(--mute); font-size: 12.5px; }
.days button b { text-transform: capitalize; font-weight: 600; }
.pick .on, .days .on { border-color: var(--brand); background: var(--tint); }
.times { display: flex; flex-wrap: wrap; gap: 6px; max-height: 164px; overflow-y: auto; }
.times button { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 13.5px; font-weight: 550; font-variant-numeric: tabular-nums; }
.times .on { background: var(--ink); border-color: var(--ink); color: #fff; }
.saved { display: grid; gap: 6px; }
.saved button { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 11px; background: var(--paper); font-size: 13.5px; text-align: start; }
.saved span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.geo { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
#co-map { height: 190px; margin-top: 12px; border-radius: 14px; overflow: hidden; z-index: 1; }
.map-pin { color: var(--brand); }
.map-pin .i { fill: var(--tint-2); }

/* Commande */
#route-alt { min-height: calc(100vh - var(--top-h)); }
.co, .orders { max-width: 1120px; margin: 0 auto; padding: 22px var(--gutter) 60px; }
.co { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.back { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-weight: 550; font-size: 14px; }
.back:hover { color: var(--ink); }
.co h1, .orders h1 { margin: 10px 0 16px; font: 800 36px/1.05 var(--display); letter-spacing: -.03em; }
.co-card { margin-bottom: 12px; padding: 22px; border-radius: var(--r-lg); background: var(--card); }
.co-card.narrow { max-width: 520px; }
.step-t { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font: 700 20px var(--display); letter-spacing: -.02em; }
.step-t i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font: 700 14px var(--body); }
.who { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--tint); color: var(--brand-deep); }
.who > div, .who > span { flex: 1; display: flex; flex-direction: column; color: var(--ink); }
.who span span, .who div span { color: var(--mute); font-size: 13.5px; }
.loyal { display: flex; gap: 8px; margin-top: 10px; color: var(--ink-2); font-size: 13.5px; }
.pays { display: grid; gap: 8px; margin-bottom: 4px; }
.pays button { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 14px; border: 1.5px solid var(--line); text-align: start; }
.pays span { flex: 1; display: flex; flex-direction: column; }
.pays small { color: var(--mute); }
.pays i { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #cfccc1; flex: none; }
.pays .on { border-color: var(--brand); background: var(--tint); }
.pays .on i { border: 6px solid var(--brand); }
.co-side { position: sticky; top: calc(var(--top-h) + 14px); border-radius: var(--r-lg); background: var(--card); display: flex; flex-direction: column; max-height: calc(100vh - var(--top-h) - 28px); overflow: hidden; }
.co-side h2 { padding: 20px 20px 8px; }
.co-side .lines { max-height: 260px; padding: 0 20px; flex: 0 1 auto; }
.promo { display: grid; gap: 6px; padding: 12px 20px; border-top: 1px solid var(--line-2); }
.promo-in { display: flex; gap: 6px; }
.promo-in input { flex: 1; min-width: 0; height: 42px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); font-size: 16px; }
.promo-in button { padding: 0 14px; border-radius: 11px; background: var(--ink); color: #fff; font-weight: 600; font-size: 13.5px; }
.promo-ok { display: flex; align-items: center; gap: 8px; color: var(--brand-deep); }
.promo-ok span { flex: 1; }
.promo-gift { display: flex; align-items: center; gap: 7px; padding: 9px 11px; border-radius: 11px; border: 1px dashed var(--brand); color: var(--brand-deep); font-size: 13.5px; font-weight: 600; }
.co-side .cart-sum { padding: 14px 20px 20px; }

/* Mes commandes */
.orders-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.orders-grid { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 14px; align-items: start; }
.o-list { display: grid; gap: 6px; }
.o-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 16px; background: var(--card); text-align: start; border: 1.5px solid transparent; }
.o-row.on { border-color: var(--brand); }
.o-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.o-main small { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-total { font: 700 15px var(--display); white-space: nowrap; }
.o-dot { width: 9px; height: 9px; border-radius: 50%; background: #b5b3a9; flex: none; }
.o-dot.s0, .o-dot.s1, .o-dot.s4 { background: var(--brand); }
.o-dot.s3 { background: var(--danger); }
.o-detail { position: sticky; top: calc(var(--top-h) + 14px); padding: 22px; border-radius: var(--r-lg); background: var(--card); }
.o-detail .lines { padding: 0; margin-top: 8px; }
.o-detail .cart-sum { padding: 12px 0 4px; }
.o-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.o-top h2 { font: 700 23px var(--display); letter-spacing: -.02em; }
.o-state { padding: 5px 11px; border-radius: 14px; background: var(--tint); color: var(--brand-deep); font-size: 13px; font-weight: 600; white-space: nowrap; }
.o-state.s3 { background: #fbe9e8; color: var(--danger); }
.o-state.s2 { background: var(--paper); color: var(--ink-2); }
.o-cancelled { display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-radius: 12px; background: #fbe9e8; color: var(--danger); font-weight: 550; font-size: 14px; }
.track { display: flex; margin-bottom: 18px; }
.track li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; font-size: 12.5px; color: var(--mute); }
.track li::before { content: ''; position: absolute; top: 12px; inset-inline-start: -50%; width: 100%; height: 3px; background: var(--line); }
.track li:first-child::before { display: none; }
.track li.done::before { background: var(--brand); }
.track i { position: relative; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--line); color: var(--on-brand); }
.track .done i { background: var(--brand); }
.track .done b { color: var(--ink); }
.track b { font-weight: 600; }
.track .cur i { box-shadow: 0 0 0 4px var(--tint-2); }
.o-actions { display: flex; gap: 8px; margin-top: 8px; }
.o-load { display: grid; gap: 10px; }

/* Squelettes, messages */
.boot { padding: 14px var(--gutter); display: grid; gap: 14px; }
.skel { display: block; height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--line-2) 25%, #fbfaf6 50%, var(--line-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel.bar { height: 48px; border-radius: 14px; }
.skel.banner { height: 230px; border-radius: 24px; }
.skel.square { aspect-ratio: 1; height: auto; border-radius: 14px; }
.skel.w40 { width: 40%; } .skel.w60 { width: 60%; }
.skel-card { padding: 12px; gap: 9px; animation: none; }
.fatal { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 100vh; padding: 24px; text-align: center; color: var(--mute); }
.fatal h1 { color: var(--ink); font: 700 28px var(--display); }
#toasts { position: fixed; z-index: 90; left: 0; right: 0; top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; max-width: min(460px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-up); animation: drop .24s var(--ease); }
.toast-err .i { color: #ff9c8f; }
.toast-ok .i { color: #8ee6b4; }
.toast.out { opacity: 0; transform: translateY(-6px); transition: .2s; }
@keyframes drop { from { opacity: 0; transform: translateY(-10px); } }

/* Tiroir panier sous 1200 px */
@media (max-width: 1199px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); }
  .cart { position: fixed; top: 0; inset-inline-end: 0; bottom: 0; z-index: 55; width: min(420px, 100vw); max-height: none; border-start-start-radius: 24px; border-end-start-radius: 24px; transform: translateX(var(--cart-off, 105%)); transition: transform .3s var(--ease); visibility: hidden; }
  .cart.open { transform: none; visibility: visible; }
  .only-drawer { display: grid; }
  .cartbar { position: fixed; z-index: 30; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; max-width: 520px; margin: 0 auto; height: 58px; padding-inline: 12px 18px; border-radius: 18px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: var(--shadow-up); animation: rise .25s var(--ease); }
  .cartbar.off { display: none; }
  .cartbar b { margin-inline-start: auto; font: 700 18px var(--display); }
  .cb-n { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 11px; background: var(--brand); color: var(--on-brand); font-weight: 700; }
  .co { grid-template-columns: minmax(0, 1fr) 340px; }
  .foot { padding-bottom: 96px; }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding-top: 14px; }
  .filters { position: fixed; inset: auto 0 0; z-index: 55; max-height: 88vh; border-radius: 24px 24px 0 0; transform: translateY(105%); transition: transform .3s var(--ease); visibility: hidden; top: auto; }
  .filters.open { transform: none; visibility: visible; }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
  .sheet-head h2 { font: 700 22px var(--display); }
  .sheet-foot { display: flex; gap: 8px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-2); }
  .sheet-foot .btn-main { flex: 1; }
  .tb-filter { display: inline-flex; }
  .hero { grid-template-columns: 1fr; }
  .hero-side { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
  .bento { min-height: 118px; }
  .co, .orders-grid { grid-template-columns: minmax(0, 1fr); }
  .co-side, .o-detail { position: static; max-height: none; }
  .co-side .lines { max-height: none; }
  .nav-btn span { display: none; }
  .search kbd { display: none; }
}

@media (max-width: 700px) {
  :root { --top-h: 112px; --depts-h: 50px; }
  html { scroll-padding-top: 170px; }
  .top-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'logo nav' 'search search'; gap: 8px 10px; height: auto; padding: 8px 16px 10px; }
  .logo { grid-area: logo; max-width: none; }
  .logo img { width: 38px; height: 38px; }
  .search { grid-area: search; max-width: none; width: 100%; height: 44px; }
  .search input { font-size: 16px; }
  .top-nav { grid-area: nav; }
  .nav-cart span { display: none; }
  .nav-btn { padding: 0 8px; }
  .hero-img { height: auto; aspect-ratio: 16 / 8; border-radius: 20px; }
  .bento { padding: 14px; min-height: 104px; border-radius: 20px; }
  .bento h2 { font-size: 17px; }
  .bento p { font-size: 12.5px; }
  .bento .i { top: 13px; inset-inline-end: 13px; }
  .tile { flex: 0 0 104px; padding: 11px 8px 10px; }
  .tile-img { width: 56px; height: 56px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card-img { padding: 8px; }
  .card-body { padding: 2px 11px 11px; }
  .price { font-size: 17px; }
  .add, .step { height: 40px; }
  .add { width: 40px; }
  .step button { width: 30px; }
  .tb-left h1 { font-size: 22px; }
  .tb-right { width: 100%; }
  .sort { flex: 1; }
  .sort select { width: 100%; max-width: none; }
  .is-list .card-body { display: flex; }
  .is-list .card-foot { padding-top: 6px; gap: 8px; }
  .is-list .prices { text-align: start; }
  .sheet { inset: auto 0 0; width: 100vw; max-height: 92vh; grid-template-columns: 1fr; border-radius: 24px 24px 0 0; overflow-y: auto; }
  .sheet-img { padding: 16px; min-height: 0; border-inline-end: 0; }
  .sheet-img img { max-height: 34vh; }
  .sheet-info { max-height: none; overflow: visible; padding: 8px 18px 0; }
  .sheet-info h2 { font-size: 23px; }
  .sheet-cta { bottom: 0; margin: 20px -18px 0; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
  .step.large button { width: 40px; }
  .dialog { inset: auto 0 0; width: 100vw; border-radius: 24px 24px 0 0; padding: 24px 18px calc(22px + env(safe-area-inset-bottom)); }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .cart { width: 100vw; border-radius: 0; }
  .co h1, .orders h1 { font-size: 29px; }
  .co-card { padding: 18px 16px; border-radius: 20px; }
  .foot small { margin-inline-start: 0; width: 100%; }
  .track li { font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Langues */
.lang { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 5px; height: 46px; min-width: 46px; padding: 0 10px; border-radius: 14px; font: 600 14px var(--body); color: var(--ink); cursor: pointer; }
.lang:hover { background: var(--paper); }
.lang:focus-within { outline: 2px solid var(--brand); outline-offset: 1px; }
.lang select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }

html[dir="rtl"] { --display: 'IBM Plex Sans Arabic', 'Onest', system-ui, sans-serif; --body: 'IBM Plex Sans Arabic', 'Onest', system-ui, sans-serif; --cart-off: -105%; }
html[dir="rtl"] * { letter-spacing: 0 !important; }
html[dir="rtl"] .i.flip { transform: scaleX(-1); }
html[dir="rtl"] .toggle.on i::after { transform: translateX(-14px); }
html[dir="rtl"] .range { direction: ltr; }
html[dir="rtl"] input[type="tel"] { direction: ltr; text-align: end; }

/* Connexion et inscription */
.dialog { max-height: 84vh; max-height: 84dvh; overflow-y: auto; overscroll-behavior: contain; }
.phone select { flex: none; height: 46px; padding-inline: 12px 4px; border: 0; background: transparent; color: var(--ink-2); font: 600 16px var(--body); cursor: pointer; direction: ltr; }
.pwd { position: relative; }
.pwd input { padding-inline-end: 48px; direction: ltr; }
html[dir="rtl"] .pwd input { text-align: end; }
.pwd button { position: absolute; inset-block: 0; inset-inline-end: 3px; display: grid; place-items: center; width: 44px; color: var(--mute); cursor: pointer; }
.auth-forgot { display: block; margin-top: 8px; margin-inline-start: auto; }
.auth-alt { margin-top: 14px; text-align: center; color: var(--mute); font-size: 14px; }
.auth-sent .link { margin-inline-start: 2px; }
@media (max-width: 640px) { .dialog { max-height: 92vh; max-height: 92dvh; } }
