/* ═══════════════════════════════════════════════════════════════════════════
   Casemira — Conseiller déco. Préfixe .cmc- (distinct du .cm- du visualiseur).
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --cmc-bg:#f8f7f5; --cmc-surface:#ffffff; --cmc-ink:#0f1e2e; --cmc-muted:#6f7682;
  --cmc-line:#e8e4de; --cmc-line-soft:#f0ece5; --cmc-navy:#0f1e2e; --cmc-gold:#a09584;
  --cmc-gold-tint:#f6f1e9; --cmc-radius:18px;
  --cmc-shadow:0 30px 70px -28px rgba(15,30,46,.42);
  --cmc-shadow-sm:0 10px 26px -14px rgba(15,30,46,.32);
  --cmc-font:"Instrument Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  --cmc-serif:"Instrument Serif",Georgia,"Times New Roman",serif;
}
/* Reset : empêche le thème Shopify de mettre des Majuscules / UPPERCASE partout. */
.cmc-card, .cmc-card *, .cmc-launcher, .cmc-lightbox, .cmc-lightbox * {
  box-sizing:border-box; text-transform:none !important; letter-spacing:normal;
}
.cmc-brand-name, .cmc-brand-name * { text-transform:uppercase !important; letter-spacing:.2em; }
.cmc-brand-name em { text-transform:none !important; letter-spacing:.02em; }

/* ── Lanceur flottant ──────────────────────────────────────────────────────── */
/* Bas-GAUCHE (le coin bas-droite est pris par le panier abandonné). Accent doré
   pour se distinguer du navy du « Ajouter au panier » → se lit comme un service. */
