/* style.css — OEG Woodworking full site styles */

/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #222;
  background: #f5f4f0;
}

/* ── Shared section layout ────────────────────────────────────────────────── */
.section-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 0.4rem;
}

.section-sub {
  color: #666;
  margin: 0 0 2.5rem;
  font-size: 1.05rem;
}

/* ── Navigation ───────────────────────────────────────────────────────────── */
#site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #2d4a1e;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-links a {
  color: #c5dba8;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 5px;
  transition: background 0.15s, color 0.15s;
}

.nav-links a:hover { background: rgba(255,255,255,0.1); color: #fff; }

.nav-cta {
  background: #5a7a3a !important;
  color: #fff !important;
  font-weight: 600 !important;
  padding: 0.45rem 1rem !important;
}

.nav-cta:hover { background: #4a6830 !important; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
#hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  text-align: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(20,35,12,0.62), rgba(20,35,12,0.72));
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 3rem 1.5rem;
  max-width: 640px;
}

.hero-eyebrow {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #a8c48a;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.5rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.hero-tagline {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  color: #c5dba8;
  margin: 0 0 2rem;
  font-weight: 400;
}

.hero-cta {
  display: inline-block;
  background: #5a7a3a;
  color: #fff;
  text-decoration: none;
  padding: 0.9rem 2.25rem;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.hero-cta:hover { background: #4a6830; transform: translateY(-2px); }

/* ── How It Works ─────────────────────────────────────────────────────────── */
#how-it-works {
  background: #fff;
  border-top: 1px solid #e8e4dc;
  border-bottom: 1px solid #e8e4dc;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.step {
  text-align: center;
}

.step-num {
  width: 52px;
  height: 52px;
  background: #5a7a3a;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: #1a1a1a;
}

.step p {
  color: #666;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}

/* ── Gallery ──────────────────────────────────────────────────────────────── */
#gallery { background: #f5f4f0; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.gallery-item {
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 4 / 3;
  background: #e8e4dc;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.gallery-item:hover img { transform: scale(1.04); }

/* ── Configure section ────────────────────────────────────────────────────── */
#configure {
  background: #f5f4f0;
  border-top: 1px solid #e8e4dc;
}

#configure .section-sub {
  margin-bottom: 2rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
#contact {
  background: #1e3212;
  color: #c5dba8;
  border-top: 3px solid #5a7a3a;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.footer-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 0.25rem;
}

.footer-tagline {
  font-size: 0.88rem;
  color: #7aaa52;
  margin: 0;
}

.footer-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7aaa52;
  margin: 0 0 0.4rem;
  font-weight: 600;
}

.footer-email {
  color: #c5dba8;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s;
}

.footer-email:hover { color: #fff; }

.footer-copy {
  text-align: right;
  font-size: 0.8rem;
  color: #5a8040;
}

.footer-copy p { margin: 0; }

/* (old main rule replaced by .section-inner above) */

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: #1a1a1a;
}

.intro {
  color: #555;
  margin: 0 0 2rem;
}

/* offset anchor targets so sticky nav doesn't cover them */
#how-it-works, #gallery, #configure, #contact {
  scroll-margin-top: 58px;
}

/* ── Fieldsets ────────────────────────────────────────────────────────────── */
fieldset {
  border: 1px solid #d6d0c4;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 0 0 1.5rem;
  background: #fff;
}

legend {
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
  padding: 0 0.4rem;
}

/* ── Field rows ───────────────────────────────────────────────────────────── */
.field-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.field-row .field {
  flex: 1;
  min-width: 140px;
}

.field {
  margin-bottom: 1rem;
}

.field:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

/* ── Inputs ───────────────────────────────────────────────────────────────── */
input[type="number"],
input[type="text"],
input[type="email"],
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1.5px solid #c8c2b8;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  color: #222;
  background: #fff;
  transition: border-color 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #5a7a3a;
  box-shadow: 0 0 0 3px rgba(90, 122, 58, 0.15);
}

input[readonly] {
  background: #f0ede8;
  color: #666;
  cursor: not-allowed;
  border-style: dashed;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

/* ── Number input + unit suffix ───────────────────────────────────────────── */
.input-with-unit {
  display: flex;
  align-items: center;
}

.input-with-unit input {
  border-radius: 6px 0 0 6px;
  border-right: none;
  flex: 1;
}

.unit {
  padding: 0.55rem 0.6rem;
  border: 1.5px solid #c8c2b8;
  border-left: none;
  border-radius: 0 6px 6px 0;
  background: #f0ede8;
  color: #666;
  font-size: 0.95rem;
  white-space: nowrap;
}

.input-with-unit input:focus {
  border-color: #5a7a3a;
  box-shadow: 0 0 0 3px rgba(90, 122, 58, 0.15);
  position: relative;
  z-index: 1;
}

/* ── Radios ───────────────────────────────────────────────────────────────── */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.15rem;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 400;
}

