/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #f0f0f0;
  --surface:     #ffffff;
  --border:      #ddd;
  --accent:      #2563eb;
  --accent-hov:  #1d4ed8;
  --text:        #1e293b;
  --muted:       #64748b;
  --success:     #16a34a;
  --error:       #dc2626;
  --radius:      12px;
  --shadow:      0 2px 12px rgba(0,0,0,0.08);
  --header-bg:   #1e293b;
  --brand-navy:  #062947;
  --brand-teal:  #2bb9c3;
  --preview-bg:  #f8fafc;
  --field-readonly-bg: #f1f5f9;
  --field-readonly-text: #475569;
}

body.dark {
  --bg:          #0f1117;
  --surface:     #1a1d27;
  --border:      #2e3347;
  --accent:      #3b82f6;
  --accent-hov:  #2563eb;
  --text:        #e2e8f0;
  --muted:       #94a3b8;
  --success:     #22c55e;
  --error:       #f87171;
  --shadow:      0 2px 12px rgba(0,0,0,0.4);
  --header-bg:   #0f1117;
  --preview-bg:  #13161f;
  --field-readonly-bg: #151923;
  --field-readonly-text: #cbd5e1;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Branded studio header ───────────────────────────────────────────────── */
.studio-header {
  position: relative;
  overflow: hidden;
  padding: 16px 32px;
  color: white;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,255,255,0.07) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 65%, rgba(255,255,255,0.05) 0 1px, transparent 2px),
    linear-gradient(115deg, #041f37, var(--brand-navy) 55%, #0b3656);
  background-size: 28px 28px, 34px 34px, auto;
  border-bottom: 3px solid var(--brand-teal);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}
.studio-logo {
  display: flex;
  flex: 0 0 auto;
  width: 112px;
  height: 82px;
  align-items: center;
  justify-content: center;
}
.studio-logo img { width: 100%; height: 100%; object-fit: contain; }
.studio-title { min-width: 0; }
.studio-kicker {
  display: block;
  margin-bottom: 1px;
  color: var(--brand-teal);
  font-size: 0.70rem;
  font-weight: 800;
  letter-spacing: 2.2px;
  text-transform: uppercase;
}
.studio-title h1 {
  font-family: nexa-rust-sans-black-2, Impact, sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.65rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.studio-title p {
  margin-top: 7px;
  color: rgba(255,255,255,0.72);
  font-size: 0.78rem;
}
.theme-toggle {
  margin-left: auto;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  padding: 4px 12px;
  transition: background 0.15s;
}
.theme-toggle:hover { background: rgba(255,255,255,0.2); }

/* ── Layout ──────────────────────────────────────────────────────────────── */
main { max-width: 1120px; margin: 28px auto; padding: 0 20px; }

#mockupForm {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 22px;
  align-items: start;
}

@media (max-width: 780px) { #mockupForm { grid-template-columns: 1fr; } }
@media (max-width: 600px) {
  .studio-header { padding: 12px 16px; }
  .header-inner { gap: 12px; }
  .studio-logo { width: 78px; height: 60px; }
  .studio-title p { display: none; }
  .theme-toggle { padding: 4px 9px; }
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}
.card h2 {
  font-size: 0.70rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.2px; color: var(--muted); margin-bottom: 16px;
}
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Fields ──────────────────────────────────────────────────────────────── */
.field { margin-bottom: 15px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.field label {
  display: block; font-size: 0.78rem; font-weight: 600;
  color: var(--muted); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.req { color: var(--error); }

input[type="text"], input[type="email"], input[type="number"], select {
  width: 100%; min-height: 38px; padding: 9px 13px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font: inherit; font-size: 0.93rem; line-height: 1.2;
  background: var(--surface); color: var(--text);
  transition: border-color 0.15s; appearance: none;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="number"]:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.11);
}
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="number"]::placeholder { color: var(--muted); opacity: 1; }

