@charset "utf-8";
/* =========================================================
   Bazardise — Les Trouvailles du Calife
   Feuille unique. Écrite mobile d'abord ; les media queries
   n'ajoutent que ce qu'un grand écran permet en plus.
   ========================================================= */

@font-face {
  font-family: "Beldi Speech";
  src: url("../fonts/beldi-speech.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --paper: #f4efe5;  --paper-2: #ece6da; --paper-3: #e0d9cb;
  --card: #fffcf6;   --niche: #e7e0d2;
  --ink: #22211e;    --ink-2: #635d54;   --ink-3: #8b8276;
  --line: #d5cdbe;   --line-2: #beb4a2;
  --carmine: #842a34; --carmine-hi: #9e3340; --carmine-bg: #f8ece9;
  --brass: #b49358;  --brass-lo: #7a5c22; --brass-bg: #fdf4de;
  --tamegroute: #315447;
  --ok: #2f6b4f;

  --r-sm: 8px; --r-md: 14px; --r-lg: 22px; --r-pill: 999px;
  --sh-1: 0 2px 10px -4px rgba(45,25,15,.14);
  --sh-2: 0 14px 30px -12px rgba(45,25,15,.2);
  --sh-3: 0 -6px 28px -10px rgba(45,25,15,.22);

  --serif: "Cormorant Garamond", Palatino, Georgia, serif;
  --sans: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --speech: "Beldi Speech", "Comic Sans MS", cursive;
  --ease: cubic-bezier(.2,.8,.25,1);

  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --appbar-h: 56px;
  --tabbar-h: 60px;
  --wrap: 1180px;
}

[data-theme="dark"] {
  --paper: #141211;  --paper-2: #1c1917; --paper-3: #262120;
  --card: #201b19;   --niche: #2a2321;
  --ink: #f2ece1;    --ink-2: #bdb4a6;   --ink-3: #8a8175;
  --line: #3a3230;   --line-2: #564a45;
  --carmine: #d9636f; --carmine-hi: #e77b86; --carmine-bg: #2d181b;
  --brass: #d3b273;  --brass-lo: #e6c993; --brass-bg: #2a2317;
  --tamegroute: #6fa791;
  --ok: #63b389;
  --sh-1: 0 2px 10px -4px rgba(0,0,0,.5);
  --sh-2: 0 14px 30px -12px rgba(0,0,0,.65);
  --sh-3: 0 -6px 28px -10px rgba(0,0,0,.6);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.1; margin: 0 0 .35em; font-weight: 600; }
h1 { font-size: clamp(2.05rem, 7.5vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.65rem, 5.5vw, 2.5rem); }
h3 { font-size: 1.3rem; }
h4 { font-family: var(--sans); font-size: 1rem; font-weight: 700; line-height: 1.3; margin: 0; }
p { margin: 0 0 1em; max-width: 68ch; }

:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 max(1rem, var(--safe-l)) 0 max(1rem, var(--safe-r)); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 300; background: var(--carmine); color: #fff; padding: .8rem 1.2rem; font-weight: 600; }
.skip:focus { left: 0; }
.hidden { display: none !important; }

/* ================= Boutons ================= */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .7rem 1.25rem;
  font-size: .9375rem; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; border-radius: var(--r-pill);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .1s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--carmine); color: #fff; }
.btn-primary:hover { background: var(--carmine-hi); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--brass); background: var(--brass-bg); }
.btn-quiet { background: var(--paper-3); border-color: transparent; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: .45rem .9rem; font-size: .8125rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--r-pill); border: 0; background: transparent;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { background: var(--paper-3); }
.icon-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.badge {
  position: absolute; top: 4px; right: 3px;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: var(--r-pill); background: var(--carmine); color: #fff;
  font-size: .625rem; font-weight: 700; line-height: 18px; text-align: center;
}
.badge:empty, .badge[data-n="0"] { display: none; }

/* ================= Coque applicative ================= */

.appbar {
  position: sticky; top: 0; z-index: 70;
  padding-top: var(--safe-t);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.appbar-inner {
  max-width: var(--wrap); margin: 0 auto;
  height: var(--appbar-h); padding: 0 .35rem 0 .75rem;
  display: flex; align-items: center; gap: .25rem;
}
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; margin-right: auto; min-width: 0; }
.brand img { width: 34px; height: 34px; border-radius: var(--r-pill); background: var(--paper-3); }
.brand b { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em; display: block; line-height: 1; }
.brand span { font-size: .5625rem; letter-spacing: .16em; color: var(--brass-lo); font-weight: 700; }

