/*
 * Booking sheet on phones (inc/meeting-sheet.php; Mike 2026-10-02). Under 768px the #smartsites-meeting HubSpot modal
 * is a full-screen navy sheet: the mobile menu's top bar (57px, logo at left, 44px X at right; values copied from
 * header-v2.css .hdr2m__top / .hdr2m__logo / .hdr2m__close and the .hdr2__menu background, so the top 57px match the
 * open menu pixel for pixel), then the HubSpot iframe fills the rest. Email step: HubSpot's card centred on its own
 * frame colour (#034b7d). Calendar step (.is-sized, footer-v2.js): the iframe is exactly the remaining height, so the
 * only scroll area is HubSpot's own. 768px and up: nothing here applies (footer-v2.css popup unchanged).
 * footer-v2.css's 575px rules load in the same footer and use #smartsites-meeting (1 id + 1 class): every rule here
 * starts with #smartsites-meeting.meeting-modal so it wins whatever the load order, with !important where theirs has it.
 * Loaded async (media=print swap): the modal is display:none until opened.
 */
@media (max-width: 767.98px) {
	html.ss-meet-sheet,
	html.ss-meet-sheet body {
		overflow: hidden !important;
		overscroll-behavior: none;
	}

	/* overlay never scrolls: the sheet is exactly the viewport */
	#smartsites-meeting.meeting-modal {
		padding: 0 !important;
		overflow: hidden !important;
		overscroll-behavior: contain;
	}

	#smartsites-meeting.meeting-modal .modal-dialog {
		display: block;
		width: 100%;
		max-width: none;
		height: 100vh;
		height: 100dvh;
		min-height: 0;
		margin: 0;
		padding: 0;
	}

	/* same box + background as the open menu (header-v2.css .hdr2__menu) */
	#smartsites-meeting.meeting-modal .modal-content {
		display: flex;
		flex-direction: column;
		width: 100%;
		height: 100%;
		margin: 0;
		padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
		border: 0;
		border-radius: 0;
		box-shadow: none;
		background-color: var(--ss-navy-deep, #001b2e);
		background-image: radial-gradient(120% 40% at 0% 0%, rgba(150, 190, 235, .10), rgba(150, 190, 235, 0) 70%);
		color: #fff;
		line-height: 1.3;
		font-family: "Proxima Nova", "Helvetica Neue", Arial, sans-serif;
		-webkit-font-smoothing: antialiased;
	}

	/* the popup's round corner X; the sheet uses the top bar's */
	#smartsites-meeting.meeting-modal .modal-content > .close {
		display: none !important;
	}

	/* top bar = .hdr2m__top at phone width */
	#smartsites-meeting.meeting-modal .mmsheet__top {
		display: flex !important;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		flex: none;
		height: 57px;
		padding: 0 16px;
		box-sizing: border-box;
	}

	#smartsites-meeting.meeting-modal .mmsheet__logo {
		display: flex;
		align-items: center;
		min-height: 44px;
		line-height: 0;
	}

	#smartsites-meeting.meeting-modal .mmsheet__logo img {
		width: auto;
		max-width: none;
		height: 30px;
	}

	#smartsites-meeting.meeting-modal .mmsheet__close {
		position: relative;
		flex: none;
		width: 44px;
		height: 44px;
		margin: 0;
		padding: 0;
		border: 1px solid rgba(255, 255, 255, .25);
		border-radius: 10px;
		background: none;
		box-shadow: none;
		color: inherit;
		cursor: pointer;
		-webkit-appearance: none;
		appearance: none;
		-webkit-tap-highlight-color: transparent;
	}

	#smartsites-meeting.meeting-modal .mmsheet__close::before,
	#smartsites-meeting.meeting-modal .mmsheet__close::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 12px;
		right: 12px;
		height: 2px;
		margin-top: -1px;
		border-radius: 2px;
		background: #fff;
		transform: rotate(45deg);
	}

	#smartsites-meeting.meeting-modal .mmsheet__close::after {
		transform: rotate(-45deg);
	}

	#smartsites-meeting.meeting-modal .mmsheet__top a:focus-visible,
	#smartsites-meeting.meeting-modal .mmsheet__close:focus-visible {
		outline: 2px solid var(--ss-gold, #f6b543);
		outline-offset: 2px;
	}

	#smartsites-meeting.meeting-modal .mmsheet__top :focus:not(:focus-visible) {
		outline: 0;
	}

	/* the scheduler fills everything under the bar */
	#smartsites-meeting.meeting-modal .iframe-wrapper {
		display: flex;
		flex-direction: column;
		flex: 1 1 auto;
		height: auto !important;
		min-height: 0 !important;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		overscroll-behavior: contain;
		border-radius: 0;
		background: #034b7d; /* HubSpot's frame colour: the email step's card sits on it */
	}

	#smartsites-meeting.meeting-modal .iframe-wrapper:has(.is-sized) {
		background: #fff;
	}

	#smartsites-meeting.meeting-modal .meetings-iframe-container {
		flex: none;
		width: 100%;
		background: transparent;
	}

	/* email step: HubSpot's card, centred, at most the popup's 400px (wider frames get HubSpot's wide layout, which
	   needs more height). Height = HubSpot's card + its 20px frame at this iframe width (467px at 328, 481 at 358, 500
	   at 400: .45 x width + 320), so the frame never scrolls inside itself. */
	#smartsites-meeting.meeting-modal .meetings-iframe-container:not(.is-sized) {
		max-width: 400px;
		margin: auto;
	}

	#smartsites-meeting.meeting-modal .meetings-iframe-container:not(.is-sized) iframe {
		height: min(500px, calc(45vw + 320px)) !important;
		min-height: 0 !important;
	}

	/* calendar step: exactly the space left, HubSpot scrolls inside */
	#smartsites-meeting.meeting-modal .meetings-iframe-container.is-sized {
		flex: 1 1 auto;
		height: 100% !important;
	}

	#smartsites-meeting.meeting-modal .meetings-iframe-container.is-sized iframe {
		height: 100% !important;
		min-height: 0 !important;
	}
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
	#smartsites-meeting.meeting-modal.fade {
		transition: none;
	}
}
