/* ScanToGrab UI Demo — Design tokens (docs/09)
   Deep teal/ink + citrus. Outfit + Source Sans 3.
   Radius 12–16px. Borders over heavy shadows. */

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

:root {
  --ink: #0b1f24;
  --ink-soft: #1a3339;
  --teal: #0d6e6e;
  --teal-deep: #0a5555;
  --teal-muted: #d7ecec;
  --citrus: #e8a017;
  --citrus-soft: #fff3d6;
  --bg: #eef3f2;
  --bg-elev: #ffffff;
  --line: #d5e0de;
  --muted: #5c7278;
  --danger: #c43c3c;
  --success: #1f8a5b;
  --veg: #1f8a5b;
  --nonveg: #b54a2a;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 0 rgba(11, 31, 36, 0.04);
  --font-brand: "Outfit", system-ui, sans-serif;
  --font-ui: "Source Sans 3", system-ui, sans-serif;
  --phone-w: 390px;
  --safe-bottom: 20px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body.demo-page {
  min-height: 100vh;
}

a {
  color: var(--teal);
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

/* —— Gallery shell —— */
.gallery {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.gallery-hero {
  margin-bottom: 36px;
}

.gallery-hero .brand {
  font-family: var(--font-brand);
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  color: var(--ink);
}

.gallery-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 42ch;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.gallery-card {
  display: block;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.gallery-card:hover {
  border-color: var(--teal);
  transform: translateY(-2px);
}

.gallery-card .tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal);
  background: var(--teal-muted);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.gallery-card h3 {
  font-family: var(--font-brand);
  font-size: 1.15rem;
  margin: 0 0 6px;
}

.gallery-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.4;
}

/* —— Demo chrome —— */
.demo-chrome {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
  align-items: flex-start;
  padding: 28px 20px 48px;
}

.demo-meta {
  flex: 1 1 280px;
  max-width: 360px;
  padding-top: 12px;
}

.demo-meta .back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.demo-meta h1 {
  font-family: var(--font-brand);
  font-size: 1.85rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.demo-meta .sku {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal);
  margin-bottom: 12px;
}

.demo-meta p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 14px;
}

.demo-meta ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* —— Phone frame (guest) —— */
.phone {
  width: var(--phone-w);
  max-width: 100%;
  height: 780px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow);
}

.phone.wide {
  width: min(960px, 100%);
  height: auto;
  min-height: 560px;
  border-radius: var(--radius);
}

.phone-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 88px;
}

/* —— Guest components —— */
.ctx-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.ctx-bar h2 {
  font-family: var(--font-brand);
  font-size: 1.15rem;
  margin: 0 0 4px;
}

.loc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--teal-muted);
  color: var(--teal-deep);
  padding: 4px 10px;
  border-radius: 999px;
}

.loc-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--ink);
}

.icon-btn:hover {
  border-color: var(--teal);
}

.search-strip {
  position: sticky;
  top: 68px;
  z-index: 30;
  background: var(--bg-elev);
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--line);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
}

.search-field input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 0.95rem;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 2px;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-soft);
}

.chip.active {
  border-color: var(--teal);
  background: var(--teal-muted);
  color: var(--teal-deep);
}

.chip .mark {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 5px;
  vertical-align: -1px;
}

.chip .mark.veg {
  background: var(--veg);
  border: 1px solid var(--veg);
}

.chip .mark.nonveg {
  width: 0;
  height: 0;
  background: transparent;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 9px solid var(--nonveg);
  border-radius: 0;
}

.cat-nav {
  position: sticky;
  top: 138px;
  z-index: 20;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 12px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.cat-nav button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  padding: 12px 12px 10px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.cat-nav button.active {
  color: var(--ink);
  border-bottom-color: var(--citrus);
}

.section {
  padding: 18px 16px 8px;
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.section-head h3 {
  font-family: var(--font-brand);
  font-size: 1.05rem;
  margin: 0;
}

.section-head .count {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.item-card {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.item-card:last-child {
  border-bottom: 0;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}

.attr-mark {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--veg);
  border-radius: 2px;
  display: grid;
  place-items: center;
}

.attr-mark::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--veg);
}

.attr-mark.nonveg {
  border-color: var(--nonveg);
}

.attr-mark.nonveg::after {
  width: 0;
  height: 0;
  border-radius: 0;
  background: transparent;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 7px solid var(--nonveg);
}

.star-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--citrus-soft);
  padding: 2px 6px;
  border-radius: 6px;
}

.item-card h4 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
}