.topnav { display: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
  box-shadow: var(--sh-3);
}
.tabbar ul { display: flex; margin: 0; padding: 0; list-style: none; height: var(--tabbar-h); }
.tabbar li { flex: 1; }
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; height: 100%; text-decoration: none; color: var(--ink-3);
  font-size: .625rem; font-weight: 600; letter-spacing: .01em;
  -webkit-tap-highlight-color: transparent;
  transition: color .2s var(--ease);
}
.tabbar a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--carmine); }
.tabbar a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--carmine);
}
.tabbar .badge { top: 6px; right: calc(50% - 20px); }

.views { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 1rem); }
.view { display: none; }
.view.active { display: block; animation: viewIn .28s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ================= Tirer pour actualiser ================= */

.ptr {
  position: fixed; top: calc(var(--safe-t) + var(--appbar-h)); left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  height: 0; overflow: hidden;
  font-size: .75rem; font-weight: 600; color: var(--ink-3);
  background: var(--paper-2);
  transition: height .2s var(--ease);
}
.ptr .spin { width: 15px; height: 15px; border: 2px solid var(--line-2); border-top-color: var(--carmine); border-radius: 50%; }
.ptr.busy .spin { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= Sections ================= */

.section { padding: 2.25rem 0; }
.section-alt { background: var(--paper-2); }
.section-head { margin-bottom: 1.5rem; }
.section-head p { color: var(--ink-2); font-size: .9375rem; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--brass-bg); color: var(--brass-lo);
  border: 1px solid color-mix(in srgb, var(--brass) 45%, transparent);
  border-radius: var(--r-pill); padding: .25rem .7rem;
  font-size: .6875rem; font-weight: 700; margin-bottom: .9rem;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tamegroute); }

.note {
  display: flex; gap: .75rem; align-items: flex-start;
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--brass);
  border-radius: var(--r-md); padding: .9rem 1rem; margin: 0 0 1.4rem;
}
.note p { margin: 0; font-size: .8125rem; color: var(--ink-2); }

/* ================= Héro ================= */

.hero { padding: 1.5rem 0 2rem; }
.hero-frame {
  border-radius: var(--r-lg); overflow: hidden; margin-bottom: 1.5rem;
  border: 1px solid var(--line); box-shadow: var(--sh-2); background: var(--niche);
}
.hero-frame img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.hero p.lede { font-size: 1.02rem; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.2rem; }
.hero-actions .btn { flex: 1 1 auto; }
.hero-facts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem;
  margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
}
.hero-facts strong { display: block; font-family: var(--serif); font-size: 1.5rem; color: var(--carmine); line-height: 1.1; }
.hero-facts span { font-size: .6875rem; color: var(--ink-3); }

/* ================= Barre de filtres collante ================= */

.filterbar {
  position: sticky; top: calc(var(--safe-t) + var(--appbar-h)); z-index: 50;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(12px);
  padding: .6rem 0; margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.filterbar .row { display: flex; gap: .5rem; align-items: center; padding: 0 max(1rem, var(--safe-l)); }
.search-field { position: relative; flex: 1; }
.search-field input {
  width: 100%; height: 42px; padding: 0 2.2rem 0 2.4rem;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--card); color: var(--ink); font-size: .9375rem;
  -webkit-appearance: none;
}
.search-field svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; stroke: var(--ink-3); fill: none; stroke-width: 1.8; }
.search-clear { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; background: transparent; border-radius: 50%; cursor: pointer; color: var(--ink-3); }

.chips {
  display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none;
  padding: .6rem max(1rem, var(--safe-l)) .1rem;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 34px; padding: .3rem .8rem;
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--card); color: var(--ink-2);
  font-size: .8125rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.chip[aria-selected="true"] { background: var(--brass); border-color: var(--brass); color: #fff; }
.chip .n { font-size: .6875rem; opacity: .75; }

/* ================= Grille et cartes ================= */

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
.results-count { font-size: .8125rem; color: var(--ink-3); margin-bottom: .8rem; }

.card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}

