/*
 * IDOM mobile refinements.
 * Everything is deliberately scoped below 768px so desktop remains unchanged.
 */
@media (max-width: 767px) {
	/* Prevent wide full-width blocks from creating sideways page movement. */
	html,
	body {
		max-width: 100%;
		overflow-x: hidden;
	}

	@supports (overflow: clip) {
		html,
		body {
			overflow-x: clip;
		}
	}

	body #page,
	body .site,
	body .site-content,
	body .ast-container,
	body .entry-content,
	body ss3-force-full-width,
	body .n2-section-smartslider {
		max-width: 100vw;
	}

	/* Keep the complete branding column compact so the menu remains on-screen. */
	body #ast-mobile-header [data-section="title_tagline"],
	body #ast-mobile-header .site-branding,
	body #ast-mobile-header .site-logo-img,
	body #ast-mobile-header .custom-logo-link {
		width: min(288px, calc(100vw - 100px)) !important;
		max-width: min(288px, calc(100vw - 100px)) !important;
		min-width: 0 !important;
	}

	body #ast-mobile-header .custom-logo {
		display: block;
		width: 100% !important;
		max-width: 100% !important;
		height: auto;
	}

	body #ast-mobile-header {
		position: relative;
	}

	body #ast-mobile-header .site-header-primary-section-right {
		display: flex !important;
		position: absolute !important;
		top: -6px !important;
		right: 20px !important;
		z-index: 50;
		visibility: visible !important;
		opacity: 1 !important;
	}

	body #ast-mobile-header .main-header-menu-toggle {
		display: flex !important;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 10px !important;
		margin: 0 !important;
		color: #55b7a8 !important;
		visibility: visible !important;
		opacity: 1 !important;
	}

	body #ast-mobile-header .main-header-menu-toggle .ast-mobile-svg {
		fill: currentColor !important;
	}

	/* Give the home slider a useful mobile crop instead of a very shallow strip. */
	body.home #n2-ss-3 .n2-ss-slider-2,
	body.home #n2-ss-3 .n2-ss-slider-3,
	body.home #n2-ss-3 .n2-ss-slide-backgrounds,
	body.home #n2-ss-3 .n2-ss-slide-background {
		min-height: 180px;
	}

	body.home #n2-ss-3 .n2-ss-slide-background-image,
	body.home #n2-ss-3 .n2-ss-slide-background-image picture,
	body.home #n2-ss-3 .n2-ss-slide-background-image img {
		height: 100% !important;
		width: 100% !important;
		object-fit: cover;
	}

	/* Home: turn the two insurer rows into one compact two-column grid. */
	body.home .uagb-block-471a66e0 {
		padding-bottom: 24px !important;
	}

	body.home .uagb-block-471a66e0 .uagb-block-3c4d78fc {
		padding-top: 24px !important;
	}

	body.home .uagb-block-471a66e0 .wp-block-group {
		width: 100%;
	}

	body.home .uagb-block-471a66e0 .wp-block-columns {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px 16px;
		width: 100%;
		margin: 0;
	}

	body.home .uagb-block-471a66e0 .wp-block-column {
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 0;
	}

	body.home .uagb-block-471a66e0 .wp-block-image {
		margin: 0;
	}

	body.home .uagb-block-471a66e0 .wp-block-image img {
		display: block;
		width: 112px;
		height: 112px;
		object-fit: contain;
	}

	body.home .uagb-block-471a66e0 > .uagb-container-inner-blocks-wrap > .wp-block-spacer {
		display: none;
	}

	/* Team: two cards per row, while the introductory copy stays full width. */
	body.page-id-469 .uagb-block-gmgy6bxc.uagb-layout-grid,
	body.page-id-469 .uagb-block-e1ed06a1.uagb-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		grid-template-rows: auto !important;
		column-gap: 14px !important;
		row-gap: 24px !important;
	}

	body.page-id-469 .uagb-block-gmgy6bxc > .uagb-block-75badc30 {
		grid-column: 1 / -1;
	}

	body.page-id-469 .uagb-block-gmgy6bxc .wp-block-uagb-image img,
	body.page-id-469 .uagb-block-e1ed06a1 .wp-block-uagb-image img {
		display: block;
		width: 100% !important;
		height: auto !important;
		aspect-ratio: 1 / 1;
		object-fit: cover;
	}

	body.page-id-469 .uagb-block-gmgy6bxc .uagb-ifb-title,
	body.page-id-469 .uagb-block-e1ed06a1 .uagb-ifb-title {
		font-size: 15px !important;
		line-height: 1.3 !important;
	}

	body.page-id-469 .uagb-block-gmgy6bxc .uagb-ifb-desc,
	body.page-id-469 .uagb-block-e1ed06a1 .uagb-ifb-desc {
		font-size: 13px;
		line-height: 1.35;
	}

	/* Contact form: make the primary action easy to tap. */
	body.page-id-321 .wpcf7-submit {
		width: 100% !important;
		min-height: 44px;
	}

	/* Compact consent controls without reducing the required tap target size. */
	.cmplz-cookiebanner {
		padding: 12px 14px !important;
		grid-gap: 8px !important;
	}

	.cmplz-cookiebanner .cmplz-divider {
		margin-left: -14px;
		margin-right: -14px;
	}

	.cmplz-cookiebanner .cmplz-message {
		line-height: 1.35;
		margin-bottom: 0;
	}

	.cmplz-cookiebanner .cmplz-buttons {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px !important;
	}

	.cmplz-cookiebanner .cmplz-buttons .cmplz-btn {
		min-height: 44px;
		padding: 8px;
	}

	.cmplz-cookiebanner .cmplz-buttons .cmplz-view-preferences,
	.cmplz-cookiebanner .cmplz-buttons .cmplz-save-preferences {
		grid-column: 1 / -1;
	}

	.cmplz-cookiebanner .cmplz-close {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin: -12px -10px -12px 0;
	}

	/* Avoid floating contact buttons competing visually with the consent modal. */
	body.cmplz-banner-active .joinchat,
	body.cmplz-banner-active #callnowbutton,
	body:has(.cmplz-cookiebanner.cmplz-show) .joinchat,
	body:has(.cmplz-cookiebanner.cmplz-show) #callnowbutton,
	#cmplz-cookiebanner-container:has(.cmplz-cookiebanner.cmplz-show) ~ .joinchat,
	#cmplz-cookiebanner-container:has(.cmplz-cookiebanner.cmplz-show) ~ #callnowbutton {
		display: none !important;
	}
}
