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

:root {
  --bg: #FAFAF8;
  --surface: #FFFFFF;
  --border: #E5E2DC;
  --border-hover: #C8C3BA;
  --text: #1A1A1A;
  --text-secondary: #5A5A5A;
  --text-muted: #8A8A8A;
  --accent: #2C3E50;
  --accent-light: #3D5166;
  --warm: #8B7355;
  --green: #4A7C59;
  --green-light: #E8F0EA;
  --red: #C0392B;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --radius: 8px;
  --radius-lg: 12px;
}

html { font-size: 16px; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.progress-bar {
  display: flex; align-items: center; justify-content: center;
  padding: 24px 20px 20px; gap: 0; max-width: 600px; margin: 0 auto;
}
.progress-step {
  display: flex; align-items: center; gap: 8px; cursor: pointer; transition: opacity 0.2s;
}
.progress-step.disabled { pointer-events: none; opacity: 0.4; }
.step-number {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  border: 2px solid var(--border); color: var(--text-muted);
  background: var(--surface); transition: all 0.3s; flex-shrink: 0;
}
.progress-step.active .step-number { background: var(--accent); border-color: var(--accent); color: #fff; }
.progress-step.completed .step-number { background: var(--green); border-color: var(--green); color: #fff; }
.step-label { font-size: 12px; font-weight: 500; color: var(--text-muted); white-space: nowrap; }
.progress-step.active .step-label { color: var(--accent); font-weight: 600; }
.progress-step.completed .step-label { color: var(--green); }
.progress-connector {
  flex: 1; height: 2px; background: var(--border); margin: 0 8px; min-width: 20px; max-width: 60px; position: relative;
}
.progress-connector .fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--green); transition: width 0.4s ease; width: 0; }
.progress-connector.filled .fill { width: 100%; }

.configurator { max-width: 960px; margin: 0 auto; padding: 48px 20px 40px; }

.step-panel { display: none; animation: fadeIn 0.35s ease; }
.step-panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.step-header { text-align: center; margin-bottom: 28px; }
.step-header h2 { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 8px; letter-spacing: -0.3px; }
.step-header p { font-size: 14px; color: var(--text-secondary); max-width: 560px; margin: 0 auto; line-height: 1.65; }

/* Door grid */
.door-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.door-card {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-lg);
  cursor: pointer; transition: all 0.25s; overflow: hidden; position: relative;
}
.door-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.door-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-md); }
.door-card .check-badge {
  position: absolute; top: 10px; right: 10px;
  width: 24px; height: 24px; background: var(--accent); border-radius: 50%;
  display: none; align-items: center; justify-content: center;
  position: absolute; z-index: 2;
}
.door-card.selected .check-badge { display: flex; position: absolute; top: 10px; right: 10px; }
.door-preview {
  width: 100%; aspect-ratio: 3/4;
  display: flex; align-items: center; justify-content: center;
  padding: 12px; background: #F6F5F2;
}
.door-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.door-card-label {
  padding: 12px 14px; font-size: 13px; font-weight: 600;
  text-align: center; color: var(--text); border-top: 1px solid var(--border);
}
.door-card-edge { font-size: 11px; font-weight: 400; color: var(--text-muted); display: block; margin-top: 2px; }