/* Galerie horizontale : c'est le scroll natif qui fait le travail. */
.gallery {
  position: relative; display: flex;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  background: var(--niche);
  aspect-ratio: 1;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery > button {
  flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always;
  padding: 0; border: 0; background: none; cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery-dots {
  position: absolute; bottom: .5rem; left: 0; right: 0;
  display: flex; justify-content: center; gap: 4px; pointer-events: none;
}
.gallery-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,.55); box-shadow: 0 0 3px rgba(0,0,0,.5);
  transition: width .2s var(--ease), background .2s var(--ease);
}
.gallery-dots i.on { width: 14px; border-radius: var(--r-pill); background: #fff; }
.gallery-wrap { position: relative; }

.card-tag {
  position: absolute; top: .5rem; left: .5rem; z-index: 2;
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: .15rem .55rem; font-size: .625rem; font-weight: 700; color: var(--ink-2);
}
.card-body { padding: .7rem .75rem .8rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.card-souk { font-size: .625rem; font-weight: 700; color: var(--brass-lo); }
.card-body h4 { font-size: .875rem; }
.card-desc { font-size: .75rem; color: var(--ink-2); line-height: 1.4; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: .6rem; display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.card-price { font-weight: 700; font-size: .8125rem; }
.card-price small { display: block; font-weight: 500; font-size: .625rem; color: var(--ink-3); }
.add-btn {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--r-pill);
  border: 1px solid var(--carmine); background: transparent; color: var(--carmine);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: background .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}
.add-btn:active { transform: scale(.88); }
.add-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.add-btn[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }

.skeleton { background: var(--niche); border-radius: var(--r-md); position: relative; overflow: hidden; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 70%, transparent), transparent);
  animation: sweep 1.3s infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }
.sk-card { height: 250px; }

.empty { grid-column: 1 / -1; text-align: center; padding: 2.5rem 1rem; color: var(--ink-2); }
.empty p { margin-inline: auto; }

/* ================= Univers ================= */

.uni-nav { margin-bottom: 1.2rem; }
.uni-plate {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--brass);
  border-radius: var(--r-md); padding: 1.1rem 1.15rem; margin-bottom: 1rem;
}
.uni-step { font-size: .625rem; letter-spacing: .1em; color: var(--brass-lo); font-weight: 700; }
.uni-plate h3 { font-size: 1.7rem; margin: .25rem 0 .05rem; }
.uni-sub { font-style: italic; color: var(--ink-3); font-size: .875rem; margin-bottom: .7rem; }
.uni-hist { font-size: .875rem; color: var(--ink-2); margin-bottom: .7rem; }
.uni-quest {
  display: block; font-size: .75rem; background: var(--niche);
  border: 1px dashed var(--line-2); border-radius: var(--r-sm); padding: .5rem .7rem;
}

/* Pellicule : on fait défiler les photos de l'univers horizontalement. */
.strip {
  display: flex; gap: .6rem; overflow-x: auto;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain; scrollbar-width: none;
  padding: 0 max(1rem, var(--safe-l)) .5rem;
  margin: 0 calc(-1 * max(1rem, var(--safe-l)));
}
.strip::-webkit-scrollbar { display: none; }
.strip > button {
  flex: 0 0 62vw; max-width: 260px; scroll-snap-align: start;
  aspect-ratio: 3 / 4; padding: 0; cursor: zoom-in;
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; background: var(--niche);
}
.strip img { width: 100%; height: 100%; object-fit: cover; }
.strip-hint { font-size: .6875rem; color: var(--ink-3); margin: .1rem 0 .8rem; display: flex; align-items: center; gap: .35rem; }

.uni-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: .6rem; }
.uni-grid button {
  aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm);
  overflow: hidden; background: var(--niche); cursor: zoom-in;
}
.uni-grid img { width: 100%; height: 100%; object-fit: cover; }

/* ================= Budget ================= */

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem; margin-bottom: 1rem; }
.presets { display: grid; gap: .5rem; margin-bottom: 1.1rem; }
.preset {
  display: flex; align-items: center; gap: .8rem; text-align: left; width: 100%;
  padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--paper); cursor: pointer;
}
.preset[aria-pressed="true"] { border-color: var(--carmine); background: var(--carmine-bg); }
.preset b { display: block; font-size: .9375rem; }
.preset span { font-size: .75rem; color: var(--ink-3); }
.preset em { margin-left: auto; font-style: normal; font-family: var(--serif); font-size: 1.25rem; color: var(--carmine); }

