* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  background: #f5f0e8;
  color: #2b2118;
}

.offline-banner {
  background: #b3541e;
  color: #fff;
  text-align: center;
  padding: 8px;
  font-size: 14px;
}
.hidden { display: none !important; }

.layout {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  height: 100vh;
  padding: 12px;
}

.products, .cart, .checkout {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  overflow-y: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 0 0 12px; color: #6b4423; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.product-btn {
  border: 2px solid #d8c8a8;
  background: #fdf9f2;
  border-radius: 10px;
  padding: 18px 8px;
  font-size: 16px;
  cursor: pointer;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.product-btn:active { background: #eee0c8; }
.product-btn .price { font-size: 14px; color: #8a6a3a; }
.product-btn .tier-tag {
  font-size: 11px;
  background: #6b4423;
  color: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  align-self: flex-start;
}

.cart-list { display: flex; flex-direction: column; gap: 8px; }
.cart-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
}
.cart-row .qty-controls button {
  width: 28px; height: 28px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
}
.cart-total {
  margin-top: 16px;
  font-size: 18px;
  font-weight: bold;
  text-align: right;
}

.pay-methods { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.staff-input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 14px;
}
.checkout-btn {
  width: 100%;
  padding: 14px;
  font-size: 18px;
  background: #6b4423;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.checkout-btn:disabled { background: #ccc; cursor: not-allowed; }

.receipt { margin-top: 16px; text-align: center; }
.receipt-codes { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.receipt-codes .code-block { border-top: 1px dashed #ccc; padding-top: 8px; }
.receipt-codes canvas { margin: 4px auto; }
.receipt-codes .code-text { font-family: monospace; font-size: 14px; }
.new-order-btn {
  margin-top: 16px;
  width: 100%;
  padding: 10px;
  background: #2b2118;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; height: auto; }
}
