/* Config3D — Studio 3D du hero (fenêtre 3 panneaux façon éditeur, flèches de commutation) */

.stage { position: relative; max-width: 1180px; margin: 44px auto 0; padding: 0 64px; }

.studio {
  display: grid;
  grid-template-columns: 220px 1fr 256px;
  height: 600px;
  background: #fff;
  border: 1px solid var(--cfg-border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  text-align: left;
  font-size: 13px;
}

/* Flèches latérales */
.stage-arrow {
  position: absolute; top: 300px; transform: translateY(-50%); z-index: 3;
  width: 40px; height: 40px; border-radius: 999px;
  display: grid; place-items: center;
  background: #fff; border: 1px solid var(--cfg-border); color: var(--cfg-text-main);
  box-shadow: var(--shadow-sm); cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.stage-arrow:hover { border-color: var(--cfg-border-strong); }
.stage-prev { left: 8px; }
.stage-next { right: 8px; }
.stage-caption { margin-top: 16px; font-size: 13px; color: var(--cfg-text-subtle); text-align: center; }

/* Panneaux */
.pane { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.pane-left { border-right: 1px solid var(--cfg-border); }
.pane-right { border-left: 1px solid var(--cfg-border); }
.pane-head { padding: 14px 16px; border-bottom: 1px solid var(--cfg-border); }
.pane-head-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 16px; }
.pane-app { font-weight: 600; font-size: 13px; }
.pane-app-sub { font-size: 12px; color: var(--cfg-text-faint); }
.pane-tabs span { font-size: 12.5px; font-weight: 500; padding: 4px 8px; border-radius: 6px; background: var(--cfg-bg-muted); }
.pane-block { padding: 12px 16px; border-bottom: 1px solid var(--cfg-border); }
.pane-block:last-child { border-bottom: 0; }
.pane-label {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 12px; font-weight: 500; color: var(--cfg-text-main); margin-bottom: 10px;
}
.pane-label-val { font-weight: 400; color: var(--cfg-text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Listes (configurateurs / modèles) */
.list { list-style: none; margin: 0 -8px; padding: 0; display: grid; gap: 1px; }
.list button {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border: 0; border-radius: 6px; background: none;
  font-size: 13px; color: var(--cfg-text-muted); text-align: left; cursor: pointer;
}
.list button:hover { background: var(--cfg-bg-muted); color: var(--cfg-text-main); }
.list button.is-active { background: var(--cfg-bg-muted); color: var(--cfg-text-main); font-weight: 500; }
.list-n { width: 16px; color: var(--cfg-text-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.list-tree button { padding-left: 10px; }
.list-tree button svg { flex: none; color: var(--cfg-text-faint); }
.list-tree button.is-active { background: var(--cfg-primary-soft); color: var(--cfg-primary); }
.list-tree button.is-active svg { color: var(--cfg-primary); }

/* Viewport */
.viewport { position: relative; background: var(--cfg-bg-muted); min-width: 0; overflow: hidden; }
.vp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; transition: opacity .25s; }
.vp-canvas:active { cursor: grabbing; }
.vp-canvas.is-fading { opacity: 0; }
.vp-2d { position: absolute; inset: 0; display: grid; place-items: center; padding: 48px 32px 80px; }
.vp-2d[hidden] { display: none; }
.vp-2d svg { width: 100%; height: 100%; max-width: 560px; }
.vp-label {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  padding: 3px 8px; border-radius: 5px;
  background: var(--cfg-primary); color: #fff;
  font-size: 11.5px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.vp-hint {
  position: absolute; left: 16px; bottom: 22px;
  font-size: 11.5px; color: var(--cfg-text-faint); transition: opacity .4s; pointer-events: none;
}
.vp-hint.is-hidden { opacity: 0; }
.toolbar {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px; padding: 4px;
  background: #fff; border: 1px solid var(--cfg-border); border-radius: 10px; box-shadow: var(--shadow-sm);
}
.tool {
  height: 28px; padding: 0 10px; border: 0; border-radius: 6px; background: none;
  font-size: 12.5px; color: var(--cfg-text-muted); cursor: pointer; display: inline-flex; align-items: center; white-space: nowrap;
}
.tool:hover { background: var(--cfg-bg-muted); color: var(--cfg-text-main); }
.tool.is-active { background: var(--cfg-primary); color: #fff; }
.tool-icon { padding: 0 7px; }
.tool-sep { width: 1px; height: 16px; background: var(--cfg-border); margin: 0 4px; }

/* Champs */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field {
  display: flex; align-items: center; height: 30px; padding: 0 8px; gap: 6px; min-width: 0;
  background: var(--cfg-bg-muted); border: 1px solid transparent; border-radius: 6px;
  transition: border-color .15s, background .15s;
}
.field:focus-within { border-color: var(--cfg-primary); background: #fff; }
.field-k { font-size: 11.5px; color: var(--cfg-text-faint); }
.field input {
  flex: 1; min-width: 0; border: 0; background: none; padding: 0; outline: none;
  font-size: 12.5px; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield; appearance: textfield;
}
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field-u { font-size: 11.5px; color: var(--cfg-text-faint); }
.field input[aria-invalid="true"] { color: #DC2626; }
.field-note { margin-top: 8px; font-size: 11.5px; line-height: 1.45; color: var(--cfg-text-subtle); font-variant-numeric: tabular-nums; }
.field-note:empty { display: none; }
.field-note strong { color: var(--cfg-text-main); font-weight: 500; }

.seg { display: grid; grid-template-columns: 1fr; padding: 2px; gap: 2px; background: var(--cfg-bg-muted); border-radius: 7px; }
.seg button {
  height: 26px; padding: 0 8px; border: 0; border-radius: 5px; background: none; text-align: left;
  font-size: 12px; color: var(--cfg-text-subtle); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg button.is-active { background: #fff; color: var(--cfg-text-main); font-weight: 500; box-shadow: var(--shadow-sm); }

.select {
  width: 100%; height: 30px; padding: 0 26px 0 8px;
  border: 1px solid transparent; border-radius: 6px; background-color: var(--cfg-bg-muted);
  font-size: 12.5px; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 12px;
}
.select:focus { outline: none; border-color: var(--cfg-primary); }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 22px; height: 22px; border-radius: 999px; padding: 0; cursor: pointer;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px transparent;
  transition: box-shadow .15s;
}
.swatch.is-active { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--cfg-primary); }

/* Prix */
.pane-price { margin-top: auto; padding: 16px; border-top: 1px solid var(--cfg-border); background: var(--cfg-bg-subtle); }
.price-ttc { font-size: 24px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.2; }
.price-ht { font-size: 12px; color: var(--cfg-text-subtle); margin-top: 2px; }
.link-btn {
  margin-top: 10px; padding: 0; border: 0; background: none; cursor: pointer;
  font-size: 12px; color: var(--cfg-primary); font-weight: 500;
}
.link-btn:hover { text-decoration: underline; }

/* Responsive */
@media (max-width: 1080px) {
  .studio { grid-template-columns: 1fr 248px; }
  .pane-left { display: none; }
}
@media (max-width: 760px) {
  .stage { padding: 0; margin-top: 40px; }
  .studio { grid-template-columns: 1fr; grid-template-rows: 340px auto; height: auto; }
  .pane-right { border-left: 0; border-top: 1px solid var(--cfg-border); overflow: visible; }
  .stage-arrow { top: 170px; width: 36px; height: 36px; }
  .stage-prev { left: 10px; }
  .stage-next { right: 10px; }
  .vp-hint { display: none; }
}
