/* ── Custom Tea Towel builder styles ──────────────────────────────────────── */

/* Layout */
.builder-page { min-height: 100vh; }

.builder-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}
@media (min-width: 900px) {
  .builder-layout {
    grid-template-columns: 380px 1fr;
    gap: 2.5rem;
    align-items: start;
    padding: 2rem 2rem 5rem;
  }
}

/* Preview Panel */
.preview-panel { order: -1; }
@media (min-width: 900px) { .preview-panel { position: relative; } }

.preview-sticky {
  position: sticky;
  top: 5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Canvas mockup — photo-realistic towel preview */
.towel-preview-wrap { text-align: center; }

.towel-mockup-canvas {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 4px 28px rgba(0,0,0,0.20);
  margin: 0 auto;
}

.preview-label {
  font-size: 0.72rem;
  color: var(--text-soft);
  margin-top: 0.5rem;
  text-align: center;
}

/* Price box */
.preview-price-box {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2d9d0);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.preview-price-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.preview-price-total {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  padding-top: 0.5rem;
  border-top: 1px solid var(--border, #e2d9d0);
}

/* Form Panel */
.form-panel { display: flex; flex-direction: column; gap: 0; }

.builder-header {
  padding: 2rem 0 1.5rem;
  border-bottom: 1px solid var(--border, #e2d9d0);
  margin-bottom: 1.5rem;
}
@media (min-width: 900px) { .builder-header { padding-top: 0; } }

.builder-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.4rem;
}
.builder-sub { color: var(--text-soft); margin: 0; }

/* Form section */
.form-section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border, #e2d9d0);
}
.form-section:last-child { border-bottom: none; }

.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  flex-shrink: 0;
}

.form-section-hint {
  font-size: 0.8rem;
  color: var(--text-soft);
  margin: 0.5rem 0 0;
}

/* Upload area */
.upload-area {
  border: 2px dashed var(--border, #d5c9bf);
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: transparent;
  position: relative;
}
.upload-area:hover,
.upload-area--active { border-color: var(--gold); background: var(--gold-dim); }
.upload-area--filled { padding: 1rem; border-style: solid; border-color: var(--gold); }
.upload-area--processing { border-color: var(--gold); cursor: default; pointer-events: none; }

.upload-processing {
  display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  pointer-events: none;
}
.processing-spinner {
  width: 2.5rem; height: 2.5rem;
  border: 3px solid var(--gold-dim);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.upload-placeholder { pointer-events: none; }
.upload-icon { width: 3rem; height: 3rem; color: var(--text-muted); margin: 0 auto 0.75rem; display: block; }
.upload-prompt { font-weight: 600; color: var(--text); margin: 0 0 0.25rem; }
.upload-hint { font-size: 0.78rem; color: var(--text-soft); margin: 0; }

.upload-filled { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.upload-preview-img {
  width: 120px; height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--gold);
}
.upload-change-btn {
  font-size: 0.8rem;
  color: var(--gold);
  background: none;
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}
.upload-error {
  color: #c0392b;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Colour swatches */
.colour-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.colour-swatch {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.colour-swatch:hover { transform: scale(1.1); }
.colour-swatch--active {
  border-color: var(--gold);
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--gold-glow, rgba(44,95,46,0.3));
}

/* Size grid */
.size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.6rem;
}
.size-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border, #d5c9bf);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.size-btn:hover { border-color: var(--gold); }
.size-btn.active { border-color: var(--gold); background: var(--gold-dim); }

.size-btn-label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.size-btn-badge {
  font-size: 0.68rem;
  color: var(--gold);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.size-btn-price { font-size: 0.8rem; color: var(--text-soft); margin-top: 0.15rem; }

/* Quantity control */
.qty-control {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.qty-btn {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1.5px solid var(--border, #d5c9bf);
  background: none;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.qty-btn:hover { border-color: var(--gold); background: var(--gold-dim); }
.qty-value { font-size: 1.2rem; font-weight: 600; color: var(--text); min-width: 1.5rem; text-align: center; }

/* Delivery grid */
.delivery-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.delivery-btn {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0 0.5rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border, #d5c9bf);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.delivery-btn:hover { border-color: var(--gold); }
.delivery-btn.active { border-color: var(--gold); background: var(--gold-dim); }

.delivery-btn-name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.delivery-btn-eta  { font-size: 0.78rem; color: var(--text-soft); grid-row: 2; }
.delivery-btn-price { font-size: 0.9rem; font-weight: 600; color: var(--gold); grid-row: 1 / 3; align-self: center; }

/* Trust strip */
.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  padding: 1rem 0;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* CTA */
.cta-area { display: flex; flex-direction: column; gap: 0.6rem; padding-top: 0.5rem; }
.cta-error { color: #c0392b; font-size: 0.85rem; margin: 0; }
.cta-note { font-size: 0.75rem; color: var(--text-muted); margin: 0; text-align: center; }

.btn-full { width: 100%; justify-content: center; }

/* Reviews section */
.builder-reviews {
  padding: 3rem 0 4rem;
  border-top: 1px solid var(--border, #e2d9d0);
  margin-top: 2rem;
}

/* Visually hidden utility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
