/* Product Sheet Print Styles */

@media print {
	/* ===== HIDE NON-PRINT ELEMENTS ===== */
	body > header,
	body > footer,
	.print-hide,
	#menuPanel,
	#wpadminbar,
	#cmplz-cookiebanner-container,
	#cmplz-manage-consent {
		display: none !important;
	}

	/* Theme base CSS starts main/footer at opacity:0 for the GSAP page-load
	   fade-in — force visible so printing never captures an invisible page
	   (e.g. print before the animation runs, or headless PDF generation). */
	main,
	.product-sheet-footer {
		opacity: 1 !important;
	}

	/* Theme base CSS sets min-height:100vh on html/body/main — in print that
	   overflows one A4 page and yields a trailing blank page on short sheets. */
	html,
	body,
	main {
		min-height: 0 !important;
		height: auto !important;
	}

	/* ===== PAGE SETUP ===== */
	@page {
		size: A4 portrait;
		margin: 8mm 10mm;
	}

	body {
		background: white !important;
		font-size: 10pt !important;
		line-height: 1.4 !important;
	}

	/* Remove all screen-specific spacing */
	.product-sheet {
		padding: 0 !important;
		margin: 0 !important;
		max-width: none !important;
	}

	/* ===== FORCE COLORS (even without "Background graphics" checkbox) ===== */
	*,
	*::before,
	*::after {
		print-color-adjust: exact !important;
		-webkit-print-color-adjust: exact !important;
	}

	/* ===== SHEET CONTAINER ===== */
	.product-sheet-content {
		border-radius: 0 !important;
		box-shadow: none !important;
	}

	/* ===== HEADER ===== */
	.product-sheet-header {
		padding: 12px 20px !important;
	}

	.product-sheet-header h1 {
		font-size: 22pt !important;
		line-height: 1.2 !important;
	}

	.product-sheet-header p {
		font-size: 8pt !important;
		margin-bottom: 2px !important;
	}

	.print-logo {
		width: 140px !important;
	}

	/* ===== GALLERY PAIRS — two columns, compact heights ===== */
	.sheet-gallery {
		display: grid !important;
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 8px !important;
		break-inside: avoid;
		margin-bottom: 12px !important;
	}

	/* A lone image in a pair spans the full width */
	.sheet-gallery img:only-child {
		grid-column: 1 / -1;
	}

	.sheet-gallery img {
		height: 150px !important;
		width: 100% !important;
		object-fit: cover;
		display: block;
		border-radius: 0 !important;
	}

	/* ===== MAIN CONTENT AREA ===== */
	.product-sheet-content > div {
		padding: 10px 20px !important;
	}

	/* ===== SECTION HEADINGS ===== */
	.product-sheet-content h2 {
		font-size: 12pt !important;
		margin-bottom: 6px !important;
		padding-bottom: 4px !important;
	}

	/* ===== SECTION SPACING ===== */
	.product-sheet-content .mb-12 {
		margin-bottom: 20px !important;
	}

	.product-sheet-content .space-y-12 > * + * {
		margin-top: 20px !important;
	}

	/* ===== DESCRIPTION + BENEFITS (full width, stacked) ===== */
	.product-sheet-content .editor,
	.product-sheet-content .editor p {
		font-size: 9pt !important;
		line-height: 1.4 !important;
	}

	/* Benefits list */
	.product-sheet-content .space-y-3 > li {
		margin-bottom: 4px !important;
		font-size: 9pt !important;
		line-height: 1.3 !important;
	}

	/* ===== FACT PILLS (compact, one row) ===== */
	.sheet-pills {
		gap: 6px !important;
		margin-bottom: 12px !important;
		break-inside: avoid;
	}

	.sheet-pill {
		font-size: 8pt !important;
		padding: 3px 10px !important;
		white-space: nowrap;
	}

	/* ===== DESCRIPTION ===== */
	.sheet-description {
		margin-bottom: 12px !important;
	}

	/* ===== TECHNICAL INFO TABLE ===== */
	.product-sheet-content dl {
		display: flex !important;
		gap: 8px !important;
	}

	.product-sheet-content dl dt,
	.product-sheet-content dl dd {
		font-size: 9pt !important;
		line-height: 1.3 !important;
	}

	.product-sheet-content .py-3 {
		padding-top: 4px !important;
		padding-bottom: 4px !important;
	}

	/* ===== FOOTER ===== */
	.product-sheet-footer {
		padding: 8px 20px !important;
		font-size: 8pt !important;
	}

	.product-sheet-footer img {
		width: 100px !important;
	}

	/* ===== PAGE BREAK CONTROL ===== */
	/*
	 * Fixed page layout (matches the hand-made reference PDFs):
	 *   Page 1: Header + image pair 1 + pills + description + image pair 2 + brand bullets
	 *   Page 2: Technical info + footer
	 *   Downloads never print (.print-hide).
	 * Empty space at bottom of page 1 is intentional.
	 */

	/* Page 2 starts here */
	.print-page-2 {
		break-before: page !important;
	}

	/* Keep small elements together */
	.sheet-benefits {
		break-inside: avoid;
	}

	.product-sheet-content dl {
		break-inside: avoid;
	}

	.product-sheet-footer {
		break-inside: avoid;
	}
}

/* ===== SCREEN ONLY ===== */
@media screen {
	.product-sheet-content {
		box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
	}
}
