/* Imperial Millwork — Configurator styles */

/* ── Minimal header ───────────────────────────────────────────────────────── */
.cfg-header {
  background: var(--header-bg);
  padding-block: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.cfg-header-inner { display: flex; align-items: center; gap: var(--space-3); }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--header-ink); }
.logo-mark { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px;
             background: var(--brass); color: var(--paper-raised); font-family: var(--font-display);
             font-weight: 600; font-size: var(--text-base); border-radius: var(--radius-sm); }
.logo-text { font-family: var(--font-display); font-size: var(--text-xs); font-weight: 500;
             line-height: 1.2; color: var(--header-ink); }
.cfg-breadcrumb { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-sm);
                  color: var(--header-ink); opacity: .7; margin-left: auto; }
.cfg-breadcrumb a { color: inherit; text-decoration: none; }
.cfg-breadcrumb a:hover { text-decoration: underline; }
.cfg-breadcrumb span[aria-current] { opacity: 1; font-weight: 500; }

/* ── Step progress bar ────────────────────────────────────────────────────── */
.cfg-steps-bar {
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
  padding-block: 16px;
}
.cfg-steps-inner {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: var(--max-content);
}
.step-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-faint);
  border-radius: var(--radius-sm);
  transition: color var(--duration-fast) var(--ease);
  white-space: nowrap;
}
.step-tab:disabled { cursor: default; }
.step-tab.active   { color: var(--ink); }
.step-tab.done     { color: var(--brass); }
.step-tab .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink-faint);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font-body);
  flex-shrink: 0;
  transition: background var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease);
}
.step-tab.active .step-num { background: var(--brass); color: var(--paper-raised); }
.step-tab.done   .step-num { background: var(--forest); color: #fff; }
.step-connector   { flex: 1; height: 1px; background: var(--line); min-width: 16px; }

@media (max-width: 640px) {
  .step-tab span:last-child { display: none; }
  .step-connector { min-width: 8px; }
}

/* ── Main layout ──────────────────────────────────────────────────────────── */
.cfg-main { padding-block: var(--space-4); min-height: 70vh; }
.cfg-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 900px) {
  .cfg-body { grid-template-columns: 1fr; }
  .cfg-preview { order: -1; }
}

/* ── Step panels ──────────────────────────────────────────────────────────── */
.step-panel { display: none; }
.step-panel.active { display: block; }
.step-panel[hidden] { display: none; }
.step-panel h2 { font-size: var(--text-3xl); margin-bottom: var(--space-1); }
.step-desc { color: var(--ink-soft); margin-bottom: var(--space-4); }
.measure-link { color: var(--brass); font-weight: 500; }

/* ── Shape select grid ───────────────────────────────────────────────────── */
.shape-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.shape-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: var(--space-2);
  background: var(--paper-raised);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  text-align: center;
  transition: border-color var(--duration-fast) var(--ease), box-shadow var(--duration-fast) var(--ease);
  user-select: none;
}
.shape-option svg { width: 60px; height: 52px; color: var(--ink-soft); }
.shape-option:hover { border-color: var(--brass-soft); }
.shape-option[aria-selected="true"] { border-color: var(--brass); box-shadow: 0 0 0 3px var(--brass-soft); color: var(--brass); }
.shape-option[aria-selected="true"] svg { color: var(--brass); }

/* ── Field groups ─────────────────────────────────────────────────────────── */
.field-group { margin-bottom: var(--space-3); }
.field-group label {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: 8px;
  color: var(--ink);
}
.input-wrap { position: relative; display: inline-flex; align-items: center; }
.input-wrap input, select, input[type="number"] {
  font-family: var(--font-body);
  font-size: var(--text-base);
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-raised);
  color: var(--ink);
  width: 100%;
  max-width: 260px;
  transition: border-color var(--duration-fast) var(--ease);
}
.input-wrap input:focus, select:focus { border-color: var(--brass); outline: none; }
.input-unit { position: absolute; right: 12px; font-size: var(--text-sm); color: var(--ink-faint); pointer-events: none; }
.input-wrap--narrow input { max-width: 100px; }
.dim-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-2); }

