/* Store Ops 2.0: phone styles. Loaded after admin.css and base.css. */

/* ---------------------------------------------------------------------------
   Scan with the phone camera on pages built for a USB scanner
   (Walk Ins, WhatsApp Orders, Stock Adjust). See redesign/phone-camera.js.
   ------------------------------------------------------------------------- */
html:not([data-device="phone"]) .so-phone-only {
  display: none !important;
}

html[data-device="phone"] [data-stock-scanner-connect] {
  display: none !important;
}

.so-camera-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  margin-top: 16px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--so-ink);
  color: var(--so-panel);
  font: 600 15px/1 var(--so-font);
  cursor: pointer;
}

.so-camera-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.so-camera-sheet {
  position: fixed;
  inset: 0;
  z-index: 13000;
}

.so-camera-sheet[hidden] {
  display: none;
}

.so-camera-scrim {
  position: absolute;
  inset: 0;
  background: var(--so-scrim);
  animation: so-fade 0.4s var(--so-ease) both;
}

.so-camera-panel {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 14px 14px;
  border-radius: 30px;
  background: var(--so-panel);
  box-shadow: var(--so-sh2);
  animation: so-sheet 0.55s var(--so-ease) both;
}

.so-camera-panel::before {
  content: '';
  align-self: center;
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--so-line2);
}

.so-camera-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-left: 4px;
}

.so-camera-head strong {
  color: var(--so-ink);
  font: 650 17px/1.2 var(--so-font);
}

.so-camera-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--so-line2);
  border-radius: 50%;
  background: transparent;
  color: var(--so-ink);
  cursor: pointer;
}

.so-camera-close svg {
  width: 16px;
  height: 16px;
}

.so-camera-view {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 22px;
  background: #000;
}

.so-camera-view video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.so-camera-frame {
  position: absolute;
  inset: 22% 14%;
  border-radius: 18px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  transition: border-color 0.3s, transform 0.4s var(--so-spring);
}

.so-camera-frame[data-flash="ok"] {
  border-color: #5ee0a6;
  transform: scale(1.03);
}

.so-camera-frame[data-flash="error"] {
  border-color: #ff6b81;
}

.so-camera-status {
  min-height: 20px;
  margin: 0;
  padding: 0 4px;
  color: var(--so-ink2);
  font: 500 14px/1.4 var(--so-font);
  text-align: center;
}

.so-camera-status[data-tone="ok"] {
  color: var(--so-mint);
}

.so-camera-status[data-tone="error"] {
  color: var(--so-red);
}

.so-camera-done {
  height: 52px;
  border: 0;
  border-radius: 999px;
  background: var(--so-ink);
  color: var(--so-panel);
  font: 600 15px/1 var(--so-font);
  cursor: pointer;
}

html[data-device="phone"] .admin-stock-empty .so-camera-button svg {
  width: 20px;
  height: 20px;
  margin: 0;
  opacity: 1;
  color: inherit;
  stroke: currentColor;
  stroke-width: 2.2;
}