.cmc-launcher {
  /* --cmc-lift : remontée dynamique posée par le JS quand la barre sticky « Ajouter
     au panier » du thème est visible (évite que le lanceur la chevauche). */
  position:fixed; left:24px; bottom:calc(24px + var(--cmc-lift,0px)); z-index:9990;
  display:inline-flex; align-items:center; gap:10px;
  padding:15px 20px 15px 19px; border:none; border-radius:999px;
  background:linear-gradient(135deg,#ecdfc7,#d4c2a1); color:var(--cmc-navy); cursor:pointer;
  font-family:var(--cmc-font); font-size:15.5px; font-weight:650;
  box-shadow:0 16px 40px -12px rgba(15,30,46,.46), inset 0 1px 0 rgba(255,255,255,.42);
  /* Apparition différée : caché tant que le JS n'a pas ajouté .is-visible. */
  opacity:0; transform:translateY(14px) scale(.92); pointer-events:none;
  transition:opacity .4s ease, transform .45s cubic-bezier(.2,.9,.3,1.2), box-shadow .25s, bottom .25s ease;
}
.cmc-launcher.is-visible { opacity:1; transform:none; pointer-events:auto; }
html:not(.cmc-touch) .cmc-launcher:hover { transform:translateY(-2px); box-shadow:0 24px 52px -14px rgba(15,30,46,.52), inset 0 1px 0 rgba(255,255,255,.42); }
/* Onde dorée : UNIQUEMENT à la toute première apparition (classe .cmc-intro posée par
   le JS, une seule fois par visiteur). Ensuite, badge calme partout = non intrusif,
   adapté à une audience qui consulte plusieurs fiches. */
.cmc-launcher::after { content:""; position:absolute; inset:0; border-radius:999px; pointer-events:none; }
.cmc-launcher.cmc-intro.is-visible::after { animation:cmc-ping 2.4s cubic-bezier(.2,.7,.3,1) 3; }
.cmc-launcher-ico { display:grid; place-items:center; flex:none; }
.cmc-launcher-ico svg { width:22px; height:22px; stroke:var(--cmc-navy); }
/* Emblème Casemira Conseil (nuancier) : version phrase = petit à gauche ; pastille = plus grand. */
.cmc-launcher-logo { display:block; width:24px; height:24px; }
.cmc-launcher.is-mini .cmc-launcher-logo { width:36px; height:36px; }
.cmc-launcher .lab-short { display:none; }
/* Bouton « réduire » (×) → replie en pastille icône. */
.cmc-launcher-x { display:grid; place-items:center; width:24px; height:24px; margin-left:1px; border-radius:50%; flex:none; opacity:.5; transition:opacity .15s, background .15s; }
.cmc-launcher-x svg { width:13px; height:13px; stroke:var(--cmc-navy); }
html:not(.cmc-touch) .cmc-launcher-x:hover { opacity:1; background:rgba(15,30,46,.12); }
/* État réduit : simple pastille icône (reste cliquable → ouvre le conseiller). */
/* Pastille = médaillon blanc/ivoire + liseré doré : le nuancier (navy/taupe) ressort,
   plus visible qu'un fond champagne sur une fiche produit claire. */
.cmc-launcher.is-mini { padding:0; width:58px; height:58px; justify-content:center; background:#fffdf9; box-shadow:0 12px 30px -10px rgba(15,30,46,.42), inset 0 0 0 1.5px #e7dcc6; }
.cmc-launcher.is-mini .lab-full, .cmc-launcher.is-mini .lab-short, .cmc-launcher.is-mini .cmc-launcher-x { display:none; }
/* Masqué tant qu'un drawer (menu / panier) est ouvert : le lanceur passerait au-dessus. */
.cmc-launcher.cmc-hidden { display:none !important; }
@media (max-width:600px){
  .cmc-launcher{ left:14px; bottom:calc(14px + var(--cmc-lift,0px)); padding:13px 17px 13px 16px; font-size:14.5px; }
  .cmc-launcher.is-mini{ width:52px; height:52px; padding:0; }
}
@media (max-width:380px){
  .cmc-launcher .lab-full { display:none; }
  .cmc-launcher .lab-short { display:inline; }
}
@media (prefers-reduced-motion:reduce){ .cmc-launcher{ transition:none; } .cmc-launcher::after { animation:none; } }

/* ── Overlay + carte ───────────────────────────────────────────────────────── */
.cmc-modal {
  position:fixed; inset:0; z-index:9999; display:none;
  align-items:flex-start; justify-content:center; padding:26px 18px; overflow-y:auto;
  background:rgba(20,17,14,.58); backdrop-filter:blur(7px);
  font-family:var(--cmc-font); color:var(--cmc-ink);
}
.cmc-modal.is-open { display:flex; animation:cmc-fade .22s ease; }
.cmc-card {
  position:relative; width:100%; max-width:720px; margin:auto;
  background:var(--cmc-bg); border-radius:var(--cmc-radius); box-shadow:var(--cmc-shadow);
  padding:22px 36px 24px;
}
.cmc-card.cmc-wide { max-width:1060px; }
.cmc-page { display:flex; justify-content:center; padding:40px 16px 64px; background:var(--cmc-bg); min-height:100vh; }
.cmc-page .cmc-card { box-shadow:none; background:transparent; max-width:980px; padding:8px 6px; }
.cmc-page .cmc-close { display:none; }

.cmc-close {
  position:absolute; top:18px; right:18px; width:38px; height:38px; border-radius:50%;
  border:1px solid var(--cmc-line); background:#fff; color:var(--cmc-ink); cursor:pointer;
  display:grid; place-items:center; transition:background .15s; z-index:5;
}
.cmc-close:hover { background:var(--cmc-line-soft); }
.cmc-close svg { width:18px; height:18px; }

/* ── En-tête + branding ────────────────────────────────────────────────────── */
.cmc-head { text-align:center; margin-bottom:18px; }
.cmc-brand-badge { max-width:124px; height:auto; margin:-6px auto 4px; display:block; }
.cmc-brand { display:inline-flex; align-items:center; gap:9px; margin-bottom:14px; }
/* Vue résultats : on masque le titre/sous-titre/étapes pour gagner de la place. */
.cmc-results-mode .cmc-title, .cmc-results-mode .cmc-sub, .cmc-results-mode .cmc-steps { display:none; }
.cmc-results-mode .cmc-head { margin-bottom:10px; }
.cmc-results-mode .cmc-brand-badge { max-width:140px; margin-bottom:0; }
.cmc-brand svg { width:22px; height:22px; stroke:var(--cmc-gold); flex:none; }
.cmc-brand-name { font-size:13.5px; font-weight:600; color:var(--cmc-ink); }
.cmc-brand-name em { font-family:var(--cmc-serif); font-style:italic; font-weight:400; color:var(--cmc-gold); font-size:15px; }
.cmc-title { font-size:31px; line-height:1.13; margin:0 0 10px; font-weight:700; letter-spacing:-.01em; }
.cmc-title em { font-family:var(--cmc-serif); font-style:italic; font-weight:400; }
.cmc-sub { color:var(--cmc-muted); font-size:15.5px; margin:0 auto; max-width:480px; line-height:1.5; }

/* ── Barre d'étapes ────────────────────────────────────────────────────────── */
.cmc-steps { display:flex; gap:7px; justify-content:center; margin:0 0 30px; }
.cmc-steps span { width:42px; height:4px; border-radius:2px; background:var(--cmc-line); transition:background .3s, transform .3s; }
.cmc-steps span.is-done { background:var(--cmc-gold); }
.cmc-steps span.is-active { background:var(--cmc-navy); transform:scaleY(1.4); }

/* ── Étapes ────────────────────────────────────────────────────────────────── */
.cmc-step { animation:cmc-rise .28s cubic-bezier(.2,.8,.2,1); }
.cmc-q { font-size:22px; font-weight:650; text-align:center; margin:0 0 6px; letter-spacing:-.01em; }
.cmc-q-hint { font-size:14.5px; color:var(--cmc-muted); text-align:center; margin:0 0 26px; }

/* ── Grilles de choix ──────────────────────────────────────────────────────── */
.cmc-grid { display:grid; gap:12px; }
.cmc-grid.pieces { grid-template-columns:repeat(5,1fr); }
.cmc-grid.needs { grid-template-columns:repeat(3,1fr); }
.cmc-grid.styles { grid-template-columns:repeat(4,1fr); }
.cmc-grid.colors { grid-template-columns:repeat(5,1fr); }
@media (max-width:680px){
  .cmc-grid.pieces, .cmc-grid.colors { grid-template-columns:repeat(3,1fr); }
  .cmc-grid.styles { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:480px){
  .cmc-grid.pieces, .cmc-grid.colors, .cmc-grid.needs { grid-template-columns:repeat(2,1fr); }
}
.cmc-opt {
  position:relative; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:11px; min-height:112px; padding:16px 10px;
  border:1.5px solid var(--cmc-line); border-radius:15px; background:#fff; color:var(--cmc-ink);
  cursor:pointer; font-family:inherit; font-size:14px; font-weight:550; text-align:center; line-height:1.3;
  transition:border-color .16s, box-shadow .16s, transform .12s;
}
/* Hover désactivé sur tactile (classe .cmc-touch posée par le JS) : évite le « hover
   collant » qui fait paraître présélectionnée la case sous le doigt après un
   changement d'étape (ex. « chambre enfant » à la place du bouton Continuer). */
html:not(.cmc-touch) .cmc-opt:hover { border-color:var(--cmc-gold); transform:translateY(-2px); box-shadow:var(--cmc-shadow-sm); }
.cmc-opt.is-sel { border-color:var(--cmc-navy); box-shadow:inset 0 0 0 1.5px var(--cmc-navy); }
.cmc-opt .ico { width:36px; height:36px; display:grid; place-items:center; color:var(--cmc-navy); flex:none; }
.cmc-opt .ico svg { width:30px; height:30px; stroke:currentColor; fill:none; }
.cmc-opt .lbl { display:block; max-width:100%; overflow-wrap:break-word; word-break:break-word; }
.cmc-opt .swatch { width:34px; height:34px; border-radius:50%; border:1px solid rgba(0,0,0,.1); box-shadow:inset 0 0 0 2px #fff; flex:none; }
/* Options texte seul (styles) : compactes, pas besoin de la hauteur des cases à icône */
.cmc-grid.styles .cmc-opt { min-height:auto; padding:15px 12px; }
.cmc-opt .chk { position:absolute; top:9px; right:9px; width:20px; height:20px; border-radius:50%; border:1.5px solid var(--cmc-line); display:grid; place-items:center; background:#fff; }
.cmc-opt.is-sel .chk { background:var(--cmc-navy); border-color:var(--cmc-navy); }
.cmc-opt .chk svg { width:12px; height:12px; stroke:#fff; opacity:0; }
.cmc-opt.is-sel .chk svg { opacity:1; }

/* ── Hero « Conseillez-moi » ───────────────────────────────────────────────── */
.cmc-hero {
  display:flex; align-items:center; gap:22px; width:100%; text-align:left;
  padding:30px 34px; border:1.5px solid var(--cmc-navy); border-radius:18px;
  background:linear-gradient(180deg,#fff,#fbfaf8); color:var(--cmc-ink); cursor:pointer;
  font-family:inherit; transition:transform .14s, box-shadow .22s;
}
.cmc-hero:hover { transform:translateY(-2px); box-shadow:var(--cmc-shadow-sm); }
.cmc-hero .h-ico { flex:none; width:52px; height:52px; border-radius:14px; background:var(--cmc-navy); display:grid; place-items:center; }
.cmc-hero .h-ico svg { width:27px; height:27px; stroke:#fff; }
.cmc-hero .h-txt { flex:1; min-width:0; padding-right:10px; }
.cmc-hero .h-txt b { display:block; font-size:18px; font-weight:650; margin-bottom:6px; line-height:1.2; }
.cmc-hero .h-txt span { display:block; font-size:13px; color:var(--cmc-muted); line-height:1.5; }
.cmc-hero .h-arrow { flex:none; }
.cmc-hero .h-arrow svg { width:22px; height:22px; stroke:var(--cmc-navy); }
@media (max-width:560px){
  /* display:block = aucun risque de chevauchement (le flex sur <button> buggait) */
  .cmc-hero { display:block; text-align:center; padding:20px 16px; }
  .cmc-hero .h-ico { width:48px; height:48px; margin:0 auto 11px; }
  .cmc-hero .h-txt { display:block; width:auto; padding:0; }
  .cmc-hero .h-txt b { display:block; font-size:16.5px; margin-bottom:4px; }
  .cmc-hero .h-txt span { display:block; font-size:13px; overflow-wrap:break-word; }
  .cmc-hero .h-arrow { display:none; }
}

.cmc-or { display:flex; align-items:center; gap:14px; margin:20px 0; color:var(--cmc-muted); font-size:13px; }
.cmc-or::before, .cmc-or::after { content:""; flex:1; height:1px; background:var(--cmc-line); }
.cmc-refine-toggle { display:block; width:100%; text-align:center; background:none; border:none; cursor:pointer; color:var(--cmc-ink); font:inherit; font-weight:600; font-size:14.5px; padding:10px; text-decoration:underline; text-underline-offset:3px; }
.cmc-refine-label { font-size:13.5px; font-weight:600; color:var(--cmc-ink); margin:20px 0 11px; }
.cmc-opt-hint { font-weight:400; color:var(--cmc-muted); font-size:12.5px; }
.cmc-opt .cmc-opt-sub { display:block; font-size:11.5px; font-weight:400; color:var(--cmc-muted); margin-top:2px; }
.cmc-opt-row { display:flex; align-items:center; gap:13px; text-align:left; }
.cmc-opt-row .ico { flex:none; }

/* ── Boutons ───────────────────────────────────────────────────────────────── */
.cmc-actions { display:flex; gap:12px; margin-top:28px; }
.cmc-btn {
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  padding:15px 22px; border-radius:11px; font-family:inherit; font-size:15px; font-weight:600;
  cursor:pointer; border:1.5px solid transparent; text-decoration:none;
  transition:transform .13s, box-shadow .22s, background .2s, border-color .2s;
}
.cmc-btn:disabled { opacity:.45; cursor:default; }
.cmc-btn--primary { background:var(--cmc-navy); color:#fff; }
.cmc-btn--primary:hover:not(:disabled){ transform:translateY(-2px); box-shadow:0 14px 30px -14px rgba(15,30,46,.55); }
.cmc-btn--ghost { background:#fff; color:var(--cmc-ink); border-color:var(--cmc-line); }
.cmc-btn--ghost:hover { border-color:var(--cmc-gold); }
.cmc-btn--block { width:100%; }
.cmc-btn svg { width:19px; height:19px; flex:none; }
.cmc-btn--primary svg { stroke:#fff; }
.cmc-skip { display:block; margin:18px auto 0; background:none; border:none; color:var(--cmc-muted); cursor:pointer; font:inherit; font-size:13.5px; text-decoration:underline; text-underline-offset:3px; }
.cmc-skip:hover { color:var(--cmc-ink); }

/* ── Étape photo ───────────────────────────────────────────────────────────── */
.cmc-photo-zone { border:1.5px dashed var(--cmc-line); border-radius:16px; padding:30px 24px; text-align:center; background:#fff; }
.cmc-photo-zone .badge { display:inline-block; font-size:11px; font-weight:700; letter-spacing:.12em !important; text-transform:uppercase !important; color:var(--cmc-gold); background:var(--cmc-gold-tint); border:1px solid #ece0cf; padding:5px 13px; border-radius:999px; margin-bottom:16px; }
.cmc-photo-zone .pz-title { font-size:18px; font-weight:650; margin:0 0 7px; }
.cmc-photo-zone .pz-sub { font-size:14px; color:var(--cmc-muted); margin:0 auto 20px; max-width:400px; line-height:1.55; }
.cmc-thumbs { display:flex; flex-wrap:wrap; gap:11px; justify-content:center; margin-bottom:18px; }
.cmc-thumb { position:relative; width:100px; height:100px; border-radius:13px; overflow:hidden; border:1px solid var(--cmc-line); }
.cmc-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.cmc-thumb .rm { position:absolute; top:5px; right:5px; width:24px; height:24px; border-radius:50%; border:none; background:rgba(15,30,46,.72); color:#fff; cursor:pointer; display:grid; place-items:center; }
.cmc-thumb .rm svg { width:12px; height:12px; }
.cmc-thumb-add { width:100px; height:100px; border-radius:13px; border:1.5px dashed var(--cmc-line); background:#fff; cursor:pointer; display:grid; place-items:center; color:var(--cmc-muted); }
.cmc-thumb-add:hover { border-color:var(--cmc-gold); }
.cmc-thumb-add svg { width:24px; height:24px; stroke:var(--cmc-gold); }

/* ── Chargement wizard (expérience premium) ────────────────────────────────── */
.cmc-loading { text-align:center; padding:26px 10px 34px; animation:cmc-fade .2s ease; }
.cmc-load-stage { position:relative; width:100%; max-width:380px; height:210px; margin:0 auto 18px; border-radius:16px; overflow:hidden; box-shadow:var(--cmc-shadow-sm); background:linear-gradient(135deg,#0f1e2e,#2a3b4d); }
.cmc-load-photo { width:100%; height:100%; object-fit:cover; display:block; animation:cmc-kenburns 9s ease-in-out infinite alternate; }
.cmc-load-points { position:absolute; inset:0; pointer-events:none; }
.cmc-load-points span { position:absolute; width:18px; height:18px; border-radius:50%; background:var(--c); transform:translate(-50%,-50%) scale(0); box-shadow:0 0 0 3px rgba(255,255,255,.92), 0 0 14px 3px var(--c); animation:cmc-pointpop .55s cubic-bezier(.2,.9,.3,1.5) forwards; }
.cmc-load-stage.noimg { display:grid; place-items:center; }
.cmc-load-mark svg { width:56px; height:56px; stroke:var(--cmc-gold); animation:cmc-breathe 2.2s ease-in-out infinite; }
.cmc-load-stage::after { content:""; position:absolute; inset:0; box-shadow:inset 0 0 60px rgba(15,30,46,.45); pointer-events:none; }
.cmc-load-dots { display:flex; gap:10px; justify-content:center; height:20px; margin-bottom:16px; }
.cmc-load-dots span { width:17px; height:17px; border-radius:50%; border:2px solid #fff; box-shadow:0 2px 8px rgba(15,30,46,.25); transform:scale(0); animation:cmc-dotpop .5s cubic-bezier(.2,.9,.3,1.5) forwards; }
.cmc-load-msg { font-size:17.5px; font-weight:650; margin:0 0 5px; min-height:23px; letter-spacing:-.01em; }
.cmc-load-hint { font-size:12.5px; color:var(--cmc-muted); margin:0; }
.cmc-progress { height:6px; background:var(--cmc-line); border-radius:999px; overflow:hidden; max-width:380px; margin:18px auto 0; }
.cmc-progress > span { display:block; height:100%; width:0; background:linear-gradient(90deg,var(--cmc-gold),#c3b8a6); border-radius:999px; transition:width .25s ease; }

/* ── Résultats ─────────────────────────────────────────────────────────────── */
.cmc-results-head { text-align:center; margin-bottom:26px; }
.cmc-cards { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
/* Mobile : carrousel horizontal (swipe) avec aperçu de la carte suivante. */
@media (max-width:780px){
  .cmc-cards { display:flex; grid-template-columns:none; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; margin:0 -16px; padding:0 16px 8px; scrollbar-width:none; }
  .cmc-cards::-webkit-scrollbar { display:none; }
  .cmc-rcard { flex:0 0 70%; scroll-snap-align:center; }
}
.cmc-swipe-hint { display:none; }
@media (max-width:780px){ .cmc-swipe-hint { display:block; text-align:center; font-size:12.5px; color:var(--cmc-muted); margin:10px 0 0; } }
.cmc-rcard { background:#fff; border:1px solid var(--cmc-line); border-radius:16px; overflow:hidden; display:flex; flex-direction:column; box-shadow:var(--cmc-shadow-sm); animation:cmc-rise .35s cubic-bezier(.2,.8,.2,1) backwards; }
.cmc-rcard:nth-child(2){ animation-delay:.07s; } .cmc-rcard:nth-child(3){ animation-delay:.14s; }
/* Ratio 3:4 = format réel du tapis (vu en entier, sans crop). Le léger scale rogne
   uniquement le liseré blanc des photos vue-complete → rendu pro edge-to-edge. */
.cmc-rcard .img { position:relative; aspect-ratio:3/4; overflow:hidden; background:var(--cmc-line-soft); }
.cmc-rcard .img img { width:100%; height:100%; object-fit:cover; display:block; transform:scale(1.07); }
.cmc-coup { position:absolute; top:11px; left:11px; font-size:10.5px; font-weight:700; letter-spacing:.05em !important; color:var(--cmc-navy); background:rgba(255,255,255,.95); padding:5px 11px; border-radius:999px; box-shadow:var(--cmc-shadow-sm); display:inline-flex; align-items:center; gap:5px; }
.cmc-coup svg { width:13px; height:13px; stroke:var(--cmc-gold); }
.cmc-rcard .body { padding:17px 17px 18px; display:flex; flex-direction:column; gap:11px; flex:1; }
.cmc-rcard .nom { font-size:16px; font-weight:650; line-height:1.25; }
.cmc-rcard .why { font-size:14px; color:#5b6470; line-height:1.6; flex:1; }
.cmc-sizes { font-size:12.5px; color:#5b6470; line-height:1.4; }
.cmc-sizes span { display:inline-block; font-size:10px; font-weight:700; letter-spacing:.05em !important; text-transform:uppercase !important; color:var(--cmc-gold); margin-right:4px; }
.cmc-rcard .ract { display:flex; flex-direction:column; gap:9px; margin-top:4px; }

/* ── Visualisation in-place (lightbox) — animation identique au visualiseur ─── */
.cmc-lightbox { position:fixed; inset:0; z-index:10001; display:none; align-items:center; justify-content:center; padding:24px; background:rgba(15,30,46,.94); backdrop-filter:blur(4px); }
.cmc-lightbox.is-open { display:flex; animation:cmc-fade .2s ease; }
.cmc-lb-close { position:absolute; top:20px; right:20px; width:42px; height:42px; border-radius:50%; border:none; background:rgba(255,255,255,.16); color:#fff; cursor:pointer; display:grid; place-items:center; z-index:3; }
.cmc-lb-close svg { width:19px; height:19px; }
.cmc-viz { width:100%; max-width:620px; }
.cmc-viz-stage { position:relative; border-radius:14px; overflow:hidden; background:#0b1622; box-shadow:0 30px 70px -20px rgba(0,0,0,.7); }
.cmc-viz-stage img { width:100%; display:block; max-height:74vh; object-fit:contain; }
.cmc-viz-stage.zoomable img { cursor:pointer; }
.cmc-viz-expand { position:absolute; top:11px; right:11px; width:40px; height:40px; display:grid; place-items:center; background:rgba(15,30,46,.6); color:#fff; border:none; border-radius:10px; cursor:pointer; backdrop-filter:blur(2px); transition:background .15s; }
.cmc-viz-expand:hover { background:rgba(15,30,46,.8); }
.cmc-viz-expand svg { width:19px; height:19px; stroke:#fff; }
.cmc-viz-over { position:absolute; inset:0; display:grid; place-items:center; background:rgba(15,30,46,.55); backdrop-filter:blur(3px); }
.cmc-viz-panel { text-align:center; color:#fff; padding:24px; width:100%; max-width:320px; }
.cmc-pct { font-family:var(--cmc-serif); font-style:italic; font-size:46px; line-height:1; margin-bottom:10px; font-variant-numeric:tabular-nums; }
.cmc-viz-panel .msg { font-size:14.5px; font-weight:500; min-height:20px; opacity:.95; }
.cmc-viz-panel .hint { font-size:12px; opacity:.7; margin-top:5px; }
.cmc-vbar { height:5px; width:100%; margin:15px 0 8px; background:rgba(255,255,255,.22); border-radius:999px; overflow:hidden; }
.cmc-vbar > span { display:block; height:100%; width:0; background:var(--cmc-gold); border-radius:999px; transition:width .3s ease; }
.cmc-scan { position:absolute; left:0; right:0; height:40%; top:-40%; background:linear-gradient(180deg,transparent,rgba(160,149,132,.4),transparent); animation:cmc-scan 2.2s ease-in-out infinite; pointer-events:none; }
.cmc-viz-caption { color:#fff; text-align:center; font-size:14px; opacity:.9; margin:16px 0 6px; }
.cmc-viz-caption b { font-weight:600; }
.cmc-lb-actions { display:flex; gap:12px; flex-wrap:wrap; justify-content:center; margin-top:16px; }
/* Zoom plein écran du rendu */
.cmc-zoom { position:fixed; inset:0; z-index:10002; display:none; align-items:center; justify-content:center; padding:16px; background:rgba(7,12,18,.97); cursor:zoom-out; }
.cmc-zoom.is-open { display:flex; }
.cmc-zoom img { max-width:98vw; max-height:96vh; border-radius:6px; }

.cmc-error { background:#fbeae5; color:#9a3412; border:1px solid #f3c4b4; border-radius:12px; padding:14px 16px; font-size:14px; margin-bottom:18px; text-align:center; }
.cmc-foot { text-align:center; font-size:12.5px; color:var(--cmc-muted); margin:26px 0 4px; }

/* ── Animations ────────────────────────────────────────────────────────────── */
@keyframes cmc-fade { from{opacity:0} to{opacity:1} }
@keyframes cmc-rise { from{opacity:0; transform:translateY(14px)} to{opacity:1; transform:none} }
@keyframes cmc-spin { to{transform:rotate(360deg)} }
@keyframes cmc-scan { 0%{top:-40%} 100%{top:100%} }
@keyframes cmc-pop { from{opacity:0; transform:translateY(10px) scale(.9)} to{opacity:1; transform:none} }
@keyframes cmc-ping {
  0%   { box-shadow:0 0 0 0 rgba(160,149,132,.6); }
  70%  { box-shadow:0 0 0 16px rgba(160,149,132,0); }
  100% { box-shadow:0 0 0 0 rgba(160,149,132,0); }
}
@keyframes cmc-dotpop { to { transform:scale(1); } }
@keyframes cmc-breathe { 0%,100%{ transform:scale(1); opacity:.85 } 50%{ transform:scale(1.12); opacity:1 } }
@keyframes cmc-pointpop { to { transform:translate(-50%,-50%) scale(1); } }
@keyframes cmc-kenburns { from{ transform:scale(1) } to{ transform:scale(1.08) } }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width:600px){
  .cmc-modal { padding:14px 12px; }
  .cmc-card { padding:18px 16px 18px; border-radius:14px; }
  .cmc-close { top:12px; right:12px; width:34px; height:34px; }
  .cmc-head { margin-bottom:14px; }
  .cmc-brand-badge { max-width:104px; margin:-4px auto 2px; }
  .cmc-title { font-size:22px; }
  .cmc-sub { font-size:13.5px; max-width:340px; }
  .cmc-steps { margin-bottom:22px; }
  .cmc-steps span { width:34px; }
  .cmc-q { font-size:18px; }
  .cmc-q-hint { font-size:13px; margin-bottom:18px; }
  .cmc-grid { gap:9px; }
  .cmc-opt { min-height:90px; font-size:13px; padding:13px 8px; gap:8px; border-radius:13px; }
  .cmc-opt .ico { width:30px; height:30px; }
  .cmc-opt .ico svg { width:26px; height:26px; }
  .cmc-opt .swatch { width:28px; height:28px; }
  .cmc-refine-label { margin:16px 0 9px; }
  .cmc-actions { flex-direction:column-reverse; gap:9px; margin-top:20px; }
  .cmc-actions .cmc-btn { width:100%; }
  .cmc-btn { padding:13px 18px; font-size:14.5px; }
  .cmc-results-head { margin-bottom:16px; }
  .cmc-cards { gap:14px; }
  /* Vue résultats : on remonte encore le bloc (badge + titres) */
  .cmc-results-mode .cmc-brand-badge { max-width:92px; margin:-4px auto 0; }
  .cmc-results-mode .cmc-head { margin-bottom:10px; }
  /* Chargement */
  .cmc-loading { padding:16px 4px 24px; }
  .cmc-load-stage { height:165px; }
  .cmc-pct { font-size:38px; }
  /* Lightbox visualisation : la croix ne chevauche plus le contenu */
  .cmc-lightbox { padding:58px 12px 18px; align-items:flex-start; overflow-y:auto; }
  .cmc-lb-close { top:13px; right:13px; }
  .cmc-viz { margin:0 auto; }
  .cmc-viz-stage img { max-height:54vh; }
  .cmc-viz-caption { font-size:13px; }
  .cmc-lb-actions { gap:8px; margin-top:12px; }
  .cmc-lb-actions .cmc-btn { flex:1 1 100%; }
}
@media (max-width:400px){
  .cmc-grid.pieces, .cmc-grid.colors, .cmc-grid.needs, .cmc-grid.styles { grid-template-columns:repeat(2,1fr); }
  .cmc-title { font-size:20px; }
  .cmc-q { font-size:17px; }
  .cmc-opt { min-height:84px; font-size:12.5px; }
}