.radio-option input[type="radio"] {
  width: auto;
  margin: 0;
  accent-color: #5a7a3a;
}

/* ── Field hints and errors ───────────────────────────────────────────────── */
.field-hint {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: #888;
}

.locked-hint {
  color: #b07000;
  font-style: italic;
}

.field-note {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: #999;
  font-style: italic;
}

.dimensions-disclaimer {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: #aaa;
  font-style: italic;
}

.field-error {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: #c0392b;
  font-weight: 500;
}

.required-mark {
  color: #c0392b;
  margin-left: 2px;
}

.optional-mark {
  color: #999;
  font-weight: 400;
  font-size: 0.85rem;
}

/* ── Price bar ────────────────────────────────────────────────────────────── */
#price-bar {
  background: #2d4a1e;
  color: #fff;
  border-radius: 8px;
  padding: 1.1rem 1.5rem;
  margin-bottom: 1.5rem;
  min-height: 60px;
  display: flex;
  align-items: center;
}

.price-prompt {
  margin: 0;
  color: #a8c48a;
  font-size: 0.95rem;
}

#price-result {
  width: 100%;
}

.price-summary {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
  color: #c5dba8;
}

.price-amount {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
}

/* ── Submit button ────────────────────────────────────────────────────────── */
button[type="submit"] {
  display: block;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: #5a7a3a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

button[type="submit"]:hover {
  background: #4a6830;
}

button[type="submit"]:disabled {
  background: #999;
  cursor: not-allowed;
}

.submit-error {
  margin: 0.75rem 0 0;
  color: #c0392b;
  font-size: 0.9rem;
  text-align: center;
}

/* ── Blueprint panel (Phase 5) ────────────────────────────────────────────── */
#blueprint-panel {
  margin-top: 2.5rem;
  background: #fff;
  border: 1px solid #d6d0c4;
  border-radius: 8px;
  padding: 1.5rem;
}

/* ── Confirmation screen ──────────────────────────────────────────────────── */
.confirmation-box {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #fff;
  border: 1px solid #d6d0c4;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.confirmation-icon {
  width: 56px;
  height: 56px;
  background: #5a7a3a;
  color: #fff;
  font-size: 1.75rem;
  line-height: 56px;
  border-radius: 50%;
  margin: 0 auto 1.25rem;
}

.confirmation-box h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  color: #1a1a1a;
}

.confirmation-box p {
  color: #555;
  margin: 0 0 0.5rem;
}

.confirmation-sub {
  font-size: 0.9rem;
  color: #888 !important;
  margin-bottom: 2rem !important;
}

.reset-btn {
  background: none;
  border: 1.5px solid #5a7a3a;
  color: #5a7a3a;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.reset-btn:hover {
  background: #5a7a3a;
  color: #fff;
}

/* ── Blueprint panel ──────────────────────────────────────────────────────── */
#blueprint-panel {
  margin-top: 2.5rem;
  background: #fff;
  border: 1px solid #d6d0c4;
  border-radius: 8px;
  padding: 1.75rem 1.5rem;
}

.bp-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #e8e4dc;
}

.bp-title-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.bp-title-row h2 {
  margin: 0;
  font-size: 1.3rem;
  color: #1a1a1a;
}

.bp-customer {
  font-size: 1rem;
  color: #5a7a3a;
  font-weight: 600;
}

.bp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  margin: 0;
}

.bp-meta > div {
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
}

.bp-meta dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #999;
  font-weight: 600;
  white-space: nowrap;
}

.bp-meta dd {
  margin: 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: #333;
}

.bp-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  font-weight: 700;
  margin: 1.75rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #e8e4dc;
}

/* ── Cut list table ───────────────────────────────────────────────────────── */
.cut-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 500px;
}

.cut-table thead th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-bottom: 2px solid #e8e4dc;
  background: #faf8f5;
}

.cut-table tbody tr {
  border-bottom: 1px solid #f0ede8;
}

.cut-table tbody tr:last-child {
  border-bottom: none;
}

.cut-table tbody tr:hover {
  background: #faf8f5;
}

