/* Etiqueta de producción 100×100 mm — vista previa e impresión */

.logistica-prod-label-preview-wrap {
	background: #e2e8f0;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	overflow: auto;
	padding: 12px;
}

.logistica-prod-label-preview-wrap [data-label-visual-preview-mount] {
	align-items: flex-start;
	display: flex;
	flex-shrink: 0;
	justify-content: center;
	min-height: 0;
	width: 100%;
}

.logistica-prod-label-preview-scaler {
	aspect-ratio: var(--prod-preview-w, 100) / var(--prod-preview-h, 100);
	display: block;
	margin: 0 auto;
	max-width: min(100%, 360px);
	position: relative;
	width: 100%;
}

.logistica-prod-label-preview-scaler > .logistica-prod-label,
.logistica-prod-label-preview-scaler > .logistica-prod-label.is-preview {
	aspect-ratio: auto !important;
	height: 100% !important;
	inset: 0;
	margin: 0;
	max-height: none !important;
	max-width: none !important;
	min-height: 0 !important;
	position: absolute !important;
	transform: none !important;
	width: 100% !important;
}

.logistica-prod-label.is-preview {
	height: 100% !important;
	width: 100% !important;
}

/* ── Etiqueta base ── */
.logistica-prod-label {
	background: #fff;
	box-sizing: border-box;
	color: #111;
	display: grid;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 8px;
	grid-template-rows: 17fr 8fr 8fr 8fr 8fr 10fr 41fr;
	height: 100mm;
	overflow: hidden;
	width: 100mm;
}

/* ── Cabecera ── */
.logistica-prod-label__head {
	border-bottom: 1px solid #111;
	box-sizing: border-box;
	display: grid;
	grid-template-columns: 34% 1fr;
	min-height: 0;
	overflow: hidden;
}

.logistica-prod-label__logo {
	align-items: center;
	border-right: 1px solid #111;
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	min-height: 0;
	overflow: hidden;
	padding: 3px;
}

.logistica-prod-label__logo img {
	max-height: 100%;
	max-width: 100%;
	object-fit: contain;
}

.logistica-prod-label__logo-fallback {
	font-weight: 800;
	line-height: 1;
	text-align: center;
}

.logistica-prod-label__logo-fallback .eco {
	display: block;
	font-size: 16px;
	letter-spacing: -0.04em;
}

.logistica-prod-label__logo-fallback .friendly {
	display: block;
	font-size: 7px;
	letter-spacing: 0.18em;
	margin-top: 2px;
}

.logistica-prod-label__cliente {
	align-items: center;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 3px;
	justify-content: center;
	min-height: 0;
	overflow: hidden;
	padding: 4px 6px;
}

/* ── Etiquetas negras ── */
.logistica-prod-label__tag {
	background: #111;
	color: #fff;
	display: inline-block;
	flex-shrink: 0;
	font-size: 7px;
	font-weight: 700;
	line-height: 1.2;
	padding: 2px 5px;
	text-transform: uppercase;
	white-space: nowrap;
}

/* ── Valores ── */
.logistica-prod-label__value {
	flex-shrink: 1;
	font-size: 11px;
	font-weight: 800;
	line-height: 1.1;
	min-width: 0;
	overflow: hidden;
	text-align: center;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}

.logistica-prod-label__cliente .logistica-prod-label__value {
	font-size: 13px;
	white-space: normal;
	word-break: break-word;
}

.logistica-prod-label__value.is-sm {
	font-size: 10px;
}

/* ── Filas ── */
.logistica-prod-label__row {
	align-items: center;
	border-bottom: 1px solid #111;
	box-sizing: border-box;
	display: flex;
	flex-wrap: nowrap;
	gap: 4px;
	min-height: 0;
	overflow: hidden;
	padding: 2px 6px;
}

.logistica-prod-label__row.is-paquetes {
	display: grid;
	gap: 0;
	grid-template-columns: repeat(4, 1fr);
	justify-items: center;
	padding: 2px 4px;
}

.logistica-prod-label__row.is-paquetes .logistica-prod-label__value,
.logistica-prod-label__row.is-paquetes .logistica-prod-label__tag {
	justify-self: center;
}

.logistica-prod-label__row.is-split {
	display: grid;
	gap: 0;
	grid-template-columns: 1fr 1fr;
	padding: 0;
}

.logistica-prod-label__row.is-triple {
	display: grid;
	gap: 0;
	grid-template-columns: repeat(3, 1fr);
	padding: 0;
}

.logistica-prod-label__cell {
	align-items: center;
	box-sizing: border-box;
	display: flex;
	flex-wrap: nowrap;
	gap: 4px;
	justify-content: center;
	min-height: 0;
	min-width: 0;
	overflow: hidden;
	padding: 2px 4px;
}

.logistica-prod-label__cell + .logistica-prod-label__cell {
	border-left: 1px solid #111;
}

.logistica-prod-label__cell.is-triple {
	flex-direction: column;
	gap: 2px;
}

.logistica-prod-label__cell.is-triple .logistica-prod-label__value {
	font-size: 9px;
}

/* ── Código de barras ── */
.logistica-prod-label__barcode {
	align-items: center;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 0;
	overflow: hidden;
	padding: 4px 6px 6px;
}

.logistica-prod-label__barcode svg {
	height: auto;
	max-height: 100%;
	max-width: 96%;
	width: 100%;
}

/* ── Documento de impresión ── */
.logistica-label-print-doc {
	background: #fff;
	margin: 0;
	padding: 0;
}

.logistica-label-print-doc .logistica-label-print-sheet {
	box-sizing: border-box;
	display: block;
	margin: 0;
	padding: 0;
}

.logistica-label-print-doc .logistica-prod-label {
	break-after: page;
	margin: 0 auto;
	page-break-after: always;
}

.logistica-label-print-doc .logistica-prod-label:last-child {
	break-after: auto;
	page-break-after: auto;
}

@media print {
	@page {
		margin: 0;
		size: 100mm 100mm;
	}

	html,
	body {
		height: auto;
		margin: 0 !important;
		padding: 0 !important;
		width: auto;
	}

	body.logistica-label-print-doc {
		margin: 0;
		padding: 0;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	.logistica-prod-label {
		font-size: 8pt;
	}

	.logistica-prod-label__tag {
		font-size: 7pt;
	}

	.logistica-prod-label__value {
		font-size: 11pt;
	}

	.logistica-prod-label__value.is-sm {
		font-size: 10pt;
	}

	.logistica-prod-label__cliente .logistica-prod-label__value {
		font-size: 13pt;
	}

	.logistica-prod-label__cell.is-triple .logistica-prod-label__value {
		font-size: 9pt;
	}
}
