/* GazzIT Simple Popup Everywhere - base popup styles. All rules are scoped to .gazzit_simplepopup. */

.gazzit_simplepopup {
	position: relative;
}

.gazzit_simplepopup .splash {
	z-index: 99998;
	background: rgba(0, 0, 0, 0.5);
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
}

.gazzit_simplepopup.gsp-no-overlay .splash {
	display: none;
}

/*
 * The box. Offsets come from the popup settings as --gsp-top/bottom/left/
 * right on the wrapper; --gsp-t/b/l/r are the values actually used, so
 * they can be adapted on small screens.
 */
.gazzit_simplepopup .popup {
	--gsp-t: var(--gsp-top, 20px);
	--gsp-b: var(--gsp-bottom, 20px);
	--gsp-l: var(--gsp-left, 20px);
	--gsp-r: var(--gsp-right, 20px);
	z-index: 99999;
	position: fixed;
	top: 50%;
	right: auto;
	bottom: auto;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	width: 600px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	box-sizing: border-box;
	padding: 0;
	background: #fff;
	border: 1px #ccc solid;
	border-radius: 5px;
}

/* Inner scroll area: keeps the scrollbar thin and inside the box. */
.gazzit_simplepopup .gsp-body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	box-sizing: border-box;
	padding: 24px;
	border-radius: inherit;
	scrollbar-width: thin;
	scrollbar-color: rgba(127, 127, 127, 0.45) transparent;
}

.gazzit_simplepopup .gsp-body::-webkit-scrollbar {
	width: 10px;
	height: 10px;
}

.gazzit_simplepopup .gsp-body::-webkit-scrollbar-track {
	background: transparent;
	margin: 10px 0;
}

.gazzit_simplepopup .gsp-body::-webkit-scrollbar-thumb {
	background-color: rgba(127, 127, 127, 0.45);
	background-clip: padding-box;
	border: 3px solid transparent;
	border-radius: 10px;
}

.gazzit_simplepopup .gsp-body::-webkit-scrollbar-thumb:hover {
	background-color: rgba(127, 127, 127, 0.7);
}

/* Fixed positions (relative to the screen). */
.gazzit_simplepopup.gsp-pos-top .popup,
.gazzit_simplepopup.gsp-pos-top-left .popup,
.gazzit_simplepopup.gsp-pos-top-right .popup {
	top: var(--gsp-t);
	max-height: calc(100vh - var(--gsp-t) - 16px);
	max-height: calc(100dvh - var(--gsp-t) - 16px);
}

.gazzit_simplepopup.gsp-pos-bottom .popup,
.gazzit_simplepopup.gsp-pos-bottom-left .popup,
.gazzit_simplepopup.gsp-pos-bottom-right .popup {
	top: auto;
	bottom: var(--gsp-b);
	max-height: calc(100vh - var(--gsp-b) - 16px);
	max-height: calc(100dvh - var(--gsp-b) - 16px);
}

.gazzit_simplepopup.gsp-pos-left .popup,
.gazzit_simplepopup.gsp-pos-top-left .popup,
.gazzit_simplepopup.gsp-pos-bottom-left .popup {
	left: var(--gsp-l);
	max-width: calc(100vw - var(--gsp-l) - 16px);
}

.gazzit_simplepopup.gsp-pos-right .popup,
.gazzit_simplepopup.gsp-pos-top-right .popup,
.gazzit_simplepopup.gsp-pos-bottom-right .popup {
	left: auto;
	right: var(--gsp-r);
	max-width: calc(100vw - var(--gsp-r) - 16px);
}

.gazzit_simplepopup.gsp-pos-top .popup,
.gazzit_simplepopup.gsp-pos-bottom .popup {
	transform: translateX(-50%);
}

.gazzit_simplepopup.gsp-pos-left .popup,
.gazzit_simplepopup.gsp-pos-right .popup {
	transform: translateY(-50%);
}

.gazzit_simplepopup.gsp-pos-top-left .popup,
.gazzit_simplepopup.gsp-pos-top-right .popup,
.gazzit_simplepopup.gsp-pos-bottom-left .popup,
.gazzit_simplepopup.gsp-pos-bottom-right .popup {
	transform: none;
}

/*
 * Absolute mode: the popup opens where the visitor currently is on the page
 * (public_global.js sets its top) and then scrolls away with the page. The
 * wrapper is moved to the end of <body> on open, so it spans the document.
 */
.gazzit_simplepopup.gsp-mode-absolute {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 0;
	z-index: 99999;
}

.gazzit_simplepopup.gsp-mode-absolute .popup {
	position: absolute;
	top: var(--gsp-t);
	right: auto;
	bottom: auto;
	left: 50%;
	transform: translateX(-50%);
	max-height: calc(100vh - var(--gsp-t) - 16px);
	max-height: calc(100dvh - var(--gsp-t) - 16px);
}

.gazzit_simplepopup.gsp-mode-absolute.gsp-pos-left .popup {
	left: var(--gsp-l);
	transform: none;
	max-width: calc(100vw - var(--gsp-l) - 16px);
}

.gazzit_simplepopup.gsp-mode-absolute.gsp-pos-right .popup {
	left: auto;
	right: var(--gsp-r);
	transform: none;
	max-width: calc(100vw - var(--gsp-r) - 16px);
}

.gazzit_simplepopup .popup:focus,
.gazzit_simplepopup .popup:focus-visible {
	/* The dialog itself only receives focus programmatically; the close
	   button keeps its own visible focus ring. */
	outline: none;
}

.gazzit_simplepopup .popup .close {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	right: 10px;
	top: 10px;
	margin: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 26px;
	height: 26px;
	padding: 0 10px;
	box-sizing: border-box;
	cursor: pointer;
	border: none;
	border-radius: 5px;
	background: transparent;
	box-shadow: none;
	color: #000000;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	text-transform: none;
	letter-spacing: normal;
	z-index: 10;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.gazzit_simplepopup .popup .close:hover {
	background: rgba(0, 0, 0, 0.08);
}

.gazzit_simplepopup .popup .close:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.gazzit_simplepopup .popup .close svg {
	display: block;
	width: 1.1em;
	height: 1.1em;
	pointer-events: none;
}

/*
 * Small screens: large offsets are reduced so the popup stays on screen, and
 * side/corner positions stretch to (almost) the full width of the screen.
 */
@media (max-width: 767px) {
	.gazzit_simplepopup .popup {
		--gsp-t: min(var(--gsp-top, 20px), 10vh);
		--gsp-b: min(var(--gsp-bottom, 20px), 10vh);
		--gsp-l: 12px;
		--gsp-r: 12px;
		max-width: calc(100vw - 24px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.gazzit_simplepopup .popup .close {
		transition: none;
	}
}