/* ── Pills ────────────────────────────────────────────────────────────────── */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  padding: 8px 16px;
  border: 1.5px solid var(--line);
  border-radius: 100px;
  background: var(--paper-raised);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease), color var(--duration-fast) var(--ease), background var(--duration-fast) var(--ease);
}
.pill:hover { border-color: var(--brass-soft); color: var(--ink); }
.pill.selected { border-color: var(--brass); color: var(--brass); background: var(--brass-soft); }

/* ── Swatch grid ──────────────────────────────────────────────────────────── */
.swatch-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-btn {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper-raised); cursor: pointer; font-family: var(--font-body);
  text-align: left; transition: border-color var(--duration-fast) var(--ease);
}
.swatch-btn:hover { border-color: var(--brass-soft); }
.swatch-btn.selected { border-color: var(--brass); box-shadow: 0 0 0 2px var(--brass-soft); }
.swatch-color { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,.1); }
.swatch-name { font-size: var(--text-sm); font-weight: 600; color: var(--ink); }
.swatch-note { font-size: var(--text-xs); color: var(--brass); }

/* ── Field hints ─────────────────────────────────────────────────────────── */
.field-hint { display: block; font-size: var(--text-xs); color: var(--ink-faint); margin-top: 6px; }
.field-hint a { color: var(--brass); }

/* ── Customize more ───────────────────────────────────────────────────────── */
.customize-more {
  margin-block: var(--space-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}
.customize-more summary {
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--brass);
  list-style: none;
  user-select: none;
}
.customize-more summary::after { content: ' ↓'; font-weight: 400; }
.customize-more[open] summary::after { content: ' ↑'; }
.customize-fields { padding-top: var(--space-2); }

/* ── Step footer ──────────────────────────────────────────────────────────── */
.step-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-soft);
  margin-top: var(--space-4);
}

/* ── Preview panel ────────────────────────────────────────────────────────── */
.cfg-preview {
  position: sticky;
  top: calc(60px + 60px + var(--space-2)); /* header + steps bar + gap */
}
.preview-inner {
  background: var(--paper-raised);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.preview-heading {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--ink);
}
.preview-schematic {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  margin-bottom: var(--space-2);
  text-align: center;
}
#preview-svg { width: 100%; max-width: 160px; margin: auto; }

/* ── Preview spec DL ─────────────────────────────────────────────────────── */
.preview-spec { margin-bottom: var(--space-2); }
.spec-row { display: flex; justify-content: space-between; gap: var(--space-2); padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.spec-row:last-child { border-bottom: none; }
.spec-row dt { font-size: var(--text-xs); color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.spec-row dd { font-size: var(--text-sm); font-weight: 500; color: var(--ink); text-align: right; }

/* ── Price display ────────────────────────────────────────────────────────── */
.preview-price-wrap { background: var(--paper); border-radius: var(--radius-sm); padding: var(--space-2); margin-bottom: var(--space-2); }
.preview-price-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-faint); margin-bottom: 4px; }
.preview-price { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 600; color: var(--brass); font-variant-numeric: tabular-nums; }
.price-loading { font-size: var(--text-base); color: var(--ink-faint); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:.4} 50%{opacity:1} }
.preview-shipping { font-size: var(--text-xs); color: var(--ink-faint); margin-top: 4px; }
.preview-note { font-size: var(--text-xs); color: var(--ink-faint); }

/* ── Freight warning ─────────────────────────────────────────────────────── */
.freight-warn {
  background: #fff3cd;
  border: 1px solid #f0c040;
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  font-size: var(--text-xs);
  color: #7a5c00;
}
:root[data-theme="dark"] .freight-warn,
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .freight-warn {
  background: #3a2d00; border-color: #7a5c00; color: #e8c94e;
}}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.cfg-footer { border-top: 1px solid var(--line); padding-block: var(--space-3); }
.cfg-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.cfg-footer p { font-size: var(--text-sm); color: var(--ink-soft); }
.cfg-footer p a { color: var(--brass); }
.footer-home-link { font-size: var(--text-sm); color: var(--ink-soft); text-decoration: none; }
.footer-home-link:hover { color: var(--brass); }
