/* ═══════════════════════════════════════════════════════════════════════════
   Printin3D — 3D Scanning Service
   Aesthetic: Precision Engineering — clean technical surfaces, teal scanning
   pulse, geometric depth. Like a calibration interface for a scanner.
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Prosto+One&family=Catamaran:wght@300;400;500;600;700&display=swap');

/* ── Variables ──────────────────────────────────────────────────────────── */
:root {
  --teal:        #179ca3;
  --teal-dark:   #0f7a80;
  --teal-light:  #e6f7f8;
  --teal-glow:   rgba(23, 156, 163, 0.18);
  --teal-glow-strong: rgba(23, 156, 163, 0.35);

  --bg:          #f4f7f8;
  --surface:     #ffffff;
  --border:      #dde6e8;
  --border-focus:#179ca3;
  --text:        #1a2a2c;
  --text-muted:  #607d82;
  --text-light:  #9ab4b8;

  --success:     #16a34a;
  --error:       #dc2626;
  --warning:     #d97706;

  --radius-sm:   8px;
  --radius:      14px;
  --radius-lg:   20px;
  --shadow-sm:   0 1px 4px rgba(0,0,0,.06), 0 0 0 1px rgba(0,0,0,.04);
  --shadow:      0 4px 20px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg:   0 12px 40px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.06);

  --transition:  cubic-bezier(.4,0,.2,1);
  --font-head:   'Prosto One', serif;
  --font-body:   'Catamaran', sans-serif;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

/* Lock the layout to the viewport width so the form behaves like an app on mobile:
   no horizontal scrolling and no accidental pinch/zoom drift. `clip` is preferred over
   `hidden` because it clips overflow without creating a scroll container — keeping the
   sticky header working (older browsers fall back to `hidden`). */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%; /* stop iOS auto-inflating text on rotate */
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  /* subtle geometric grid background */
  background-image:
    linear-gradient(rgba(23,156,163,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23,156,163,.04) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
  display: block;
}

.site-logo-fallback {
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--teal);
  letter-spacing: .02em;
}

.header-badge {
  font-family: var(--font-body);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Progress Bar ───────────────────────────────────────────────────────── */
.progress-wrap {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 20px 20px;
}

.progress-inner {
  max-width: 800px;
  margin: 0 auto;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.progress-step-label {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-light);
  transition: color .3s var(--transition);
}
.progress-step-label.active { color: var(--teal); }
.progress-step-label.done   { color: var(--teal-dark); }

.progress-track {
  height: 6px;
  background: var(--teal-light);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--teal-dark));
  border-radius: 99px;
  transition: width .5s var(--transition);
  position: relative;
}

/* scanning pulse on the fill edge */
.progress-fill::after {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 24px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5));
  animation: scan-pulse 1.5s ease-in-out infinite;
}
@keyframes scan-pulse {
  0%,100% { opacity: 0; } 50% { opacity: 1; }
}

.progress-text {
  margin-top: 8px;
  font-size: .78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ── Main Container ─────────────────────────────────────────────────────── */
.form-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* ── Step Card ──────────────────────────────────────────────────────────── */
.step-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 40px;
  animation: step-in .35s var(--transition) both;
}

@keyframes step-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-out {
  animation: step-out .25s var(--transition) both !important;
}
@keyframes step-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(-12px); }
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  background: var(--teal-light);
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 16px;
  font-family: var(--font-body);
}

.step-title {
  font-family: var(--font-head);
  font-size: 1.75rem;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -.01em;
}

.step-subtitle {
  font-size: .95rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 32px;
  line-height: 1.5;
}

/* ── Form Fields ────────────────────────────────────────────────────────── */
.field-group {
  display: grid;
  gap: 20px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 540px) { .field-row { grid-template-columns: 1fr; } }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color .2s, box-shadow .2s, background .2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23607d82' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

.field input.error,
.field select.error,
.field textarea.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}

.field-error {
  font-size: .78rem;
  color: var(--error);
  font-weight: 500;
  display: none;
}
.field-error.visible { display: block; }

.field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

/* Phone field with intl-tel-input overrides */
.iti {
  width: 100%;
}
.iti__flag-container { top: 0; bottom: 0; }
.iti--separate-dial-code .iti__selected-flag {
  background: transparent;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border-right: 1.5px solid var(--border);
}
.field input.iti__tel-input {
  padding-left: 90px;
}

/* ── Option Cards (selectable tiles) ───────────────────────────────────── */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.option-grid.two-col {
  grid-template-columns: 1fr 1fr;
}

