/**
 * Strategic Core — Theme Builder runtime: popups (<dialog>) and mega menus.
 */

/* --------------------------------------------------------------------------
 * Popups
 * ------------------------------------------------------------------------ */
.stc-popup {
	width: min(var(--stc-popup-width, 640px), calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 32px);
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: var(--st-site-bg, #fff);
	color: inherit;
	box-shadow: 0 30px 80px -30px rgba(14, 19, 31, 0.6);
	overflow: auto;
}

.stc-popup::backdrop {
	background: rgba(14, 19, 31, 0.6);
	backdrop-filter: blur(3px);
}

.stc-popup[open] {
	animation: stc-popup-in 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes stc-popup-in {
	from {
		opacity: 0;
		transform: translateY(16px) scale(0.98);
	}
}

.stc-popup--bottom-right,
.stc-popup--bottom-left {
	position: fixed;
	inset: auto 24px 24px auto;
	margin: 0;
}

.stc-popup--bottom-left {
	inset: auto auto 24px 24px;
}

.stc-popup--top {
	position: fixed;
	inset: 0 0 auto;
	width: 100%;
	max-width: none;
	margin: 0;
	border-radius: 0;
}

.stc-popup--bottom-right::backdrop,
.stc-popup--bottom-left::backdrop,
.stc-popup--top::backdrop {
	background: transparent;
	backdrop-filter: none;
}

.stc-popup__close {
	position: sticky;
	top: 10px;
	z-index: 5;
	float: right;
	width: 36px;
	height: 36px;
	margin: 10px 10px -46px 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(14, 19, 31, 0.08);
	color: inherit;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.stc-popup__close:hover,
.stc-popup__close:focus-visible {
	background: rgba(14, 19, 31, 0.16);
}

/* --------------------------------------------------------------------------
 * Mega menu
 * ------------------------------------------------------------------------ */
.stc-has-mega {
	position: static !important;
}

.stc-mega-menu {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 1000;
	visibility: hidden;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
	background: var(--st-site-bg, #fff);
	box-shadow: 0 24px 50px -24px rgba(14, 19, 31, 0.35);
}

.stc-has-mega:hover > .stc-mega-menu,
.stc-has-mega:focus-within > .stc-mega-menu,
.stc-has-mega.is-open > .stc-mega-menu {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

@media (max-width: 1024px) {
	.stc-mega-menu {
		position: static;
		display: none;
		visibility: visible;
		opacity: 1;
		transform: none;
		box-shadow: none;
	}

	.stc-has-mega.is-open > .stc-mega-menu {
		display: block;
	}
}

@media (prefers-reduced-motion: reduce) {
	.stc-popup[open] {
		animation: none;
	}

	.stc-mega-menu {
		transition: none;
	}
}
