:root {
  --bg: #0b0a08;
  --panel: #15130e;
  --panel-2: #1d1a12;
  --line: #3a3220;
  --gold: #d4af37;
  --gold-hi: #f6e08a;
  --gold-lo: #8a6a12;
  --silver: #d9dde3;
  --text: #f3ecd8;
  --muted: #a89f86;
  --ok: #4ade80;
  --bad: #f87171;
  --radius: 14px;
  --wm-x: 0deg;
  --wm-y: 0deg;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--gold-hi); text-decoration: none; }
[hidden] { display: none !important; }

/* ---------- Filigrane 3D (5 teintes en fondu, enchaînées dans chaque rubrique) ---------- */
body {
  --wm-g: 0; --wm-s: .4; --wm-h: 0deg; --wm-sa: 1.4; --wm-b: 1; --wm-k: 1;
}
body[data-tone='or'] { --wm-g: 0; --wm-s: .4; --wm-h: 0deg; --wm-sa: 1.4; --wm-b: 1; --wm-k: 1; }
body[data-tone='cuivre'] { --wm-g: 0; --wm-s: .8; --wm-h: -18deg; --wm-sa: 2.2; --wm-b: .95; --wm-k: 1; }
body[data-tone='argent'] { --wm-g: 1; --wm-s: 0; --wm-h: 0deg; --wm-sa: 1; --wm-b: 1.15; --wm-k: .65; }
body[data-tone='bronze'] { --wm-g: 0; --wm-s: .9; --wm-h: -30deg; --wm-sa: 1.6; --wm-b: .8; --wm-k: 1.1; }
body[data-tone='champagne'] { --wm-g: 0; --wm-s: .3; --wm-h: 10deg; --wm-sa: .9; --wm-b: 1.25; --wm-k: .9; }
.wm {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; perspective: 900px;
  display: grid; place-items: center; overflow: hidden;
}
.wm-scene {
  position: relative; width: min(78vmin, 560px); aspect-ratio: 1; transform-style: preserve-3d;
  transform: rotateY(var(--wm-x)) rotateX(var(--wm-y));
}
.wm-layer {
  position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%;
  transform: translateZ(var(--z)); user-select: none;
  opacity: calc(.09 * var(--wm-k));
  filter: grayscale(var(--wm-g)) sepia(var(--wm-s)) hue-rotate(var(--wm-h)) saturate(var(--wm-sa)) brightness(var(--wm-b));
  transition: filter 2.5s ease-in-out, opacity 2.5s ease-in-out;
}
.wm-layer:last-child { opacity: calc(.24 * var(--wm-k)); }

/* ---------- En-tête ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: rgba(11, 10, 8, .92); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.brand-text { display: grid; line-height: 1.1; min-width: 0; }
.brand-name {
  display: inline-flex; font-weight: 900; font-size: 1.25rem; letter-spacing: .06em;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: .6px var(--silver); paint-order: stroke fill;
}
.brand-name .ch { display: inline-block; animation: letterWave 2.8s ease-in-out infinite; animation-delay: calc(var(--n) * 110ms); }
.brand-name .sp { width: .35em; }
@keyframes letterWave { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.brand-slogan { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; color: var(--muted); font-style: italic; }
.star { display: inline-block; color: var(--gold-hi); font-style: normal; font-size: .7rem; animation: starFloat 2.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes starFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(25deg); } }
.nav { display: none; gap: 6px; margin-left: auto; }
.nav a { padding: 8px 12px; border-radius: 999px; color: var(--text); font-weight: 600; }
.nav a.active, .nav a:hover { background: var(--panel-2); color: var(--gold-hi); }
.cart-btn {
  margin-left: auto; position: relative; width: 44px; height: 44px; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 50%; font-size: 1.15rem;
}
.cart-count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--gold); color: #1a1405; font-size: .75rem; font-weight: 800; display: grid; place-items: center;
}

/* ---------- Mise en page ---------- */
main { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 14px 14px 110px; outline: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; color: var(--gold-hi); }
.muted { color: var(--muted); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 10px; }
.section-head h2 { margin: 0; }

