/* ============================================================
   Configurateur Casa Modular : choix du modèle, étapes numérotées en cartes,
   aperçu dessiné, récapitulatif fixe ; barre de prix fixe sur téléphone.
   ============================================================ */
.cz-page { --z-navy: #062440; --z-navy-2: #0b3a66; --z-accent: #0b78c2; --z-accent-2: #0a68a8; --z-ok: #0b78c2; --z-line: #e3e9ef; --z-soft: #f3f6f9; --z-muted: #5c6b79; padding-bottom: 6rem; }
.cz-page .status-msg:empty { display: none; }

.cz-hero { position: relative; overflow: hidden; margin: .5rem 0 1.5rem; padding: clamp(1.6rem, 4.5vw, 2.8rem) clamp(1.3rem, 4vw, 2.6rem); border-radius: 24px; color: #fff;
  background: radial-gradient(520px 240px at 100% 0%, rgba(11, 120, 194, .5), transparent 70%), linear-gradient(135deg, var(--z-navy), var(--z-navy-2)); }
.cz-eyebrow { display: flex; align-items: center; gap: .8rem; margin: 0 0 .6rem; color: #7cc3f2; font-size: .8rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; }
.cz-eyebrow::before { content: ""; width: 2rem; height: 2px; background: currentColor; }
.cz-hero h1 { margin: 0; color: #fff; font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.12; overflow-wrap: anywhere; }
.cz-lead { max-width: 640px; margin: .7rem 0 0; color: #d7e2ec; line-height: 1.6; }

.cz-h2 { display: flex; align-items: center; gap: .8rem; margin: 0 0 1rem; font-size: 1.3rem; color: var(--z-navy); }
.cz-num { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--z-navy); color: #fff; font-size: .95rem; font-weight: 800; }
.cz-num.is-done { background: var(--z-ok); }

/* ---------- Choix du modèle ---------- */
.cz-filters { display: flex; gap: .5rem; margin: 0 0 1.2rem; padding: 2px 2px 6px; overflow-x: auto; scrollbar-width: none; }
.cz-filters::-webkit-scrollbar { display: none; }
.cz-filter { flex: none; min-height: 42px; padding: 0 1.1rem; border: 1.5px solid var(--z-line); border-radius: 999px; background: #fff; color: var(--z-navy); font: inherit; font-weight: 700; cursor: pointer; }
.cz-filter.is-on { background: var(--z-navy); border-color: var(--z-navy); color: #fff; }
.cz-model-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cz-model { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--z-line); border-radius: 20px; background: #fff; color: inherit; text-decoration: none; transition: transform .25s cubic-bezier(.22, 1, .36, 1), box-shadow .25s, border-color .2s; }
.cz-model:hover, .cz-model:focus-visible { transform: translateY(-4px); border-color: #c9dceb; box-shadow: 0 22px 40px -24px rgba(6, 36, 64, .45); }
.cz-model__media { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(135deg, #f4f6f9, #e9edf2); overflow: hidden; }
.cz-model__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.22, 1, .36, 1); }
.cz-model:hover .cz-model__media img { transform: scale(1.05); }
.cz-model__size { position: absolute; top: 12px; left: 12px; padding: 5px 12px; border-radius: 999px; background: rgba(6, 36, 64, .82); color: #fff; font-size: .8rem; font-weight: 800; letter-spacing: .04em; }
.cz-model__body { display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.1rem 1.15rem; flex: 1; }
.cz-model__name { color: var(--z-navy); font-size: 1rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cz-model__price { color: var(--z-muted); font-size: .9rem; font-weight: 600; }
.cz-model__go { margin-top: auto; padding-top: .6rem; color: var(--z-accent); font-weight: 800; font-size: .92rem; }
.cz-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2.5rem 1rem; border: 1.5px dashed #d5dce7; border-radius: 20px; text-align: center; color: var(--z-muted); }

/* ---------- Mise en page de la configuration ---------- */
.cz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 2rem; align-items: start; }
.cz[hidden], .cz-models[hidden] { display: none; }
.cz-model-bar { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; padding: .8rem 1rem; border: 1px solid var(--z-line); border-radius: 18px; background: #fff; }
.cz-model-bar img { width: 64px; height: 48px; object-fit: cover; border-radius: 10px; flex: none; }
.cz-model-bar__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cz-model-bar__text strong { color: var(--z-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-model-bar__text small { color: var(--z-muted); font-size: .8rem; }
.cz-change { flex: none; padding: .55rem .9rem; border: 1.5px solid var(--z-line); border-radius: 999px; background: #fff; color: var(--z-accent); font: inherit; font-size: .85rem; font-weight: 800; cursor: pointer; }
.cz-change:hover { border-color: var(--z-accent); }

/* Étapes */
.cz-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.cz-step { border: 1px solid var(--z-line); border-radius: 18px; background: #fff; overflow: hidden; transition: box-shadow .2s, border-color .2s; }
.cz-step.is-open { border-color: #b9d6ec; box-shadow: 0 18px 36px -26px rgba(6, 36, 64, .5); }
.cz-step__head { display: flex; align-items: center; gap: .9rem; width: 100%; padding: 1rem 1.1rem; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.cz-step__titles { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cz-step__title { color: var(--z-navy); font-size: 1.05rem; font-weight: 800; }
.cz-step__sub { color: var(--z-muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-step.is-done .cz-step__sub { color: var(--z-ok); font-weight: 600; }
.cz-step__chev { flex: none; width: 10px; height: 10px; border-right: 2.5px solid var(--z-muted); border-bottom: 2.5px solid var(--z-muted); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
.cz-step.is-open .cz-step__chev { transform: rotate(-135deg); }
.cz-step__body { padding: 0 1.1rem 1.2rem; animation: cz-in .22s ease-out; }
@keyframes cz-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.cz-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .6rem; }
.cz-opt { position: relative; display: flex; align-items: center; gap: .8rem; min-height: 64px; padding: .8rem 2.6rem .8rem 1rem; border: 1.5px solid var(--z-line); border-radius: 14px; background: #fff; font: inherit; text-align: left; color: inherit; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.cz-opt:hover { border-color: #9cc9ea; }
.cz-opt.is-on { border-color: var(--z-accent); background: #eef6fc; box-shadow: 0 0 0 1px var(--z-accent); }
.cz-opt:focus-visible { outline: 3px solid rgba(11, 120, 194, .35); outline-offset: 2px; }
.cz-opt__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cz-opt__text strong { color: var(--z-navy); font-size: .93rem; line-height: 1.35; }
.cz-opt__text small { color: var(--z-muted); font-size: .82rem; font-weight: 600; }
.cz-opt.is-on .cz-opt__text small { color: var(--z-accent); }
.cz-check { position: absolute; top: 50%; right: .9rem; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; border: 2px solid #c9d2dc; background: #fff; }
.cz-opt.is-on .cz-check { border-color: var(--z-accent); background: var(--z-accent); }
.cz-opt.is-on .cz-check::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.cz-opts--colors { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.cz-swatch { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px #c9d2dc, inset 0 -6px 10px rgba(0, 0, 0, .15); }
.cz-opt.is-on .cz-swatch { box-shadow: 0 0 0 2px var(--z-accent), inset 0 -6px 10px rgba(0, 0, 0, .15); }
.cz-opt--qty { cursor: default; padding-right: 1rem; justify-content: space-between; }
.cz-stepper { flex: none; display: inline-flex; align-items: center; gap: .3rem; padding: 4px; border-radius: 999px; background: var(--z-soft); }
.cz-qbtn { width: 38px; height: 38px; border: 0; border-radius: 50%; background: #fff; color: var(--z-navy); font-size: 1.25rem; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px -3px rgba(15, 23, 42, .35); }
.cz-qbtn:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.cz-stepper output { min-width: 1.8rem; text-align: center; font-weight: 800; color: var(--z-navy); }
.cz-next { margin-top: 1rem; padding: .7rem 1.2rem; border: 0; border-radius: 999px; background: var(--z-navy); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }

/* ---------- Colonne de droite : aperçu + récapitulatif ---------- */
.cz-side { position: sticky; top: 90px; display: grid; gap: 1rem; }
.cz-preview { padding: 1rem 1rem .6rem; border-radius: 22px; border: 1px solid var(--z-line); background: radial-gradient(120% 120% at 20% 0%, #ffffff 0%, #eef3f8 60%, #e3eaf1 100%); }
.cz-preview__stage svg { display: block; width: 100%; height: auto; }
.cz-preview__hint { margin: .3rem 0 0; font-size: .75rem; color: var(--z-muted); text-align: center; }
.cz-summary { padding: 1.3rem 1.3rem 1.2rem; border-radius: 22px; border: 1px solid var(--z-line); background: #fff; box-shadow: 0 14px 34px -26px rgba(15, 23, 42, .4); }
.cz-summary h2 { margin: 0 0 .8rem; font-size: 1.1rem; color: var(--z-navy); }
.cz-lines { display: grid; gap: .45rem; }
.cz-line { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; color: #24313d; }
.cz-line span:first-child { min-width: 0; }
.cz-line span:last-child { flex: none; font-weight: 700; color: var(--z-navy); }
.cz-line--base { padding-bottom: .45rem; border-bottom: 1px dashed #d5dce7; }
.cz-missing { margin: 0; padding: .7rem .8rem; border-radius: 12px; background: #fff7e6; color: #92400e; font-size: .88rem; }
.cz-total { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-top: .9rem; padding-top: .9rem; border-top: 1px solid var(--z-line); }
.cz-total:empty { display: none; }
.cz-total span { font-weight: 700; color: var(--z-navy); }
.cz-total strong { font-size: 1.7rem; font-weight: 800; color: var(--z-navy); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.cz-leadtime { margin: .5rem 0 0; font-size: .88rem; font-weight: 600; color: var(--z-ok); }
.cz-leadtime:empty { display: none; }
.cz-cta { display: grid; gap: .6rem; margin-top: 1.1rem; }
.cz-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 1.4rem; border-radius: 14px; border: 0; font: inherit; font-size: 1rem; font-weight: 800; text-decoration: none; cursor: pointer; transition: background .15s, transform .15s; }
.cz-btn--primary { background: var(--z-accent); color: #fff; box-shadow: 0 12px 24px -14px rgba(11, 120, 194, .9); }
.cz-btn--primary:hover { background: var(--z-accent-2); transform: translateY(-1px); }
.cz-btn--ghost { background: #fff; color: var(--z-navy); border: 1.5px solid var(--z-line); }
.cz-btn--ghost:hover { border-color: var(--z-navy); }
.cz-share { display: grid; gap: .5rem; margin-top: .8rem; }
.cz-share[hidden] { display: none; }
.cz-disclaimer { margin: .9rem 0 0; font-size: .75rem; line-height: 1.5; color: var(--z-muted); }
.cz-mobilebar { display: none; }

/* ---------- Tablette et téléphone ---------- */
@media (max-width: 980px) {
  .cz { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .cz-side { position: static; order: -1; }
  .cz-summary { order: 2; }
  .cz-main { order: 1; }
  .cz-side { display: contents; }
  .cz-preview { order: 0; position: sticky; top: 74px; z-index: 5; padding: .5rem .6rem .2rem; box-shadow: 0 10px 24px -18px rgba(6, 36, 64, .5); }
  .cz-preview__hint { display: none; }
  .cz-mobilebar { position: fixed; left: 0; right: 0; bottom: env(safe-area-inset-bottom); z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--z-line); box-shadow: 0 -10px 24px -18px rgba(6, 36, 64, .5); }
  .cz-mobilebar div { display: flex; flex-direction: column; min-width: 0; }
  .cz-mobilebar small { font-size: .75rem; color: var(--z-muted); font-weight: 600; }
  .cz-mobilebar strong { font-size: 1.3rem; color: var(--z-navy); font-variant-numeric: tabular-nums; }
  .cz-mobilebar .cz-btn { min-height: 46px; padding: 0 1.1rem; font-size: .92rem; }
  .cz-page { padding-bottom: 10rem; }
}
@media (min-width: 981px) { .cz-mobilebar { display: none !important; } }
@media (max-width: 720px) { .cz-mobilebar { bottom: calc(86px + env(safe-area-inset-bottom)); left: 10px; right: 10px; border-radius: 18px; border: 1px solid var(--z-line); } .cz-preview { top: 62px; } .cz-page { padding-bottom: 12rem; } }
@media (max-width: 600px) {
  .cz-hero { border-radius: 20px; margin-top: 0; }
  .cz-opts, .cz-opts--colors { grid-template-columns: minmax(0, 1fr); }
  .cz-opts--colors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cz-opt--color { flex-direction: column; align-items: flex-start; padding: .8rem; }
  .cz-opt--color .cz-check { top: 14px; margin-top: 0; }
  .cz-model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .cz-model { border-radius: 16px; }
  .cz-model__body { padding: .7rem .75rem .85rem; }
  .cz-model__name { font-size: .88rem; }
  .cz-model__price { font-size: .78rem; }
  .cz-model__go { font-size: .82rem; }
  .cz-step__head { padding: .9rem; }
  .cz-step__body { padding: 0 .9rem 1rem; }
  .cz-model-bar img { display: none; }
}
@media (prefers-reduced-motion: reduce) { .cz-model, .cz-model__media img, .cz-step__body { transition: none; animation: none; } }
/* Boutons flottants (panier, chat) au-dessus de la barre de prix */
@media (max-width: 980px) {
  body:has(.cz:not([hidden])) .cart-fab { bottom: calc(96px + env(safe-area-inset-bottom)) !important; }
  body:has(.cz:not([hidden])) #chat-btn { bottom: 96px !important; }
}
@media (max-width: 720px) {
  body:has(.cz:not([hidden])) .cart-fab { bottom: calc(150px + env(safe-area-inset-bottom)) !important; }
  body:has(.cz:not([hidden])) #chat-btn { bottom: 150px !important; }
}
