/* configurator.css — styles for /configure, /checkout, /orders/confirmation pages.
   Inherits design tokens from theme.css. Does NOT override theme variables. */

/* ---- SHARED NAV ADDITIONS ---- */
.nav-back {
  font-size: 0.875rem;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-back:hover { color: var(--accent-dark); }

/* ---- CONFIGURATOR PAGE ---- */
.cfg-page {
  padding-top: 5.5rem;
  min-height: 100vh;
  background: var(--bg);
}

.cfg-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 3rem;
  align-items: start;
}

/* Left panel */
.cfg-panel {
  position: sticky;
  top: 5.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.cfg-header { margin-bottom: 0.5rem; }

.cfg-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--fg);
  margin: 0.5rem 0 0.75rem;
}
.cfg-title em { font-style: italic; color: var(--accent-dark); }

.cfg-subtitle {
  font-size: 0.95rem;
  color: var(--fg-muted);
  max-width: 340px;
  line-height: 1.6;
}

.cfg-section {
  background: var(--white);
  border: 1px solid var(--bg-accent);
  border-radius: 16px;
  padding: 1.5rem;
}

.cfg-step-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--fg-light);
  font-weight: 600;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cfg-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0;
}

/* Fabric cards */
.fabric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.fabric-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg);
  border: 2px solid var(--bg-accent);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
  width: 100%;
}
.fabric-card:hover { border-color: var(--accent-light); }
.fabric-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196,149,106,0.15); }

.fabric-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

/* Re-use swatch classes from theme.css */
.swatch-linen { background: linear-gradient(145deg, #D4C5A9 0%, #C2B08A 30%, #E0D4BC 60%, #CFC0A2 100%); }
.swatch-cotton { background: linear-gradient(145deg, #F0EAE0 0%, #E6DDD0 30%, #F5F0E8 60%, #EDE4D8 100%); }
.swatch-blend { background: linear-gradient(145deg, #B8ADA0 0%, #A69888 30%, #C4BAB0 60%, #B0A494 100%); }
.swatch-smart { background: linear-gradient(145deg, #3D3832 0%, #524B44 30%, #2C2622 60%, #4A433C 100%); }

.fabric-card-body { flex: 1; min-width: 0; }
.fabric-name { font-size: 0.82rem; font-weight: 600; color: var(--fg); line-height: 1.3; }
.fabric-price { font-size: 0.73rem; color: var(--fg-muted); margin-top: 0.15rem; }

.cfg-fabric-desc {
  font-size: 0.85rem;
  color: var(--fg-muted);
  line-height: 1.55;
  margin-top: 0.25rem;
  min-height: 1.2em;
}

/* Color swatches */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.color-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
  outline: none;
}
.color-dot:hover { transform: scale(1.1); }
.color-dot.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196,149,106,0.25); transform: scale(1.1); }

.color-name-display {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--fg);
  height: 1.3em;
}

/* Dimensions */
.dim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.dim-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}

.dim-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--bg-accent);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.dim-btn {
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.dim-btn:hover { background: var(--bg-accent); color: var(--fg); }
.dim-input-wrap input[type=number] {
  flex: 1;
  border: none;
  background: none;
  text-align: center;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--fg);
  padding: 0.5rem 0.25rem;
  -moz-appearance: textfield;
}
.dim-input-wrap input[type=number]::-webkit-inner-spin-button,
.dim-input-wrap input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; }
.dim-hint { font-size: 0.72rem; color: var(--fg-light); margin-top: 0.35rem; }

/* Quantity */
.qty-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.qty-display {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--fg);
  min-width: 2rem;
  text-align: center;
}
.qty-label { font-size: 0.85rem; color: var(--fg-muted); }
.qty-row .dim-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--bg-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  padding: 0;
}

/* Right panel: preview */
.cfg-preview {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 5.5rem;
}

.cfg-preview-window {
  background: var(--bg-warm);
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 4/3;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--bg-accent);
}

