/* ── Product view card + quick stock stepper ─────────────────────────────── */
.product-view {
  position: relative;
  max-width: 560px;
  margin-inline: auto;
}

.product-view__edit {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
}

.product-view__head {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  padding-right: 128px; /* clear the Edit product button */
}

.product-view__thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  flex: none;
}
.product-view__thumb--empty {
  background: linear-gradient(160deg, var(--color-surface-2), #eef2f8);
  display: grid;
  place-items: center;
  color: var(--color-faint);
}
.product-view__thumb-icon { width: 32px; height: 32px; display: block; }

.product-view__badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 8px;
}
.pill--stock {
  color: var(--color-text);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
}

.product-view__name { font-size: 1.4rem; line-height: 1.15; }
.product-view__desc { margin: 6px 0 10px; color: var(--color-muted); font-size: 0.92rem; }

.product-view__meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2) var(--space-4);
  margin: var(--space-4) 0;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.product-view__meta div { display: flex; flex-direction: column; gap: 2px; }
.product-view__meta dt {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-faint);
}
.product-view__meta dd { margin: 0; font-weight: 600; font-size: 1rem; }

/* Inline QR block */
.product-view__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
}
.product-view__qr-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-faint);
}
.product-view__qr-btn {
  padding: 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  line-height: 0;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s ease, box-shadow 0.12s ease, transform 0.05s ease;
}
.product-view__qr-btn:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); }
.product-view__qr-btn:active { transform: scale(0.98); }
.product-view__qr-img {
  width: 176px;
  height: 176px;
  image-rendering: pixelated;
  display: block;
}
.product-view__qr-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-muted);
  text-align: center;
}

/* Stepper */
.stepper { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); }
.stepper__label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-faint);
}
.stepper__controls { display: flex; align-items: center; gap: var(--space-4); }
.stepper__btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.05s ease;
}
.stepper__btn svg { width: 20px; height: 20px; display: block; }
.stepper__btn:hover { border-color: var(--color-primary); background: var(--color-surface-2); }
.stepper__btn:active { transform: scale(0.94); }
.stepper__value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  min-width: 3ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.stepper__hint { font-size: 0.82rem; color: var(--color-muted); min-height: 1.2em; }
.stepper__confirm { margin-top: var(--space-2); min-width: 160px; }
.stepper__confirm:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 640px) {
  .product-view__meta { grid-template-columns: 1fr 1fr; }
  .stepper__confirm { width: 100%; }
}

/* QR label ---------------------------------------------------------------- */
.qr-print {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.qr-print__card {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  width: min(460px, 92vw);
}
.qr-print__img {
  width: min(380px, 78vw);
  height: auto;
  aspect-ratio: 1;
  image-rendering: pixelated;
}
.qr-print__name { font-weight: 700; margin-top: 12px; }
.qr-print__meta { color: #475569; font-family: 'Space Mono', monospace; margin-top: 4px; }
.qr-print__actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }

@media print {
  body > #app { display: none !important; }
  .qr-print { position: static; background: none; }
  .qr-print__card { box-shadow: none; }
  .qr-print__actions { display: none !important; }
}
