/* NAGIIH — mobile-first stylesheet. Warna mengikuti logo: hitam-putih + krem hangat. */
:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #141414;
  --muted: #6d6a65;
  --line: #e9e4dc;
  --soft: #f3eee6;
  --accent: #141414;
  --on-accent: #ffffff;
  --highlight: #f6d77a;
  --danger: #b3261e;
  --ok: #1f7a3d;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 20, 20, .06), 0 4px 14px rgba(20, 20, 20, .05);
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 16px; }
.section { padding-top: 24px; padding-bottom: 24px; }
.section-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: baseline; }
.section-title a { font-size: .9rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.demo-bar { background: var(--highlight); color: #3a2c00; font-size: .8rem; font-weight: 700; text-align: center; padding: 6px 12px; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(250, 247, 242, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 900; letter-spacing: .28em; font-size: 1.05rem; }
.brand img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav a { text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: 999px; }
.nav a[aria-current="page"] { background: var(--soft); }
.cart-link { position: relative; display: inline-flex; align-items: center; }
.cart-link svg { width: 24px; height: 24px; }
.badge { position: absolute; top: 0; right: 2px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--on-accent); font-weight: 800; text-decoration: none; cursor: pointer;
  transition: transform .1s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: .9rem; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-wa { background: #1f8f4e; border-color: #1f8f4e; }
.btn:focus-visible, .stepper button:focus-visible, .choice:focus-within { outline: 3px solid var(--highlight); outline-offset: 2px; }

/* ---------- Hero ---------- */
.hero { padding: 28px 0 8px; text-align: center; }
.hero-logo { width: 150px; height: 150px; margin: 0 auto 14px; border-radius: 50%; object-fit: cover; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); }
.hero h1 { font-size: 2rem; font-weight: 900; letter-spacing: .3em; margin-left: .3em; }
.hero .tagline { color: var(--muted); font-weight: 700; margin: 4px 0 12px; }
.hero p.desc { max-width: 480px; margin: 0 auto 20px; }
.banner { margin-top: 20px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 7; background: var(--ink); color: #fff; display: grid; place-items: center; text-align: center; padding: 18px; }
.banner { position: relative; }
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner.has-img::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .45); }
.banner > div { position: relative; z-index: 1; }
.banner strong { display: block; font-size: 1.25rem; font-weight: 900; }

/* ---------- Product grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.product { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.product-img { aspect-ratio: 1; background: var(--soft); }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { background: var(--soft) url('../assets/logo.jpg') center / 62% no-repeat; background-blend-mode: multiply; }
.product-body { padding: 10px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.product-name { font-size: .95rem; font-weight: 800; }
.product-desc { font-size: .8rem; color: var(--muted); margin: 4px 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.price { font-weight: 900; }
.product-action .btn { width: 100%; }
.category-title { font-size: 1rem; font-weight: 800; margin: 22px 0 10px; }

.stepper { display: inline-flex; align-items: center; justify-content: space-between; border: 2px solid var(--ink); border-radius: 999px; height: 38px; width: 100%; max-width: 140px; }
.product .stepper { max-width: none; }
.stepper button { width: 40px; height: 100%; border: 0; background: none; font-size: 1.2rem; font-weight: 800; cursor: pointer; border-radius: 999px; }
.stepper span { font-weight: 800; min-width: 24px; text-align: center; }

/* ---------- Sticky bottom bar ---------- */
.bottom-bar { position: sticky; bottom: 0; z-index: 15; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, rgba(250, 247, 242, 0)); }
.bottom-bar .btn { width: 100%; justify-content: space-between; }