.price {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.item-media {
  position: relative;
}

.thumb {
  width: 110px;
  height: 110px;
  border-radius: 12px;
  background: linear-gradient(145deg, #c5ddd8, #e8f0ee 40%, #d4c4a8);
  display: grid;
  place-items: center;
  font-size: 2rem;
}

.thumb.alt {
  background: linear-gradient(145deg, #d8cfc0, #f0e6d8 45%, #b8c9c4);
}

.thumb.sold {
  filter: grayscale(0.5);
  opacity: 0.7;
}

.add-wrap {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  text-align: center;
}

.btn-add {
  border: 0;
  background: var(--bg-elev);
  color: var(--teal-deep);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 7px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(11, 31, 36, 0.08);
}

.btn-add:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.custom-hint {
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 600;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--teal);
  color: #fff;
  border-radius: 10px;
  padding: 4px 6px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(13, 110, 110, 0.25);
}

.stepper button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  font-weight: 700;
}

/* Floating cart */
.cart-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(12px + var(--safe-bottom));
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--ink);
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  animation: cartIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cartIn {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.cart-bar .left {
  font-weight: 600;
  font-size: 0.92rem;
}

.cart-bar .left span {
  opacity: 0.7;
  font-weight: 500;
  font-size: 0.8rem;
  display: block;
}

.cart-bar .right {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.92rem;
}

/* Sheets */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 31, 36, 0.45);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.sheet {
  width: 100%;
  max-height: 85%;
  background: var(--bg-elev);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: sheetUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes sheetUp {
  from {
    transform: translateY(40%);
  }
  to {
    transform: none;
  }
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h3 {
  font-family: var(--font-brand);
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.sheet-body {
  padding: 12px 16px;
  overflow-y: auto;
  flex: 1;
}

.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg-elev);
}

.mod-group {
  margin-bottom: 18px;
}

.mod-group h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.mod-group .req {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.mod-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  gap: 12px;
}

.mod-option:last-child {
  border-bottom: 0;
}

.mod-option label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  flex: 1;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-citrus {
  background: var(--citrus);
  color: var(--ink);
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row .btn {
  flex: 1;
}

/* Merchant / desktop panels */
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-family: var(--font-brand);
  font-size: 1.2rem;
  margin: 0;
}

.panel-body {
  padding: 16px 20px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.status.prep {
  background: #fff3d6;
  color: #8a6500;
}

.status.ready {
  background: var(--teal-muted);
  color: var(--teal-deep);
}

.status.done {
  background: #d8f0e4;
  color: var(--success);
}

.status.off {
  background: #f5dede;
  color: var(--danger);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 80;
  animation: cartIn 0.3s ease;
}

.note-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  min-height: 72px;
  background: var(--bg);
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.timeline li {
  position: relative;
  padding: 0 0 18px 28px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.timeline li.done::before {
  background: var(--teal);
}

.timeline li.active::before {
  background: var(--citrus);
  box-shadow: 0 0 0 4px var(--citrus-soft);
}

.timeline li::after {
  content: "";
  position: absolute;
  left: 10px;
  top: 18px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.timeline li:last-child::after {
  display: none;
}

.timeline strong {
  display: block;
  font-size: 0.92rem;
}

.timeline span {
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.stat {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.stat .label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.stat .value {
  font-family: var(--font-brand);
  font-size: 1.55rem;
  font-weight: 700;
  margin-top: 4px;
}

.kds-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  padding: 16px;
  background: #121c1e;
  min-height: 480px;
}

.kds-ticket {
  background: #1c2a2d;
  border-radius: 12px;
  border-left: 4px solid var(--citrus);
  padding: 14px;
  color: #e8f0ef;
}

.kds-ticket.ready {
  border-left-color: var(--success);
}

.kds-ticket h4 {
  margin: 0 0 8px;
  font-family: var(--font-brand);
}

.kds-ticket ul {
  margin: 0 0 12px;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.45;
}

.module-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-elev);
}

.module-card .price {
  color: var(--teal-deep);
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  border: 0;
}

.switch.on {
  background: var(--teal);
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.switch.on::after {
  transform: translateX(18px);
}

.scan-viewfinder {
  aspect-ratio: 1;
  border-radius: var(--radius);
  background: #0b1f24;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  color: #fff;
}

.scan-viewfinder .frame {
  width: 70%;
  height: 70%;
  border: 2px solid var(--citrus);
  border-radius: 12px;
}

@media (max-width: 820px) {
  .demo-chrome {
    flex-direction: column;
    align-items: stretch;
  }
  .demo-meta {
    max-width: none;
  }
  .phone {
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
