/* ═══════════════════════════════════════════════════════════════
   CONFIGURATEUR COUVERTINE — Step-based layout
   Metal Pliage · Dark industrial · #FF4500
═══════════════════════════════════════════════════════════════ */


/* ── PAGE HEADER ─────────────────────────────────────────────── */
.cfg-page-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
}
.cfg-page-header-inner { max-width: 680px; margin: 0 auto; }

.cfg-page-header-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  background: rgba(255,69,0,.1);
  border: 1px solid rgba(255,69,0,.25);
  border-radius: 3px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 0.75rem;
}

.cfg-page-header h1 {
  font-family: var(--font-head);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.cfg-page-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}


/* ── LAYOUT PRINCIPAL ────────────────────────────────────────── */
.config-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  align-items: start;
}


/* ── STEP SECTIONS ───────────────────────────────────────────── */
.step-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  transition: opacity 0.25s var(--ease), border-color 0.25s var(--ease);
}

.step-section--disabled {
  opacity: 0.38;
  pointer-events: none;
}

.step-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.step-num {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 50%;
  margin-top: 2px;
}

.step-header-text h2 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.step-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}


/* ── MATERIAL CARDS ──────────────────────────────────────────── */
.material-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.material-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  color: var(--text-primary);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
  position: relative;
}

.material-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.material-card.is-selected {
  border-color: var(--accent);
  background: rgba(255,69,0,.06);
}

.material-card-icon {
  margin-bottom: 0.25rem;
}

.material-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.material-card-body strong {
  font-size: 1rem;
  font-weight: 600;
}

.material-epaisseur {
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}

.material-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.material-card-check {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  color: var(--border);
  transition: color 0.2s;
}

.material-card.is-selected .material-card-check {
  color: var(--accent);
}


/* ── DIMENSION INPUTS ────────────────────────────────────────── */
.couvertine-preview {
  background: #0f1215;
  border: 1px solid #1e2830;
  border-radius: 12px;
  padding: 0;
  margin-bottom: 1.5rem;
  overflow: hidden;
  position: relative;
  min-height: 240px;
}

.couvertine-preview::after {
  content: 'Vue en coupe transversale';
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 10px;
  color: #2E404F;
  letter-spacing: 0.08em;
  font-family: var(--font-head);
  pointer-events: none;
}

#profile-svg {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#profile-svg.color-changing {
  animation: svgColorPulse 0.55s cubic-bezier(0.25, 0.1, 0.25, 1);
}
@keyframes svgColorPulse {
  0%   { opacity: 0.35; transform: scale(0.985); filter: brightness(1.15); }
  45%  { opacity: 0.85; transform: scale(1.005); filter: brightness(1.05); }
  100% { opacity: 1;    transform: scale(1);     filter: brightness(1); }
}
#mini-svg {
  transition: opacity 0.25s ease;
}
#mini-svg.color-changing {
  animation: miniColorPulse 0.45s ease;
}
@keyframes miniColorPulse {
  0%   { opacity: 0.5; }
  50%  { opacity: 0.85; }
  100% { opacity: 1; }
}

.dim-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dim-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 0.75rem;
}

.dim-row--info {
  opacity: 0.6;
  pointer-events: none;
}

.dim-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
}

.dim-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255,69,0,.15);
  color: var(--accent);
  border-radius: 4px;
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.dim-letter--fixed {
  background: rgba(255,255,255,.06);
  color: var(--text-secondary);
}

.dim-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.dim-input-wrap:focus-within {
  border-color: var(--accent);
}

.dim-input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.55rem 0.75rem;
  width: 100%;
  outline: none;
  -moz-appearance: textfield;
}

.dim-input::-webkit-outer-spin-button,
.dim-input::-webkit-inner-spin-button { -webkit-appearance: none; }

