/* ── Custom Print Page ─────────────────────────────── */

/* File input: visually hidden, activated by <label for="..."> */
.hlcp-file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hlcp-page {
  padding-block: clamp(40px, 6vw, 72px);
}

.hlcp-unavailable {
  padding-block: 80px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Step indicator ──────────────────────────────── */
.hlcp-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 48px;
  overflow-x: auto;
  scrollbar-width: none;
}
.hlcp-steps::-webkit-scrollbar { display: none; }

.hlcp-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  opacity: .35;
  transition: opacity .2s;
}
.hlcp-step.active  { opacity: 1; }
.hlcp-step.done    { opacity: .7; }

.hlcp-step__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg);
  flex-shrink: 0;
  transition: background .2s, border-color .2s, color .2s;
}
.hlcp-step.active .hlcp-step__num {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
.hlcp-step.done .hlcp-step__num {
  background: #F0FDF4;
  border-color: #22C55E;
  color: #166534;
}

.hlcp-step__label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.hlcp-step.active .hlcp-step__label { color: var(--text); }

.hlcp-step-line {
  flex: 1;
  min-width: 24px;
  height: 1px;
  background: var(--border);
  margin-inline: 8px;
}

/* ── Panels ──────────────────────────────────────── */
.hlcp-panel {
  display: none;
  max-width: 640px;
}
.hlcp-panel--wide {
  max-width: 800px;
}
.hlcp-panel.active { display: block; }

.hlcp-title {
  font-size: clamp(22px, 3.5vw, 32px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.hlcp-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 32px;
}

/* ── Upload zone ─────────────────────────────────── */
.hlcp-upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--white);
  margin-bottom: 0;
}
.hlcp-upload-zone:hover,
.hlcp-upload-zone.dragover {
  border-color: var(--accent);
  background: #FFFBF5;
}

.hlcp-upload-zone__inner svg { margin: 0 auto 16px; color: var(--muted); }
.hlcp-upload-zone__inner p   { font-size: 15px; color: var(--muted); margin-bottom: 6px; }
.hlcp-upload-zone__hint      { font-size: 12px !important; color: #9E9B95 !important; }

.hlcp-link-btn {
  color: var(--accent);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.hlcp-upload-zone__loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.hlcp-upload-zone__loading:not([hidden]) { display: flex; }
.hlcp-upload-zone__loading p { font-size: 14px; color: var(--muted); }

.hlcp-spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: hlcp-spin .7s linear infinite;
}
@keyframes hlcp-spin { to { transform: rotate(360deg); } }

.hlcp-upload-zone__error {
  display: none;
  color: #991B1B;
  font-size: 14px;
  padding: 12px;
  background: #FEF2F2;
  border-radius: var(--radius);
}
.hlcp-upload-zone__error:not([hidden]) { display: block; }

/* ── 3D Preview ──────────────────────────────────── */
.hlcp-preview-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #F0EDEA;
  position: relative;
  margin-top: 16px;
}
#hlcp-canvas {
  display: block;
  width: 100%;
  height: 380px;
}
@media (max-width: 600px) {
  #hlcp-canvas { height: 240px; }
}
.hlcp-preview-hint {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  color: rgba(255,255,255,.7);
  background: rgba(26,26,26,.45);
  padding: 4px 8px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.hlcp-preview-info {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(26,26,26,.72);
  color: #fff;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  line-height: 1.6;
  backdrop-filter: blur(4px);
  pointer-events: none;
}

/* ── File confirm bar ────────────────────────────── */
.hlcp-file-confirm {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: var(--radius-lg);
  margin-top: 16px;
}
.hlcp-file-confirm__icon {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #22C55E;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hlcp-file-confirm__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.hlcp-file-confirm__body strong {
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}
.hlcp-file-confirm__body span {
  font-size: 13px;
  color: var(--muted);
}

/* ── Step 1 actions row ──────────────────────────── */
.hlcp-step1-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ── Form fields ─────────────────────────────────── */
.hlcp-field {
  margin-bottom: 28px;
}
.hlcp-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.hlcp-field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Material cards ──────────────────────────────── */
.hlcp-material-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (max-width: 480px) {
  .hlcp-material-grid { grid-template-columns: 1fr; }
}

.hlcp-material-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  cursor: pointer;
  background: var(--white);
  transition: border-color .15s, background .15s, box-shadow .15s;
  user-select: none;
}
.hlcp-material-card:hover {
  border-color: #c0bbb3;
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.hlcp-material-card.active {
  border-color: var(--text);
  background: #FAFAF8;
  box-shadow: 0 0 0 3px rgba(26,26,26,.05);
}

.hlcp-mat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.hlcp-mat-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.hlcp-mat-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: #F0EDEA;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.hlcp-material-card.active .hlcp-mat-tag {
  background: var(--text);
  color: #fff;
}