.cut-table td {
  padding: 0.55rem 0.75rem;
  vertical-align: top;
}

.cut-table td:first-child {
  font-weight: 500;
  color: #222;
}

.col-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.col-notes {
  color: #666;
  font-size: 0.88rem;
}

/* Ripped floor board row — clearly distinguished (5.3) */
.ripped-row {
  background: #fffbf0;
}

.ripped-row td:first-child::before {
  content: '✂ ';
  color: #b07000;
  font-size: 0.85rem;
}

/* ── Material summary table ───────────────────────────────────────────────── */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  max-width: 420px;
}

.summary-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid #f0ede8;
}

.summary-table tfoot td {
  border-top: 2px solid #d6d0c4;
  border-bottom: none;
}

.total-row td {
  font-weight: 600;
  padding-top: 0.65rem;
}

.purchase-row td {
  font-weight: 700;
  font-size: 1rem;
  color: #2d4a1e;
}

.cost-row td {
  font-weight: 600;
  color: #444;
}

.bp-meta-note, .bp-meta {
  font-size: 0.82rem;
  color: #aaa;
  font-weight: 400;
}

/* ── Assembly notes ───────────────────────────────────────────────────────── */
.assembly-notes {
  margin: 0;
  padding-left: 1.4rem;
  color: #444;
  font-size: 0.92rem;
}

.assembly-notes li {
  padding: 0.3rem 0;
  line-height: 1.5;
}

/* ── Plank guide ──────────────────────────────────────────────────────────── */
.plank-guide {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.plank-item {
  border: 1px solid #e4dfd5;
  border-radius: 6px;
  padding: 0.75rem 1rem 0.5rem;
  background: #faf8f5;
}

.plank-item-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0 0 0.3rem;
}

/* ── Configurator two-column layout ──────────────────────────────────────── */
.configurator-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.form-col {
  flex: 1 1 380px;
  min-width: 0;
}

.preview-col {
  flex: 0 0 300px;
  position: sticky;
  top: calc(58px + 1rem); /* 58px nav + breathing room */
  align-self: flex-start;
}

/* ── Box preview panel ────────────────────────────────────────────────────── */
.box-preview {
  background: #fff;
  border: 1px solid #d6d0c4;
  border-radius: 8px;
  padding: 1rem 1rem 0.75rem;
}

.box-preview-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #aaa;
  font-weight: 700;
  margin: 0 0 0.6rem;
  text-align: center;
}

.box-dims-row {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
  color: #666;
}

.box-dims-row span {
  white-space: nowrap;
}

.box-dims-row strong {
  color: #222;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */

/* Nav collapses to hamburger below 700px */
@media (max-width: 700px) {
  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 58px;
    left: 0;
    right: 0;
    background: #2d4a1e;
    padding: 0.5rem 0 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 99;
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 0.7rem 1.5rem;
    border-radius: 0;
    font-size: 1rem;
  }

  .nav-cta {
    margin: 0.5rem 1.5rem 0 !important;
    border-radius: 6px !important;
    text-align: center;
  }
}

/* Steps stack on tablet */
@media (max-width: 720px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 420px;
    margin: 0 auto;
  }
}

/* Hero shrinks gracefully */
@media (max-width: 480px) {
  #hero { min-height: 400px; }
}

/* Gallery: 2 columns on small screens, 1 on very small */
@media (max-width: 560px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

@media (max-width: 360px) {
  .gallery-grid { grid-template-columns: 1fr; }
}

/* Footer stacks */
@media (max-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }
  .footer-copy { text-align: center; }
}

/* Configurator layout */
@media (max-width: 680px) {
  .configurator-layout {
    flex-direction: column;
  }

  .preview-col {
    position: static;
    width: 100%;
    flex: none;
    order: -1;
  }
}

@media (max-width: 520px) {
  .section-inner { padding: 2.5rem 1rem; }

  .field-row {
    flex-direction: column;
    gap: 0;
  }

  .field-row .field {
    min-width: unset;
  }

  #price-bar {
    padding: 1rem;
  }

  .price-amount {
    font-size: 1.2rem;
  }

  .box-preview {
    padding: 0.75rem;
  }
}

/* ── Print (builder PDF export — print window approach) ───────────────────── */
@media print {
  .plank-item    { page-break-inside: avoid; }
  .bp-section-title { page-break-after: avoid; }
  .cut-table tr, .summary-table tr { page-break-inside: avoid; }
  svg { page-break-inside: avoid; }
}
