@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap");

:root {
  --bg: #f7f3ef;
  --fg: #331111;
  --border: #e6dcd6;
  --card: #ffffff;
  --primary: #331111;
  --primary-soft: rgba(51, 17, 17, 0.07);
  --primary-line: rgba(51, 17, 17, 0.18);
  --muted: #f1ebe6;
  --muted-fg: #7a635e;
  --font: "Open Sans", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input { font: inherit; }
button { cursor: pointer; }

.noise {
  position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
}

.wrap {
  width: min(72rem, 100%);
  margin: 0 auto;
  padding: 2.25rem 1.5rem 3rem;
}
@media (min-width: 768px) {
  .wrap { padding: 2.75rem 2rem 3.5rem; }
}
@media (min-width: 1100px) {
  .wrap {
    width: min(88rem, calc(100% - 3rem));
    padding: 2.5rem 2.5rem 3.5rem;
  }
}
@media (min-width: 1440px) {
  .wrap {
    width: min(96rem, calc(100% - 4rem));
    padding-left: 3rem;
    padding-right: 3rem;
  }
}

.test-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-bottom: 2rem;
  padding: 0.7rem 1rem;
  border: 1px dashed var(--primary-line);
  border-radius: 0.9rem;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
}
.test-banner a { color: inherit; }

.site-header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(232, 228, 220, 0.8);
  margin-bottom: 1.75rem;
}
@media (min-width: 768px) {
  .site-header {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
  }
}
.intro { max-width: 40rem; min-width: 0; }
.brand-logo {
  display: block;
  width: min(15rem, 100%);
  max-height: 4.4rem;
  height: auto;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 1.25rem;
}
@media (min-width: 768px) {
  .brand-logo { width: min(18rem, 100%); max-height: 5.2rem; margin-bottom: 1.35rem; }
}
h1 {
  font-size: 2.6rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.85rem;
}
@media (min-width: 768px) { h1 { font-size: 3.15rem; } }
@media (min-width: 1100px) { h1 { font-size: 3.35rem; } }
.lede { font-size: 1.125rem; color: var(--muted-fg); max-width: 28rem; line-height: 1.7; }
.lede-note {
  margin-top: 0.45rem;
  font-size: 0.875rem;
  font-style: italic;
  color: var(--muted-fg);
  max-width: 28rem;
  line-height: 1.6;
}

.controls {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
@media (min-width: 768px) {
  .controls { flex-direction: column; align-items: flex-end; gap: 1.5rem; }
}
.pills {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.2rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: rgba(240, 237, 230, 0.4);
  box-shadow: 0 1px 2px rgba(33, 37, 44, 0.04);
}
.pills button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.5rem 1rem;
  border-radius: 0.65rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted-fg);
  white-space: nowrap;
}
@media (min-width: 640px) {
  .pills button { padding: 0.5rem 1.15rem; }
}
.pills button[aria-pressed="true"],
.pills button[aria-selected="true"] {
  background: #fff;
  color: var(--fg);
  border-color: rgba(232,228,220,0.7);
  box-shadow: 0 1px 2px rgba(33,37,44,0.06);
}
.pills.tabs button[aria-selected="true"] {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.panel { display: none; }
.panel.active { display: block; }

/* Cards until the 7 columns fit. No inner scrollbar on packs. */
.table-wrap { display: none; }
.mobile-rates { display: grid; gap: 1.5rem; }
@media (min-width: 1100px) {
  .table-wrap {
    display: block;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 1rem;
    background: var(--card);
    box-shadow: 0 1px 2px rgba(33,37,44,0.04);
  }
  .mobile-rates { display: none; }
}

table.rates { width: 100%; border-collapse: collapse; text-align: left; }
table.rates th {
  padding: 1.5rem 2rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-fg);
  background: rgba(240,237,230,0.2);
  border-bottom: 1px solid var(--border);
}
table.rates th.num { text-align: right; }
table.rates td.num { text-align: right; white-space: nowrap; }
table.rates td {
  padding: 1.5rem 2rem;
  font-size: 0.94rem;
  border-bottom: 1px solid rgba(232,228,220,0.4);
}
table.rates tr:last-child td { border-bottom: 0; }
table.rates td.format { font-weight: 500; white-space: nowrap; }
table.rates td.hint { color: var(--muted-fg); white-space: nowrap; }
table.rates td.num { font-variant-numeric: tabular-nums; }

