/* ═══════════════════════════════════════════════════════════
   Configurateur — flat two-column layout
   30% form left · 70% preview right · max-width 1279px
   No shadows · sharp borders · no section cards
═══════════════════════════════════════════════════════════ */

/* ─── Page wrap ──────────────────────────────────────────── */

.cfg-wrap {
  display: flex;
  max-width: 1279px;
  margin: 0 auto;
  height: calc(100vh - 64px);
  overflow: hidden;
  border-left: 1px solid #E2E2E2;
  border-right: 1px solid #E2E2E2;
}

/* ─── Form column (30%) ──────────────────────────────────── */

.cfg-form {
  width: 30%;
  min-width: 0;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid #E2E2E2;
  flex-shrink: 0;
}

.cfg-form-inner {
  padding: 36px 28px 56px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── Field ──────────────────────────────────────────────── */

.cfg-field {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cfg-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 8px;
}

/* ─── Registration input ─────────────────────────────────── */

.cfg-reg-input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid #D0D0D0;
  border-radius: 0;
  background: #fff;
  font-family: 'Courier New', Courier, monospace;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  color: #111;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  transition: border-color 0.12s;
}

.cfg-reg-input::placeholder {
  color: #BEBEBE;
  letter-spacing: 0.1em;
}

.cfg-reg-input:focus   { border-color: #111; }
.cfg-reg-input.valid   { border-color: #16a34a; }
.cfg-reg-input.invalid { border-color: #dc2626; }

.cfg-feedback {
  font-size: 11px;
  height: 15px;
  margin-top: 4px;
  color: #dc2626;
}

/* ─── Select ─────────────────────────────────────────────── */

.cfg-select {
  width: 100%;
  height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid #D0D0D0;
  border-radius: 0;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  -webkit-appearance: none;
  appearance: none;
  font-size: 14px;
  font-weight: 500;
  color: #111;
  outline: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.12s;
}

.cfg-select:focus { border-color: #111; }

/* ─── Toggle (territorial band) ──────────────────────────── */

.cfg-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
  user-select: none;
}

.cfg-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.cfg-tog-ui {
  display: inline-block;
  width: 32px;
  height: 17px;
  background: #D0D0D0;
  border: 1px solid #C0C0C0;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.cfg-tog-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 11px;
  height: 11px;
  background: #888;
  transition: left 0.15s, background 0.15s;
}

.cfg-toggle input:checked + .cfg-tog-ui {
  background: #111;
  border-color: #111;
}

.cfg-toggle input:checked + .cfg-tog-ui::after {
  left: 17px;
  background: #fff;
}

/* ─── Two-option button row (type / finition) ────────────── */

.cfg-btn-row {
  display: flex;
}

.cfg-opt-btn {
  flex: 1;
  height: 40px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid #D0D0D0;
  border-right: none;
  font-size: 13px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  font-family: inherit;
}

.cfg-opt-btn:last-child {
  border-right: 1px solid #D0D0D0;
}

.cfg-opt-btn.active {
  background: #111;
  color: #fff;
  border-color: #111;
  z-index: 1;
  position: relative;
}

.cfg-opt-btn.active + .cfg-opt-btn {
  border-left-color: #111;
}

.cfg-price-tag {
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  background: #FFC500;
  color: #111;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
}

/* ─── Face checkboxes ────────────────────────────────────── */

.cfg-check-row {
  display: flex;
  gap: 20px;
}

.cfg-check-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  cursor: pointer;
}

.cfg-check {
  width: 15px;
  height: 15px;
  accent-color: #111;
  cursor: pointer;
  flex-shrink: 0;
}

.cfg-hint {
  font-size: 11px;
  color: #999;
  margin-top: 7px;
}

/* ─── Qty stepper ────────────────────────────────────────── */

.cfg-field-qty .cfg-label { margin-bottom: 8px; }

.cfg-qty {
  display: flex;
  align-items: stretch;
  width: fit-content;
  border: 1px solid #D0D0D0;
}

.cfg-qty-btn {
  width: 36px;
  height: 36px;
  background: #fff;
  border: none;
  font-size: 18px;
  color: #333;
  cursor: pointer;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
  font-family: inherit;
}

.cfg-qty-btn:hover { background: #F5F5F5; }

.cfg-qty-val {
  width: 44px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #111;
  font-variant-numeric: tabular-nums;
  border-left: 1px solid #D0D0D0;
  border-right: 1px solid #D0D0D0;
  line-height: 36px;
  height: 36px;
}

/* ─── Preview column (70%) ───────────────────────────────── */

.cfg-preview {
  width: 70%;
  min-width: 0;
  background: #0C0E14;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cfg-preview-inner {
  width: 72%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

/* ─── Canvas ─────────────────────────────────────────────── */

.cfg-canvas-wrap {
  width: 100%;
}

#plate-canvas {
  display: block;
  width: 100%;
  height: auto;
  border: none;
  outline: none;
}

/* ─── Reg / dim meta ─────────────────────────────────────── */

.cfg-preview-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid #1E2330;
  padding-bottom: 20px;
}

.cfg-meta-reg {
  font-family: 'Courier New', Courier, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
}

.cfg-meta-dim {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #444;
}

/* ─── Price block ────────────────────────────────────────── */

.cfg-price-block {
  width: 100%;
}

.cfg-price-main {
  display: block;
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 12px;
}

.cfg-price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cfg-pb-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #444;
  gap: 12px;
}

.cfg-pb-surcharge { color: #B87A00; }
.cfg-pb-pair      { color: #4A8C5C; }

/* ─── Add to basket ──────────────────────────────────────── */

.cfg-add-btn {
  width: 100%;
  height: 50px;
  background: #fff;
  color: #0C0E14;
  border: none;
  border-radius: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  transition: background 0.12s;
  font-family: inherit;
}

.cfg-add-btn:hover:not(:disabled) { background: #E8E8E8; }

.cfg-add-btn:disabled {
  background: #1E2330;
  color: #444;
  cursor: not-allowed;
}

/* ─── Trust line ─────────────────────────────────────────── */

.cfg-trust {
  font-size: 11px;
  color: #444;
  margin: 0;
  letter-spacing: 0.02em;
}

/* ─── Scrollbar (form column, minimal) ───────────────────── */

.cfg-form::-webkit-scrollbar { width: 4px; }
.cfg-form::-webkit-scrollbar-track { background: transparent; }
.cfg-form::-webkit-scrollbar-thumb { background: #E0E0E0; }

/* ─── Responsive ─────────────────────────────────────────── */

@media (max-width: 900px) {
  .cfg-wrap {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .cfg-form,
  .cfg-preview {
    width: 100%;
  }
  .cfg-form {
    overflow-y: visible;
    border-right: none;
    border-bottom: 1px solid #E2E2E2;
  }
  .cfg-preview {
    height: 56vw;
    min-height: 260px;
  }
  .cfg-preview-inner {
    width: 85%;
    gap: 18px;
  }
}

@media (max-width: 480px) {
  .cfg-form-inner { padding: 24px 18px 40px; gap: 20px; }
  .cfg-btn-row { flex-direction: column; }
  .cfg-opt-btn { border-right: 1px solid #D0D0D0; border-bottom: none; }
  .cfg-opt-btn:last-child { border-top: none; border-bottom: 1px solid #D0D0D0; }
  .cfg-opt-btn.active + .cfg-opt-btn { border-top-color: #111; border-left-color: #D0D0D0; }
}
