/* Hang-tag label design (10×72 mm jewellery string tag) */

.label-design-page {
  --label-ink: #111;
  --label-paper: #fbfbfb;
  --label-stage: linear-gradient(165deg, #2a2a2a 0%, #141414 55%, #1f1f1f 100%);
}

.label-heading-row { align-items: flex-end; gap: 18px; }
.label-heading-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

.label-studio {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(260px, 0.7fr);
  gap: 16px;
  align-items: start;
  margin-top: 6px;
}

.label-preview-stage {
  position: relative;
  min-height: min(68vh, 560px);
  padding: 18px 20px 16px;
  border-radius: 10px;
  color: #ececec;
  background: var(--label-stage);
  overflow: auto;
}

.label-preview-stage::before {
  content: "";
  position: absolute;
  inset: -30% auto auto 60%;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  border: 1px solid #ffffff10;
  box-shadow: 0 0 0 40px #ffffff06;
  pointer-events: none;
}

.preview-stage-meta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.preview-stage-meta .eyebrow { color: #bdbdbd; margin: 0; }
.preview-size-chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #d8d8d8;
  border: 1px solid #ffffff22;
  padding: 5px 9px;
  border-radius: 4px;
}

.hangtag-viewport {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: min(42vh, 320px);
  padding: 36px 12px 28px;
  overflow: auto;
}

.hangtag-preview-host {
  /* One scale only (on the tag). Larger default so the shop can read the design. */
  --hangtag-preview-scale: 4.6;
  width: calc(72mm * var(--hangtag-preview-scale));
  height: calc(10mm * var(--hangtag-preview-scale));
  display: grid;
  place-items: center;
  filter: drop-shadow(0 10px 18px #00000066);
  transform: none;
}

.hangtag-preview-host > .hang-tag {
  transform: scale(var(--hangtag-preview-scale));
  transform-origin: center center;
}

.offset-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.nudge-pad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 4px 0 8px;
}

.nudge-mid-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
}

.nudge-btn {
  min-width: 4.5rem;
  font-size: 11px;
  padding: 6px 10px;
}

.nudge-reset {
  min-width: 4rem;
}

.offset-summary {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

/* Shared hang-tag geometry (preview + print) */
.hang-tag {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 72mm;
  height: 10mm;
  background: var(--label-paper);
  color: var(--label-ink);
  border: 0.2mm solid #c8c8c8;
  box-sizing: border-box;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  overflow: hidden;
}

.hang-tag-tail {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    repeating-linear-gradient(-45deg, #ececec 0 1.2px, #f6f6f6 1.2px 4px);
  border-right: 0.2mm dashed #b0b0b0;
  color: #9a9a9a;
  font-size: 2.4px;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 700;
}
.hang-tag-tail span {
  visibility: hidden;
}

.hang-tag-body {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 0;
  /* Offset is applied as translate on the faces wrapper in JS — keep body in flow. */
}

.hang-tag-face {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.6mm 0.7mm;
  min-width: 0;
  overflow: hidden;
}

.hang-tag-face-left { border-right: 0.15mm solid #d4d4d4; }

.hang-tag-brand {
  font-weight: 800;
  letter-spacing: .08em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hang-tag-barcode {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  min-height: 0;
  margin: 0.2mm 0;
}
.hang-tag-barcode svg {
  display: block;
  width: 100%;
  height: 3.6mm;
}

.hang-tag-code {
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.hang-tag-specs {
  line-height: 1.15;
  font-weight: 600;
}
.hang-tag-specs > div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hang-tag-muted { color: #999; font-weight: 500; }

.hang-tag-price {
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: auto;
}

.preview-hint {
  position: relative;
  z-index: 1;
  margin: 18px 0 0;
  color: #9a9a9a;
  font-size: 11px;
  line-height: 1.5;
}

.label-controls { display: grid; gap: 12px; }
.control-block {
  padding: 14px 15px 15px;
  background: #fff;
  border: 1px solid var(--vow-line, #e2e2e2);
  border-radius: 8px;
}
.control-block h2 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: .04em;
  color: #1a1a1a;
}
.control-block .field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 10px;
  color: #656565;
  font-size: 9px;
  font-weight: 700;
}
.control-block .field input {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e2e2e2;
  border-radius: 4px;
  background: #fff;
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 500;
}
.control-block .field input:focus {
  outline: 0;
  border-color: #8a8a8a;
  box-shadow: 0 0 0 2px #8a8a8a16;
}
.size-inputs, .font-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.control-note, .selected-product-summary {
  margin: 0 0 10px;
  color: #87909b;
  font-size: 10px;
  line-height: 1.45;
}
.field-toggles { display: grid; gap: 7px; }
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #333;
  font-weight: 600;
  margin-bottom: 6px;
}
.toggle input { accent-color: #1a1a1a; }
.brand-text-field { margin-top: 4px; }

.product-results {
  max-height: 160px;
  overflow: auto;
  border: 1px solid #ececec;
  border-radius: 5px;
  margin-bottom: 10px;
  background: #fafafa;
}
.product-result {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid #ececec;
  background: transparent;
  color: inherit;
}
.product-result:hover, .product-result.active { background: #efefef; }
.product-result strong { font-size: 12px; }
.product-result span { font-size: 11px; color: #666; }
.product-results-empty { padding: 14px 12px; color: #888; font-size: 11px; }
.rfid-note-block { background: #f7f7f7; }
.rfid-note { margin: 0; color: #6b6b6b; font-size: 11px; line-height: 1.5; }

/* Settings launcher card */
.label-settings-card .label-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 21px 18px;
}

@media (max-width: 980px) {
  .label-studio { grid-template-columns: 1fr; }
  .hangtag-preview-host { --hangtag-preview-scale: 3.6; }
}
@media (max-width: 560px) {
  .hangtag-preview-host { --hangtag-preview-scale: 2.6; }
  .size-inputs, .font-grid { grid-template-columns: 1fr; }
}

/* Accidental host Ctrl+P: never dump the designer UI to the printer.
   Real labels print from #vowLabelPrintFrame only (see label-print.js). */
@media print {
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  body > *:not(#vowLabelPrintFrame) {
    display: none !important;
    visibility: hidden !important;
  }
  #vowLabelPrintFrame {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: 0 !important;
    opacity: 1 !important;
  }
}
