/* Order Esteh — es.bernadya.net
   Palette: kertas hangat, tinta, hijau teh. Aksen dipakai di tombol utama dan angka total saja. */

:root {
  --paper: #F6F2E9;
  --surface: #FFFDF8;
  --ink: #1C2320;
  --muted: #636A60;
  --line: #DCD5C6;
  --line-soft: #EAE4D6;
  --accent: #1F5C46;
  --accent-ink: #FFFFFF;
  --ochre: #8F5620;
  --danger: #8A2B22;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --r-sm: 3px;
  --r-md: 6px;
  --pad: 20px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding-bottom: 24px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
}

body.has-bar {
  padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- kepala ---------- */

.top {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.top .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
}

.mark {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}

.endpoint {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- pembuka ---------- */

.intro { padding: 44px 0 8px; }

h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 5.5vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.015em;
  font-weight: 400;
  margin: 0 0 12px;
  max-width: 20ch;
}

.lede {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
  font-size: 16px;
}

/* ---------- langkah ---------- */

.steps {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
}

.step {
  border-top: 1px solid var(--line);
  padding: 26px 0 30px;
  scroll-margin-top: 16px;
}

.step:last-child { border-bottom: 1px solid var(--line); }

.step[data-state="active"] .step-no,
.step[data-state="done"] .step-no { color: var(--accent); }

.step-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}

.step-no {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 3px;
}

h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
}

.step[data-state="locked"] {
  opacity: 0.4;
  pointer-events: none;
}

.step[data-state="locked"] .step-body,
.step[data-state="locked"] form { user-select: none; }

.step[data-state="done"] .step-no { color: var(--accent); }

/* ---------- form ---------- */

.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="tel"],
input[type="search"],
select {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color 120ms ease;
}

input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

input::placeholder { color: #8A8A7E; }

.hint, .note {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 16px;
  max-width: 56ch;
}

.note { margin-top: 4px; }

.btn {
  display: inline-block;
  padding: 11px 20px;
  min-height: 44px;
  font: inherit;
  font-size: 15px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 120ms ease;
  touch-action: manipulation;
}

.btn + .btn { margin-left: 8px; }

.btn:hover { background: #17402F; }
.btn:active { background: #123326; }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.btn-quiet {
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
}

.btn-quiet:hover { background: var(--surface); }

.msg {
  font-size: 14px;
  margin: 12px 0 0;
  min-height: 1.2em;
}

.msg.err { color: var(--danger); }
.msg.ok { color: var(--accent); }

/* ---------- pemilih ---------- */

.picker {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.picker:empty { display: none; }

.picker li { border-bottom: 1px solid var(--line-soft); }
.picker li:last-child { border-bottom: 0; }

.picker button {
  display: flex;
  width: 100%;
  gap: 14px;
  align-items: baseline;
  padding: 13px 14px;
  font: inherit;
  text-align: left;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
}

.picker button:hover { background: #F2EDE1; }
.picker button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.picker .o-no {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
}

.picker .o-name { font-weight: 500; display: block; }
.picker .o-addr { font-size: 13px; color: var(--muted); display: block; }

.picker li[data-picked="true"] button { background: #E8EFE9; }

/* ---------- menu ---------- */

.menu { display: block; }

.menu-cat {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 22px 0 8px;
}

.menu-cat:first-child { margin-top: 0; }

.mrow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.m-info { min-width: 0; }

.m-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mrow[data-off="true"] { opacity: 0.45; }

.m-name { font-weight: 500; }
.m-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.mrow .sizes {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.mrow .sizes button {
  padding: 10px 16px;
  font: inherit;
  font-size: 14px;
  min-height: 44px;
  background: var(--surface);
  color: var(--muted);
  border: 0;
  cursor: pointer;
}

.mrow .sizes button + button { border-left: 1px solid var(--line); }
.mrow .sizes button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.qty {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}

.qty button {
  width: 44px;
  height: 44px;
  font: inherit;
  font-size: 19px;
  line-height: 1;
  background: none;
  color: var(--ink);
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.qty button:hover { background: #F2EDE1; }
.qty button:disabled { opacity: 0.35; cursor: default; }
.qty output {
  min-width: 40px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
}

/* ---------- opsi ---------- */

.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

/* ---------- bar bawah ---------- */

.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bar-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.bar-facts {
  display: flex;
  align-items: baseline;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.bar-poin { color: var(--ochre); font-weight: 600; font-size: 16px; }

/* ---------- struk ---------- */

.receipt {
  margin: 28px 0 8px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.receipt h3 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 400;
  margin: 0 0 4px;
}

.receipt .stamp {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
}

.receipt dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  margin: 0;
  font-size: 15px;
}

.receipt dt { color: var(--muted); }
.receipt dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.receipt .lines {
  margin: 16px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line-soft);
  font-size: 14px;
  color: var(--muted);
}

.receipt .bad { color: var(--danger); }

/* ---------- kaki ---------- */

.bottom {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding: 22px 0 34px;
}

.bottom .wrap {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (max-width: 560px) {
  .intro { padding-top: 32px; }
  h1 { max-width: none; }
  .step { padding: 22px 0 26px; }
  .step-head { gap: 10px; }
  .bar-facts { gap: 10px; }
  .bar .btn-send { padding: 11px 16px; }
  .bar-in { padding-top: 10px; padding-bottom: 10px; }

  .mrow {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .m-controls {
    justify-content: space-between;
    width: 100%;
  }

  .picker { max-height: 58vh; }

  .btn + .btn {
    margin-left: 0;
    margin-top: 8px;
  }
}
