/* Customizer page. Uses the colour variables from styles.css (--bg, --text,
   --muted, --line, --card); only adds new classes, never redefines existing ones. */

.hidden { display: none !important; }

/* ---------- Model-type tabs ---------- */
.cz-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.cz-tab {
  font: inherit;
  font-size: 14px;
  padding: 9px 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}
.cz-tab:hover { color: var(--text); border-color: #cfcfcf; }
.cz-tab.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

/* ---------- Two-column layout ---------- */
.cz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr);
  gap: 28px;
  align-items: start;
}

.cz-preview {
  position: sticky;
  top: 16px;
}
.cz-viewport {
  position: relative;
  width: 100%;
  height: 480px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #f1f2f4;
  overflow: hidden;
}
.cz-viewport canvas { display: block; width: 100%; height: 100%; }

.cz-loading {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}
.cz-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ---------- Controls panel ---------- */
.cz-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
}
.cz-description {
  margin: 0 0 18px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.cz-controls { display: grid; gap: 16px; margin-bottom: 18px; }

.cz-group {
  margin: 4px 0 -4px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.cz-controls > .cz-group:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.cz-field-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 13px;
}
.cz-field-head label { font-size: 13px; display: block; }
.cz-field-unit { color: var(--muted); font-size: 12px; }

.cz-field-inputs {
  display: grid;
  grid-template-columns: 1fr 84px;
  gap: 12px;
  align-items: center;
}
.cz-field input[type="range"] {
  width: 100%;
  height: auto;
  padding: 0;
  border: none;
  accent-color: #111;
  cursor: pointer;
}
.cz-field input[type="range"]:focus { box-shadow: none; }
.cz-field input[type="number"] {
  height: 36px;
  padding: 0 8px;
  font-size: 13px;
  text-align: right;
}
.cz-field-help { margin: 4px 0 0; font-size: 11px; color: var(--muted); }

.cz-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}
.cz-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #111;
  cursor: pointer;
}

/* ---------- Messages ---------- */
.cz-error {
  margin: 0 0 14px;
  padding: 10px 12px;
  font-size: 13px;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 8px;
}
.cz-warnings {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: grid;
  gap: 6px;
}
.cz-warnings li {
  font-size: 12px;
  color: #92400e;
  background: #fef3c7;
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.4;
}

/* ---------- Price summary ---------- */
.cz-summary {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-bottom: 16px;
  display: grid;
  gap: 8px;
}
.cz-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
}
.cz-summary-row span:last-child { color: var(--text); }
.cz-price-row { font-size: 18px; font-weight: bold; margin-top: 4px; }
.cz-price-row span:first-child { color: var(--text); }

.cz-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cz-panel textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8d8d8;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  resize: vertical;
  outline: none;
}
.cz-panel textarea:focus { border-color: #111; box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.1); }

.cz-add { width: 100%; margin-top: 14px; }
.cz-add:disabled { opacity: 0.5; cursor: not-allowed; }

.cz-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 8px;
  background: #dcfce7;
  color: #15803d;
}
.cz-status a { color: inherit; font-weight: bold; text-decoration: underline; }

.cz-notes {
  list-style: none;
  margin: 18px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.cz-notes li { font-size: 12px; color: var(--muted); line-height: 1.5; }
.cz-notes:empty { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .cz-layout { grid-template-columns: 1fr; }
  .cz-preview { position: static; }
  .cz-viewport { height: 340px; }
}

/* ---------- View buttons: turn the model to see every side ---------- */
.cz-viewbar {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  max-width: calc(100% - 20px);
  pointer-events: none; /* only the buttons catch the mouse, so dragging the model works everywhere else */
}
.cz-viewbar button {
  pointer-events: auto;
  padding: 6px 11px;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.cz-viewbar button:hover { border-color: var(--text); }
.cz-viewbar button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.cz-viewbar button.active,
.cz-viewbar button[aria-pressed="true"] { background: var(--text); color: #fff; border-color: var(--text); }
.cz-viewbar-sep { width: 1px; height: 18px; background: var(--line); }
@media (max-width: 600px) {
  .cz-viewbar { gap: 5px; }
  .cz-viewbar button { padding: 6px 9px; font-size: 11px; }
}