/* Keep Chrome autofill from replacing dark fields with pale browser defaults. */
input[type="text"]:-webkit-autofill,
input[type="email"]:-webkit-autofill,
input[type="number"]:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  caret-color: var(--text);
  box-shadow: 0 0 0 1000px var(--surface) inset;
  border-color: var(--border);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}

.hint { font-size: 0.70rem; color: var(--muted); margin-top: 4px; }
.size-breakdown-field { margin: 0 0 15px; }
.size-breakdown-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
#sizeTotalHint { color: var(--text); font-size: 0.72rem; letter-spacing: 0; text-transform: none; }
.size-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(58px, 1fr)); gap: 7px; }
.size-input-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.size-input-item span { color: var(--muted); font-size: 0.68rem; font-weight: 700; text-align: center; }
.size-input-item small { font-size: 0.58rem; font-weight: 700; text-align: center; }
.size-input-item .size-surcharge { color: var(--success); }
.size-input-item input { min-width: 0; padding: 8px 5px; text-align: center; }
.size-input-item.is-unavailable span { text-decoration: line-through; opacity: 0.55; }
.size-input-item.is-unavailable input { background: var(--preview-bg); cursor: not-allowed; opacity: 0.55; }
.size-input-item .size-availability { color: var(--muted); }
.size-input-item.is-confirmed .size-availability { color: var(--success); }
.size-input-item.is-insufficient .size-availability,
.size-input-item.is-unavailable .size-availability { color: #b91c1c; }
.size-input-item.is-insufficient input { border-color: #dc2626; background: #fef2f2; }
body.dark .size-input-item.is-insufficient input { background: #2b1217; }
.size-breakdown-note { margin-top: 7px; color: var(--muted); font-size: 0.68rem; line-height: 1.35; }

/* ── Color Search ────────────────────────────────────────────────────────── */
.color-search {
  width: 100%; padding: 6px 10px 6px 28px;
  border: 1.5px solid var(--border); border-radius: 20px;
  font-size: 0.82rem; background: var(--preview-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") no-repeat 9px center;
  color: var(--text); margin-bottom: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.color-search:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.11);
  background-color: var(--surface);
}
.color-search::placeholder { color: var(--muted); }

/* ── Color Swatches ──────────────────────────────────────────────────────── */
.swatches {
  display: flex; gap: 8px; flex-wrap: wrap;
  max-height: 160px; overflow-y: auto; padding: 4px 0;
}
.swatch-group-label {
  width: 100%; font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: #94a3b8; margin: 4px 0 2px;
}
.generic-templates-group { width: 100%; margin-top: 6px; }
.fallback-details { width: 100%; margin-top: 8px; }
.fallback-body { padding-top: 2px; }
.swatch-group-toggle {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: #94a3b8; cursor: pointer;
  list-style: none; display: flex; align-items: center; gap: 5px;
  user-select: none; padding: 2px 0;
}
.swatch-group-toggle::-webkit-details-marker { display: none; }
.swatch-group-toggle::before { content: '▶'; font-size: 8px; transition: transform 0.15s; }
details[open] .swatch-group-toggle::before { transform: rotate(90deg); }
.generic-templates-group .swatch { display: inline-block; margin-top: 6px; }
.swatch {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid transparent; cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  position: relative; flex-shrink: 0;
}
.swatch:hover { transform: scale(1.15); }
.swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px white, 0 0 0 4px var(--accent);
}
.swatch[title*="White"], .swatch[title*="white"] { border: 3px solid #bbb; }

/* ── Size Buttons ────────────────────────────────────────────────────────── */
.size-buttons { display: flex; gap: 8px; }
.size-btn {
  flex: 1; padding: 8px; border: 1.5px solid var(--border);
  border-radius: 8px; background: white;
  font-size: 0.88rem; font-weight: 700; cursor: pointer;
  transition: all 0.15s; color: var(--muted);
}
.size-btn:hover { border-color: var(--accent); color: var(--accent); }
.size-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ── Scale Slider ────────────────────────────────────────────────────────── */
input[type="range"] {
  width: 100%; accent-color: var(--accent);
  height: 6px; cursor: pointer; margin-top: 6px;
}

/* ── Drop Zone ───────────────────────────────────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border); border-radius: 10px;
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: all 0.2s; background: #fafafa;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent); background: rgba(37,99,235,0.04);
}
.drop-icon { font-size: 1.8rem; margin-bottom: 6px; }
.drop-text { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }
.drop-text span { color: var(--accent); font-weight: 600; }

.artwork-thumb-wrap {
  margin-top: 10px; display: flex; align-items: center; gap: 12px;
  padding: 10px; background: var(--preview-bg);
  border-radius: 8px; border: 1.5px solid var(--border);
}
.artwork-thumb-wrap img {
  width: 52px; height: 52px; object-fit: contain; border-radius: 4px;
  background: repeating-conic-gradient(#ddd 0% 25%, white 0% 50%) 0 0 / 10px 10px;
}
#clearArtwork {
  margin-left: auto; background: none; border: none;
  color: var(--error); cursor: pointer;
  font-size: 0.78rem; font-weight: 600;
  padding: 4px 8px; border-radius: 4px;
}
#clearArtwork:hover { background: rgba(220,38,38,0.08); }

/* ── Preview Placement Tabs ──────────────────────────────────────────────── */
.preview-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 10px;
}
.preview-tab {
  padding: 5px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: white;
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted); cursor: pointer;
  transition: all 0.15s;
}
.preview-tab:hover {
  border-color: var(--accent); color: var(--accent);
}
.preview-tab.active {
  background: var(--accent); border-color: var(--accent);
  color: white;
}

/* ── Preview Card ────────────────────────────────────────────────────────── */
.preview-card { position: sticky; top: 20px; }

.preview-area {
  background: var(--preview-bg); border: 1.5px solid var(--border);
  border-radius: 10px; min-height: 420px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin-bottom: 14px; position: relative;
}
.preview-placeholder { text-align: center; color: var(--muted); }
.preview-icon { font-size: 3rem; margin-bottom: 10px; opacity: 0.35; }
.preview-placeholder p { font-size: 0.88rem; line-height: 1.6; }

#previewImg { max-width: 100%; max-height: 540px; object-fit: contain; border-radius: 6px; }

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--muted); font-size: 0.85rem;
}
.spin-ring {
  width: 48px; height: 48px;
  border: 4px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Filename Preview ────────────────────────────────────────────────────── */
.filename-preview {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 13px; background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--accent) 36%, var(--border)); border-radius: 8px;
  font-size: 0.78rem; color: var(--accent-hov); margin-bottom: 14px;
  word-break: break-all;
}
.filename-preview code { font-family: 'Courier New', monospace; font-size: 0.76rem; }

