/* ══════════════════════════════════════════════════════════════
   Pintail Printed — Configure page
══════════════════════════════════════════════════════════════ */

.stl-layout {
  display: grid;
  grid-template-columns: 220px 1fr 1fr;
  gap: 1.25rem;
  margin: 2rem 2.5rem;
  min-height: 640px;
  align-items: start;
}

html { scrollbar-gutter: stable; }

.panel {
  box-shadow: var(--shadow);
  background: var(--surface);
  padding: 1.75rem;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  min-width: 0;
}

.panel-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0; padding: 0; border: none;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-btns {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

.header-btns .btn {
  padding: 0.4rem 0.95rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* ── Model list ── */
#modelsContainer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.model-empty {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.5rem 0;
}

#modelsContainer div {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.9rem;
  cursor: pointer;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
  border-radius: 16px;
}

#modelsContainer div:hover { border-color: var(--accent); color: var(--text); }

#modelsContainer div.model-selected {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--surface);
}

#modelsContainer img {
  display: block;
  margin: 0 auto 0.6rem;
  width: 100%;
  max-width: 130px;
  height: 86px;
  object-fit: contain;
}

/* ── Status line ── */
#queueStatus {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  min-height: 1.1em;
  margin-bottom: 0.85rem;
}

/* ── Blueprint ── */
.blueprint-inline {
  width: 100%;
  aspect-ratio: 640 / 340;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  margin-bottom: 1.25rem;
  position: relative;
  border-radius: 16px;
}

.blueprint-inline svg { width: 100%; height: 100%; overflow: visible; }

.blueprint-inline .bp-empty {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

/* ── Param list ── */
#paramForm {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

#paramForm:empty { display: none; }

#paramForm div {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  align-items: center;
  gap: 0.6rem;
}

#paramForm label {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.3;
}

#paramForm input {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  border-radius: 10px;
}

#paramForm input::placeholder { color: var(--text-muted); opacity: 0.45; }
#paramForm input:focus { border-color: var(--accent); }

/* Slider rows */
#paramForm .slider-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  align-items: center;
  gap: 0.6rem;
}

#paramForm input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: var(--border);
  border: none;
  outline: none;
  cursor: pointer;
  padding: 0;
  border-radius: 3px;
}

#paramForm input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2.5px solid var(--bg);
}

#paramForm input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2.5px solid var(--bg);
}

.slider-value-label {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text);
  text-align: center;
  padding: 0.45rem;
  border: 1px solid var(--border);
  background: var(--surface2);
  min-width: 50px;
  border-radius: 10px;
}

/* ── Price panel ── */
#priceSection { min-height: 300px; }

.price-display-empty {
  padding: 2.5rem 1rem;
  text-align: center;
}

.price-hint {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.price-card {
  border: 1px solid var(--border);
  background: var(--surface2);
  padding: 1.75rem;
  border-radius: 16px;
  margin-top: 0.5rem;
}

.price-main {
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.price-sub {
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.price-parts-note {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.35rem 0.7rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  display: inline-block;
}

.price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.price-line {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.price-line span:last-child { color: var(--text); }

.price-shipping-note {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding: 0.6rem 0.85rem;
  background: var(--surface2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.price-actions { display: flex; flex-direction: column; gap: 0.6rem; }

/* ── Order modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58,52,47,0.55);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.modal-overlay.open { display: flex; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  padding: 2.25rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.modal-close {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1;
}
.modal-close:hover { color: var(--accent2); border-color: var(--accent2); }

.price-breakdown-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1.4rem 1.6rem;
  margin-bottom: 1.25rem;
  border-radius: 16px;
}

.price-breakdown-box .pbb-amount {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.6rem;
}

.price-breakdown-box .pbb-lines {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.price-breakdown-box .pbb-line {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.price-breakdown-box .pbb-line span:last-child { color: var(--text); }

.pbb-shipping-note {
  font-family: var(--font-body);
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  font-style: italic;
}

/* ── Order STL file list ── */
.order-stl-list {
  margin-bottom: 1.5rem;
}

.order-stl-header {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.order-stl-files {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.order-stl-file {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.stl-icon {
  color: var(--accent);
  font-size: 1rem;
  flex-shrink: 0;
}

.stl-fname {
  color: var(--text);
  flex: 1;
}

.stl-size {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* ── Enquiry form ── */
.enq-form { display: flex; flex-direction: column; gap: 1.1rem; }

.enq-field { display: flex; flex-direction: column; gap: 0.4rem; }

.enq-field label {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.enq-field input,
.enq-field textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.65rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  border-radius: 10px;
}

.enq-field input:focus,
.enq-field textarea:focus { border-color: var(--accent); }

.enq-field textarea { resize: vertical; min-height: 80px; }

.click-feel-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}

.click-chip {
  padding: 0.45rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  user-select: none;
  border-radius: 16px;
}

.click-chip.selected {
  border-color: var(--accent);
  color: var(--accent);
}

.enq-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.enquiry-status {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--text-muted);
  min-height: 1.2em;
  margin-top: 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .stl-layout { grid-template-columns: 1fr 1fr; margin: 1.25rem; }
  .stl-layout > .panel:first-child { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .stl-layout { grid-template-columns: 1fr; margin: 1rem; }
  #paramForm div { grid-template-columns: 1fr; }
}

/* ── Currency switcher ── */
.currency-switcher {
  display: flex;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.currency-btn {
  padding: 0.28rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  line-height: 1;
}

.currency-btn:hover { color: var(--text); border-color: var(--text-muted); }

.currency-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* Live/estimated rate badge */
.rate-live {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #6aaa7a;
  margin-left: 0.4rem;
}

.rate-est {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: 0.4rem;
  opacity: 0.7;
}
