/* h2o CoverMe ROI Calculator
 * rem follows the site root (10.8px desktop, 9px at <=1024px), as the rest of the site.
 * The calculator itself is Noel's page in an iframe (calculator/index.html), so none of these rules reach it. */

.h2o-roi {
	--roi-green: var(--global-palette1, #1ce783);
	--roi-green-hover: var(--global-palette2, #18d277);
	--roi-dark: var(--global-palette3, #111111);
	--roi-dark-2: var(--global-palette4, #2a2a2a);
	--roi-grey: var(--global-palette6, #a1a1a1);
	--roi-line: #3d3d3d;
	--roi-white: var(--global-palette9, #ffffff);
	--roi-error: #ff9a8f;
	--roi-speed: .35s;
	font-family: inherit;
}

.h2o-roi .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
	overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---------- Tab (desktop) / bottom pill (mobile) ----------
 * Sized like the header Book a Demo button (4.33rem thick, 1.42rem / 500, round ends).
 * .h2o-roi prefix + :hover/:focus/:active so Kadence's button:focus/hover colours never win. */
.h2o-roi .h2o-roi-tab,
.h2o-roi .h2o-roi-tab:hover,
.h2o-roi .h2o-roi-tab:focus,
.h2o-roi .h2o-roi-tab:active {
	color: var(--roi-dark);
	background-color: var(--roi-green);
}
.h2o-roi .h2o-roi-tab {
	position: fixed;
	z-index: 9990;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	writing-mode: vertical-rl;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .6rem;
	width: 4.33rem;
	min-width: 40px;
	margin: 0;
	padding: 2.4rem 0;
	border: 0;
	border-radius: 3rem 0 0 3rem;
	font-family: inherit;
	font-size: max(14px, 1.42rem);
	font-weight: 500;
	line-height: 1;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	box-shadow: -2px 2px 12px rgba(17, 17, 17, .18);
	transition: background-color .2s, width .2s;
}
.h2o-roi .h2o-roi-tab:hover { background-color: var(--roi-green-hover); width: calc(4.33rem + 4px); }
.h2o-roi-tab-label { transform: rotate(180deg); }
.h2o-roi-tab-cta { display: none; }
.h2o-roi .h2o-roi-tab:focus { outline: none; }
.h2o-roi .h2o-roi-tab:focus-visible { outline: 3px solid var(--roi-dark); outline-offset: -6px; }

@media (max-width: 767px) {
	.h2o-roi .h2o-roi-tab {
		left: 50%; right: auto; top: auto; bottom: 0;
		transform: translateX(-50%);
		writing-mode: horizontal-tb;
		width: auto;
		min-width: 0;
		height: auto;
		min-height: 44px;
		padding: 0 22px env(safe-area-inset-bottom, 0px);
		border-radius: 14px 14px 0 0;
		font-size: 15px;
		white-space: nowrap;
		box-shadow: 0 -2px 12px rgba(17, 17, 17, .2);
	}
	.h2o-roi .h2o-roi-tab:hover { width: auto; }
	.h2o-roi-tab-label { transform: none; }
	.h2o-roi-tab-label::after { content: "\203A"; margin-left: 6px; font-size: 19px; line-height: 0; position: relative; top: 1px; }
	.h2o-roi .h2o-roi-tab:focus-visible { outline: 3px solid var(--roi-dark); outline-offset: -5px; }
	/* keep the end of the page clear of the bar: extra dark space at the foot of the sub-footer
	   (its palette3 background is on the row's inner container) */
	html.h2o-roi-has-bar .site-bottom-footer-wrap .site-footer-row-container-inner {
		padding-bottom: calc(44px + env(safe-area-inset-bottom, 0px));
	}
	/* fallback for a page without the Kadence footer */
	html.h2o-roi-has-bar body:not(:has(.site-bottom-footer-wrap)) { padding-bottom: calc(44px + env(safe-area-inset-bottom, 0px)); }
}

@media print { .h2o-roi--panel { display: none !important; } }

/* ---------- Overlay + panel ---------- */
.h2o-roi-overlay {
	position: fixed; inset: 0; z-index: 99980;
	background-color: rgba(0, 0, 0, .6);
	opacity: 0; visibility: hidden;
	transition: opacity var(--roi-speed), visibility 0s linear var(--roi-speed);
}
.h2o-roi--panel .h2o-roi-dialog {
	position: fixed; z-index: 99990;
	top: 0; right: 0; bottom: 0;
	width: min(100rem, 94vw);
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	transform: translateX(100%);
	visibility: hidden;
	transition: transform var(--roi-speed) ease, visibility 0s linear var(--roi-speed);
	box-shadow: -8px 0 30px rgba(0, 0, 0, .3);
}
/* logged-in admin bar sits above everything (z 99999) */
body.admin-bar .h2o-roi--panel .h2o-roi-dialog { top: 32px; }
@media (max-width: 782px) { body.admin-bar .h2o-roi--panel .h2o-roi-dialog { top: 46px; height: auto; } }
.h2o-roi.is-open .h2o-roi-overlay { opacity: 1; visibility: visible; transition: opacity var(--roi-speed); }
.h2o-roi.is-open .h2o-roi-dialog { transform: none; visibility: visible; transition: transform var(--roi-speed) ease; }
.h2o-roi.is-open .h2o-roi-tab { visibility: hidden; }

@media (max-width: 767px) {
	.h2o-roi--panel .h2o-roi-dialog {
		top: 0; width: 100%;
		height: 100%; height: 100dvh;
		transform: translateY(100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.h2o-roi-overlay, .h2o-roi--panel .h2o-roi-dialog, .h2o-roi.is-open .h2o-roi-overlay, .h2o-roi.is-open .h2o-roi-dialog, .h2o-roi .h2o-roi-tab { transition: none; }
}

/* scroll lock while open */
html.h2o-roi-lock, html.h2o-roi-lock body { overflow: hidden !important; }
html.h2o-roi-lock body { position: fixed; left: 0; right: 0; width: 100%; }

/* ---------- Panel content: Noel's calculator in an iframe ---------- */
.h2o-roi-dialog { background-color: #fafafa; }
.h2o-roi-frame, .h2o-roi-iframe { display: block; width: 100%; border: 0; }
.h2o-roi--panel .h2o-roi-iframe { min-height: 100%; }
.h2o-roi--inline .h2o-roi-iframe { min-height: 900px; }
.h2o-roi-sentinel { position: absolute; width: 1px; height: 1px; overflow: hidden; }
.h2o-roi-sentinel:focus { outline: none; }

.h2o-roi .h2o-roi-close,
.h2o-roi .h2o-roi-close:focus,
.h2o-roi .h2o-roi-close:active {
	/* sticky, so it stays in reach while the calculator scrolls */
	position: sticky; z-index: 2; top: 1.2rem;
	margin: 1.2rem 1.2rem -44px auto;
	display: flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; padding: 0;
	border: 0; border-radius: 50%;
	background-color: #fafafa; color: var(--roi-dark); box-shadow: none;
	cursor: pointer; transition: background-color .2s;
}
.h2o-roi .h2o-roi-close:hover { background-color: #e6e6e6; color: var(--roi-dark); }
.h2o-roi .h2o-roi-close:focus-visible { outline: 3px solid #000e82; outline-offset: 2px; }

/* loading note until the calculator has loaded (it normally loads in the background first) */
.h2o-roi-frame { position: relative; min-height: 100%; }
.h2o-roi-frame::before {
	content: "Loading the calculator\2026";
	position: absolute; top: 9rem; left: 0; right: 0;
	text-align: center; color: var(--global-palette5, #6b7280); font-size: 16px;
}
.h2o-roi-frame.is-loaded::before { content: none; }
.h2o-roi--panel .h2o-roi-iframe { opacity: 0; transition: opacity .2s; }
.h2o-roi-frame.is-loaded .h2o-roi-iframe { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .h2o-roi--panel .h2o-roi-iframe { transition: none; } }