/* Live curtain preview */
.curtain-preview {
  width: 100%;
  height: 100%;
  position: relative;
  display: none;
}

.curtain-room-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg-accent) 100%);
  z-index: 0;
}

.curtain-rod {
  position: absolute;
  top: 12%;
  left: 10%;
  right: 10%;
  height: 6px;
  background: #8A7A6E;
  border-radius: 3px;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.curtain-rod::before, .curtain-rod::after {
  content: '';
  position: absolute;
  top: -4px;
  width: 14px; height: 14px;
  background: #6B5E55;
  border-radius: 50%;
}
.curtain-rod::before { left: -4px; }
.curtain-rod::after { right: -4px; }

.curtain-panel {
  position: absolute;
  top: calc(12% + 6px);
  bottom: 5%;
  width: 38%;
  z-index: 2;
  border-radius: 0 0 4px 4px;
  transition: background 0.3s;
}
.curtain-panel.left {
  left: 10%;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0% 100%);
}
.curtain-panel.right {
  right: 10%;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 8% 100%);
}

.cfg-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--fg-light);
  height: 100%;
}
.placeholder-icon {
  font-size: 2.5rem;
  color: var(--accent-light);
}
.placeholder-text {
  font-size: 0.9rem;
  color: var(--fg-light);
}

/* Price card */
.cfg-price-card {
  background: var(--white);
  border: 1px solid var(--bg-accent);
  border-radius: 16px;
  padding: 1.5rem;
}
.price-card-inner { margin-bottom: 1.25rem; }
.price-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-light);
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.price-amount {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}
.price-breakdown {
  font-size: 0.8rem;
  color: var(--fg-light);
  min-height: 1.2em;
  margin-bottom: 0.75rem;
}
.price-delivery {
  font-size: 0.82rem;
  color: var(--accent-dark);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.delivery-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.cfg-cta-btn {
  display: block;
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-align: center;
  letter-spacing: 0.02em;
}
.cfg-cta-btn:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-1px); }
.cfg-cta-btn:disabled { background: var(--bg-accent); color: var(--fg-light); cursor: not-allowed; }

.cfg-cta-hint {
  font-size: 0.78rem;
  color: var(--fg-light);
  text-align: center;
  margin-top: 0.65rem;
}

/* Fabric detail */
.cfg-fabric-detail {
  background: var(--fg);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  color: var(--bg);
}
.fabric-detail-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-light);
  font-weight: 600;
  margin-bottom: 0.85rem;
}
.prop-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(250,247,242,0.08);
}
.prop-row:last-child { border-bottom: none; }
.prop-key {
  color: var(--fg-light);
  text-transform: capitalize;
  font-size: 0.78rem;
}
.prop-val { color: var(--bg); font-weight: 500; }

/* ---- CHECKOUT PAGE ---- */
.checkout-page {
  padding-top: 5.5rem;
  min-height: 100vh;
}
.checkout-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 2.5rem;
  align-items: start;
}

.order-summary-card {
  background: var(--bg-warm);
  border: 1px solid var(--bg-accent);
  border-radius: 16px;
  padding: 1.5rem;
  position: sticky;
  top: 5.5rem;
}

.summary-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fg-light);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.summary-fabric {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.summary-swatch { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; }
.summary-fabric-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem; }
.summary-fabric-color { font-size: 0.82rem; color: var(--fg-muted); }

.summary-dims {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.summary-dim-item {
  background: var(--white);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}
.dim-key {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-light);
  margin-bottom: 0.2rem;
}
.dim-val { font-weight: 600; font-size: 0.9rem; }