.option-grid.single-col {
  grid-template-columns: 1fr;
}

@media (max-width: 480px) {
  .option-grid, .option-grid.two-col { grid-template-columns: 1fr; }
}

.option-card {
  position: relative;
  cursor: pointer;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  padding: 20px;
  transition: border-color .2s, box-shadow .2s, transform .15s, background .2s;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card:hover {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
  transform: translateY(-2px);
}

.option-card.selected {
  border-color: var(--teal);
  background: var(--teal-light);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

.option-card.selected .option-check {
  opacity: 1;
  transform: scale(1);
}

.option-check {
  position: absolute;
  top: 12px; right: 12px;
  width: 22px; height: 22px;
  background: var(--teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .2s, transform .2s;
}

.option-check::after {
  content: '';
  width: 6px; height: 10px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.option-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.option-title {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--text);
  line-height: 1.2;
}

.option-desc {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.4;
  font-weight: 400;
}

.option-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: .85rem;
  font-weight: 700;
  color: var(--teal-dark);
  background: rgba(23,156,163,.12);
  padding: 3px 10px;
  border-radius: 99px;
  width: fit-content;
}

/* Delivery cards render the pill before their price is known — don't show an empty one. */
.option-price:empty { display: none; }

/* ── Info Box (shown after selection) ──────────────────────────────────── */
.info-box {
  background: var(--teal-light);
  border: 1.5px solid rgba(23,156,163,.25);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 16px;
  font-size: .9rem;
  color: var(--text);
  line-height: 1.6;
  display: none;
  animation: step-in .3s var(--transition);
}
.info-box.visible { display: block; }

.info-box strong { color: var(--teal-dark); }

.info-box a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--teal-light);
  transition: border-color .2s;
}
.info-box a:hover { border-color: var(--teal); }

.warning-box {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: .88rem;
  color: #78350f;
  line-height: 1.55;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.warning-box .warn-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }

/* ── Address Block ──────────────────────────────────────────────────────── */
.address-block {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: .9rem;
  font-weight: 500;
  white-space: pre-line;
  line-height: 1.7;
  color: var(--text);
  font-family: var(--font-body);
}

/* ── Navigation Buttons ─────────────────────────────────────────────────── */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  gap: 12px;
}

.btn {
  font-family: var(--font-body);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: .03em;
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 28px;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s, opacity .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1;
}

.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--teal);
  color: white;
  box-shadow: 0 4px 14px rgba(23,156,163,.35);
}
.btn-primary:hover {
  background: var(--teal-dark);
  box-shadow: 0 6px 20px rgba(23,156,163,.45);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover {
  background: var(--bg);
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-ghost.hidden { visibility: hidden; pointer-events: none; }

.btn-lg {
  font-size: 1rem;
  padding: 16px 36px;
  border-radius: var(--radius);
}

.btn-icon {
  font-size: 1rem;
}

/* spinner inside button */
.btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
.btn.loading .spinner { display: block; }
.btn.loading .btn-label { opacity: .6; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Quote step loading ─────────────────────────────────────────────────── */
.quote-loading {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 36px 0; text-align: center; color: var(--text-muted); font-size: .92rem;
}
.quote-spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--teal-light); border-top-color: var(--teal);
  border-radius: 50%; animation: spin .8s linear infinite;
}

/* ── Order Summary ──────────────────────────────────────────────────────── */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.summary-table td {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

.summary-table td:first-child { color: var(--text-muted); }
.summary-table td:last-child  { text-align: right; font-weight: 600; color: var(--text); }

.summary-table tr:last-child td { border-bottom: none; }

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0 0;
  border-top: 2px solid var(--text);
  margin-top: 4px;
}

.summary-total .label {
  font-family: var(--font-head);
  font-size: 1.05rem;
}

.summary-total .amount {
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--teal);
}

.vat-note {
  font-size: .78rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

/* ── Collapsed price breakdown ──────────────────────────────────────────── */
/* The headline total is delivery- and VAT-inclusive; this holds the full split
   so nothing is hidden, it's just not the first thing read. */
.quote-breakdown {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.quote-breakdown > summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 14px;
  font-size: .84rem;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 7px;
}

.quote-breakdown > summary::-webkit-details-marker { display: none; }

.quote-breakdown > summary::before {
  content: '▸';
  font-size: .8rem;
  transition: transform .15s ease;
}

.quote-breakdown[open] > summary::before { transform: rotate(90deg); }
.quote-breakdown > summary:hover { color: var(--teal-dark); }

.quote-breakdown .summary-table {
  padding: 0 14px 6px;
  width: calc(100% - 28px);
}

.quote-breakdown .summary-table td { padding: 9px 0; font-size: .85rem; }

/* ── Payment section ────────────────────────────────────────────────────── */
.payment-section {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.payment-section p {
  font-size: .88rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  line-height: 1.5;
}

.stripe-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--text-light);
  margin-top: 12px;
  justify-content: center;
}
.stripe-badge svg { opacity: .5; }

