/* =============================================================================
   DRIMBOT — Configurateur 3D
   ============================================================================= */

.cfg {
  display: grid;
  grid-template-columns: 55fr 45fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
  align-items: start;
  padding-block: clamp(1.5rem, 3vw, 2.5rem) var(--section-y);
}

/* ---------------------------------------------------------------------------
   Colonne gauche — scène 3D
--------------------------------------------------------------------------- */
.cfg__stage-col {
  position: sticky;
  top: 96px;
}
.cfg__stage {
  position: relative;
  height: calc(100vh - 150px);
  min-height: 480px;
  max-height: 820px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background:
    radial-gradient(640px 420px at 50% 62%, #FFFFFF 0%, transparent 70%),
    radial-gradient(var(--line) 1px, transparent 1.5px) 0 0 / 24px 24px,
    linear-gradient(180deg, #FAF9F5, #F1EFE8);
  cursor: grab;
}
.cfg__stage:active { cursor: grabbing; }
.cfg__stage canvas { position: absolute; inset: 0; }

.cfg__legend {
  position: absolute;
  top: 1rem;
  left: 1rem;
  display: flex;
  gap: .5rem;
  z-index: 2;
  pointer-events: none;
}
.cfg__hint {
  position: absolute;
  bottom: 1.1rem;
  left: 50%;
  translate: -50% 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: .55em 1.1em;
  pointer-events: none;
  transition: opacity .5s ease;
}
.cfg__hint.is-hidden { opacity: 0; }
.cfg__hint svg { width: 16px; height: 16px; }

.cfg__under {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.1rem;
  font-size: .82rem;
  color: var(--ink-2);
}
.cfg__under span { display: inline-flex; align-items: center; gap: .45em; }
.cfg__under svg { width: 15px; height: 15px; color: var(--ok); flex: none; }

/* ---------------------------------------------------------------------------
   Colonne droite — options
--------------------------------------------------------------------------- */
.cfg-group { margin-bottom: 2.4rem; }
.cfg-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .4rem;
}
.cfg-group__head h2 { font-size: 1.18rem; margin: 0; }
.cfg-group__sub { font-size: .85rem; color: var(--ink-3); margin: 0 0 1rem; }
.cfg-group .opt + .opt { margin-top: .6rem; }

/* Pastilles de couleur (habillage) */
.swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgb(0 0 0 / .12);
  vertical-align: -2px;
  margin-right: .4em;
}

/* Sélecteur du nombre de jours */
.cfg-days {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-top: .9rem;
  padding: .8rem 1rem;
  background: var(--cobalt-tint);
  border: 1px dashed color-mix(in srgb, var(--cobalt) 35%, var(--line));
  border-radius: var(--r-md);
}
.cfg-days__btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.cfg-days__btn:hover { background: var(--ink); color: #fff; }
.cfg-days__val {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 600;
  min-width: 2ch;
  text-align: center;
}
.cfg-days__label { font-size: .8rem; color: var(--ink-2); }

/* ---------------------------------------------------------------------------
   Carte de prix temps réel (flux normal — le suivi pendant le défilement est
   assuré par la barre fixe .cfg-bar, qui n'influe jamais sur la mise en page)
--------------------------------------------------------------------------- */
.cfg-price {
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  padding: 1.5rem;
}

.cfg-price__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.cfg-price__head h2 { font-size: 1.05rem; margin: 0; }

/* .cfg-line : styles partagés définis dans app.css */

.cfg-price__totals { margin-top: .8rem; }
.cfg-price__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .88rem;
  color: var(--ink-2);
  padding: .2rem 0;
}
.cfg-price__row--ttc {
  align-items: center;
  margin-top: .5rem;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.cfg-price__row--ttc .label { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.cfg-price__deposit {
  margin-top: .6rem;
  font-size: .78rem;
  color: var(--ink-3);
  text-align: right;
}
.cfg-price__deposit .price { color: var(--accent); }

.cfg-price__ctas { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.1rem; }

.cfg-price.is-quote-only .cfg-price__row--ttc .price--xl { font-size: clamp(1.4rem, 3vw, 1.8rem); color: var(--cobalt); }

/* ---------------------------------------------------------------------------
   Barre de devis fixe — total TTC + CTA, visible quand la carte de prix est
   hors écran. position:fixed : elle ne modifie jamais la mise en page, donc
   aucune boucle d'oscillation possible (cause du bug de l'ancienne sticky).
--------------------------------------------------------------------------- */
.cfg-bar {
  position: fixed;
  left: 50%;
  bottom: .9rem;
  z-index: 920; /* sous le modal (950) */
  width: min(820px, calc(100vw - 1.5rem));
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1.2rem;
  padding: .75rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--ink);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  translate: -50% calc(100% + 1.5rem);
  opacity: 0;
  pointer-events: none;
  transition: translate .35s var(--ease-out), opacity .25s var(--ease-out);
}
.cfg-bar.is-visible {
  translate: -50% 0;
  opacity: 1;
  pointer-events: auto;
}
.cfg-bar__total { display: flex; align-items: baseline; gap: .7rem; }
.cfg-bar__label { font-family: var(--font-display); font-weight: 700; font-size: .95rem; }
.cfg-bar__total .price--xl { font-size: clamp(1.35rem, 3vw, 1.7rem); }
.cfg-bar.is-quote-only .price--xl { color: var(--cobalt); }
.cfg-bar__ctas { display: flex; flex-wrap: wrap; gap: .6rem; }

@media (prefers-reduced-motion: reduce) {
  .cfg-bar { transition: opacity .2s linear; }
}

/* ---------------------------------------------------------------------------
   Section pré-réservation (#prereservation)
--------------------------------------------------------------------------- */
.cfg-prereserve {
  border-radius: var(--r-lg);
  background: var(--ink-surface);
  color: var(--ink-inverse);
  padding: clamp(2rem, 5vw, 3.5rem);
  position: relative;
  overflow: hidden;
}
.cfg-prereserve::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(440px 280px at 85% 15%, rgb(0 155 97 / .2), transparent 60%),
    radial-gradient(rgb(255 255 255 / .07) 1px, transparent 1.5px) 0 0 / 24px 24px;
  pointer-events: none;
}
.cfg-prereserve > * { position: relative; }
.cfg-prereserve .tag-row { margin: 1.2rem 0 1.8rem; }
.cfg-prereserve .spec-tag { background: rgb(255 255 255 / .07); border-color: rgb(255 255 255 / .16); color: #DDE1E8; }
.cfg-prereserve .spec-tag--accent { background: rgb(0 155 97 / .2); border-color: rgb(0 155 97 / .55); color: #7CEDBB; }

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */
@media (max-width: 980px) {
  .cfg { grid-template-columns: 1fr; }
  .cfg__stage-col { position: sticky; top: 64px; z-index: 30; }
  .cfg__stage { height: 46vh; min-height: 340px; border-radius: var(--r-md); }
  .cfg__under { display: none; }
  .cfg-price { padding: 1.1rem; }
  .cfg-bar { bottom: .5rem; padding: .65rem .9rem; }
  .cfg-bar__ctas { flex: 1 1 100%; }
  .cfg-bar__ctas .btn { flex: 1 1 auto; }
}