.field { margin-bottom: 1rem; }
.field > label { display: block; font-size: .8125rem; font-weight: 700; margin-bottom: .35rem; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select, .field textarea {
  width: 100%; min-height: 46px; padding: .65rem .8rem;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px;
  -webkit-appearance: none;
}
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-size: .6875rem; color: var(--ink-3); margin-top: .25rem; }
.field .err { display: none; color: var(--carmine); font-size: .6875rem; font-weight: 700; margin-top: .25rem; }
.field.invalid input, .field.invalid textarea { border-color: var(--carmine); }
.field.invalid .err { display: block; }
.check { display: flex; gap: .6rem; align-items: flex-start; font-size: .8125rem; }
.check input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--carmine); flex-shrink: 0; }

input[type="range"] { width: 100%; height: 40px; accent-color: var(--carmine); background: transparent; }
.amount-display { font-family: var(--serif); font-size: 2.4rem; color: var(--carmine); line-height: 1; }

.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li { display: flex; justify-content: space-between; gap: .8rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); font-size: .875rem; }
.ledger li span:last-child { font-weight: 600; white-space: nowrap; }
.ledger .total { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: .3rem; padding-top: .7rem; font-size: 1.05rem; font-weight: 700; }
.ledger .muted span { color: var(--ink-3); font-weight: 500; }
.rate-note { font-size: .6875rem; color: var(--ink-3); margin-top: .7rem; }

/* ================= Feuille inférieure ================= */

.backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(20,12,8,.5);
  opacity: 0; visibility: hidden; transition: opacity .28s var(--ease), visibility .28s;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.backdrop.open { opacity: 1; visibility: visible; }

.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
  max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--paper);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--sh-3);
  transform: translateY(100%);
  transition: transform .34s var(--ease);
  padding-bottom: var(--safe-b);
}
.sheet.open { transform: none; }
.sheet.dragging { transition: none; }
.sheet-grab { padding: .55rem 0 .3rem; display: flex; justify-content: center; cursor: grab; touch-action: none; flex-shrink: 0; }
.sheet-grab i { width: 38px; height: 4px; border-radius: var(--r-pill); background: var(--line-2); }
.sheet-head {
  display: flex; align-items: center; gap: .5rem; flex-shrink: 0;
  padding: .1rem .6rem .7rem 1.1rem; border-bottom: 1px solid var(--line);
}
.sheet-head h2, .sheet-head h3 { margin: 0; font-size: 1.25rem; margin-right: auto; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 1rem 1.1rem; }
.sheet-foot { flex-shrink: 0; padding: .85rem 1.1rem; border-top: 1px solid var(--line); background: var(--card); }