/* ── Success / Thank You Screen ─────────────────────────────────────────── */
.success-screen {
  text-align: center;
  padding: 24px 0;
}

.success-icon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--teal-light), rgba(23,156,163,.15));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 2.2rem;
  animation: pop-in .4s cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(.4); }
  to   { opacity: 1; transform: scale(1); }
}

.success-screen h2 {
  font-family: var(--font-head);
  font-size: 2rem;
  margin-bottom: 12px;
  color: var(--text);
}

.success-screen p {
  color: var(--text-muted);
  font-size: .97rem;
  max-width: 420px;
  margin: 0 auto 8px;
  line-height: 1.6;
}

.success-next-steps {
  text-align: left;
  background: var(--teal-light);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
}

.success-next-steps h4 {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--teal-dark);
  margin-bottom: 14px;
}

.next-step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: .9rem;
}
.next-step-item:last-child { margin-bottom: 0; }

.next-step-num {
  width: 24px; height: 24px;
  background: var(--teal);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ── Divider ────────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* ── Section Label ──────────────────────────────────────────────────────── */
.section-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Cookie Banner ──────────────────────────────────────────────────────── */
.cookie-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--text);
  color: #e5e7eb;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: .85rem;
  z-index: 999;
  transform: translateY(100%);
  transition: transform .4s var(--transition);
}
.cookie-bar.visible { transform: translateY(0); }
.cookie-bar a { color: var(--teal); text-decoration: none; }

/* ── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal-light); }

/* ── Utilities ──────────────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.mt-4    { margin-top: 16px; }
.mt-6    { margin-top: 24px; }
.text-sm { font-size: .85rem; }
.text-muted { color: var(--text-muted); }
.bold    { font-weight: 700; }
.teal    { color: var(--teal); }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .step-card { padding: 24px 20px; }
  .step-title { font-size: 1.4rem; }
  .nav-buttons { flex-direction: column-reverse; }
  .nav-buttons .btn { width: 100%; justify-content: center; }
  .btn-ghost.hidden { display: none !important; }
  .option-grid { grid-template-columns: 1fr; }
}

/* ── Admin overrides (loaded separately but scoped here too) ───────────── */
.admin-body {
  background: var(--bg);
  background-image: none;
}

/* ── WhatsApp FAB ───────────────────────────────────────────────────────── */
.wa-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--teal);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  padding: 10px 18px 10px 10px;
  box-shadow: 0 4px 16px rgba(23,156,163,.4), 0 2px 6px rgba(0,0,0,.15);
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  transition: transform .2s, box-shadow .2s;
  white-space: nowrap;
}
.wa-fab svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.wa-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(23,156,163,.5), 0 3px 8px rgba(0,0,0,.18);
}
.wa-fab-label {
  font-size: .85rem;
}
@media (max-width: 480px) {
  .wa-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px;
    border-radius: 50%;
  }
  .wa-fab-label { display: none; }
}

/* ── Dropzone (file upload) ─────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.dropzone:hover, .dropzone:focus {
  border-color: var(--teal);
  background: var(--teal-light);
  outline: none;
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.dropzone.dragover {
  border-color: var(--teal);
  background: var(--teal-light);
  box-shadow: 0 0 0 3px var(--teal-glow-strong);
}
.dropzone-icon { font-size: 2.2rem; line-height: 1; margin-bottom: 10px; }
.dropzone-title { font-family: var(--font-head); font-size: 1.05rem; color: var(--text); }
.dropzone-sub { font-size: .85rem; color: var(--text-muted); margin-top: 4px; }
.dropzone-browse { color: var(--teal); font-weight: 700; text-decoration: underline; }

.upload-progress { margin-top: 16px; }
.upload-progress-bar { height: 8px; background: var(--teal-light); border-radius: 99px; overflow: hidden; }
.upload-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--teal-dark)); border-radius: 99px; transition: width .2s; }
.upload-progress-text { font-size: .8rem; color: var(--text-muted); margin-top: 6px; }

/* ── File list (upload step) ────────────────────────────────────────────── */
.file-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: .9rem;
}
.file-item-name { flex: 1; font-weight: 600; color: var(--text); word-break: break-word; }
.file-item-size { color: var(--text-muted); font-size: .8rem; white-space: nowrap; }
.file-item-del, .config-row-del {
  background: none; border: none; cursor: pointer; color: var(--text-light);
  font-size: 1rem; padding: 4px 8px; border-radius: 6px; transition: background .2s, color .2s;
}
.file-item-del:hover, .config-row-del:hover { background: rgba(220,38,38,.1); color: var(--error); }
.file-badge {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .03em;
  background: var(--teal-light); color: var(--teal-dark); padding: 2px 8px; border-radius: 99px; margin-left: 6px;
}
.file-item-link {
  color: var(--teal); font-size: .8rem; font-weight: 600; white-space: nowrap; text-decoration: none;
}
.file-item-link:hover { text-decoration: underline; }