.dim-unit {
  padding: 0 0.65rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-left: 1px solid var(--border);
  background: var(--bg-card);
  align-self: stretch;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.dim-hint {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dim-fixed-val {
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding: 0.55rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.dim-fixed-val em { font-style: italic; font-size: 0.8rem; }

.info-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.info-sep { opacity: 0.3; }


/* ── RAL SWATCHES ────────────────────────────────────────────── */
.ral-grid {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.ral-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-body);
}

.ral-swatch-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid transparent;
  outline: 2px solid transparent;
  outline-offset: 3px;
  transition: border-color 0.15s, outline-color 0.15s, transform 0.15s;
}

.ral-swatch:hover .ral-swatch-circle {
  transform: scale(1.08);
}

.ral-swatch.is-selected .ral-swatch-circle {
  border-color: #fff;
  outline-color: var(--accent);
  transform: scale(1.1);
}

.ral-swatch-name {
  font-size: 0.62rem;
  color: var(--text-secondary);
  text-align: center;
  max-width: 58px;
  line-height: 1.35;
}

.ral-swatch-name em {
  font-style: normal;
  display: block;
  color: var(--text-muted);
  font-size: 0.58rem;
}

.btn-autre-ral {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px dashed var(--border-hover);
  border-radius: 8px;
  padding: 0.65rem 1rem;
  transition: color 0.2s, border-color 0.2s;
  text-decoration: none;
}

.btn-autre-ral:hover {
  color: var(--accent);
  border-color: var(--accent);
}


/* ── ACCESSOIRES ─────────────────────────────────────────────── */
.accessories-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.accessory-row {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-wrap: wrap;
}

.accessory-icon { flex-shrink: 0; }

.accessory-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.accessory-info strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.accessory-price {
  font-size: 0.78rem;
  color: var(--accent);
}

.accessory-qty {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.accessory-colors {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.accessory-colors .ral-swatch-circle {
  width: 28px;
  height: 28px;
  border-width: 2px;
  outline-width: 2px;
}

/* When accessory qty = 0, hide color swatches */
.accessory-row.acc-inactive .accessory-colors {
  opacity: 0.3;
  pointer-events: none;
}


/* ── QTY CONTROLS ────────────────────────────────────────────── */
.qty-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.qty-btn:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent);
}

.qty-input {
  width: 48px;
  text-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.35rem;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }


/* STEP 5 big qty */
.qty-row-main {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.qty-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  min-width: 80px;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn--lg {
  width: 40px;
  height: 40px;
  font-size: 1.3rem;
}

.qty-input--lg {
  width: 64px;
  height: 40px;
  font-size: 1.1rem;
}

.step5-price-block {
  padding: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.step5-price-ht {
  font-family: var(--font-head);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.step5-price-ht em {
  font-size: 1.1rem;
  font-style: normal;
  color: var(--text-secondary);
  font-weight: 400;
}

.step5-price-ttc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}

.step5-ctas {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}


/* ── SIDEBAR ─────────────────────────────────────────────────── */
.config-sidebar {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sidebar-head h3 {
  font-family: var(--font-head);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.sidebar-svg-mini {
  background: #12161a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 110px;
}

#mini-svg {
  width: 100%;
  max-height: 110px;
}

.sidebar-recap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.recap-row {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.5rem;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.recap-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recap-row dt {
  color: var(--text-secondary);
  font-weight: 500;
}

.recap-row dd {
  color: var(--text-primary);
  font-weight: 400;
}

.sidebar-price-block {
  padding: 1rem;
  background: rgba(255,69,0,.06);
  border: 1px solid rgba(255,69,0,.2);
  border-radius: 8px;
}

.sidebar-price-ht {
  font-family: var(--font-head);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.sidebar-price-ht em {
  font-size: 0.9rem;
  font-style: normal;
  color: var(--text-secondary);
  font-weight: 400;
}

.sidebar-price-ttc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

.sidebar-ctas {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sidebar-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}


/* ── BUTTONS ─────────────────────────────────────────────────── */
.btn-full { width: 100%; text-align: center; justify-content: center; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  color: var(--text-primary);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-hover);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}


/* ── CART FAB ────────────────────────────────────────────────── */
.cart-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,69,0,.35);
  z-index: 100;
  transition: background 0.2s, transform 0.15s;
}

.cart-fab:hover { background: var(--accent-hover); transform: scale(1.06); }

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background: #fff;
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 0 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.cart-badge.has-items { opacity: 1; }


/* ── CART DRAWER ─────────────────────────────────────────────── */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100dvh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 500;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out);
}

.cart-drawer:not([hidden]) { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.cart-drawer-header h2 {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
}

.cart-close {
  font-size: 1.5rem;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  transition: color 0.15s;
}

.cart-close:hover { color: var(--text-primary); }

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem;
}

.cart-empty {
  color: var(--text-secondary);
  text-align: center;
  padding: 3rem 0;
  font-size: 0.9rem;
}

.cart-items { display: flex; flex-direction: column; gap: 0.75rem; }

.cart-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-total {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 499;
  opacity: 0;
  transition: opacity 0.3s;
}

.cart-backdrop:not([hidden]) { opacity: 1; }


/* ── Blocs accessoires (schéma + ligne d'achat couplés) ─────── */
.acc-blocks {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.acc-block {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .2s;
}

.acc-block:hover {
  border-color: rgba(255,69,0,0.35);
}

/* schéma à l'intérieur d'un bloc — pas de bordure ni fond propre */
.acc-block .acc-diag-card {
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: default;
}

.acc-block .acc-diag-card:hover {
  background: transparent;
  border: none;
}

/* ligne d'achat à l'intérieur d'un bloc — séparée du schéma par un trait fin */
.acc-block .accessory-row {
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: rgba(255,69,0,0.02);
}

/* ── Schémas accessoires (cartes — kept for backwards compat) ── */
.acc-diagrams-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.acc-diag-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

.acc-diag-card:hover {
  border-color: var(--accent);
  background: rgba(255,69,0,.04);
}

.acc-diag-num {
  position: absolute;
  top: .55rem;
  left: .65rem;
  width: 22px;
  height: 22px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  color: #fff;
  z-index: 1;
  font-family: var(--font-head);
}

.acc-diag-svgwrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.acc-diag-info {
  padding: .65rem .8rem .75rem;
  border-top: 1px solid var(--border);
}

.acc-diag-info strong {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: .25rem;
}

.acc-diag-info span {
  font-size: .73rem;
  color: var(--text-secondary);
  line-height: 1.4;
}


/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .config-layout {
    grid-template-columns: 1fr;
  }
  .config-sidebar {
    position: static;
    order: -1;
  }
}

@media (max-width: 600px) {
  .material-cards { grid-template-columns: 1fr; }

  .dim-row {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }
  .dim-label { grid-column: 1 / -1; }
  .dim-hint { grid-column: 1 / -1; }

  .accessory-row {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
  }
  .accessory-qty { grid-column: 2; }
  .accessory-colors { grid-column: 1 / -1; }
  .acc-diagrams-grid { grid-template-columns: 1fr; }
}
