/* ==========================================================================
   Garment customiser (the RX500 prototype, on the shared design system)
   ========================================================================== */

.customiser { display: grid; grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: start; }
.customiser > .panel { margin: 0; }

/* Groups and labels */
.cz-group { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }

.cz-label { display: block; margin: 0 0 10px; padding: 0; }
.cz-note { font-size: 0.75rem; color: var(--ink-soft); margin: 0 0 10px; line-height: 1.55; }
.cz-note--after { margin: var(--s2) 0 0; }

/* Colour swatches */
.swatch-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.swatch {
  width: 34px; height: 34px; padding: 0;
  border-radius: 50%; border: 2px solid transparent;
  background: var(--swatch); cursor: pointer; position: relative;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.swatch[aria-pressed="true"] { border-color: var(--gold); box-shadow: inset 0 0 0 2px var(--panel); }
.swatch[aria-pressed="true"]::after { content: ""; position: absolute; inset: -6px; border: 1px solid var(--gold); border-radius: 50%; }
.swatch-name { font-size: var(--step--1); color: var(--ink-soft); margin-left: var(--s1); }

/* Saved placement cards */
.cz-el {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--cream); font-size: 0.78rem;
}
.cz-el__thumb {
  width: 34px; height: 34px; flex: none; border-radius: var(--radius); overflow: hidden;
  display: grid; place-items: center;
  background: repeating-conic-gradient(#EFE7E2 0 25%, #fff 0 50%) 50% / 8px 8px;
  font-size: 0.55rem; letter-spacing: 0.04em; color: var(--ink-soft);
}
.cz-el__thumb img { width: 100%; height: 100%; object-fit: contain; }
.cz-el__info { flex: 1; min-width: 0; line-height: 1.45; }
.cz-el__info b { font-weight: 500; }
.cz-el__file { color: var(--ink-soft); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cz-icon-btn {
  background: none; border: 0; color: var(--ink-soft);
  cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 4px 5px; border-radius: var(--radius);
}
.cz-icon-btn:hover { color: var(--gold-deep); }
.cz-icon-btn--remove:hover { color: var(--warn); }
.cz-empty { color: var(--ink-soft); border: 1px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; font-size: 0.8rem; margin-bottom: 8px; }

.cz-add-row { display: flex; gap: 8px; margin-top: 4px; }
.cz-dashed-btn {
  flex: 1; padding: 11px; border: 1px dashed var(--line-strong); background: transparent;
  border-radius: var(--radius); cursor: pointer; font-size: 0.78rem; color: var(--ink-soft);
  transition: border-color 0.15s, color 0.15s;
}
.cz-dashed-btn:hover { border-color: var(--gold); color: var(--ink); }
.cz-dashed-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cz-dashed-btn:disabled:hover { border-color: var(--line-strong); color: var(--ink-soft); }

/* Builder (adding or editing one placement) */
.cz-builder { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 14px; background: var(--cream); }
.cz-builder .cz-group { margin-bottom: 16px; }
.cz-builder__actions { display: flex; gap: 10px; margin-top: 4px; }
.cz-builder__actions .btn { flex: 1; padding-inline: 12px; }

.cz-upload {
  display: block; width: 100%;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius);
  padding: 22px; text-align: center; background: var(--panel);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.cz-upload:hover, .cz-upload.is-dragging { border-color: var(--gold); }
.cz-upload.is-dragging { background: var(--note-bg); }
.cz-upload.has-file { border-style: solid; }
.cz-upload:focus-within { box-shadow: var(--focus); }
.cz-upload__text { display: block; font-size: var(--step--1); color: var(--ink-soft); }
.cz-upload__name { display: block; color: var(--ink); font-weight: 500; margin-top: 4px; overflow-wrap: anywhere; }

/* Quality box */
.cz-quality { margin-top: 14px; border-radius: var(--radius); padding: 14px 16px; font-size: 0.8rem; line-height: 1.55; }
.cz-quality--empty { color: var(--ink-soft); border: 1px dashed var(--line-strong); }
.cz-quality--good { background: var(--good-bg); color: var(--good-text); }
.cz-quality--warn { background: var(--note-bg); color: var(--note-text); }
.cz-quality--error { background: var(--warn-bg); color: var(--warn); }
.cz-quality ul { margin: 8px 0 0; padding-left: 18px; }
.cz-quality__title { display: block; font-weight: 500; font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 2px; }

/* Size and colour breakdown */
.cz-size-row { display: flex; gap: 10px; }
.cz-size-row select { flex: 1.2; }
.cz-size-row input { flex: 0.8; min-width: 0; }
.cz-size-add { margin-top: 10px; }
.cz-lines { margin-top: 12px; }
.cz-line {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--cream); font-size: 0.78rem;
}
.cz-line__swatch { width: 18px; height: 18px; border-radius: 50%; flex: none; border: 1px solid var(--line); background: var(--swatch); }
.cz-line__info { flex: 1; }
.cz-lines__total { font-size: 0.75rem; color: var(--ink-soft); text-align: right; margin: 4px 0 0; max-width: none; }

/* Submit */
.cz-error { color: var(--warn); font-size: var(--step--1); margin: 0 0 var(--s3); }
.cz-added { margin-top: var(--s4); padding: 14px 16px; background: var(--good-bg); color: var(--good-text); border-radius: var(--radius); font-size: var(--step--1); }
.cz-added p { margin-bottom: var(--s3); }
.cz-added .btn { margin: 0 var(--s2) var(--s1) 0; }

/* Preview panel */
.cz-preview { display: flex; flex-direction: column; align-items: center; text-align: center; position: sticky; top: var(--s4); }
.cz-preview .cz-label { align-self: flex-start; }
.cz-stage {
  width: 100%; max-width: 400px;
  aspect-ratio: 300 / 340;
  margin: 8px 0 6px;
  overflow: hidden; border-radius: var(--radius);
  position: relative; cursor: zoom-in; background: var(--white);
  touch-action: manipulation;
}
.cz-stage svg { display: block; position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; }
.cz-zoom-hint {
  position: absolute; bottom: 6px; right: 8px;
  font-size: 0.6rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-soft); background: rgba(251, 247, 244, 0.88);
  padding: 3px 8px; border-radius: 999px; pointer-events: none;
}
.cz-side-label {
  position: absolute; top: 8px; left: 8px;
  font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink); background: rgba(251, 247, 244, 0.88);
  padding: 3px 8px; border-radius: 999px; pointer-events: none;
}
.cz-price-line {
  display: flex; justify-content: space-between; gap: var(--s3);
  width: 100%; max-width: 400px;
  font-size: var(--step--1); color: var(--ink-soft); text-align: left;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line);
}
.cz-price-line strong { color: var(--ink); font-weight: 500; white-space: nowrap; }
.cz-price-line--total strong { font-family: var(--serif); font-weight: 400; font-size: 1.2rem; }
.cz-preview__note { font-size: 0.72rem; color: var(--ink-soft); margin: var(--s3) 0 0; max-width: 400px; }

@media (max-width: 860px) {
  .customiser { grid-template-columns: 1fr; gap: var(--s5); }
  .cz-preview { position: static; order: -1; }
}
