/* Toko Bangunan Sumber Rejeki — arah visual "Katalog Toko":
   kertas krem kuning, pita kuning diagonal di header, tabel harga bergaris
   penuh 1px hitam, angka tabular, papan hitam untuk total. Tanpa sudut
   membulat besar, tanpa ilustrasi dekoratif, tanpa bayangan blur. */

:root {
  --bg: #FFF9EA;
  --paper: #FFFDF2;
  --ink: #241C0A;
  --ink-soft: #574A2E;
  --amber-ink: #7A4A00;
  --accent: #F5A400;
  --accent-soft: #FDF3D8;
  --line: #E3D5AE;
  --warn: #A3231B;
  --radius: 2px;
  --display: "Roboto Condensed", "Arial Narrow", sans-serif;
  --body: "Archivo", system-ui, sans-serif;
  --pad: clamp(16px, 4vw, 48px);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
}

/* ---------- Header + pita kuning diagonal ---------- */
.top {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  padding: 16px 0 26px;
}

.top::after {
  content: "";
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -18px;
  height: 28px;
  background: var(--accent);
  border-top: 1px solid var(--ink);
  transform: rotate(-1.4deg);
}

.top-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.top-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.demo-badge { color: var(--amber-ink); font-weight: 600; text-decoration: none; }

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  text-transform: uppercase;
  letter-spacing: .02em;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.top-right { display: flex; align-items: center; gap: 18px; font-size: 12.5px; color: var(--ink-soft); }

.top-wa {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
}

/* ---------- Kerangka halaman ---------- */
.sheet {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(26px, 3.6vw, 48px) var(--pad) clamp(40px, 5vw, 64px);
}

.kicker {
  margin: 0 0 14px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--amber-ink);
}

.kicker::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 8px;
  background: var(--accent);
  border: 1px solid var(--ink);
}

h1 {
  margin: 0 0 16px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.1rem, 5.2vw, 3.9rem);
  line-height: .96;
  letter-spacing: -.015em;
  text-transform: uppercase;
}

.lede {
  margin: 0 0 24px;
  max-width: 58ch;
  font-size: 15.5px;
  color: var(--ink-soft);
}

.facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 clamp(24px, 3vw, 36px);
  padding: 14px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.facts li {
  flex: 1 1 0;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 16px;
}

.facts li + li { padding-left: 16px; border-left: 1px solid var(--line); }

.fact-num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.fact-label { font-size: 12px; color: var(--ink-soft); max-width: 22ch; }

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 400px);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}

.col-main { display: flex; flex-direction: column; gap: clamp(20px, 2.6vw, 30px); min-width: 0; }

/* ---------- Panel hitung (kanan) ---------- */
.counter { position: sticky; top: 16px; }

.counter-card {
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--accent);
  padding: clamp(18px, 2.2vw, 26px);
}

.counter-head h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 25px;
  text-transform: uppercase;
  letter-spacing: .01em;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--ink);
}

.counter-head p {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.form { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Field ---------- */
.fld-label {
  font-family: var(--body);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink);
}

.fld-req { color: var(--warn); }

.fld-unit { font-weight: 500; letter-spacing: 0; text-transform: none; opacity: 1; color: var(--ink-soft); }

.fld-input {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: #FFFFFF;
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  transition: background .15s ease, border-color .15s ease;
}

.fld-input:hover { background: var(--accent-soft); }

.fld-input:focus,
.fld-input:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 1px;
  background: #FFFFFF;
}

.fld-input:focus:not(:focus-visible) { outline-width: 3px; }

select.fld-input { padding-right: 8px; }

.fld-hint { font-size: 12px; color: var(--ink-soft); line-height: 1.45; }

.fld-error { color: var(--warn); }

.fld.is-error .fld-input { border-color: var(--warn); border-width: 2px; background: #FDF1EC; }

.opt-check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 11px 12px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  cursor: pointer;
  transition: background .15s ease;
}

.opt-check:hover { background: var(--accent-soft); }

