/**
 * Print Stylesheet
 * Styles for print media
 */

/* Hide non-essential elements when printing */
@media print {
	/* Hide navigation but keep logo */
	nav,
	.menu,
	.menu-item,
	.navigation,
	.header-nav,
	#header-nav,
	.fl-menu,
	.fl-menu-item,
	.fl-menu-toggle,
	.fl-menu-mobile-toggle,
	.uabb-creative-menu,
	.site-search,
	.search-form,
	
	/* Hide footers and other non-content elements */
	footer,
	.sidebar,
	.widget,
	.comments,
	.comment-form,
	.social-share,
	.breadcrumbs,
	button,
	.btn,
	.button,
	form,
	input[type="submit"],
	.no-print {
		display: none !important;
	}

	/* Hide HubSpot chat bubbles and widgets */
	#hubspot-messages-iframe-container,
	.hubspot-messages-widget,
	iframe[src*="hubspot"],
	iframe[src*="hs-scripts"],
	[class*="hubspot"],
	[id*="hubspot"],
	[class*="hs-"],
	[id*="hs-"] {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		height: 0 !important;
		width: 0 !important;
		overflow: hidden !important;
	}

	/* Ensure logo remains visible */
	.logo,
	.site-logo,
	.fl-logo,
	[class*="logo"],
	header .logo,
	header img[class*="logo"],
	header .site-logo,
	header a[class*="logo"] {
		display: block !important;
		visibility: visible !important;
	}

	/* Ensure content is visible and properly formatted */
	body {
		font-size: 12pt;
		line-height: 1.5;
		color: #000;
		background: #fff;
	}

	/* Remove backgrounds and borders for cleaner printing */
	* {
		background: transparent !important;
		color: #000 !important;
		box-shadow: none !important;
		text-shadow: none !important;
	}

	/* Keep borders for tables and important elements */
	table,
	table th,
	table td {
		border: 1px solid #000 !important;
	}

	/* Ensure links are visible and show URL */
	a,
	a:visited {
		color: #000 !important;
		text-decoration: underline;
	}

	a[href]:after {
		content: " (" attr(href) ")";
		font-size: 90%;
	}

	/* Don't show URLs for images, internal links, or logo links */
	a[href^="#"]:after,
	a[href^="javascript:"]:after,
	a[class*="logo"]:after,
	.logo a:after,
	.site-logo a:after,
	.fl-logo a:after,
	header a[class*="logo"]:after,
	header .logo a:after {
		content: "" !important;
	}

	/* Hide "Back to results" link */
	.js-equipment-back-link,
	a.js-equipment-back-link,
	[class*="js-equipment-back-link"] {
		display: none !important;
	}

	/* Page breaks */
	.page-break {
		page-break-before: always;
	}

	/* Avoid breaking inside these elements */
	h1, h2, h3, h4, h5, h6 {
		page-break-after: avoid;
	}

	p,
	li {
		page-break-inside: avoid;
	}

	/* Images - reduce white space before/after and keep on one line */
	img {
		max-width: 100% !important;
		height: auto !important;
		page-break-inside: avoid !important;
		page-break-before: avoid !important;
		page-break-after: avoid !important;
		margin: 0.5em 0 !important;
		padding: 0 !important;
		display: inline-block !important;
	}

	/* Reduce excessive spacing around image containers and keep together */
	figure,
	.fl-photo,
	.fl-photo-content,
	.fl-image,
	.wp-block-image,
	[class*="image"],
	[class*="photo"] {
		margin: 0.5em 0 !important;
		padding: 0 !important;
		page-break-inside: avoid !important;
		page-break-before: avoid !important;
		page-break-after: avoid !important;
		display: block !important;
	}

	/* Fix contact information line breaks - prevent excessive breaking */
	.contact-info,
	.contact-information,
	[class*="contact"],
	[class*="phone"],
	[class*="address"],
	[class*="location"],
	.fl-rich-text,
	.fl-rich-text p,
	.fl-rich-text div {
		white-space: normal !important;
		word-break: keep-all !important;
		word-wrap: normal !important;
		overflow-wrap: normal !important;
		hyphens: none !important;
		line-height: 1.4 !important;
		width: 100% !important;
		max-width: 100% !important;
	}

	/* Prevent forced line breaks in contact details */
	.contact-info br,
	[class*="contact"] br,
	[class*="phone"] br,
	[class*="address"] br {
		display: none !important;
	}

	/* Allow contact info to flow naturally on one line when possible */
	.contact-info > *,
	[class*="contact"] > * {
		display: inline-block !important;
		margin-right: 0.5em !important;
		vertical-align: top !important;
	}

	/* Tables */
	table {
		page-break-inside: avoid;
	}

	thead {
		display: table-header-group;
	}

	tfoot {
		display: table-footer-group;
	}

	/* Ensure proper spacing */
	@page {
		margin: 2cm;
	}

	/* Print only specific content */
	.print-only {
		display: block !important;
	}
	
	#collapse-engine-drivetrain {
		display: block;
	}
}
