/**
 * PDF Print Styles - AGGRESSIVE version to kill "Undefined"
 *
 * @package Korterid
 */

@media print {
	/* CRITICAL: Force wide viewport to prevent mobile styles from triggering */
	@page {
		size: A4 portrait;
		margin: 10mm;
	}

	html {
		min-width: 1200px !important;
	}

	body {
		min-width: 1200px !important;
		width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	/* Hide EVERYTHING on the page first */
	body * {
		visibility: hidden !important;
	}

	/* Show ONLY the popup container */
	.ct-popup-container,
	.ct-popup-container * {
		visibility: visible !important;
	}

	/* Position popup */
	.ct-popup-container {
		position: absolute !important;
		left: 0 !important;
		top: 0 !important;
		width: 100% !important;
	}

	.ct-popup-content {
		width: 100% !important;
		padding: 20px !important;
		background: white !important;
	}

	/* Hide buttons and overlays */
	.korterid-action-buttons,
	.korterid-pdf-btn,
	.contact-btn,
	.korterid-form-wrapper,
	.ct-toggle-close,
	.ct-popup-container-overlay {
		display: none !important;
	}

	/* ============================================
	   NUCLEAR OPTION: Kill ALL pseudo-elements
	   ============================================ */

	/* Target EVERY possible element with maximum specificity */
	html *::before,
	html *::after,
	body *::before,
	body *::after,
	div::before,
	div::after,
	td::before,
	td::after,
	tr::before,
	tr::after,
	table::before,
	table::after,
	p::before,
	p::after,
	span::before,
	span::after,
	a::before,
	a::after,
	strong::before,
	strong::after,
	.ct-popup-container *::before,
	.ct-popup-container *::after,
	.ct-popup-content *::before,
	.ct-popup-content *::after,
	.entry-content *::before,
	.entry-content *::after {
		display: none !important;
		content: "" !important;
		content: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		width: 0 !important;
		height: 0 !important;
		position: absolute !important;
		left: -9999px !important;
	}

	/* Logos header */
	.logod {
		display: block !important;
		width: 100% !important;
		margin-bottom: 20px !important;
	}

	.logod .kt-row-column-wrap {
		display: flex !important;
		gap: 20px !important;
	}

	.logod img {
		max-width: 100% !important;
		height: auto !important;
	}

	/* Main content row */
	.prindi {
		display: block !important;
		width: 100% !important;
	}

	.prindi .kt-row-column-wrap {
		display: flex !important;
		gap: 20px !important;
	}

	.inner-column-1,
	.inner-column-2 {
		flex: 1 !important;
	}

	/* Force table to display as table (NOT card view) */
	.korterid-detail-table {
		display: table !important;
		width: 100% !important;
		border-collapse: collapse !important;
		margin-bottom: 20px !important;
		table-layout: auto !important;
	}

	.korterid-detail-table tbody {
		display: table-row-group !important;
	}

	.korterid-detail-table tr {
		display: table-row !important;
		page-break-inside: avoid !important;
	}

	.korterid-detail-table td {
		display: table-cell !important;
		padding: 8px !important;
		border: 1px solid #ddd !important;
		font-size: 11pt !important;
		text-align: left !important;
		vertical-align: middle !important;
		/* CRITICAL: Reset any flex/mobile styles */
		flex: none !important;
		justify-content: flex-start !important;
	}

	.korterid-detail-table td:first-child {
		font-weight: bold !important;
		background: #f5f5f5 !important;
		width: 50% !important;
	}

	.korterid-detail-table td:last-child {
		width: 50% !important;
	}

	/* Contact info */
	.korterid-contact-info {
		display: block !important;
		margin-bottom: 20px !important;
	}

	.korterid-contact-info p {
		margin: 4px 0 !important;
		font-size: 10pt !important;
	}

	/* Floor plan image */
	.inner-column-2 img {
		width: 100% !important;
		height: auto !important;
	}
}