.summary-price-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--fg-muted);
  padding: 0.3rem 0;
  border-top: 1px solid var(--bg-accent);
}
.summary-total-line {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  padding: 0.5rem 0;
  border-top: 1.5px solid var(--fg);
  margin-top: 0.25rem;
}
.summary-delivery-note {
  font-size: 0.8rem;
  color: var(--accent-dark);
  margin-top: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.summary-edit-link {
  display: block;
  font-size: 0.8rem;
  color: var(--fg-light);
  text-decoration: underline;
  margin-top: 0.85rem;
  text-align: center;
}
.summary-edit-link:hover { color: var(--accent-dark); }

/* Checkout form */
.checkout-form-card {
  background: var(--white);
  border: 1px solid var(--bg-accent);
  border-radius: 16px;
  padding: 2rem;
}
.checkout-form-header { margin-bottom: 2rem; }
.checkout-form-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 400;
  line-height: 1.2;
  margin: 0.4rem 0 0;
}
.checkout-form-title em { font-style: italic; color: var(--accent-dark); }

.form-error {
  background: #FEF2F2;
  color: #B91C1C;
  border: 1px solid #FECACA;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.form-field label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-muted);
}
.form-field input,
.form-field textarea {
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--bg-accent);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg);
  transition: border-color 0.15s;
  resize: vertical;
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196,149,106,0.12);
}

.submit-btn { margin-top: 0.5rem; font-size: 1.05rem; }
.spinner { font-style: italic; color: rgba(255,255,255,0.8); }

.form-disclaimer {
  font-size: 0.78rem;
  color: var(--fg-light);
  line-height: 1.55;
  margin-top: 1rem;
}

/* ---- CONFIRMATION PAGE ---- */
.confirmation-page {
  padding-top: 5.5rem;
  min-height: 100vh;
  background: var(--bg);
}
.confirmation-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  text-align: center;
}
.confirmation-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px; height: 64px;
  background: var(--accent);
  color: white;
  font-size: 1.8rem;
  border-radius: 50%;
  margin-bottom: 1.5rem;
}
.confirmation-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.15;
  margin: 0.5rem 0 1rem;
}
.confirmation-title em { font-style: italic; color: var(--accent-dark); }
.confirmation-sub {
  font-size: 1rem;
  color: var(--fg-muted);
  line-height: 1.65;
  margin-bottom: 2rem;
}

.confirmation-card {
  background: var(--white);
  border: 1px solid var(--bg-accent);
  border-radius: 16px;
  padding: 1.75rem;
  text-align: left;
  margin-bottom: 2rem;
}
.conf-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--bg-accent);
  font-size: 0.9rem;
}
.conf-row:last-child { border-bottom: none; }
.conf-key { color: var(--fg-muted); }
.conf-val { font-weight: 500; text-align: right; }
.conf-ref { font-family: monospace; font-size: 1rem; color: var(--accent-dark); }
.conf-addr { max-width: 220px; white-space: pre-wrap; }
.conf-divider { height: 1px; background: var(--bg-accent); margin: 0.35rem 0; }
.conf-total .conf-key { font-weight: 700; color: var(--fg); }
.conf-total .conf-val { font-size: 1.05rem; font-weight: 700; color: var(--fg); }

/* Timeline */
.confirmation-timeline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 2rem;
}
.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.tl-dot {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--bg-accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg-light);
  background: var(--white);
}
.timeline-step.done .tl-dot {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.tl-label {
  font-size: 0.68rem;
  color: var(--fg-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  max-width: 70px;
}
.timeline-step.done .tl-label { color: var(--accent-dark); font-weight: 600; }
.timeline-line { flex: 1; height: 2px; background: var(--bg-accent); min-width: 24px; margin: 0 0; margin-bottom: 1.4rem; }

.confirmation-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}
.conf-home-link { font-size: 0.88rem; color: var(--fg-muted); text-decoration: none; }
.conf-home-link:hover { color: var(--accent-dark); }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .cfg-inner {
    grid-template-columns: 1fr;
  }
  .cfg-panel { position: static; }
  .cfg-preview { position: static; }
  .checkout-inner { grid-template-columns: 1fr; }
  .order-summary-card { position: static; }
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .fabric-grid { grid-template-columns: 1fr; }
  .dim-grid { grid-template-columns: 1fr; }
}
