:root {
  --bg: #f7f3ee;
  --card: #ffffff;
  --ink: #2b211a;
  --muted: #8a7d70;
  --accent: #6f4e37;
  --accent-dark: #543b29;
  --line: #e7 ddd2;
  --line: #e7ddd2;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; background: var(--accent); color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.brand { font-size: 1.25rem; font-weight: 700; }
.cart-btn {
  background: #fff; color: var(--accent); border: none; border-radius: 999px;
  padding: 8px 16px; font-weight: 600; cursor: pointer; display: flex; gap: 8px; align-items: center;
}
.badge {
  background: var(--accent); color: #fff; border-radius: 999px;
  min-width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.8rem; padding: 0 6px;
}
main { max-width: 1000px; margin: 0 auto; padding: 24px; }
.hero { text-align: center; padding: 32px 0 8px; }
.hero h1 { margin: 0 0 8px; font-size: 2rem; }
.hero p { color: var(--muted); margin: 0; }
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px; padding: 24px 0;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; display: flex; flex-direction: column; gap: 8px;
}
.card .thumb { font-size: 3rem; text-align: center; padding: 12px 0; }
.card h3 { margin: 0; font-size: 1.1rem; }
.card .roast { font-size: 0.8rem; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.card .notes { color: var(--muted); font-size: 0.9rem; flex: 1; }
.card .price-row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.card .price { font-weight: 700; font-size: 1.1rem; }
.primary {
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 10px 16px; font-weight: 600; cursor: pointer;
}
.primary:hover { background: var(--accent-dark); }
.primary:disabled { background: #c9bdb0; cursor: not-allowed; }
.add-btn { background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 8px 14px; font-weight: 600; cursor: pointer; }
.add-btn:hover { background: var(--accent-dark); }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 20; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 360px; max-width: 90vw;
  background: #fff; z-index: 30; display: flex; flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.15);
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 1.2rem; }
.icon-btn { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.cart-items { flex: 1; overflow-y: auto; padding: 12px 18px; }
.cart-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); gap: 8px; }
.cart-row .meta { flex: 1; }
.cart-row .name { font-weight: 600; }
.cart-row .qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 26px; height: 26px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-size: 1rem; }
.cart-empty { color: var(--muted); text-align: center; padding: 40px 0; }
.cart-foot { padding: 18px; border-top: 1px solid var(--line); }
.total-row { display: flex; justify-content: space-between; margin-bottom: 12px; }
.total-row.big { font-size: 1.15rem; margin: 16px 0; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: #fff; border-radius: 16px; padding: 28px; width: 100%; max-width: 420px; position: relative; }
.modal-close { position: absolute; top: 14px; right: 16px; }
.modal-card h2 { margin: 0 0 4px; }
.muted { color: var(--muted); font-size: 0.9rem; margin: 0 0 16px; }
.modal-card label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; }
.modal-card input { width: 100%; padding: 10px; margin-top: 4px; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; }
.confirmation { text-align: center; padding: 12px 0; }
.confirmation .check { width: 56px; height: 56px; border-radius: 50%; background: #2e7d32; color: #fff; font-size: 1.8rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.hidden { display: none !important; }
.footer { text-align: center; color: var(--muted); padding: 32px; font-size: 0.85rem; }