.opt-check:has(input:checked) { background: var(--accent-soft); }

.opt-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--ink);
}

.opt-check:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }

.opt-text { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }

.btn {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: .07em;
  text-transform: uppercase;
  transition: background .15s ease, color .15s ease;
}

.btn:hover { background: var(--accent); color: var(--ink); }

.btn:active { transform: translateY(1px); }

.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.form-note { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--ink-soft); }

.alert {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--warn);
  border-left-width: 4px;
  background: #FDF1EC;
  color: #7C1D17;
  font-size: 13.5px;
  font-weight: 600;
}

/* ---------- Katalog harga ---------- */
.catalog-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 3px solid var(--ink);
}

.catalog-head h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(21px, 2.4vw, 27px);
  text-transform: uppercase;
  letter-spacing: .01em;
}

.stamp {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 2px 7px 3px;
  background: var(--accent);
  color: var(--ink);
  border: 1px solid var(--ink);
  transform: rotate(-2deg);
}

.catalog-sub {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.price-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}

.price-table thead th {
  background: var(--ink);
  color: var(--bg);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: left;
  padding: 9px 12px;
  border: 1px solid var(--ink);
}

.price-table thead th:last-child { text-align: right; }

.price-table tbody th,
.price-table tbody td {
  border: 1px solid var(--ink);
  padding: 10px 12px;
  text-align: left;
  vertical-align: baseline;
  font-size: 14px;
}

.price-table tbody tr.grp th {
  background: var(--accent-soft);
  color: var(--amber-ink);
  font-family: var(--display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 7px 12px;
}

.price-table tbody tr:not(.grp) td:first-child { font-weight: 600; }

.price-table td.num { text-align: right; white-space: nowrap; font-weight: 600; }

.unit {
  margin-left: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
}

.catalog-note {
  margin: 12px 0 0;
  padding-left: 11px;
  border-left: 3px solid var(--accent);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}

/* ---------- Nota RAB ---------- */
.nota {
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
}

.nota-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--ink);
}

.nota-kicker {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--amber-ink);
}

.nota-code {
  margin: 2px 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .07em;
  font-variant-numeric: tabular-nums;
}

.nota-stamp {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .16em;
  padding: 2px 6px 3px;
  background: var(--accent);
  color: var(--ink);
  border: 1px solid var(--ink);
  transform: rotate(2deg);
}

.nota-title {
  margin: 16px 18px 12px;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(20px, 2.3vw, 26px);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .005em;
}

.nota-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin: 0 18px 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

