@import url('https://fonts.googleapis.com/css2?family=Alfa+Slab+One&family=Work+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
  --ink: #262220;
  --paper: #F3EAD8;
  --paper-2: #EADFC7;
  --green: #46664A;
  --red: #B23A2E;
  --yellow: #E0A82E;
  --line: rgba(38,34,32,0.16);
  --radius: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Work Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'IBM Plex Mono', monospace; }

/* ---------- Header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--ink); color: var(--paper);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.topbar h1 {
  font-family: 'Alfa Slab One', serif;
  font-size: 1.3rem; margin: 0; letter-spacing: 0.5px;
  color: var(--yellow);
}
.topbar .tagline { font-size: 0.72rem; opacity: 0.75; margin-top: 2px; }
.cart-btn {
  background: var(--red); color: #fff; border: none;
  border-radius: 999px; padding: 10px 16px; font-weight: 600;
  cursor: pointer; font-size: 0.85rem;
  display: flex; align-items: center; gap: 8px;
}
.cart-btn .count {
  background: #fff; color: var(--red); border-radius: 999px;
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
}

/* ---------- Warung grid ---------- */
.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 100px; }
.section-label {
  font-family: 'Alfa Slab One', serif;
  color: var(--green); font-size: 1.5rem; margin: 18px 0 14px;
}
.warung-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.warung-card {
  background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line); overflow: hidden;
  box-shadow: 0 2px 0 var(--line);
}
.warung-card .banner {
  height: 110px; background: linear-gradient(135deg, var(--green), #2f4a33);
  background-size: cover; background-position: center;
  display: flex; align-items: flex-end; padding: 10px;
}
.warung-card .banner span {
  background: var(--yellow); color: var(--ink); font-weight: 700;
  font-size: 0.7rem; padding: 3px 8px; border-radius: 4px;
}
.warung-card .body { padding: 14px; }
.warung-card h3 { margin: 0 0 4px; font-size: 1.05rem; }
.warung-card p { margin: 0 0 10px; font-size: 0.8rem; color: #6b625a; }

.menu-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-top: 1px dashed var(--line);
}
.menu-row:first-of-type { border-top: none; }
.menu-row .name { font-size: 0.87rem; font-weight: 500; }
.menu-row .price { font-size: 0.8rem; color: var(--green); font-weight: 600; }
.menu-row button {
  background: var(--ink); color: var(--paper); border: none;
  border-radius: 999px; width: 26px; height: 26px; font-size: 1rem;
  cursor: pointer; line-height: 1;
}

/* ---------- Cart drawer (receipt / kwitansi motif) ---------- */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: none; z-index: 30;
}
.drawer-backdrop.open { display: block; }

.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(400px, 100%);
  background: #fff; z-index: 31;
  transform: translateX(100%); transition: transform 0.25s ease;
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.receipt {
  flex: 1; overflow-y: auto; padding: 20px 22px;
  background:
    repeating-linear-gradient(to bottom, transparent, transparent 27px, var(--line) 27px, var(--line) 28px);
}
.receipt-head {
  text-align: center; border-bottom: 2px dashed var(--ink); padding-bottom: 12px; margin-bottom: 10px;
}
.receipt-head .title { font-family: 'Alfa Slab One', serif; font-size: 1.15rem; }
.receipt-head .sub { font-size: 0.7rem; color: #8a8078; margin-top: 2px; }

.warung-block { margin-bottom: 14px; }
.warung-block .wname {
  font-weight: 700; font-size: 0.82rem; background: var(--paper-2);
  display: inline-block; padding: 2px 8px; border-radius: 4px; margin-bottom: 6px;
}
.receipt-line { display: flex; justify-content: space-between; font-size: 0.82rem; padding: 3px 0; }
.receipt-line .qty { color: #8a8078; margin-right: 6px; }
.receipt-line .rm { background: none; border: none; color: var(--red); cursor: pointer; font-size: 0.75rem; margin-left: 6px; }

.receipt-totals { border-top: 2px dashed var(--ink); margin-top: 12px; padding-top: 10px; }
.receipt-totals .row { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 3px 0; }
.receipt-totals .grand { font-weight: 700; font-size: 1.05rem; margin-top: 4px; }
.receipt-empty { text-align: center; color: #8a8078; padding: 40px 10px; font-size: 0.85rem; }

.checkout-form { padding: 16px 22px; border-top: 1px solid var(--line); }
.checkout-form input, .checkout-form textarea {
  width: 100%; padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 0.85rem;
}
.checkout-form button {
  width: 100%; background: var(--red); color: #fff; border: none;
  padding: 12px; border-radius: 8px; font-weight: 700; font-size: 0.9rem; cursor: pointer;
}
.checkout-form button:disabled { opacity: 0.5; cursor: not-allowed; }
.drawer-close {
  position: absolute; top: 14px; right: 16px; background: none; border: none;
  font-size: 1.3rem; cursor: pointer; color: var(--ink);
}
.hint { font-size: 0.72rem; color: #8a8078; margin: -4px 0 8px; }
.status-msg { font-size: 0.8rem; text-align: center; padding: 8px; border-radius: 6px; margin-top: 8px; }
.status-msg.ok { background: #e4f0e5; color: var(--green); }
.status-msg.err { background: #f7e3e0; color: var(--red); }

@media (max-width: 480px) {
  .topbar h1 { font-size: 1.05rem; }
}
