/* RAWA public POS demo (/demo) — demo-only chrome on top of the real POS styles.
   Colours come from the POS tokens so light and dark both work. */

/* features that need a real account / hardware are simply not shown */
.rawa-demo #btn-dashboard,
.rawa-demo #btn-logout,
.rawa-demo #btn-switch-cashier,
.rawa-demo #btn-close-shift,
.rawa-demo #btn-attendance-toggle,
.rawa-demo #btn-drawer,
.rawa-demo #btn-add-category,
.rawa-demo #btn-add-item,
.rawa-demo #btn-pair-display,
.rawa-demo #btn-customer-display,
.rawa-demo #btn-channel-orders,
.rawa-demo #btn-menu-qr,
.rawa-demo #btn-menu-qr-actions,
.rawa-demo #btn-cash-movement,
.rawa-demo .pos-drag-hint,
.rawa-demo [data-view="online"],
.rawa-demo #pos-nav-menu,
.rawa-demo #save-table-count,
.rawa-demo label:has(> #table-count-input) { display: none !important; }

/* ---------- chrome inside the POS top bar ---------- */
.demo-chrome { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.demo-site {
  display: inline-flex; align-items: center; height: 30px; padding: 0 0.55rem;
  border-radius: 8px; text-decoration: none; color: var(--pos-ink);
  border: 1px solid var(--pos-line-strong); background: var(--pos-surface);
}
.demo-site:hover { border-color: var(--pos-accent); }
.demo-wm { font-family: var(--rawa-wordmark-font, "Archivo Black", Inter, sans-serif); font-size: 0.85rem; letter-spacing: 0.04em; direction: ltr; }
.demo-wm b { color: var(--pos-accent); font-weight: inherit; }
.demo-live {
  display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
  font-size: 0.78rem; font-weight: 800; color: var(--pos-accent);
  background: var(--pos-champagne-glow); padding: 0.28rem 0.65rem; border-radius: 999px;
}
.demo-live-s { font-weight: 600; color: var(--pos-muted); }
.demo-live-s::before { content: "·"; margin-inline-end: 0.35rem; color: var(--pos-muted); }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; flex: 0 0 auto; animation: demo-ping 1.6s infinite; }
@keyframes demo-ping {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.demo-cta {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; height: 32px;
  padding: 0 0.9rem; border-radius: 9px; background: var(--pos-accent); color: #fff !important;
  font-weight: 800; font-size: 0.82rem; text-decoration: none; white-space: nowrap;
}
.demo-cta:hover { filter: brightness(1.06); }
.demo-cta::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  transform: translateX(120%); animation: demo-shine 3.4s ease-in-out infinite;
}
@keyframes demo-shine { 0%, 60% { transform: translateX(120%); } 100% { transform: translateX(-120%); } }
.demo-cta .s { display: none; }
.demo-cta:focus-visible, .demo-site:focus-visible { outline: 2px solid var(--pos-accent); outline-offset: 2px; }

@media (max-width: 1100px) { .demo-live-s { display: none; } }
@media (max-width: 760px) {
  .demo-chrome { gap: 0.35rem; }
  .demo-live { padding: 0.28rem 0.5rem; }
  .demo-live-t { display: none; }
  .demo-cta { height: 30px; padding: 0 0.65rem; font-size: 0.76rem; }
  .demo-cta .l { display: none; }
  .demo-cta .s { display: inline; }
}
@media (max-width: 380px) { .demo-site { display: none; } }

/* ---------- toast (replaces blocking alert()) ---------- */
#demo-toast {
  position: fixed; inset-inline: 0; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); margin-inline: auto;
  width: max-content; max-width: min(92vw, 520px); z-index: 100000;
  background: var(--pos-ink); color: var(--pos-bg); font-weight: 700; font-size: 0.9rem; line-height: 1.6;
  padding: 0.7rem 1.1rem; border-radius: 14px; text-align: center;
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, 0.45);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
#demo-toast.show { opacity: 1; transform: none; }

/* ---------- receipt preview ---------- */
#demo-receipt {
  position: fixed; inset: 0; z-index: 100001; display: none; align-items: center; justify-content: center;
  background: rgba(8, 10, 14, 0.55); padding: 16px;
}
#demo-receipt.show { display: flex; }
.demo-receipt-card {
  /* exactly one 80 mm thermal roll wide, like the real printout */
  width: 80mm; max-width: 100%; max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: var(--pos-surface); color: var(--pos-ink); border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.5);
}
.demo-receipt-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--pos-line); }
.demo-receipt-x {
  border: 1px solid var(--pos-line-strong); background: var(--pos-surface); color: var(--pos-ink);
  border-radius: 9px; padding: 0.35rem 0.8rem; font: inherit; font-weight: 700; cursor: pointer;
}
.demo-receipt-body { flex: 1 1 auto; overflow-y: auto; background: #fff; }
#demo-receipt iframe { display: block; width: 80mm; max-width: 100%; border: 0; background: #fff; }
.demo-receipt-head strong { font-size: 0.95rem; }
.demo-receipt-note { margin: 0; padding: 0.65rem 1rem 0.8rem; font-size: 0.8rem; color: var(--pos-muted); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .demo-dot, .demo-cta::after { animation: none; }
  #demo-toast { transition: none; }
}