.line-item { display: flex; gap: .7rem; padding: .7rem 0; border-bottom: 1px dashed var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-thumb { width: 62px; height: 62px; border-radius: var(--r-sm); overflow: hidden; background: var(--niche); flex-shrink: 0; }
.line-thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-info { flex: 1; min-width: 0; }
.line-info h4 { font-size: .8125rem; }
.line-info p { font-size: .6875rem; color: var(--ink-3); margin: .1rem 0 .4rem; }
.line-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.qty { display: inline-flex; align-items: center; gap: .1rem; border: 1px solid var(--line-2); border-radius: var(--r-pill); }
.qty button { width: 32px; height: 30px; border: 0; background: transparent; cursor: pointer; font-size: 1rem; line-height: 1; border-radius: var(--r-pill); }
.qty span { font-size: .8125rem; font-weight: 700; min-width: 1.4em; text-align: center; }
.link-danger { background: none; border: 0; padding: 0; color: var(--carmine); font-size: .75rem; font-weight: 600; cursor: pointer; text-decoration: underline; }

/* ================= Visionneuse plein écran ================= */

.lightbox { position: fixed; inset: 0; z-index: 140; display: none; background: #100c0a; }
.lightbox.open { display: block; }
.lb-track {
  position: absolute; inset: 0; display: flex;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; scrollbar-width: none;
}
.lb-track::-webkit-scrollbar { display: none; }
.lb-slide {
  flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always;
  display: flex; align-items: center; justify-content: center;
  padding: calc(var(--safe-t) + 3.5rem) 1rem calc(var(--safe-b) + 4rem);
}
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-sm); }
.lb-top {
  position: absolute; top: var(--safe-t); left: 0; right: 0; z-index: 2;
  display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem;
  color: #f0e8db; background: linear-gradient(180deg, rgba(0,0,0,.6), transparent);
}
.lb-top .count { margin-right: auto; padding-left: .6rem; font-size: .8125rem; font-weight: 600; }
.lb-top .icon-btn { color: #f0e8db; }
.lb-cap {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 2;
  padding: 2rem 1.2rem calc(var(--safe-b) + 1rem);
  color: #ece3d5; font-size: .8125rem; text-align: center;
  background: linear-gradient(0deg, rgba(0,0,0,.75), transparent);
}
.lb-arrow { display: none; }

/* ================= Marchandage ================= */

.bubble {
  position: relative; background: var(--card); border: 2px solid var(--ink);
  border-radius: var(--r-md); padding: .85rem 1rem; margin-bottom: 1.6rem;
  font-family: var(--speech); font-size: 1.02rem; line-height: 1.35;
}
.bubble::after { content: ""; position: absolute; bottom: -12px; left: 28px; border: 6px solid transparent; border-top-color: var(--ink); }
.seller img { width: 170px; margin: 0 auto; }
.tea { display: flex; gap: .2rem; font-size: 1.1rem; }
.tea span { filter: grayscale(1); opacity: .28; }
.tea span.full { filter: none; opacity: 1; }
.offer-presets { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .8rem; }

/* ================= FAQ et tableau ================= */

.faq details { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); margin-bottom: .55rem; overflow: hidden; }
.faq summary { padding: .9rem 1rem; cursor: pointer; font-weight: 600; font-size: .875rem; list-style: none; display: flex; justify-content: space-between; gap: .8rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brass); font-size: 1.25rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 1rem 1rem; color: var(--ink-2); font-size: .875rem; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * max(1rem, var(--safe-l))); padding: 0 max(1rem, var(--safe-l)); }
table.compare { border-collapse: collapse; min-width: 620px; font-size: .8125rem; }
table.compare th, table.compare td { text-align: left; padding: .65rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.compare thead th { font-size: .6875rem; letter-spacing: .06em; color: var(--brass-lo); }
table.compare tbody th { font-weight: 700; color: var(--ink); }
table.compare td:first-of-type { color: var(--ink); font-weight: 600; }
table.compare td { color: var(--ink-2); }

/* ================= Liste de liens type app ================= */

.rows { list-style: none; margin: 0 0 1.4rem; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.rows li + li { border-top: 1px solid var(--line); }
.rows a, .rows button {
  display: flex; align-items: center; gap: .75rem; width: 100%;
  padding: .95rem 1rem; text-decoration: none; background: none; border: 0;
  font-size: .9375rem; font-weight: 500; text-align: left; cursor: pointer;
}
.rows a:active, .rows button:active { background: var(--paper-3); }
.rows .chev { margin-left: auto; color: var(--ink-3); }
.rows small { display: block; font-size: .6875rem; color: var(--ink-3); font-weight: 400; }

/* ================= Pied de page ================= */

.footer { background: var(--paper-3); border-top: 1px solid var(--line); padding: 2rem 0 1.5rem; }
.footer h4 { font-size: .6875rem; letter-spacing: .12em; color: var(--brass-lo); margin-bottom: .6rem; }
.footer ul { list-style: none; margin: 0 0 1.4rem; padding: 0; }
.footer li { margin-bottom: .4rem; }
.footer a { font-size: .8125rem; color: var(--ink-2); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-legal { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line-2); font-size: .6875rem; color: var(--ink-3); }

/* ================= Toast, bannières ================= */

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + .8rem); z-index: 160;
  transform: translate(-50%, 160%);
  background: var(--ink); color: var(--paper);
  border-radius: var(--r-pill); padding: .7rem 1.2rem;
  font-size: .8125rem; font-weight: 600; box-shadow: var(--sh-2);
  max-width: calc(100vw - 2rem); text-align: center;
  transition: transform .32s var(--ease);
}
.toast.show { transform: translate(-50%, 0); }

.install-banner {
  position: fixed; left: .7rem; right: .7rem; z-index: 130;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + .7rem);
  display: none; gap: .8rem; align-items: center;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: var(--r-md); padding: .8rem .9rem; box-shadow: var(--sh-2);
}
.install-banner.show { display: flex; }
.install-banner img { width: 40px; height: 40px; border-radius: var(--r-sm); }
.install-banner b { display: block; font-size: .875rem; }
.install-banner p { margin: 0; font-size: .6875rem; color: var(--ink-3); }

.offline-bar {
  position: fixed; left: 0; right: 0; z-index: 150;
  bottom: calc(var(--tabbar-h) + var(--safe-b));
  background: var(--carmine); color: #fff; text-align: center;
  font-size: .75rem; font-weight: 600; padding: .4rem; display: none;
}
body.is-offline .offline-bar { display: block; }