.live-quote {
  margin-bottom: 14px; padding: 16px 18px;
  background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
  border: 1.5px solid #6ee7b7; border-radius: 10px;
}
.live-quote-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.live-quote-eyebrow {
  display: block; margin-bottom: 3px; color: #047857;
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.9px; text-transform: uppercase;
}
.live-quote-total { color: #064e3b; font-size: 2rem; line-height: 1.05; font-weight: 800; }
.live-quote-each { color: #047857; font-size: 0.88rem; font-weight: 700; white-space: nowrap; }
.live-quote-details { margin-top: 9px; color: #065f46; font-size: 0.78rem; line-height: 1.45; }
.live-quote-note {
  margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(5,150,105,0.2);
  color: #52766c; font-size: 0.66rem; line-height: 1.4;
}
.live-quote.is-loading { opacity: 0.72; }
.live-quote.is-unavailable { background: var(--preview-bg); border-color: var(--border); }
.live-quote.is-unavailable .live-quote-eyebrow,
.live-quote.is-unavailable .live-quote-total,
.live-quote.is-unavailable .live-quote-each,
.live-quote.is-unavailable .live-quote-details { color: var(--muted); }
body.dark .live-quote { background: linear-gradient(135deg, #052e2b, #063b35); border-color: #047857; }
body.dark .live-quote-total { color: #a7f3d0; }
body.dark .live-quote-eyebrow,
body.dark .live-quote-each,
body.dark .live-quote-details { color: #6ee7b7; }
body.dark .live-quote-note { color: #94a3b8; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.actions { display: flex; gap: 10px; }
.btn {
  flex: 1; padding: 12px 18px; border: none; border-radius: 9px;
  font-size: 0.92rem; font-weight: 700; cursor: pointer;
  transition: all 0.15s; text-align: center; text-decoration: none;
}
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:not(:disabled):hover { background: var(--accent-hov); transform: translateY(-1px); }
.btn-secondary { background: #f1f5f9; color: var(--text); border: 1.5px solid var(--border); }
.btn-secondary:not(:disabled):hover { background: #e2e8f0; }
.btn-checkout { background: #16a34a; color: white; }
.btn-checkout:hover { background: #15803d; transform: translateY(-1px); }
.btn-checkout:disabled { background: #86b996; color: rgba(255,255,255,0.82); }
.delivery-choice {
  margin: 12px 0; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 9px; display: flex; gap: 16px; flex-wrap: wrap;
}
.delivery-choice legend { padding: 0 5px; color: var(--muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.delivery-choice label { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 0.82rem; cursor: pointer; }
.turnaround-note {
  display: flex;
  gap: 10px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--border));
  border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  color: var(--text);
}
.turnaround-icon {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
}
.turnaround-note strong { display: block; margin: 1px 0 3px; font-size: 0.84rem; }
.turnaround-note p { color: var(--muted); font-size: 0.76rem; line-height: 1.45; }
.turnaround-note b { color: var(--text); font-weight: 750; }
.art-approval {
  display: flex; gap: 10px; align-items: flex-start; margin: 12px 0;
  padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 9px; background: color-mix(in srgb, var(--accent) 5%, var(--surface));
  color: var(--muted); font-size: 0.76rem; line-height: 1.45; cursor: pointer;
}
.art-approval input { margin-top: 3px; flex: 0 0 auto; }
.art-approval strong { display: block; color: var(--text); font-size: 0.8rem; }

/* ── Error ───────────────────────────────────────────────────────────────── */
.error-msg {
  margin-top: 12px; padding: 11px 15px;
  background: #fef2f2; border: 1.5px solid #fca5a5;
  border-radius: 8px; color: var(--error); font-size: 0.85rem;
}

/* ── Decoration Cards ────────────────────────────────────────────────────── */
.deco-card {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.2s;
}
.deco-card--active {
  border-color: var(--accent);
  background: var(--surface);
}
.deco-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  background: var(--preview-bg);
  border-bottom: 1px solid var(--border);
}
.deco-card--active .deco-card-header {
  background: rgba(37,99,235,0.06);
  border-bottom-color: rgba(37,99,235,0.15);
}
.deco-label {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text);
}
.deco-hint { font-size: 0.70rem; color: var(--muted); }
.deco-remove {
  font-size: 0.72rem; font-weight: 600; color: var(--error);
  background: none; border: none; cursor: pointer;
  padding: 2px 6px; border-radius: 4px;
}
.deco-remove:hover { background: rgba(220,38,38,0.08); }

.deco-drop {
  padding: 18px 14px; text-align: center; cursor: pointer;
  transition: background 0.2s;
}
.deco-drop:hover, .deco-drop.dragover {
  background: rgba(37,99,235,0.04);
}
.deco-drop .drop-icon { font-size: 1.3rem; margin-bottom: 4px; }
.deco-drop .drop-text { font-size: 0.80rem; color: var(--muted); line-height: 1.5; }
.deco-drop .drop-text span { color: var(--accent); font-weight: 600; }

.deco-body {
  display: flex; gap: 12px; padding: 12px 14px; align-items: flex-start;
}
.deco-thumb-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; flex-shrink: 0;
}
.deco-thumb {
  width: 68px; height: 68px; object-fit: contain;
  border-radius: 6px;
  background: repeating-conic-gradient(#ddd 0% 25%, white 0% 50%) 0 0 / 10px 10px;
  transition: transform 0.2s;
}
.deco-rotate-btns {
  display: flex; gap: 4px;
}
.rotate-btn {
  width: 30px; height: 30px; border-radius: 6px;
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.rotate-btn:hover { border-color: var(--accent); color: var(--accent); }
.deco-controls { flex: 1; min-width: 0; }
.deco-scale-label {
  display: block; font-size: 0.72rem; font-weight: 600;
  color: var(--muted); margin-bottom: 4px;
}
.deco-pos-val { font-weight: 600; color: var(--accent); }

.deco-dims {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; margin-top: 8px;
}
.deco-dims label > span { display:block; margin-bottom:4px; color:var(--muted); font-size:0.69rem; font-weight:700; }
.deco-dims input, .deco-size-preset {
  width: 100%; padding: 6px 10px;
  font-size: 0.82rem;
}
.deco-size-preset { margin-top: 5px; }
.dimension-input { display:flex; align-items:center; border:1px solid var(--border); border-radius:7px; background:var(--surface); overflow:hidden; }
.dimension-input input { border:0; min-width:0; }
.dimension-input input[readonly] { background:color-mix(in srgb, var(--surface) 88%, var(--border)); color:var(--muted); }
.dimension-input b { padding-right:8px; color:var(--muted); font-size:0.72rem; }
.dimension-lock { padding-bottom:7px; font-size:0.85rem; }
.deco-size-note { margin-top:6px; color:var(--muted); font-size:0.68rem; line-height:1.35; }

/* ── Quote button ────────────────────────────────────────────────────────── */
.btn-quote {
  background: #0f766e;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn-quote:hover:not(:disabled) { background: #0d6460; }
.btn-quote:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Garment hint ────────────────────────────────────────────────────────── */
.garment-hint {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.garment-hint.found {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
}
.garment-hint.not-found {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}
.garment-hint.loading {
  background: #f0f4ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

/* ── S&S Style Picker ────────────────────────────────────────────────────── */
.ss-picker-field { position: relative; }

.ss-search-wrap { position: relative; }
.ss-search-wrap input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--input-bg);
  color: var(--text);
}
.ss-search-wrap input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }

.ss-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  max-height: 280px;
  overflow-y: auto;
  z-index: 500;
}
.ss-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.ss-dropdown-item:last-child { border-bottom: none; }
.ss-dropdown-item:hover  { background: #f0f4ff; }
.ss-dropdown-item:active { background: #e0e7ff; }
.ss-item-left { flex: 1; min-width: 0; }
.ss-dropdown-item .ss-item-brand {
  font-size: 9px;
  font-weight: 700;
  color: #2563eb;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 2px;
}
.ss-dropdown-item .ss-item-title {
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ss-dropdown-item .ss-item-num {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 4px;
  padding: 1px 6px;
  flex-shrink: 0;
}
.ss-dropdown-empty { padding: 16px; text-align: center; color: #64748b; font-size: 13px; }

.ss-selected-banner {
  margin-top: 6px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--border));
  border-radius: 6px;
  font-size: 12px;
  color: #065f46;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ss-selected-banner button {
  background: none;
  border: none;
  color: var(--accent-hov);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
  opacity: 0.7;
}
.ss-selected-banner button:hover { opacity: 1; }

/* S&S Color Swatches */
.ss-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  max-height: 150px;
  overflow-y: auto;
}
.ss-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.1s, border-color 0.1s;
}
.ss-swatch:hover  { transform: scale(1.15); border-color: #2563eb; }
.ss-swatch.active { border-color: #2563eb; transform: scale(1.15); box-shadow: 0 0 0 3px rgba(37,99,235,0.25); }
.ss-swatch[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
}

/* ── Import bar ──────────────────────────────────────────────────────────── */
.ss-import-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 8px 10px;
  background: #f0f4ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-size: 12px;
  flex-wrap: wrap;
}
.btn-import {
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-import:hover { background: #1d4ed8; }
.ss-import-note  { font-size: 11px; color: #64748b; }
.ss-importing    { font-size: 12px; color: #1e40af; font-style: italic; }
.ss-calibrate-link {
  font-size: 12px;
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  margin-left: auto;
}
.ss-calibrate-link:hover { text-decoration: underline; }
.ss-delete-btn {
  font-size: 12px; color: #ef4444; background: transparent;
  border: 1px solid #ef4444; border-radius: 6px;
  padding: 3px 10px; cursor: pointer;
}
.ss-delete-btn:hover { background: rgba(239,68,68,0.1); }

/* ── Category chips ──────────────────────────────────────────────────────── */
.shirt-picker-intro { position: relative; }
.shirt-picker-intro .section-heading { padding-right: 126px; }
.catalog-link {
  position: absolute;
  top: 4px;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}
.catalog-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
body.dark .catalog-link { color: #aebbd0; }
body.dark .catalog-link:hover { color: #7dd3fc; }

.ss-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.ss-chip {
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ss-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ss-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 17px;
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 2px solid var(--brand-teal);
  border-radius: 50%;
  background: var(--brand-navy);
  color: white;
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.7px;
  box-shadow: 0 3px 8px rgba(6, 41, 71, 0.16);
}
.section-heading strong {
  display: block;
  color: var(--brand-navy);
  font-family: nexa-rust-sans-black-2, Impact, sans-serif;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.section-heading small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.67rem;
  line-height: 1.25;
}
body.dark .section-heading strong { color: #e5f7f8; }

@media (max-width: 600px) {
  .shirt-picker-intro .section-heading { padding-right: 0; }
  .catalog-link {
    position: static;
    width: max-content;
    margin: -2px 0 10px auto;
  }
}

/* ── Popular garment cards ──────────────────────────────────────────────── */
.popular-garments {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
  margin: 4px 0 12px;
}
.popular-loading {
  grid-column: 1 / -1;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}
.popular-garment-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.popular-garment-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10);
}
.popular-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.popular-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f3f4f6;
  border-bottom: 1px solid var(--border);
}
.popular-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.popular-image-placeholder { font-size: 2.5rem; opacity: 0.45; }
.popular-card-name {
  padding: 9px 9px 2px;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.25;
}
.popular-card-style {
  padding: 0 9px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.3;
}
.popular-card-action {
  margin-top: auto;
  padding: 9px;
  color: var(--accent);
  font-size: 0.70rem;
  font-weight: 700;
}

/* ── Color detect hint ───────────────────────────────────────────────────── */
.color-detect-hint {
  font-size: 0.75rem;
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: -8px;
  margin-bottom: 12px;
}
body.dark .color-detect-hint {
  color: #4ade80;
  background: #052e16;
  border-color: #166534;
}

.preview-area.preview-refreshing #previewImg {
  opacity: 0.72;
  transition: opacity 120ms ease;
}

.field input[readonly] {
  background: var(--field-readonly-bg);
  color: var(--field-readonly-text);
  cursor: default;
}

/* ── Add-ons grid ────────────────────────────────────────────────────────── */
.addons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
  margin-top: 4px;
}
.addon-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text);
  cursor: pointer;
}
.addon-check input[type="checkbox"] { accent-color: var(--accent); }
.addon-price {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
}
/* Admin-only header shown when the protected /admin route serves this page. */
.admin-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  color: #fff;
  background: #172554;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.admin-banner[hidden] { display: none; }
.admin-banner span { flex: 1; opacity: .86; }
.admin-banner a { color: #fff; font-weight: 700; }