/* ── "Paste a link instead" (Upload step) ───────────────────────────────── */
.btn-secondary {
  background: var(--teal-light);
  color: var(--teal-dark);
  border: 1.5px solid var(--teal);
}
.btn-secondary:hover { background: var(--teal); color: #fff; }
.btn-secondary:disabled { opacity: .55; cursor: not-allowed; }

.link-or {
  text-align: center; color: var(--text-muted); font-size: .8rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; margin: 18px 0 4px;
}
.link-add-label { display: block; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.link-add-row { display: flex; gap: 10px; flex-wrap: wrap; }
.link-add-input {
  flex: 1; min-width: 200px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: var(--font-body); font-size: .92rem;
}
.link-add-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-glow); }
.link-add-row .btn { flex-shrink: 0; }
.link-add-help { margin-top: 10px; color: var(--text-muted); font-size: .82rem; line-height: 1.5; }
@media (max-width: 560px) {
  .link-add-row .btn { width: 100%; justify-content: center; }
}

/* ── Configure step ─────────────────────────────────────────────────────── */
.apply-all {
  background: linear-gradient(135deg, var(--teal-light), #f0fdf4);
  border: 1.5px solid rgba(23,156,163,.35);
  box-shadow: 0 0 0 3px var(--teal-glow);
  border-radius: var(--radius); padding: 10px 18px 18px;
}
.apply-all .section-label {
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--teal-dark);
  margin-top: 14px;
}
.apply-all .section-label::after { background: rgba(23,156,163,.3); }
/* Prominent "Your files" heading */
.section-label.files-heading {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  margin-top: 28px;
}
.section-label.files-heading::after { background: var(--border); }

/* Material guide (layman's help) */
.material-guide {
  background: var(--teal-light);
  border: 1.5px solid rgba(23,156,163,.25);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.material-guide > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--teal-dark);
  font-size: .95rem;
  list-style: none;
}
.material-guide > summary::-webkit-details-marker { display: none; }
.material-guide[open] > summary { margin-bottom: 4px; }

.config-list { display: flex; flex-direction: column; gap: 12px; }
/* Per-file colour / quantity shown only when their toggle is on (always for a single file) */
.config-list:not(.per-file-on) .file-colour-field { display: none; }
.config-list:not(.per-file-qty-on) .file-qty-field { display: none; }

