/* Box label CX- (wms-order-boxes, Shared/BoxLabelSheet, D279): 80 x 50 mm, black on white with a border, one label per page of the named page "box-label" (never a
   global @page, it would change the other documents). Printed through Shared/BoxLabelPrint inside .print-area.volume-labels-print (components/printing.css hides the
   rest, components/volume-labels.css takes the workspace out of the flow). The order line, origin, destination, the band "CAIXA" | "ROTA", the Code 128 and the code in text. */
@page box-label {
    size: 80mm 50mm;
    margin: 0;
}

.box-label {
    page: box-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;
}

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

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

/* The order line (PEDIDO + code in one line, the reprint mark at the right): kept short so the rest keeps its size. */
.box-label-order {
    display: flex;
    align-items: baseline;
    gap: 1.5mm;
    line-height: 1;
    padding-bottom: .4mm;
    border-bottom: .3mm solid var(--print-ink);
    margin-bottom: .4mm;
    min-width: 0;
}

.box-label-order small {
    display: inline;
}

.box-label-order strong {
    font-size: 9pt;
    font-weight: 700;
    white-space: nowrap;
}

.box-label-origin,
.box-label-destination {
    padding-bottom: .5mm;
    border-bottom: .3mm solid var(--print-ink);
    margin-bottom: .5mm;
    min-width: 0;
}

.box-label-origin strong,
.box-label-destination strong {
    display: block;
    font-size: 10pt;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.box-label-reprint {
    margin-left: auto;
    font-size: 6pt;
    font-style: normal;
    white-space: nowrap;
}

.box-label-band {
    display: grid;
    grid-template-columns: 1fr 18mm 1fr;
    border-bottom: .3mm solid var(--print-ink);
    padding-bottom: .5mm;
    margin-bottom: .8mm;
}

.box-label-band div {
    text-align: center;
    min-width: 0;
}

.box-label-band div + div {
    border-left: .3mm solid var(--print-ink);
}

.box-label-band strong {
    display: block;
    font-size: 22pt;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* A long box number (past CX-999999-x) or route code steps down instead of being cut (OrderLabelsRules.BandSize); the line keeps the 22pt height. */
.box-label-band strong.is-long {
    font-size: 18pt;
    line-height: 22pt;
}

.box-label-band strong.is-longer {
    font-size: 14pt;
    line-height: 22pt;
}

.box-label-band strong.is-longest {
    font-size: 11pt;
    line-height: 22pt;
}

.box-label-band strong.is-tiny {
    font-size: 9pt;
    line-height: 22pt;
}

.box-label .barcode {
    height: 11mm;
    flex-shrink: 0;
    width: 100%;
    margin: auto 0 0;
}

/* The mark "Drism - WMS" in the lower right corner: solid black (thermal printers print no grey), bold, the size of the field titles (6pt), on the line of
   the code in text (centered, it never reaches the corner). */
.box-label-brand {
    position: absolute;
    right: 2.5mm;
    bottom: 1.2mm;
    color: var(--print-ink);
    font: 700 6pt/1 Arial, sans-serif;
    white-space: nowrap;
}

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