/* Storage unit label UA- (wms-storage-units, Shared/StorageUnitLabelSheet, D4): 80 x 50 mm, black on white with a border (thermal printers: no grey), one label per page of
   the named page "storage-unit-label" (never a global @page). Printed through Shared/StorageUnitLabelPrint inside .print-area.volume-labels-print (components/printing.css hides
   the rest). The product, the band "EMBALAGEM" | "LOTE" | "VALIDADE", the Code 128 and the code in text. Never the quantity nor the apartment. */
@page storage-unit-label {
    size: 80mm 50mm;
    margin: 0;
}

.storage-unit-label {
    page: storage-unit-label;
    position: relative;
    width: 80mm;
    height: 50mm;
    box-sizing: border-box;
    padding: 1.5mm 2.5mm 1mm;
    border: .3mm solid var(--print-ink);
    background: var(--print-paper);
    color: var(--print-ink);
    font: 7pt/1.15 Arial, sans-serif;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    break-inside: avoid;
    page-break-inside: avoid;
    break-after: page;
    page-break-after: always;
}

.storage-unit-label:last-child {
    break-after: auto;
    page-break-after: auto;
}

.storage-unit-label small {
    display: block;
    font-size: 6pt;
    text-transform: uppercase;
}

/* The description of the product: two lines at most (a long description never pushes the barcode out). */
.storage-unit-label-product {
    padding-bottom: .5mm;
    border-bottom: .3mm solid var(--print-ink);
    margin-bottom: .5mm;
    min-width: 0;
}

.storage-unit-label-product strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 10pt;
    line-height: 1.1;
    font-weight: 700;
    min-height: 2.2em;
}

/* F7-8: the strip (pack at the left; at the right the mark of a reprint and "Caixa i de N"), then the big block LOTE | VALIDADE that takes the free space. */
.storage-unit-label-strip {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 2mm;
    border-bottom: .3mm solid var(--print-ink);
    padding-bottom: .4mm;
    margin-bottom: .6mm;
}

.storage-unit-label-strip strong {
    font-size: 9pt;
    font-weight: 700;
    white-space: nowrap;
}

.storage-unit-label-marks {
    display: flex;
    gap: 1.5mm;
    align-items: baseline;
    font: 700 7pt/1.1 Arial, sans-serif;
    font-style: normal;
    text-align: right;
    white-space: nowrap;
}

.storage-unit-label-reprint {
    font-style: normal;
    border: .25mm solid var(--print-ink);
    padding: 0 1mm;
}

.storage-unit-label-lot {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    border-bottom: .3mm solid var(--print-ink);
    margin-bottom: .6mm;
}

.storage-unit-label-lot div {
    min-width: 0;
    padding: 0 1.5mm;
    text-align: center;
}

.storage-unit-label-lot div + div {
    border-left: .3mm solid var(--print-ink);
}

.storage-unit-label-lot strong {
    display: block;
    font-size: 22pt;
    line-height: 1.05;
    font-weight: 700;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* A long lot shrinks (only the lot) and breaks; it is never cut. */
.storage-unit-label-lot strong.is-long {
    font-size: 14pt;
}

.storage-unit-label .barcode {
    height: 9mm;
    flex-shrink: 0;
    width: 100%;
    margin: auto 0 0;
}

.storage-unit-label-brand {
    position: absolute;
    right: 2.5mm;
    bottom: 1.2mm;
    color: var(--print-ink);
    font: 700 6pt/1 Arial, sans-serif;
    white-space: nowrap;
}

.storage-unit-label-code {
    margin: .3mm 0 0;
    text-align: center;
    font: 700 10pt/1 'Courier New', monospace;
    letter-spacing: .08em;
}