/* "Different colour per file" toggle */
.perfile-toggle {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  margin-top: 14px; font-size: .9rem; font-weight: 600; color: var(--teal-dark);
}
.perfile-toggle input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--teal); cursor: pointer; }
.config-row {
  position: relative; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 16px 16px 14px;
}
.config-row-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; padding-right: 28px; }
.config-row-name { font-weight: 700; color: var(--text); word-break: break-word; }
.config-row-size { color: var(--text-light); font-size: .76rem; white-space: nowrap; }
.config-row-body { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.config-row-body .field { flex: 1; min-width: 180px; }
.config-row-body .config-adv { flex-basis: 100%; }
.config-row-del { position: absolute; top: 10px; right: 8px; }

/* Material picker — colour swatch + select */
.material-pick { display: flex; align-items: stretch; gap: 10px; }
.material-pick select { flex: 1; min-width: 0; }
.mat-swatch {
  width: 40px; flex-shrink: 0;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: #cccccc;
  background-image:
    linear-gradient(45deg, rgba(0,0,0,.06) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.06) 75%),
    linear-gradient(45deg, rgba(0,0,0,.06) 25%, transparent 25%, transparent 75%, rgba(0,0,0,.06) 75%);
  background-size: 10px 10px; background-position: 0 0, 5px 5px;
}
/* Multicolor / translucent fallback — rainbow */
.mat-swatch.swatch-multi {
  background: conic-gradient(from 0deg, #ff5f6d, #ffc371, #47e891, #3aa9ff, #a36bff, #ff5f6d) !important;
}
/* Sourcing options (suggest / bring-your-own) — neutral dashed */
.mat-swatch.swatch-special {
  background: #eef2f3 !important;
  border-style: dashed;
  border-color: var(--text-light);
}

.mult-tag {
  font-size: .7rem; font-weight: 700; background: rgba(217,119,6,.12); color: var(--warning);
  padding: 1px 7px; border-radius: 99px; margin-left: 6px;
}
.mult-tag.discount { background: rgba(22,163,74,.12); color: var(--success); }
.option-card.disabled { opacity: .55; cursor: not-allowed; }
.option-card.disabled:hover { border-color: var(--border); box-shadow: none; transform: none; }

/* ── Advanced settings ──────────────────────────────────────────────────── */
.advanced-wrap { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.advanced-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: none; cursor: pointer; padding: 8px 0;
  font-family: var(--font-body); font-size: .92rem; font-weight: 700; color: var(--text-muted);
}
.advanced-toggle .chev { font-size: .75rem; }
.advanced-body { margin-top: 12px; }

/* ── Upsell checkbox (step 6) ───────────────────────────────────────────── */
.upsell-check {
  margin: 0 0 20px;
  background: linear-gradient(135deg, #e6f7f8 0%, #f0fdf4 100%);
  border: 1.5px solid rgba(23,156,163,.25);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.upsell-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: .95rem;
  color: var(--text);
  line-height: 1.4;
}
.upsell-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--teal);
  cursor: pointer;
}

/* ── "You may like this" upsell strip + product popup ───────────────────── */
.upsell-row {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  -webkit-overflow-scrolling: touch;
}
.upsell-card {
  position: relative;
  flex: 0 0 220px;
  max-width: 240px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .2s var(--transition), box-shadow .2s var(--transition);
}
.upsell-card:hover { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-glow); }
.upsell-card.selected { border-color: var(--teal); background: var(--teal-light); }
.upsell-added-badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  z-index: 1;
}
.upsell-thumb {
  height: 130px;
  background: var(--teal-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.upsell-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upsell-thumb-ph { font-size: 42px; }
.upsell-thumb-ph.big { font-size: 84px; }
.upsell-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.upsell-title { font-weight: 700; font-size: 15px; cursor: pointer; color: var(--text); }
.upsell-title:hover { color: var(--teal); }
.upsell-desc { font-size: 13px; color: var(--text-muted); line-height: 1.35; }
.upsell-price { font-weight: 700; color: var(--teal-dark); }
.upsell-variant-pick {
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  width: 100%;
}
.upsell-variant-pick:disabled { opacity: .7; }
.btn.btn-sm { padding: 9px 14px; font-size: 14px; }
.upsell-stepper {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--teal);
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--surface);
  align-self: flex-start;
}
.upsell-step {
  width: 28px; height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--teal-light);
  color: var(--teal-dark);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.upsell-step:hover { background: var(--teal); color: #fff; }
.upsell-qty { font-weight: 700; min-width: 18px; text-align: center; }

/* Popup */
.p3d-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 30, 32, .55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: p3dFade .18s var(--transition);
}
@keyframes p3dFade { from { opacity: 0; } to { opacity: 1; } }
.p3d-modal {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 640px) { .p3d-modal { grid-template-columns: 1fr; } }
.p3d-modal-close {
  position: absolute;
  top: 10px; right: 12px;
  width: 34px; height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  z-index: 2;
}
.p3d-modal-close:hover { color: var(--text); }
.p3d-modal-gallery { background: var(--teal-light); }
.p3d-modal-mainimg {
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.p3d-modal-mainimg img { width: 100%; height: 100%; object-fit: cover; }
.p3d-modal-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.p3d-modal-thumbs img {
  width: 54px; height: 54px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
}
.p3d-modal-thumbs img.active { border-color: var(--teal); }
.p3d-modal-info { padding: 22px 22px 20px; }
.p3d-modal-info h3 { font-family: var(--font-head); font-size: 20px; margin-bottom: 10px; color: var(--text); }
.upsell-long-desc { font-size: 14px; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px; }
.upsell-variant-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.upsell-variant-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  cursor: pointer;
  font-size: 14px;
}
.upsell-variant-opt.selected { border-color: var(--teal); background: var(--teal-light); }
.upsell-variant-opt input { accent-color: var(--teal); }
.upsell-variant-opt .upsell-price { margin-left: auto; }
.p3d-modal-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
