/* ==========================================================================
   Security notice popup (inc/security-popup.php)
   Uses Avada global options (CSS vars) so it follows the site design.
   ========================================================================== */

.hsp-overlay {
	--hsp-brand: var(--button_gradient_top_color, #332c66);
	--hsp-brand-hover: var(--button_gradient_top_color_hover, #251f4d);
	--hsp-brand-text: var(--button_accent_color, #fff);
	--hsp-accent: var(--primary_color, #67c1bf);
	--hsp-heading: var(--h2_typography-color, #212934);
	--hsp-text: var(--awb-text-color, var(--awb-color7, #333));
	--hsp-surface: var(--awb-color1, #fff);
	--hsp-muted-surface: var(--awb-color2, #f9f9fb);
	--hsp-border: var(--awb-color4, #e2e2e2);
	--hsp-font: var(--body_typography-font-family, Assistant, Arial, sans-serif);
	--hsp-heading-font: var(--h2_typography-font-family, var(--hsp-font));

	position: fixed;
	inset: 0;
	/* Same max value as the cookie bar; rendered later in the DOM, so it sits above it. */
	z-index: 2147483647;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(33, 41, 52, 0.65);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
	opacity: 0;
	transition: opacity 0.3s ease;
	font-family: var(--hsp-font);
}

.hsp-overlay[hidden] {
	display: none;
}

.hsp-overlay.is-visible {
	opacity: 1;
}

html.hsp-lock,
html.hsp-lock body {
	overflow: hidden !important;
}

.hsp-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 620px;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	background: var(--hsp-surface);
	color: var(--hsp-text);
	border-radius: 8px;
	border-top: 5px solid var(--hsp-accent);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	text-align: right;
	overflow: hidden;
	transform: translateY(16px);
	transition: transform 0.3s ease;
}

.hsp-overlay.is-visible .hsp-dialog {
	transform: none;
}

.hsp-dialog:focus {
	outline: none;
}

/* Header */
.hsp-header {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 24px 28px 16px;
}

.hsp-icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: var(--hsp-brand);
	color: var(--hsp-brand-text);
}

.hsp-dialog .hsp-title {
	margin: 0;
	padding: 0;
	font-family: var(--hsp-heading-font);
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--hsp-heading);
}

/* Body */
.hsp-body {
	padding: 0 28px 8px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.hsp-dialog .hsp-intro {
	margin: 0 0 16px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.5;
}

.hsp-dialog .hsp-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.hsp-dialog .hsp-list li {
	position: relative;
	margin: 0 0 10px;
	padding: 12px 44px 12px 14px;
	font-size: 16px;
	line-height: 1.5;
	background: var(--hsp-muted-surface);
	border: 1px solid var(--hsp-border);
	border-radius: 6px;
}

.hsp-dialog .hsp-list li::before {
	content: "";
	position: absolute;
	top: 14px;
	right: 14px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--hsp-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.hsp-item-title {
	display: block;
	margin: 0 0 2px;
	font-weight: 700;
	color: var(--hsp-heading);
}

.hsp-item-text {
	display: block;
}

.hsp-ltr {
	direction: ltr;
	unicode-bidi: isolate;
	font-weight: 700;
	white-space: nowrap;
}

.hsp-dialog a.hsp-ltr {
	color: var(--hsp-brand);
	text-decoration: underline;
}

.hsp-dialog a.hsp-ltr:hover,
.hsp-dialog a.hsp-ltr:focus-visible {
	color: var(--hsp-brand-hover);
}

/* Footer / button – mirrors the cookie bar & Avada button styling */
.hsp-footer {
	display: flex;
	justify-content: center;
	padding: 16px 28px 24px;
	border-top: 1px solid var(--hsp-border);
	background: var(--hsp-surface);
}

.hsp-dialog .hsp-button {
	min-width: 200px;
	height: 48px;
	padding: 0 40px;
	font-family: var(--hsp-font);
	font-size: 18px;
	font-weight: 600;
	line-height: 1;
	color: var(--hsp-brand-text);
	background: var(--hsp-brand);
	border: 1px solid var(--hsp-brand);
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.hsp-dialog .hsp-button:focus {
	outline: none;
}

.hsp-dialog .hsp-button:hover,
.hsp-dialog .hsp-button:focus-visible {
	background: var(--hsp-brand-hover);
	color: var(--button_accent_hover_color, var(--hsp-brand-text));
	border-color: var(--button_border_hover_color, var(--hsp-brand-hover));
}

.hsp-dialog .hsp-button:focus-visible {
	outline: 3px solid var(--hsp-accent);
	outline-offset: 2px;
}

/* Mobile */
@media screen and (max-width: 767px) {
	.hsp-overlay {
		padding: 12px;
	}

	.hsp-header {
		padding: 20px 18px 12px;
		gap: 12px;
	}

	.hsp-icon {
		width: 44px;
		height: 44px;
	}

	.hsp-dialog .hsp-title {
		font-size: 21px;
	}

	.hsp-body {
		padding: 0 18px 6px;
	}

	.hsp-dialog .hsp-intro {
		font-size: 16px;
	}

	.hsp-dialog .hsp-list li {
		font-size: 15px;
		padding: 10px 40px 10px 12px;
	}

	.hsp-dialog .hsp-list li::before {
		top: 12px;
		right: 12px;
	}

	.hsp-ltr {
		white-space: normal;
		word-break: break-all;
	}

	.hsp-footer {
		padding: 14px 18px 18px;
	}

	.hsp-dialog .hsp-button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hsp-overlay,
	.hsp-dialog,
	.hsp-dialog .hsp-button {
		transition: none;
	}
}