.hlcp-mat-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 10px;
}

.hlcp-mat-props {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.hlcp-prop-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 100px;
  background: #F0EDEA;
  color: #6B6B6B;
}
.hlcp-material-card.active .hlcp-prop-pill {
  background: #E8E3DC;
}

/* ── Colour swatches ─────────────────────────────── */
.hlcp-colour-grid {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.hlcp-colour-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: transform .1s;
}
.hlcp-colour-swatch:hover { transform: scale(1.08); }

.hlcp-colour-swatch__dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--swatch-color, #999);
  border: 2px solid rgba(0,0,0,.14);
  transition: box-shadow .15s, border-color .15s;
}
/* Light swatches need a visible border */
.hlcp-colour-swatch[data-colour="white"] .hlcp-colour-swatch__dot { border-color: var(--border); }
.hlcp-colour-swatch[data-colour="grey"]  .hlcp-colour-swatch__dot { border-color: #c8cdd3; }

/* Selected: ring around the dot */
.hlcp-colour-swatch.active .hlcp-colour-swatch__dot {
  box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 4.5px var(--text);
  border-color: transparent;
}

.hlcp-colour-swatch__label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
}
.hlcp-colour-swatch.active .hlcp-colour-swatch__label {
  color: var(--text);
  font-weight: 600;
}

/* ── Infill buttons ──────────────────────────────── */
.hlcp-infill-grid {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.hlcp-infill-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.hlcp-infill-btn:hover { border-color: var(--text); color: var(--text); }
.hlcp-infill-btn.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}

/* ── Textarea ────────────────────────────────────── */
.hlcp-textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  background: var(--white);
  color: var(--text);
  resize: vertical;
  transition: border-color .15s;
}
.hlcp-textarea:focus { outline: none; border-color: var(--accent); }

/* ── Quote card ──────────────────────────────────── */
.hlcp-quote-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
}

.hlcp-quote-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.hlcp-quote-row:last-of-type { border-bottom: none; }
.hlcp-quote-row--sub span:first-child { color: var(--muted); padding-left: 16px; }
.hlcp-quote-total {
  font-size: 18px;
  font-weight: 600;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1.5px solid var(--text) !important;
  border-bottom: none !important;
}
.hlcp-quote-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}

/* ── Order summary ───────────────────────────────── */
.hlcp-order-summary {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.8;
}
.hlcp-summary-file { word-break: break-all; }
.hlcp-summary-note { font-size: 13px; color: var(--muted); margin-top: 12px; }

.hlcp-login-gate {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.hlcp-login-gate p { font-size: 15px; color: var(--muted); }

/* ── Actions row ─────────────────────────────────── */
.hlcp-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.hlcp-order-status {
  margin-top: 12px;
  font-size: 13px;
  min-height: 20px;
}
.hlcp-order-status.error   { color: #991B1B; }
.hlcp-order-status.loading { color: var(--muted); }

/* ── Done screen ─────────────────────────────────── */
.hlcp-done {
  text-align: center;
  padding: 48px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.hlcp-done h2 { font-size: 28px; font-weight: 600; }
.hlcp-done p  { font-size: 15px; color: var(--muted); }
