/* Book Intro Call → GoHighLevel calendar popup. See includes/intro-call-booking.php. */

/* Closed, it stays in place but transparent and click-through (not display:none or off-screen), so the calendar loads,
   lays itself out and is already drawn when the popup opens. */
.ioi-bk {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	box-sizing: border-box;
	opacity: 0;
	pointer-events: none;
}
/* GoHighLevel's script sets pointer-events:auto inline on the iframe; !important keeps the closed popup click-through. */
.ioi-bk:not(.is-open),
.ioi-bk:not(.is-open) * {
	pointer-events: none !important;
}
.ioi-bk.is-open {
	opacity: 1;
	pointer-events: auto;
	background: rgba(8, 8, 10, 0.62);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	transition: opacity 0.2s ease;
}
html.ioi-bk-lock,
html.ioi-bk-lock body {
	overflow: hidden;
}

.ioi-bk__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1040px, 100%);
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	box-sizing: border-box;
	padding-top: 56px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
	overflow: hidden;
	outline: none;
}
/* The calendar scrolls in here, so the X above it stays in view. */
.ioi-bk__body {
	position: relative;
	flex: 1 1 auto;
	/* Keeps the popup full size while GoHighLevel's script holds the calendar hidden during loading. */
	min-height: min(600px, calc(100vh - 120px));
	min-height: min(600px, calc(100dvh - 120px));
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 0 16px 16px;
}
/* GoHighLevel's script sets the real height inline; this height is only used if that script is blocked. */
.ioi-bk__body iframe {
	display: block;
	width: 100%;
	height: min(800px, calc(100vh - 120px));
	height: min(800px, calc(100dvh - 120px));
	border: 0;
}

/* Higher specificity than the theme's global button styles. */
.ioi-bk .ioi-bk__close[type="button"] {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	box-shadow: none;
	color: #000;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.ioi-bk .ioi-bk__close[type="button"]:hover,
.ioi-bk .ioi-bk__close[type="button"]:focus-visible {
	background: #e8e8e8;
	color: #000;
}
.ioi-bk .ioi-bk__close[type="button"]:focus-visible {
	outline: 2px solid #000;
	outline-offset: 2px;
}
.ioi-bk__close svg {
	width: 20px;
	height: 20px;
	pointer-events: none;
}

.ioi-bk__loader {
	position: absolute;
	top: 90px;
	left: 0;
	right: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	color: #555;
	font-size: 15px;
	text-align: center;
}
.ioi-bk__loader[hidden] {
	display: none;
}
.ioi-bk__spinner {
	width: 28px;
	height: 28px;
	border: 3px solid #e4e4e4;
	border-top-color: #000;
	border-radius: 50%;
	animation: ioi-bk-spin 0.8s linear infinite;
}
.ioi-bk__fallback {
	color: inherit;
	text-decoration: underline;
}
@keyframes ioi-bk-spin {
	to {
		transform: rotate(360deg);
	}
}

.ioi-bk-reopen-wrap {
	margin-top: 16px;
}

@media (max-width: 600px) {
	.ioi-bk {
		padding: 8px;
	}
	.ioi-bk__panel {
		max-height: calc(100vh - 16px);
		max-height: calc(100dvh - 16px);
		padding-top: 52px;
		border-radius: 10px;
	}
	.ioi-bk__body {
		padding: 0 4px 8px;
	}
}
@media (prefers-reduced-motion: reduce) {
	.ioi-bk.is-open {
		transition: none;
	}
	.ioi-bk__spinner {
		animation-duration: 2s;
	}
}
