:root {
  --green: #14532d;
  --green-2: #166534;
  --paper: #f7f4ef;
  --card: #ffffff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #f97316;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Calibri, Arial, sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: var(--green);
  color: #fff;
}

.eyebrow {
  color: #bbf7d0;
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 20px;
}

.status {
  max-width: 44%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 8px 10px;
  color: #dcfce7;
  font-size: 13px;
  text-align: right;
}

.shell {
  display: block;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 14px 14px 96px;
}

.menu-area,
.checkout-page {
  min-width: 0;
}

.search-row {
  margin-bottom: 12px;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--green-2);
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
}

.category-tabs button {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 700;
}

.category-tabs button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.product-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.product-image {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #dcfce7, #ffedd5);
  color: var(--green);
  font-size: 38px;
  font-weight: 800;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.product-name {
  min-height: 42px;
  font-weight: 800;
  line-height: 1.15;
}

.product-remark {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.product-price {
  color: var(--green);
  font-weight: 800;
}

.product-card button,
.confirm-button,
.primary {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--green-2);
  color: #fff;
  font-weight: 800;
}

.checkout-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.checkout-header,
.cart-total,
.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.checkout-header {
  justify-content: flex-start;
  margin-bottom: 14px;
}

.dark {
  color: var(--green);
}

.icon-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--green);
  font-size: 24px;
  font-weight: 800;
}

.ghost {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 8px 10px;
}

.cart-items {
  display: grid;
  gap: 10px;
  min-height: 64px;
  padding: 12px 0;
}

.checkout-list {
  max-height: none;
}

.cart-line {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.cart-name {
  font-weight: 800;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cart-controls button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.customer-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.cart-total {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding: 14px 0;
  font-size: 20px;
}

.confirm-button {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% - 28px);
  max-width: 520px;
  margin: 0;
  transform: translateX(-50%);
  text-align: center;
}

.message {
  position: fixed;
  inset: auto 16px 16px 16px;
  z-index: 10;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 8px;
  background: #111827;
  color: #fff;
  padding: 14px 16px;
  text-align: center;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.cart-button {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  width: calc(100% - 28px);
  max-width: 520px;
  min-height: 56px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  padding: 0 16px;
  font-weight: 800;
  transform: translateX(-50%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.24);
}

.cart-button:disabled {
  background: #9ca3af;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.52);
  padding: 20px;
}

.dialog-box {
  width: min(420px, 100%);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.dialog-box p {
  margin: 10px 0 18px;
  color: var(--muted);
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (min-width: 821px) {
  .shell {
    padding: 16px 16px 96px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .checkout-page {
    max-width: 680px;
    margin: 0 auto;
  }
}

@media (max-width: 820px) {
  .shell {
    padding: 12px;
    padding-bottom: 94px;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .product-body {
    padding: 9px;
  }

  .product-name {
    min-height: 38px;
    font-size: 15px;
  }

  .status {
    max-width: 42%;
  }
}

@media (max-width: 380px) {
  .product-grid {
    gap: 10px;
  }

  .cart-button {
    grid-template-columns: 1fr auto;
  }

  .cart-button span:last-child {
    display: none;
  }
}