.noscript-note { background: var(--carmine); color: #fff; padding: 1rem; text-align: center; font-size: .875rem; }
.noscript-note a { color: #fff; }

/* ================= Pages de contenu ================= */

.doc { max-width: 720px; margin: 0 auto; padding: 1.5rem max(1rem, var(--safe-l)) 3rem; }
.doc .updated { color: var(--ink-3); font-size: .75rem; margin-bottom: 2rem; }
.doc h2 { font-size: 1.35rem; margin-top: 2rem; }
.doc h3 { font-size: 1rem; font-family: var(--sans); margin-top: 1.4rem; }
.doc p, .doc li { color: var(--ink-2); font-size: .9375rem; }
.doc ul { padding-left: 1.1rem; }
.doc li { margin-bottom: .35rem; }
.doc table { width: 100%; border-collapse: collapse; margin: .8rem 0 1.4rem; font-size: .875rem; }
.doc th, .doc td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--ink); }
.doc td { color: var(--ink-2); }
.todo { background: var(--carmine-bg); border: 1px dashed var(--carmine); border-radius: var(--r-sm); padding: .05rem .35rem; font-weight: 700; color: var(--carmine); }
.backlink { display: inline-flex; align-items: center; gap: .4rem; font-size: .8125rem; font-weight: 600; text-decoration: none; margin-bottom: 1.2rem; }

/* =========================================================
   Écrans larges : on ajoute, on ne réécrit pas.
   ========================================================= */

@media (min-width: 560px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
  .uni-grid { grid-template-columns: repeat(4, 1fr); gap: .5rem; }
  .strip > button { flex-basis: 240px; }
  .card-body h4 { font-size: .9375rem; }
  .card-desc { font-size: .8125rem; }
}

@media (min-width: 900px) {
  :root { --appbar-h: 64px; }

  .tabbar { display: none; }
  .views { padding-bottom: 0; }
  .toast { bottom: 1.5rem; }
  .install-banner { left: auto; right: 1.2rem; bottom: 1.2rem; max-width: 360px; }
  .offline-bar { bottom: 0; }

  .topnav { display: flex; gap: .2rem; margin-left: 1rem; }
  .topnav a {
    padding: .5rem .8rem; border-radius: var(--r-pill); text-decoration: none;
    font-size: .875rem; font-weight: 600; color: var(--ink-2);
  }
  .topnav a:hover { background: var(--paper-3); color: var(--ink); }
  .topnav a[aria-current="page"] { background: var(--carmine); color: #fff; }

  .section { padding: 3.5rem 0; }
  .wrap { padding-inline: 1.5rem; }

  .hero { padding: 3rem 0; }
  .hero .wrap { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; }
  .hero-frame { order: 2; margin: 0; }
  .hero-facts { grid-template-columns: repeat(3, 1fr); }
  .hero-facts strong { font-size: 1.9rem; }

  .grid { grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
  .uni-grid { grid-template-columns: repeat(6, 1fr); }
  .uni-plate { padding: 1.5rem 1.7rem; }
  .uni-plate h3 { font-size: 2.1rem; }

  .budget-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 2rem; align-items: start; }
  .game-grid { display: grid; grid-template-columns: 260px 1fr; gap: 2rem; align-items: start; }
  .footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 2rem; }

  /* La feuille devient une boîte de dialogue centrée. */
  .sheet {
    top: 50%; left: 50%; right: auto; bottom: auto;
    width: min(620px, 92vw); max-height: 86vh;
    border-radius: var(--r-lg);
    transform: translate(-50%, -46%) scale(.97); opacity: 0;
    transition: transform .26s var(--ease), opacity .26s var(--ease);
    padding-bottom: 0;
  }
  .sheet.open { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  .sheet-grab { display: none; }

  .lb-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); color: #fff;
  }
  .lb-arrow:hover { background: var(--brass); border-color: var(--brass); }
  .lb-prev { left: 1.2rem; }
  .lb-next { right: 1.2rem; }

  .card { transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
  .card:hover { box-shadow: var(--sh-2); transform: translateY(-2px); }
}

@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .card:hover { transform: none; }
}

@media print {
  .appbar, .tabbar, .sheet, .backdrop, .lightbox, .toast, .filterbar,
  .install-banner, .offline-bar, .footer { display: none !important; }
  .view { display: block !important; }
}
