/* ==========================================================================
   Layout fixes (loaded last)
   ========================================================================== */

/* Mega menu: nested lists must never inherit the dropdown's centring transform on hover. */
@media (min-width: 1200px) {
	.site-nav .menu .sub-menu .sub-menu,
	.site-nav .menu .sub-menu li:hover > .sub-menu,
	.site-nav .menu .sub-menu li:focus-within > .sub-menu {
		position: static;
		left: auto;
		transform: none;
		opacity: 1;
		visibility: visible;
		min-width: 0;
		width: auto;
	}
	.site-nav .menu > li:has(.sub-menu .sub-menu) > .sub-menu > li { min-width: 0; }
	.site-nav .menu .sub-menu .sub-menu a { white-space: normal; }
}

/* Never allow sideways page scroll (animated elements may briefly scale past the edge). */
html { overflow-x: clip; }

/* Contact map: a fixed height instead of aspect-ratio + min-height (which forced ~640px width on phones). */
.map { aspect-ratio: auto; min-height: 0; height: clamp(240px, 42vw, 460px); width: 100%; }
.map iframe { display: block; width: 100%; height: 100%; }

/* Grid children may shrink below their content width (prevents horizontal overflow on phones). */
.split__grid > *, .faq__grid > *, .pdp > *, .quote-page__grid > *, .contact-grid > *, .unbox__grid > * { min-width: 0; }

/* Section heads wrap on small screens so the "View all" link never pushes past the edge. */
@media (max-width: 599px) {
	.section-head { flex-wrap: wrap; align-items: flex-start; }
	.section-head .link-arrow { order: 2; }
}

/* Shop pagination: WooCommerce puts the "page-numbers" class on the <ul> too — keep it a plain row. */
.pagination ul.page-numbers,
.woocommerce-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 6px;
	min-width: 0;
	height: auto;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 0;
	list-style: none;
	background: none;
}
.pagination ul.page-numbers > li { display: block; margin: 0; }
.pagination { clear: both; }

/* Learn & grow cards on narrow phones. */
.learn-item { grid-template-columns: 96px minmax(0, 1fr) 24px; }
.learn-item__body strong { overflow-wrap: anywhere; }
@media (max-width: 420px) {
	.learn-item { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 8px; }
	.learn-item__media { width: 64px; height: 64px; }
	.learn-item__go { display: none; }
	.learn-item__body strong { font-size: 14.5px; }
}