.nota-meta > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.nota-meta dt {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nota-meta dd {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.nota-table {
  width: calc(100% - 36px);
  margin: 0 18px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.nota-table thead th {
  padding: 0 0 6px;
  border-bottom: 2px solid var(--ink);
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.nota-table thead th:last-child { text-align: right; }

.nota-table tbody th,
.nota-table tbody td {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  vertical-align: top;
}

.nota-table tbody td.num {
  padding-left: 12px;
  text-align: right;
  white-space: nowrap;
}

.line-note {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 400;
  color: var(--ink-soft);
}

.board {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 14px 18px 0;
  padding: 12px 16px;
  background: var(--ink);
  color: var(--bg);
}

.board-label {
  margin: 0;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.board-total {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.05;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.nota-msg {
  margin: 12px 18px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.nota-again {
  display: inline-block;
  margin: 12px 18px 18px;
  padding-bottom: 2px;
  font-size: 13px;
  font-weight: 700;
  color: var(--amber-ink);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.nota-again:hover { color: var(--ink); }

/* Keadaan belum ada hitungan */
.waiting {
  border: 1px dashed var(--ink);
  border-radius: var(--radius);
  padding: 15px 18px;
  background: var(--paper);
}

.waiting-label {
  margin: 0 0 5px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--amber-ink);
}

.waiting p { margin: 0; font-size: 13px; color: var(--ink-soft); max-width: 62ch; }

/* ---------- Riwayat ---------- */
.recent h2 {
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.recent ul { list-style: none; margin: 0; padding: 0; }

.recent li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.recent-sum { font-size: 13px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.recent-meta { font-size: 11.5px; color: var(--ink-soft); }

.recent-empty,
.recent-count { margin: 8px 0 0; font-size: 12px; color: var(--ink-soft); }

.recent-count { margin-top: 6px; }

/* ---------- Footer ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 18px var(--pad);
  border-top: 3px solid var(--ink);
  background: var(--paper);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.foot p { margin: 0; }

.foot-credit { color: var(--ink); font-weight: 600; }

/* ---------- Tablet: satu kolom, panel hitung naik ---------- */
@media (max-width: 1040px) {
  .grid { display: flex; flex-direction: column; gap: clamp(18px, 2.6vw, 24px); }

  .col-main,
  .counter { display: contents; }

  .nota,
  .waiting { order: 1; }

  .counter-card { order: 2; box-shadow: 4px 4px 0 var(--accent); }

  .catalog { order: 3; }

  .recent { order: 4; }

  .nota-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .facts li { min-width: 33%; }
}

/* ---------- Mobile: tabel harga jadi kartu bertumpuk ---------- */
@media (max-width: 680px) {
  .top { padding: 12px 0 22px; }

  .top-hours { display: none; }

  .brand { font-size: 16px; padding-left: 0; border-left: 0; }

  .top-left { gap: 6px 14px; }

  .facts { gap: 12px 0; }

  .facts li { flex: 1 1 100%; min-width: 0; padding-right: 0; padding-bottom: 10px; }

  .facts li + li { padding-left: 0; padding-top: 10px; border-left: 0; border-top: 1px solid var(--line); }

  .fact-num { font-size: 24px; }

  .fact-label { max-width: none; }

  /* Tabel jadi kartu: judul baris di kiri, harga di kanan, satuan di bawah. */
  .price-table,
  .price-table thead,
  .price-table tbody,
  .price-table tbody tr {
    display: block;
    width: 100%;
  }

  .price-table { border: 0; background: transparent; }

  .price-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .price-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1px 12px;
    margin: 0 0 8px;
    padding: 10px 12px;
    border: 1px solid var(--ink);
    background: var(--paper);
  }

  .price-table tbody tr:not(.grp):last-child { margin-bottom: 0; }

  .price-table tbody tr.grp {
    grid-template-columns: 1fr;
    margin: 14px 0 8px;
    padding: 5px 12px;
    border: 0;
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
  }

  .price-table tbody tr.grp:first-child { margin-top: 0; }

  .price-table tbody tr > * {
    border: 0;
    padding: 0;
    font-size: 14px;
  }

  .price-table tbody tr.grp th {
    padding: 0;
    background: transparent;
    color: var(--amber-ink);
  }

  .price-table tbody tr:not(.grp) td:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .price-table tbody tr:not(.grp) td:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
  }

  .price-table tbody tr:not(.grp) td:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 12px;
    color: var(--ink-soft);
  }

  .price-table tbody tr:not(.grp) td:nth-child(2)::before {
    content: "Kebutuhan: ";
    font-size: 11px;
    letter-spacing: .04em;
    color: var(--ink-soft);
  }

  /* Nota lebih rapat di layar sempit */
  .nota-head { padding: 11px 14px; }

  .nota-title { margin: 14px 14px 10px; }

  .nota-meta {
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 0 14px 14px;
  }

  .nota-table { width: calc(100% - 28px); margin: 0 14px; }

  .nota-table tbody th { font-size: 13px; }

  .nota-table tbody td.num { font-size: 13px; }

  .board { margin: 12px 14px 0; padding: 11px 12px; }

  .nota-msg { margin: 10px 14px 0; }

  .nota-again { margin: 10px 14px 14px; }

  .counter-card { padding: 16px; box-shadow: 3px 3px 0 var(--accent); }

  .counter-head h2 { font-size: 22px; }

  .recent li { gap: 1px 10px; }
}

@media (max-width: 380px) {
  .board-total { font-size: 23px; }
}
