@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --paper: #eae6dc;
  --paper-raised: #f2efe7;
  --ink: #1f2420;
  --muted: #6b6558;
  --line: #c9c2b4;
  --accent: #2f4b3c;
  --accent-ink: #f2efe7;
  --warm: #8a3324;
}
[data-theme="dark"] {
  --paper: #16181a;
  --paper-raised: #1f2224;
  --ink: #ece8de;
  --muted: #8b8a82;
  --line: #34362f;
  --accent: #5c8e73;
  --accent-ink: #10130f;
  --warm: #c97456;
}

* {
  box-sizing: border-box;
}
html {
  transition: background 0.25s ease;
}
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--ink);
  display: flex;
  justify-content: center;
  background: #d9d4c6;
  min-height: 100vh;
  opacity: 0;
  animation: pageIn 0.4s ease forwards;
}
[data-theme="dark"] body {
  background: #0b0c0d;
}
@keyframes pageIn {
  to {
    opacity: 1;
  }
}

.device {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  background: var(--paper);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.15);
  transition:
    background 0.25s ease,
    color 0.25s ease;
}

header {
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 10;
  transition:
    background 0.25s ease,
    border-color 0.25s ease;
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.venue-name {
  font-family: "Inter", sans-serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.table-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.table-tag .dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
}

.header-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.icon-toggle {
  display: flex;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  overflow: hidden;
  height: 30px;
}
.icon-toggle button {
  border: none;
  background: var(--paper);
  color: var(--muted);
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  padding: 0 9px;
  cursor: pointer;
}
.icon-toggle button.active {
  background: var(--ink);
  color: var(--paper-raised);
}
.theme-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-btn:active {
  background: var(--line);
}

.quick-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.quick-btn {
  flex: 1;
  padding: 10px 8px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 600;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  transition: transform 0.15s ease;
}
.quick-btn:active {
  background: var(--line);
  transform: scale(0.97);
}
.quick-btn.done {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  cursor: default;
}
.quick-btn:disabled {
  opacity: 0.85;
}

.tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 130px;
  z-index: 9;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  flex-shrink: 0;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: "Inter", sans-serif;
}
.tab.active {
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 12px 20px;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.reorder-banner {
  margin: 16px 20px 0;
  padding: 14px 16px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 5px;
  animation: fadeSlideIn 0.35s ease;
}
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.reorder-title {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.reorder-items {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 10px;
  line-height: 1.5;
}
.reorder-btn {
  width: 100%;
  padding: 10px;
  background: var(--ink);
  color: var(--paper-raised);
  border: none;
  border-radius: 3px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.menu {
  padding: 8px 20px 100px;
  flex: 1;
}
.section-label {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 24px 0 10px;
}

.item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.item-thumb {
  width: 52px;
  height: 52px;
  border-radius: 4px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Inter", sans-serif;
  font-size: 20px;
  font-style: italic;
  color: var(--muted);
  overflow: hidden;
}
.item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.item-body {
  display: flex;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.item-info {
  flex: 1;
  min-width: 0;
}
.item-name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.item-name {
  font-family: "Inter", sans-serif;
  font-size: 17px;
  font-weight: 500;
  margin: 0;
}
.item-icons {
  display: inline-flex;
  gap: 4px;
  color: var(--muted);
}
.item-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  margin: 4px 0 8px;
}
.item-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.item-price {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--ink);
}
.item-prep {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: "Inter", sans-serif;
  font-size: 11px;
  color: var(--muted);
}
.item-action {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  position: relative;
}

.add-btn {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-family: "Inter", sans-serif;
  transition: transform 0.15s ease;
}
.add-btn:active {
  background: var(--ink);
  color: var(--paper-raised);
  transform: scale(0.9);
}
.stepper {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  overflow: hidden;
}
.stepper button {
  width: 30px;
  height: 34px;
  border: none;
  background: var(--paper);
  font-size: 15px;
  cursor: pointer;
  color: var(--ink);
}
.stepper button:active {
  background: var(--line);
}
.stepper .qty {
  width: 26px;
  text-align: center;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  font-weight: 700;
  display: inline-block;
}
.stepper .qty.pop {
  animation: qtyPop 0.25s ease;
}
@keyframes qtyPop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.4);
  }
  100% {
    transform: scale(1);
  }
}

.float-plus {
  position: absolute;
  top: -6px;
  right: 0;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  pointer-events: none;
  animation: floatUp 0.6s ease forwards;
}
@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-22px);
  }
}

.order-bar {
  position: sticky;
  bottom: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  z-index: 20;
  transition: background 0.25s ease;
}
.order-bar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.order-bar-count {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  letter-spacing: 0.05em;
  opacity: 0.75;
  text-transform: uppercase;
}
.order-bar-total {
  font-family: "Inter", sans-serif;
  font-size: 20px;
  font-weight: 600;
  display: inline-block;
}
.order-bar-total.bump {
  animation: bump 0.35s ease;
}
@keyframes bump {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}
.order-bar-cta {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(31, 36, 32, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 30;
}
.scrim.visible {
  opacity: 1;
  pointer-events: auto;
}

.ticket-drawer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  bottom: 0;
  width: 100%;
  max-width: 420px;
  background: var(--paper-raised);
  border-radius: 14px 14px 0 0;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 31;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}
