:root {
  color-scheme: light;
  --bg: #f4f5f2;
  --band: #ffffff;
  --ink: #161616;
  --muted: #626762;
  --line: #dadeda;
  --accent: #c81018;
  --accent-dark: #8e0d12;
  --green: #1f6b4a;
  --green-soft: #e8f3ed;
  --warning: #9a5518;
  --soft: #f7f8f6;
  --shadow: 0 16px 38px rgba(22, 22, 22, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: var(--accent-dark);
  font-weight: 800;
}

.page-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.masthead,
.form-band,
.totals-band,
.submit-band,
.preview-panel {
  background: var(--band);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  border-radius: 8px 8px 0 0;
}

.brand-lockup {
  display: flex;
  justify-content: center;
  width: 100%;
}

.brand-lockup img {
  width: min(50vw, 620px);
  min-width: 280px;
  max-width: 100%;
}

.masthead h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.masthead h1 {
  font-size: clamp(2rem, 6vw, 4.25rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.brand-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.catalog-status {
  display: inline-flex;
  max-width: 100%;
  border: 1px solid #bdd3c6;
  background: var(--green-soft);
  border-radius: 999px;
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 800;
  margin: 8px 0 0;
  padding: 8px 12px;
  text-align: center;
}

.form-band {
  border-top: 0;
  padding: 24px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading h2 {
  font-size: 1.45rem;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd0cc;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 16, 24, 0.13);
}

.full-width {
  margin-top: 16px;
}

.product-band {
  padding-bottom: 18px;
}

.product-heading {
  align-items: center;
}

.line-header {
  display: grid;
  grid-template-columns: minmax(320px, 1.8fr) 100px 150px 150px 94px;
  gap: 12px;
  padding: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.line-items {
  display: grid;
  gap: 12px;
}

.line-item {
  display: grid;
  grid-template-columns: minmax(320px, 1.8fr) 100px 150px 150px 94px;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.mobile-label {
  display: none;
}

.price-cell,
.line-total-cell {
  display: grid;
  gap: 4px;
  min-height: 44px;
  align-content: center;
}

.unit-price,
.line-total {
  font-size: 1.05rem;
}

.price-break {
  display: block;
  color: var(--muted);
  font-weight: 800;
  white-space: pre-line;
  margin-top: 4px;
  line-height: 1.3;
}

.primary-button,
.secondary-button,
.remove-button {
  min-height: 44px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-dark);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-color: #b8c0bb;
  background: #fff;
  color: var(--ink);
  padding: 10px 14px;
}

.remove-button {
  border-color: #e3b4b6;
  background: #fff5f5;
  color: var(--accent-dark);
  padding: 10px 12px;
}

.totals-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  border-top: 0;
  padding: 18px 24px;
}

.totals-band div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}

.totals-band span,
.totals-band p {
  color: var(--muted);
  font-weight: 800;
}

.totals-band strong {
  font-size: 1.25rem;
}

.totals-band p {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.9rem;
}

.payment-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.payment-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  padding: 14px;
}

.payment-option input,
.terms-check input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.payment-option span {
  display: grid;
  gap: 4px;
}

.payment-option small {
  color: var(--muted);
  font-weight: 800;
}

.terms-check {
  grid-template-columns: auto 1fr;
  align-items: start;
  margin-top: 16px;
  color: var(--ink);
}

.submit-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  padding: 22px 24px;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: var(--warning);
  font-weight: 800;
}

.action-row {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 12px;
}

.preview-panel {
  margin-top: 20px;
  border-radius: 8px;
  padding: 24px;
}

.preview-brand {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.preview-brand img {
  width: 90px;
}

.preview-brand h3,
.preview-brand p {
  margin: 0;
}

.summary-list,
.summary-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.summary-list div,
.summary-totals div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.summary-list dt,
.summary-totals dt {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-list dd,
.summary-totals dd {
  margin: 3px 0 0;
  font-weight: 800;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 18px;
}

.summary-table th,
.summary-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.summary-table small {
  color: var(--muted);
  font-style: italic;
}

.hidden {
  display: none;
}

@media (max-width: 1040px) {
  .totals-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .field-grid,
  .payment-options,
  .totals-band,
  .summary-list,
  .summary-totals {
    grid-template-columns: 1fr;
  }

  .masthead,
  .section-heading,
  .submit-band {
    align-items: stretch;
    flex-direction: column;
  }

  .brand-lockup img {
    width: min(74vw, 520px);
    min-width: 220px;
  }

  .line-header {
    display: none;
  }

  .line-item {
    grid-template-columns: 1fr 1fr;
  }

  .product-select-wrap {
    grid-column: 1 / -1;
  }

  .mobile-label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  .remove-button {
    grid-column: 1 / -1;
  }

  .action-row {
    justify-content: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 20px, 1220px);
    padding-top: 10px;
  }

  .masthead,
  .form-band,
  .totals-band,
  .submit-band,
  .preview-panel {
    padding: 18px;
  }

  .brand-lockup,
  .preview-brand,
  .line-item {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .masthead,
  #orderForm {
    display: none;
  }

  .page-shell {
    width: 100%;
    padding: 0;
  }

  .preview-panel {
    display: block !important;
    box-shadow: none;
    border: 0;
  }
}
