:root {
  --ink: #F2F0EB;
  --muted: #b8b5af;
  --panel: rgba(14, 14, 14, 0.92);
  --line: rgba(245, 244, 241, 0.16);
  --accent: #7A1F1F;
  --accent-ink: #ffffff;
  --serif: "Fraunces", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0e0e0e; color: var(--ink); font: 15px/1.5 var(--sans); }
body { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* brouillard blanc pendant le chargement, qui se lève une fois la boutique prête */
.fog { position: fixed; inset: 0; display: flex; /* juste au-dessus de la 3D, sous tous les boutons */ flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem;
  background: radial-gradient(ellipse at 50% 45%, #ffffff 0%, #f4f4f2 45%, #e9ebec 100%); transition: opacity 1.6s ease, visibility 1.6s; }
.fog::before, .fog::after { content: ""; position: absolute; inset: -20%; pointer-events: none; opacity: 0.6;
  background: radial-gradient(closest-side, rgba(255,255,255,0.9), rgba(255,255,255,0)) 0 0 / 55% 45% repeat;
  animation: drift 18s linear infinite; }
.fog::after { background-size: 70% 60%; animation-duration: 27s; animation-direction: reverse; opacity: 0.45; }
@keyframes drift { to { transform: translate(12%, 4%); } }
.loading { position: relative; margin: 0 0 18vh; color: #6b6964; font-size: 0.9rem; }
body.ready .fog { opacity: 0; visibility: hidden; pointer-events: none; }
.fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.38s; z-index: 5; }
.fade.on { opacity: 1; }
/* petit lecteur YouTube (YouTube impose qu'il reste visible : 200 × 200 px minimum) */
.yt-box { position: fixed; left: 16px; bottom: 72px; z-index: 4; width: 300px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.yt-head { display: flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.5rem 0.4rem 0.8rem; font-size: 0.8rem; color: var(--muted); }
.yt-head span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yt-head button { background: none; border: 1px solid var(--line); border-radius: 99px; width: 2rem; height: 2rem; color: var(--ink); }
.yt-head button:hover { border-color: var(--ink); }
#yt-player { height: 200px; }
#yt-player iframe { display: block; }
@media (max-width: 400px) { .yt-box { width: 220px; } }
.zones button.on { border-color: var(--accent); }

/* entrée */
.intro { position: fixed; inset: auto 0 0 0; display: flex; justify-content: center; padding: 24px 16px calc(28px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(5, 8, 15, 0.75)); pointer-events: none; }
.intro-card { text-align: center; pointer-events: none; } /* les clics traversent jusqu'aux vitrines */
.intro-card button { pointer-events: auto; }
.brand { font: 600 clamp(1.6rem, 4.5vw, 2.4rem)/1 var(--serif); margin: 0; letter-spacing: 0.01em; }
.tagline { margin: 0.3rem 0 0.9rem; color: var(--muted); }
.btn { background: var(--accent); border: 0; border-radius: 99px; padding: 0.85rem 1.8rem; font-weight: 600; color: var(--accent-ink); }
.btn:hover { background: #8f2727; }
.small { font-size: 0.8rem; color: var(--muted); margin-top: 0.8rem; }

/* barre du haut */
.topbar { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: linear-gradient(rgba(10, 7, 4, 0.6), transparent); pointer-events: none; }
.brand-sm { font: 600 1.2rem var(--serif); }
.actions { display: flex; gap: 8px; pointer-events: auto; }
.actions button, .zones button { background: var(--panel); border: 1px solid var(--line); border-radius: 99px; padding: 0.45rem 0.9rem; }
.actions button:hover, .zones button:hover { border-color: var(--accent); }
#cart-count { display: inline-block; min-width: 1.4em; margin-left: 0.2em; padding: 0 0.35em; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 0.8rem; text-align: center; }

/* zones (téléportation rapide) */
.zones { position: fixed; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 0 16px; overflow-x: auto; justify-content: center; scrollbar-width: none; }
.zones button { flex: none; white-space: nowrap; }
.hint { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); margin: 0; padding: 0.5rem 1rem; border-radius: 99px; background: var(--panel); color: var(--muted); font-size: 0.85rem; text-align: center; width: max-content; max-width: calc(100% - 32px); }

.tip { position: fixed; left: 0; top: 0; padding: 0.45rem 0.7rem; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); pointer-events: none; opacity: 0; transition: opacity 0.15s; display: flex; flex-direction: column; font-size: 0.85rem; }
.tip.on { opacity: 1; }
.tip span { color: var(--muted); }
.toast { position: fixed; left: 50%; top: 64px; transform: translate(-50%, -10px); padding: 0.55rem 1rem; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-weight: 600; opacity: 0; transition: 0.25s; pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* fiche produit */
.panel { position: fixed; top: 64px; right: 16px; bottom: 70px; width: 360px; overflow-y: auto; padding: 22px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); transform: translateX(calc(100% + 30px)); transition: transform 0.35s ease; }
.panel.open { transform: none; }
.panel .close, .cat-inner .close { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); }
.panel-art canvas { width: 100%; height: auto; display: block; border-radius: 6px; margin-bottom: 14px; pointer-events: none; }
.kicker { margin: 0; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: #c9776f; }
.panel h2, .cat-inner h2 { font: 600 1.5rem/1.2 var(--serif); margin: 0.2rem 0 0.5rem; }
.desc { color: var(--muted); margin: 0 0 1rem; }
.opt-title { margin: 1rem 0 0.4rem; font-weight: 600; font-size: 0.85rem; }
.opt-detail { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { background: transparent; border: 1px solid var(--line); border-radius: 99px; padding: 0.3rem 0.75rem; font-size: 0.85rem; }
.chips button.on { background: var(--ink); color: #111; border-color: var(--ink); }
.price { font: 600 1.6rem var(--serif); margin: 1.1rem 0 0.6rem; }
.stock { color: #c9776f; margin: 0; }
.buy { width: 100%; background: var(--accent); border: 0; border-radius: 10px; padding: 0.8rem; font-weight: 700; color: var(--accent-ink); }
.note { font-size: 0.78rem; color: var(--muted); margin: 0.7rem 0 0; }
.note a { color: var(--ink); text-underline-offset: 2px; }
.line { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.line small { display: block; color: var(--muted); }
.line span { flex: 1; }
.line .remove { background: none; border: 0; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: 0 0.2rem; }
.line .remove:hover { color: var(--ink); }
.empty { width: 100%; margin-top: 0.5rem; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 0.65rem; color: var(--muted); }
.empty:hover { border-color: var(--ink); color: var(--ink); }
.line.total { border: 0; margin-bottom: 0.8rem; }

/* catalogue */
.catalogue { position: fixed; inset: 0; background: rgba(8, 6, 4, 0.82); overflow-y: auto; }
.cat-inner { position: relative; max-width: 960px; margin: 0 auto; padding: 70px 16px 40px; }
.cat-inner h3 { font: 600 1.1rem var(--serif); margin: 1.6rem 0 0.7rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 8px 10px; }
.card:hover { border-color: var(--accent); }
.card canvas, .card .ph { width: 100%; aspect-ratio: 24 / 17; border-radius: 6px; pointer-events: none; }
.card .ph { display: grid; place-items: center; background: #3a2a1c; color: var(--muted); text-transform: capitalize; }
.card span { color: var(--muted); font-size: 0.85rem; }

/* téléphone : la fiche devient un tiroir en bas */
@media (max-width: 700px) {
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 72vh; border-radius: 16px 16px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateY(105%); }
  .panel.open { transform: none; }
  .zones { justify-content: flex-start; }
  .actions button { padding: 0.4rem 0.7rem; }
  .brand-sm { font-size: 1rem; }
}

.no-webgl #scene { display: none; }