/* ---------- Cards / lists ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 1.05rem; font-weight: 800; margin-bottom: 12px; }
.line-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-item .name { font-weight: 800; }
.line-item .unit { color: var(--muted); font-size: .85rem; }
.line-item .sub { font-weight: 800; text-align: right; }
.line-item .controls { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; }
.link-btn { background: none; border: 0; color: var(--danger); font-weight: 700; cursor: pointer; padding: 8px 0; }

.totals { display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 1.15rem; font-weight: 900; border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }

/* ---------- Form ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.field .req { color: var(--danger); }
.input { width: 100%; min-height: 48px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 16px; }
textarea.input { min-height: 84px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ink); }
.input.invalid { border-color: var(--danger); }
.hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.error-text { font-size: .82rem; color: var(--danger); margin-top: 4px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; }
.choice input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }
.choice .c-main { flex: 1; }
.choice .c-title { font-weight: 800; }
.choice .c-title, .choice .c-sub { display: block; }
.choice .c-sub { font-size: .82rem; color: var(--muted); }
.choice .c-fee { font-weight: 800; white-space: nowrap; }
.choice:has(input:checked) { border-color: var(--ink); background: var(--soft); }

.pay-info { margin-top: 12px; padding: 14px; border-radius: 12px; background: var(--soft); font-size: .92rem; }
.pay-info dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 0; }
.pay-info dt { color: var(--muted); }
.pay-info dd { margin: 0; font-weight: 800; word-break: break-all; }
.qris-box { margin-top: 12px; text-align: center; }
.qris-box img.qris { width: 280px; max-width: 100%; margin: 0 auto 10px; background: #fff; padding: 10px; border-radius: 10px; border: 1px solid var(--line); }
.qris-box .hint { margin-top: 8px; }
.copy-btn { margin-left: 6px; border: 1px solid var(--ink); background: #fff; border-radius: 999px; font-size: .75rem; font-weight: 700; padding: 2px 10px; cursor: pointer; }

.alert { padding: 12px 14px; border-radius: 12px; background: #fdecea; color: var(--danger); font-weight: 700; margin-bottom: 14px; }
.alert.ok { background: #e8f5ec; color: var(--ok); }

/* ---------- Upload (owner) ---------- */
.upload-drop { display: block; border: 2px dashed var(--line); border-radius: 12px; padding: 22px 14px; text-align: center; cursor: pointer; background: #fff; }
.upload-drop input { display: none; }
.upload-drop img { max-height: 320px; margin: 0 auto; border-radius: 8px; }
.upload-current { margin-top: 14px; }
.upload-current img { max-height: 160px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }

/* ---------- States ---------- */
.state { padding: 40px 16px; text-align: center; color: var(--muted); }
.state-error { color: var(--danger); }
.state .btn { margin-top: 12px; }
.spinner { display: inline-block; width: 18px; height: 18px; margin-right: 10px; vertical-align: -3px; border: 2.5px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; padding: 48px 16px; }
.empty p { color: var(--muted); margin-bottom: 18px; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: .9rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.footer { padding: 32px 0 40px; text-align: center; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); margin-top: 24px; }
.footer a { font-weight: 700; color: var(--ink); text-decoration: none; }
.footer p { margin: 4px 0; }

/* ---------- Nota ---------- */
.nota { background: #fff; color: #000; padding: 22px 18px; border-radius: 6px; box-shadow: var(--shadow); font-size: .92rem; }
.nota-head { display: flex; gap: 14px; align-items: flex-start; }
.nota-head img { width: 64px; height: 64px; object-fit: cover; flex: none; }
.nota-head h2 { font-size: 1.2rem; font-weight: 500; letter-spacing: .35em; margin-bottom: 6px; }
.nota-head p { margin: 0; font-size: .8rem; line-height: 1.4; }
.nota hr { border: 0; border-top: 1.5px solid #000; margin: 12px 0; }
.nota .row { display: flex; justify-content: space-between; gap: 10px; }
.nota .meta p { margin: 2px 0; }
.nota-item { margin-bottom: 10px; }
.nota-item .qty { display: grid; grid-template-columns: 1fr 1.4fr 1fr; padding-left: 24px; }
.nota-item .qty span:last-child { text-align: right; }
.nota-totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin-left: auto; max-width: 300px; }
.nota-totals .v { text-align: right; }
.nota-totals .grand { font-weight: 900; }
.nota-status { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: .85rem; }
.nota-status b { font-weight: 800; }
.nota-foot { text-align: center; white-space: pre-line; font-size: .82rem; margin-top: 20px; }
.nota-actions { display: grid; gap: 10px; margin: 16px 0; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; border: 1px solid #000; font-size: .75rem; font-weight: 800; }

/* ---------- HPP ---------- */
.ing-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: #fff; }
.ing-row .full { grid-column: 1 / -1; }
.ing-row .cost { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; font-weight: 800; }
.ing-row [data-note] { font-weight: 600; }
.ing-row label { font-size: .75rem; color: var(--muted); font-weight: 700; display: block; margin-bottom: 2px; }
.ing-row .input { min-height: 42px; padding: 8px 10px; }
@media (min-width: 720px) {
  .ing-row { grid-template-columns: 1.6fr .9fr .8fr .9fr .8fr 1.2fr; align-items: end; }
  .ing-row .full { grid-column: auto; }
}
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.table th:first-child, .table td:first-child { text-align: left; }
.table tr.target td { background: var(--soft); font-weight: 900; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- Print (nota) ---------- */
@media print {
  @page { margin: 10mm; }
  body { background: #fff; }
  .topbar, .demo-bar, .no-print, .footer, .toast { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .nota { box-shadow: none; padding: 0; font-size: 11pt; }
}