.ticket-drawer.visible {
  transform: translateX(-50%) translateY(0);
}
.drawer-handle {
  width: 36px;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin: 10px auto 4px;
}
.drawer-header {
  padding: 12px 24px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--line);
}
.drawer-title {
  font-family: "Inter", sans-serif;
  font-size: 18px;
  font-weight: 600;
}
.drawer-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.ticket-body {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1;
}
.ticket-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  margin-bottom: 10px;
  align-items: baseline;
}
.ticket-row .t-name {
  color: var(--ink);
  flex: 1;
}
.ticket-row .t-qty {
  color: var(--muted);
}
.ticket-row .t-price {
  color: var(--ink);
  font-weight: 700;
}
.ticket-divider {
  border: none;
  border-top: 1px dashed var(--line);
  margin: 16px 0;
}
.ticket-total-row {
  display: flex;
  justify-content: space-between;
  font-family: "Inter", sans-serif;
  font-size: 15px;
  font-weight: 700;
}
.notes-field {
  width: 100%;
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--ink);
  resize: none;
  height: 54px;
}
.notes-field::placeholder {
  color: var(--muted);
}
.drawer-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--line);
}
.send-btn {
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  border-radius: 3px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: "Inter", sans-serif;
}
.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.send-btn:not(:disabled):active {
  transform: scale(0.98);
}

.empty-cart {
  text-align: center;
  padding: 50px 20px 30px;
}
.empty-cart .icon-wrap {
  color: var(--line);
  margin-bottom: 14px;
}
.empty-cart p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.confirm {
  position: fixed;
  inset: 0;
  max-width: 420px;
  margin: 0 auto;
  background: var(--paper);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 30px;
  text-align: center;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  overflow-y: auto;
}
.confirm.visible {
  transform: translateY(0);
}
.confirm-stamp {
  font-family: "Inter", sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--warm);
  border: 1px solid var(--warm);
  padding: 5px 10px;
  border-radius: 3px;
  margin-bottom: 22px;
}
.confirm-title {
  font-family: "Inter", sans-serif;
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 10px;
}
.confirm-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.5;
  white-space: pre-line;
}
.confirm-prep {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Inter", sans-serif;
  font-size: 12px;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: 3px;
  margin-bottom: 22px;
}
.confirm-order-no {
  font-family: "Inter", sans-serif;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 30px;
}
.confirm-order-no span {
  color: var(--ink);
  font-weight: 700;
}

.status-track {
  width: 100%;
  max-width: 280px;
  position: relative;
  margin-bottom: 40px;
}
.status-track-line {
  position: relative;
  height: 17px;
  margin-bottom: 8px;
}
.status-track-base {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  height: 1px;
  background: var(--line);
}
.status-track-fill {
  position: absolute;
  top: 8px;
  left: 8px;
  height: 1px;
  background: var(--accent);
  width: 0%;
  transition: width 0.5s ease;
}
.status-nodes {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-top: -17px;
}
.status-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.status-step .node {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--line);
  transition:
    background 0.3s ease,
    border-color 0.3s ease;
}
.status-step.active .node {
  background: var(--accent);
  border-color: var(--accent);
  animation: pulseNode 1.6s ease-in-out infinite;
}
.status-step.done .node {
  background: var(--accent);
  border-color: var(--accent);
}
@keyframes pulseNode {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 75, 60, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(47, 75, 60, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 75, 60, 0);
  }
}
.status-step .label {
  font-family: "Inter", sans-serif;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.status-step.active .label,
.status-step.done .label {
  color: var(--ink);
  font-weight: 700;
}
.confirm-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 260px;
}
.back-to-menu {
  margin-top: 40px;
  background: none;
  border: none;
  text-decoration: underline;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  font-family: "Inter", sans-serif;
}

.invalid-screen {
  position: fixed;
  inset: 0;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}
.invalid-screen .icon-wrap {
  color: var(--warm);
  margin-bottom: 16px;
}
.invalid-screen p {
  font-size: 14px;
  color: var(--muted);
  max-width: 280px;
  line-height: 1.6;
}


/* Typography and surface refinement */
body { font-feature-settings: "kern" 1; }
.venue-name, .item-name, .drawer-title, .confirm-title, .order-bar-total { letter-spacing: -0.025em; }
.table-tag, .legend, .section-label, .reorder-title, .order-bar-count, .confirm-stamp, .status-step .label { font-weight: 700; }
.item-price, .item-prep, .ticket-row, .ticket-total-row, .confirm-order-no { font-variant-numeric: tabular-nums; }
.device, .reorder-banner, .item-thumb, .ticket-drawer, .confirm-prep { border-radius: 8px; }
.quick-btn, .reorder-btn, .add-btn, .theme-btn, .send-btn { border-radius: 5px; }
