/* Restock barcode UI — modal scanner + printable barcode display.
   Loaded only on pages that scan or display barcodes. */

/* ── Inline barcode swatch (catalog rows, invoice footers) ─────────────── */
.rsbc-swatch {
  display: inline-flex;
  align-items: center; gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
}
.rsbc-swatch svg { display: block; height: 36px; }
.rsbc-swatch-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.04em;
}
/* Block style used on SKU detail pages — bigger, centered, print-ready */
.rsbc-block {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  text-align: center;
}
.rsbc-block svg { display: inline-block; height: 60px; max-width: 100%; }
.rsbc-block-num {
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; letter-spacing: 0.06em;
  color: var(--text);
}

/* ── Scanner modal (full-screen overlay) ───────────────────────────────── */
.rsbc-modal {
  position: fixed; inset: 0;
  background: rgba(11, 15, 20, 0.92);
  z-index: 1000;
  display: flex; align-items: stretch; justify-content: center;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0)
           env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
.rsbc-stage {
  position: relative;
  width: 100%; max-width: 600px;
  display: flex; align-items: center; justify-content: center;
}
.rsbc-video {
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
}
/* Aim frame — white rounded rectangle with a softly glowing border */
.rsbc-frame {
  position: absolute;
  inset: 25% 12% 30% 12%;
  border: 2px solid rgba(255,255,255,.85);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(11,15,20,0.55);
  pointer-events: none;
}
/* Animated scanline */
.rsbc-frame::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px;
  height: 2px;
  background: linear-gradient(to right, transparent, #2D4BFF 50%, transparent);
  top: 50%;
  animation: rsbc-scan 1.6s ease-in-out infinite;
  border-radius: 1px;
}
@keyframes rsbc-scan {
  0%   { top: 12%; opacity: 0.5; }
  50%  { top: 88%; opacity: 1; }
  100% { top: 12%; opacity: 0.5; }
}
.rsbc-status {
  position: absolute;
  bottom: env(safe-area-inset-bottom, 24px); left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,0.95);
  color: var(--text, #0B0F14);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  max-width: 90vw;
  text-align: center;
  margin-bottom: 16px;
}
.rsbc-status--ok  { background: #16a34a; color: #fff; }
.rsbc-status--err { background: #dc2626; color: #fff; }
.rsbc-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0) + 14px); right: 14px;
  width: 44px; height: 44px;
  border: 0; border-radius: 50%;
  background: rgba(255,255,255,0.95);
  color: #0B0F14;
  font-size: 28px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

/* Driver-app integration: scan-confirm button inside stop cards */
.m-scan-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #0B0F14; color: #fff;
  border: 0; border-radius: 8px;
  padding: 0 14px; height: var(--m-touch-min, 48px);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.m-scan-btn svg { width: 18px; height: 18px; }