.mobile-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(33,37,44,0.04);
}
.mobile-card h3 { font-size: 1.5rem; font-weight: 500; }
.mobile-card .use { color: var(--muted-fg); font-size: 0.875rem; margin-top: 0.25rem; margin-bottom: 1.25rem; }
.mobile-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(232,228,220,0.4);
  font-size: 0.875rem;
}
.mobile-row:last-child { border-bottom: 0; }
.mobile-row span:first-child { font-weight: 500; }
.mobile-row span:last-child { font-variant-numeric: tabular-nums; }

.note {
  margin-top: 2.5rem;
  max-width: 42rem;
  display: flex;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 1rem;
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
}
.note strong { display: block; color: var(--primary); font-size: 0.875rem; margin-bottom: 0.35rem; }
.note p { color: rgba(51, 17, 17, 0.72); font-size: 0.875rem; line-height: 1.65; }

.builder {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .builder {
    grid-template-columns: minmax(0, 8fr) minmax(280px, 4fr);
    gap: 3rem;
    align-items: start;
  }
}
.sku-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(33,37,44,0.04);
  margin-bottom: 1.5rem;
}
@media (min-width: 640px) { .sku-card { padding: 2rem; } }
.sku-card h3 { font-size: 1.5rem; font-weight: 500; }
.sku-card .use { color: var(--muted-fg); font-size: 0.875rem; margin-top: 0.25rem; }
.qty-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(232,228,220,0.5);
}
@media (min-width: 640px) { .qty-grid { grid-template-columns: 1fr 1fr; } }
.qty-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-fg);
  margin-bottom: 1rem;
}
.qty-hint { font-size: 0.75rem; color: var(--muted-fg); margin-top: 0.5rem; }
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 0.7rem;
  background: var(--bg);
}
.stepper button {
  appearance: none;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: var(--muted-fg);
}
.stepper button:hover { background: var(--muted); color: var(--fg); }
.stepper input {
  width: 3.75rem;
  height: 2rem;
  border: 0;
  background: transparent;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.side { display: grid; gap: 1.5rem; min-width: 0; }
@media (min-width: 1024px) { .side { position: sticky; top: 3rem; } }
.guide {
  padding: 1.5rem;
  border-radius: 1rem;
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
}
.guide h4 { color: var(--primary); font-size: 0.875rem; }
.guide p { color: rgba(51, 17, 17, 0.72); font-size: 0.875rem; margin-top: 0.4rem; line-height: 1.65; }
.summary {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(33,37,44,0.08);
}
.summary-head {
  padding: 1.5rem 1.5rem 1.25rem;
  background: rgba(240,237,230,0.2);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 640px) { .summary-head { padding: 2rem; } }
.summary-head h3 { font-size: 1.875rem; font-weight: 500; }
.summary-body { padding: 1.5rem; }
@media (min-width: 640px) { .summary-body { padding: 2rem; } }
.empty {
  text-align: center;
  color: var(--muted-fg);
  font-size: 0.875rem;
  padding: 2rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 0.8rem;
}
.break-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(232,228,220,0.4);
  font-size: 0.875rem;
}
.break-item:last-child { border-bottom: 0; }
.totals { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: grid; gap: 1rem; }
.total-line { display: flex; justify-content: space-between; font-size: 0.875rem; color: var(--muted-fg); }
.total-line span:last-child { color: var(--fg); font-variant-numeric: tabular-nums; }
.total-line.save { color: var(--primary); font-weight: 600; }
.total-line.save span:last-child { color: var(--primary); }
.total-line.grand { align-items: baseline; padding-top: 1rem; border-top: 1px solid var(--border); margin-top: 0.25rem; }
.total-line.grand span:first-child { color: var(--fg); font-size: 1.125rem; font-weight: 500; }
.total-line.grand span:last-child { font-size: 1.5rem; font-weight: 500; }
.estimate-note { font-size: 0.75rem; color: rgba(104,110,122,0.7); text-align: center; margin-top: 1.2rem; }
.actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(240,237,230,0.2);
  border-top: 1px solid var(--border);
}
@media (min-width: 640px) { .actions { flex-direction: row; } }
.btn {
  flex: 1;
  appearance: none;
  border-radius: 0.8rem;
  padding: 0.8rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--fg);
}
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }

@media print {
  .noise, .test-banner, .controls, .actions, .guide { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .summary { box-shadow: none; }
}
