:root {
  --bg: #f6f7f2;
  --surface: #ffffff;
  --surface-2: #eef5f1;
  --text: #1f2a2a;
  --muted: #67736f;
  --line: #dce4df;
  --primary: #1f7a72;
  --primary-dark: #155d57;
  --danger: #d95745;
  --shadow: 0 12px 30px rgba(31, 42, 42, 0.08);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.customer-shell {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.customer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 8px;
  background: #203b3a;
  color: #fff;
  font-weight: 900;
}

h1,
h2,
p {
  margin: 0;
}

.brand-block h1 {
  font-size: 26px;
  line-height: 1.15;
}

.brand-block p,
.cart-head p,
.sync-status,
.menu-meta,
.line-sub,
.note-field span,
.search-field span,
.table-box span {
  color: var(--muted);
}

.table-box {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.table-box span,
.search-field span,
.note-field span {
  font-size: 14px;
  font-weight: 800;
}

.table-box input,
.search-field input,
.note-field input,
.line-note {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 14px;
  outline-color: var(--primary);
}

.table-box input {
  min-height: 58px;
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}

.customer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 14px;
  align-items: start;
}

.menu-panel,
.cart-panel,
.menu-card,
.cart-line {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.menu-panel {
  padding: 14px;
  min-width: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.search-field,
.note-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.sync-status {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d4ded8;
  border-radius: 8px;
  background: #f7fbf9;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.sync-status.online {
  border-color: #b9dec9;
  background: #edf8f1;
  color: #20743d;
}

.sync-status.error {
  border-color: #efc9c3;
  background: #fff3f1;
  color: #9f3326;
}

.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.chip {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 14px;
  white-space: nowrap;
  font-weight: 800;
}

.chip.active {
  border-color: var(--primary);
  background: #e3f3ef;
  color: var(--primary-dark);
}

.menu-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.menu-card {
  display: grid;
  gap: 10px;
  min-height: 156px;
  padding: 12px;
  box-shadow: none;
}

.menu-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
}

.menu-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  color: #304441;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
}

.price {
  color: var(--primary-dark);
  font-weight: 900;
}

.menu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.add-button,
.qty-button,
.remove-button,
.submit-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
}

.add-button {
  flex: 1 1 100px;
  background: #f2fbf8;
  border-color: #b8ddd4;
  color: var(--primary-dark);
  padding: 0 12px;
  font-weight: 900;
}

.cart-panel {
  position: sticky;
  top: 12px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.cart-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.cart-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 360px);
  overflow: auto;
  padding-right: 2px;
}

.cart-line {
  display: grid;
  gap: 10px;
  padding: 12px;
  box-shadow: none;
}

.line-main {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.line-title {
  font-weight: 900;
}

.line-sub {
  margin-top: 3px;
  font-size: 13px;
}

.line-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qty-button {
  width: 44px;
  background: #fff;
  font-size: 20px;
  font-weight: 900;
}

.qty-value {
  min-width: 34px;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.remove-button {
  background: #fff3f1;
  border-color: #efc9c3;
  color: #9f3326;
  padding: 0 12px;
  font-weight: 900;
}

.cart-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  font-size: 20px;
}

.cart-total strong {
  color: var(--primary-dark);
  font-size: 26px;
}

.submit-button {
  min-height: 56px;
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.submit-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed #c8d3cd;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 20;
  transform: translateX(-50%) translateY(80px);
  min-width: min(420px, calc(100vw - 32px));
  border-radius: 8px;
  background: #203b3a;
  color: #fff;
  padding: 14px 16px;
  font-weight: 900;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 960px) {
  .customer-grid {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
  }

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

@media (max-width: 640px) {
  .customer-shell {
    padding: 10px;
  }

  .customer-topbar,
  .toolbar,
  .line-main,
  .line-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-topbar,
  .line-main,
  .line-actions {
    display: flex;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .table-box {
    min-width: 0;
  }

  .menu-list {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Cafe Baan Yo Shop v2 — แถบแจ้งปิดรับออเดอร์ และท้ายหน้า
   ============================================================ */

[hidden] {
  display: none !important;
}

.closed-banner {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: rgba(217, 87, 69, 0.08);
  border: 1px solid rgba(217, 87, 69, 0.3);
  color: #96311f;
  line-height: 1.5;
}

.closed-banner strong {
  font-size: 15px;
}

.closed-banner span {
  font-size: 14px;
}

.submit-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.customer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.staff-link {
  color: var(--muted);
  text-decoration: none;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.staff-link:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
}

.staff-link:focus-visible,
.submit-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