/* Color grid */
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.color-card {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all 0.25s; overflow: hidden;
}
.color-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.color-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.color-swatch {
  width: 100%; aspect-ratio: 1/1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #F6F5F2; padding: 8px;
}
.color-swatch img { max-width: 100%; max-height: 100%; object-fit: contain; }
.color-swatch .check-badge {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px; background: var(--accent); border-radius: 50%;
  display: none; align-items: center; justify-content: center; z-index: 2;
}
.color-card.selected .check-badge { display: flex; }
.color-card-label { padding: 8px 10px; font-size: 12px; font-weight: 600; text-align: center; color: var(--text); }
.custom-color-note {
  text-align: center; margin-top: 20px; padding: 14px 20px;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); font-size: 13px; color: var(--text-secondary);
}
.custom-color-note a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* Hardware */
.hardware-section { margin-bottom: 32px; }
.hardware-section-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.hardware-question { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.toggle-group { display: flex; gap: 8px; margin-bottom: 16px; }
.toggle-btn {
  padding: 8px 24px; border: 2px solid var(--border); border-radius: 100px;
  background: var(--surface); font-size: 13px; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.toggle-btn:hover { border-color: var(--border-hover); }
.toggle-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.hinge-grid, .handle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.hw-card {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  cursor: pointer; transition: all 0.2s; overflow: hidden;
}
.hw-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.hw-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.hw-card-icon {
  width: 100%; height: 100px; background: #F6F5F2;
  display: flex; align-items: center; justify-content: center; padding: 8px;
}
.hw-card-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.hw-card-label {
  padding: 8px 8px; font-size: 11px; font-weight: 600;
  text-align: center; color: var(--text); border-top: 1px solid var(--border); line-height: 1.3;
}
.hw-card-finish { font-size: 10px; font-weight: 400; color: var(--text-muted); display: block; margin-top: 1px; }
.product-select-card { display:block;border:2px solid var(--border);border-radius:var(--radius-lg);cursor:pointer;transition:all 0.2s;background:var(--bg); }
.product-select-card:hover { border-color:var(--text-muted);background:var(--surface); }
.product-select-card.checked { border-color:var(--accent);background:var(--accent);color:#fff !important; }
.product-card-title { color: var(--text); }
.product-card-desc { color: var(--text-secondary); }
.product-select-card.checked .product-card-title { color: #fff !important; }
.product-select-card.checked .product-card-desc { color:rgba(255,255,255,0.8) !important; }
.product-select-card.checked .product-check { background:#fff;border-color:#fff; }
.product-select-card.checked .product-check svg { stroke:var(--accent); }
.product-select-card.checked .product-select-icon { background:rgba(255,255,255,0.2); }
.product-select-card.checked .product-select-icon svg { stroke:#fff; }
.sample-product-card { background:#FBF8F2; border-color:#D8CCBA; }
.sample-product-card:hover { border-color:var(--warm); background:#F7F2E9; }
.sample-product-card.checked { border-color:var(--warm); background:var(--warm); }
.sample-product-card.checked .product-select-icon { background:rgba(255,255,255,0.18) !important; }
.sample-product-card.checked .product-select-icon svg { stroke:#fff; }

.free-service-callout {
  margin-top: 24px; padding: 20px; background: var(--green-light);
  border-radius: var(--radius-lg); border: 1px solid #C2D9C8;
}
.free-service-callout h4 {
  font-size: 14px; font-weight: 700; color: var(--green); margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.free-service-callout p { font-size: 13px; color: #3A5A44; line-height: 1.6; }

/* Dimensions */
.door-entries { max-width: 600px; margin: 0 auto; }
.door-entry {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.door-entry-num { font-size: 12px; font-weight: 700; color: var(--text-muted); min-width: 52px; }
.door-entry input {
  width: 90px; padding: 8px 10px; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; text-align: center; color: var(--text);
  background: var(--bg); transition: border-color 0.2s;
}
.door-entry input:focus { outline: none; border-color: var(--accent); }
.door-entry input::placeholder { color: var(--text-muted); }
.door-entry .times { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.door-entry .qty-label { font-size: 12px; color: var(--text-muted); margin-left: auto; margin-right: 4px; }
.door-entry input.qty-input { width: 56px; }
.remove-entry {
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 4px; display: flex; align-items: center; transition: color 0.2s;
}
.remove-entry:hover { color: var(--red); }

.add-door-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; max-width: 600px; margin: 0 auto 20px; padding: 12px;
  background: transparent; border: 2px dashed var(--border); border-radius: var(--radius);
  font-size: 13px; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; font-family: inherit; transition: all 0.2s;
}
.add-door-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(44,62,80,0.03); }

.measure-link { text-align: center; margin-top: 8px; font-size: 13px; }
.measure-link a { color: var(--accent); text-decoration: none; font-weight: 500; }

/* Nav */
.step-nav {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px; max-width: 600px; margin-left: auto; margin-right: auto;
}
.btn {
  padding: 12px 28px; border-radius: 100px; font-size: 14px; font-weight: 600;
  font-family: inherit; cursor: pointer; transition: all 0.2s; border: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-back { background: transparent; color: var(--text-secondary); border: 1.5px solid var(--border); }
.btn-back:hover { border-color: var(--text-secondary); color: var(--text); }
.btn-next { background: var(--accent); color: #fff; }
.btn-next:hover { background: var(--accent-light); }
.btn-next:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-submit { background: var(--green); color: #fff; padding: 14px 36px; font-size: 15px; }
.btn-submit:hover { background: #3D6B4B; }

/* Summary */
.summary-panel {
  max-width: 600px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}
.summary-row {
  display: flex; justify-content: space-between; padding: 14px 20px;
  font-size: 14px; border-bottom: 1px solid var(--border);
}
.summary-row:last-child { border-bottom: none; }
.summary-label { color: var(--text-muted); font-weight: 500; }
.summary-value { font-weight: 600; color: var(--text); text-align: right; }
.summary-doors-list { font-size: 12px; color: var(--text-secondary); font-weight: 400; margin-top: 4px; line-height: 1.5; }

/* Contact */
.contact-fields {
  max-width: 600px; margin: 20px auto 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.contact-fields .full-width { grid-column: 1 / -1; }
.contact-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.contact-field input, .contact-field textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 14px; font-family: inherit; color: var(--text); background: var(--bg); transition: border-color 0.2s;
}
.contact-field input:focus, .contact-field textarea:focus { outline: none; border-color: var(--accent); }
.contact-field textarea { resize: vertical; min-height: 72px; }
.submit-error { text-align: center; color: var(--red); font-size: 13px; margin-top: 8px; display: none; }

.progress-wrap { display: none; justify-content: center; width: 100%; }

.site-header {
  background: #fff;
  border-bottom: 1px solid #E6E6E6;
  margin-bottom: 0;
  position: relative;
  z-index: 20;
}
.site-header-inner {
  position: relative;
  max-width: none;
  margin: 0 auto;
  padding: 6px 40px;
  min-height: 92px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 24px;
}
.header-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  justify-self: start;
}
.header-logo img {
  display: block;
  height: 76px;
  width: auto;
}
.header-nav {
  position: static;
  left: auto;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin: 0;
  justify-self: center;
}
.header-shop-desktop { justify-self: end; }
.header-link {
  font-family: Montserrat, Inter, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: #1A1A1A;
  white-space: nowrap;
  padding: 4px 0;
}
.header-link:hover { color: #002958; }
.header-link.is-active {
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1.5px;
}
.header-shop {
  font-family: Montserrat, Inter, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: #002958;
  border-radius: 999px;
  padding: 13px 28px;
  white-space: nowrap;
  line-height: 1;
  position: relative;
  z-index: 2;
}
.header-shop:hover { background: #00366f; color: #fff; }
.header-shop-mobile { display: none; }
.header-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 10px 8px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  position: relative;
  z-index: 2;
}
.header-toggle span {
  display: block;
  height: 2px;
  background: #1A1A1A;
  border-radius: 2px;
}

.page-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
  background: #F7F3F0;
}
.page-hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 48px 72px 56px;
  max-width: 680px;
  margin-left: auto;
  width: 100%;
}
.page-hero-copy h1 {
  font-family: Montserrat, Inter, sans-serif;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.6px;
  color: #1A1A1A;
  margin-bottom: 20px;
}
.page-hero-copy p {
  font-size: 16px;
  line-height: 1.65;
  color: #3A3A3A;
  max-width: 460px;
  margin-bottom: 28px;
}
.page-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-btn {
  font-family: Montserrat, Inter, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  border: 0;
  line-height: 1;
}
.hero-btn-primary {
  background: #42774D;
  color: #fff;
}
.hero-btn-primary:hover { background: #35633e; }
.hero-btn-secondary {
  background: #fff;
  color: #1A1A1A;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.hero-btn-secondary:hover { background: #f3f3f3; }
.page-hero-media {
  min-height: 560px;
  overflow: hidden;
}
.page-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}
#builder { scroll-margin-top: 16px; }

.site-footer {
  background: #00275B;
  color: #fff;
  margin-top: auto;
  padding: 0;
  text-align: left;
  font-size: 14px;
  line-height: 1.55;
}
.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 64px 44px;
  display: grid;
  grid-template-columns: 1.2fr 1.1fr 0.9fr;
  gap: 40px 56px;
}
.footer-brand p {
  font-family: Montserrat, Inter, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 22px;
}
.footer-logo {
  display: inline-block;
  background: #fff;
  border-radius: 6px;
  padding: 14px 18px;
}
.footer-logo img {
  display: block;
  height: 56px;
  width: auto;
}
.footer-col h3 {
  font-family: Montserrat, Inter, sans-serif;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 16px;
}
.footer-col p {
  margin: 0 0 16px;
  color: #fff;
  font-size: 14px;
  max-width: 280px;
}
.footer-col a,
.footer-legal a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.22);
}
.footer-bottom-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 64px 28px;
  grid-template-columns: none;
}
.footer-legal {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.footer-legal span { opacity: 0.75; }
.footer-credit {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  white-space: nowrap;
}
.footer-credit img {
  display: block;
  height: 36px;
  width: auto;
  background: #00275B;
}

.shipping-note {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 12px 0 0;
}
.shipping-note a {
  color: var(--text);
  text-decoration: underline;
}
.shipping-note a:hover {
  color: var(--accent);
}
.status-page .shipping-note {
  max-width: 420px;
  margin: 0 auto 18px;
}
.pay-mode {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
}
.pay-mode label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkout-nav {
  max-width: 600px;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.checkout-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.status-page {
  max-width: 520px;
  margin: 48px auto;
  padding: 40px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
}
.status-page h1 { font-size: 24px; margin-bottom: 10px; }
.status-page p { color: var(--text-secondary); font-size: 14px; margin-bottom: 18px; }

[hidden] { display: none !important; }

/* Measuring diagram */
.measure-diagram { max-width: 400px; margin: 0 auto 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.measure-diagram svg { width: 100%; display: block; }

@media (max-width: 1020px) {
  .site-header-inner {
    display: flex;
    flex-wrap: wrap;
    padding: 10px 20px;
    min-height: 76px;
    gap: 8px;
  }
  .header-logo img { height: 56px; }
  .header-toggle { display: flex; }
  .header-shop-desktop { display: none; }
  .header-shop-mobile { display: block; }
  .header-nav {
    position: static;
    left: auto;
    transform: none;
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px 0 12px;
    border-top: 1px solid #E6E6E6;
  }
  .header-nav.is-open { display: flex; }
  .header-link {
    padding: 12px 4px;
    border-bottom: 1px solid #F0F0F0;
  }
  .header-shop-mobile {
    margin: 12px 0 0;
    text-align: center;
  }
  .page-hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .page-hero-copy {
    padding: 40px 24px 36px;
    max-width: none;
  }
  .page-hero-copy h1 { font-size: 32px; }
  .page-hero-media { min-height: 320px; max-height: 420px; }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 24px 32px;
  }
  .footer-bottom-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 24px;
  }
  .footer-col p { max-width: none; }
}

@media (max-width: 640px) {
  .step-label { display: none; }
  .progress-bar { padding: 16px 16px 12px; }
  .step-number { width: 28px; height: 28px; font-size: 12px; }
  .door-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .color-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .hinge-grid, .handle-grid { grid-template-columns: repeat(2, 1fr); }
  .step-header h2 { font-size: 20px; }
  .door-entry { flex-wrap: wrap; }
  .door-entry input { width: 70px; }
  .configurator { padding: 0 12px 32px; }
  .contact-fields { grid-template-columns: 1fr; }
  .checkout-nav { flex-direction: column; align-items: stretch; }
  .checkout-actions { justify-content: stretch; }
  .checkout-actions .btn { width: 100%; justify-content: center; }
}

/* Keyboard focus for div-based controls (cards, progress steps, handle finishes) */
[role="button"]:focus-visible,
.toggle-btn:focus-visible,
.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.progress-step[aria-disabled="true"] { cursor: default; }

.status-page .order-ref {
  font-size: 13px;
  color: var(--text-secondary);
}
.status-page .order-ref code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  user-select: all;
}