.tabs-mobile { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 999px; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); font: inherit; font-weight: 600; cursor: pointer;
}
.chip.active { background: var(--gold); color: #1a1405; border-color: var(--gold); }

/* ---------- Carrousel 3D ---------- */
.carousel { position: relative; height: 210px; perspective: 900px; margin: 6px 0 18px; }
.carousel-track { position: absolute; inset: 0; transform-style: preserve-3d; }
.slide {
  position: absolute; left: 50%; top: 0; width: min(86%, 560px); height: 100%; margin-left: calc(min(86%, 560px) / -2);
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  background: linear-gradient(135deg, #2a2108, #0f0c04); display: flex; align-items: flex-end;
  transition: transform .6s ease, opacity .6s ease; color: var(--text);
}
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.slide-text { position: relative; padding: 16px; background: linear-gradient(0deg, rgba(0,0,0,.75), transparent); width: 100%; }
.slide-text strong { display: block; font-size: 1.25rem; color: var(--gold-hi); }
.carousel-dots { display: flex; gap: 6px; justify-content: center; margin-top: -6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); border: 0; padding: 0; }
.dot.active { background: var(--gold); }

/* ---------- Produits ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; color: var(--text);
}
.card-img { position: relative; aspect-ratio: 1; background: #0f0d08; display: grid; place-items: center; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-img .noimg { font-size: 2.2rem; opacity: .4; }
.badge { position: absolute; top: 8px; left: 8px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 800; background: var(--gold); color: #1a1405; }
.badge.out { background: #3b1f1f; color: var(--bad); }
.card-body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.card-name { font-weight: 700; font-size: .95rem; }
.price { color: var(--gold-hi); font-weight: 800; }
.price s { color: var(--muted); font-weight: 500; margin-left: 6px; font-size: .85em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border: 0; border-radius: 12px; font: inherit; font-weight: 800; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #1a1405;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--gold-hi); border: 1px solid var(--gold); }
.btn.small { min-height: 36px; padding: 0 14px; }
.btn.block { width: 100%; }
.icon-btn { background: transparent; border: 0; color: var(--muted); font-size: 1.1rem; padding: 8px; cursor: pointer; }

/* ---------- Filtres ---------- */
.filters { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
.filters .wide { grid-column: 1 / -1; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); font: inherit;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, .chip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
label { display: grid; gap: 4px; font-size: .88rem; color: var(--muted); }
.pager { display: flex; justify-content: center; gap: 12px; align-items: center; margin: 18px 0; }

/* ---------- Fiche produit ---------- */
.detail { display: grid; gap: 16px; }
.gallery-main { aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: #0f0d08; border: 1px solid var(--line); display: grid; place-items: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; overflow-x: auto; }
.thumb { width: 64px; height: 64px; flex: none; border-radius: 10px; overflow: hidden; border: 2px solid transparent; padding: 0; background: none; }
.thumb.active { border-color: var(--gold); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.specs { width: 100%; border-collapse: collapse; }
.specs th, .specs td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); font-size: .92rem; }
.specs th { color: var(--muted); font-weight: 500; width: 40%; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font-size: 1.1rem; cursor: pointer; }
.qty span { min-width: 30px; text-align: center; font-weight: 700; }

/* ---------- Panier / commande ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.line { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line:last-child { border-bottom: 0; }
.line-img { width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #0f0d08; }
.line-img img { width: 100%; height: 100%; object-fit: cover; }
.line-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.total { display: flex; justify-content: space-between; font-size: 1.15rem; font-weight: 800; margin: 12px 0; }
.form { display: grid; gap: 12px; }
.pay-options { display: grid; gap: 8px; }
.pay-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); cursor: pointer; color: var(--text); }
.pay-option input { width: 20px; min-height: 20px; margin-top: 2px; accent-color: var(--gold); }
.pay-option.selected { border-color: var(--gold); }
.notice { padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.notice.ok { border-color: var(--ok); } .notice.bad { border-color: var(--bad); }
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; background: var(--panel-2); border: 1px solid var(--gold); color: var(--gold-hi); }
.empty { text-align: center; padding: 40px 10px; color: var(--muted); }

/* ---------- Pied, WhatsApp, toast, installation ---------- */
.foot { position: relative; z-index: 1; padding: 24px 14px 110px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); font-size: .9rem; }
.foot strong { color: var(--gold-hi); }
.wa-float {
  position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 30; padding: 12px 18px;
  border-radius: 999px; background: #1faa59; color: #fff; font-weight: 800; box-shadow: 0 6px 18px rgba(0,0,0,.5);
}
.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  max-width: 92vw; padding: 12px 18px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--gold); color: var(--text);
}
.toast.error { border-color: var(--bad); }
.install-tip {
  position: relative; z-index: 2; display: flex; gap: 10px; align-items: center; margin: 8px 14px; padding: 10px 12px;
  border: 1px solid var(--gold); border-radius: 12px; background: var(--panel-2); font-size: .9rem;
}
.install-tip p { margin: 2px 0 0; color: var(--muted); }
.install-body { flex: 1; }
.skeleton { height: 220px; border-radius: var(--radius); background: var(--panel); }

@media (min-width: 720px) {
  .nav { display: flex; }
  .cart-btn { margin-left: 0; }
  .tabs-mobile { display: none; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .detail { grid-template-columns: 1fr 1fr; align-items: start; }
  .carousel { height: 300px; }
  .filters { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .filters .wide { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-name .ch, .star { animation: none; }
  .slide { transition: none; }
}

/* Corrections : prix sur une ligne, boutons-lignes sans fond natif */
.price { white-space: nowrap; }
.price s { white-space: nowrap; display: inline-block; }
button.row { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; font: inherit; cursor: pointer; }
.row .muted { font-size: .85rem; }

.tabs-mobile { position: relative; z-index: 1; padding: 8px 14px 0; }
.tabs-mobile .chip { text-decoration: none; display: inline-block; }
@media (min-width: 720px) { .tabs-mobile { display: none; } }
