/**
 * Front-end styles for Visual Popups.
 *
 * Per-popup colors, width and radius are supplied as inline custom
 * properties (--vpopup-bg, --vpopup-text, --vpopup-width, --vpopup-radius).
 * Defaults below keep it neutral so it sits well inside any theme.
 */

.vpopup-root {
	--vpopup-bg: #ffffff;
	--vpopup-text: #1a1a1a;
	--vpopup-width: 480px;
	--vpopup-radius: 8px;
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	pointer-events: none;
}

.vpopup-root[hidden] {
	display: none;
}

/* Overlay */
.vpopup-overlay {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.55 );
	pointer-events: auto;
}

/* The popup box */
.vpopup-box {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: var( --vpopup-width );
	background: var( --vpopup-bg );
	color: var( --vpopup-text );
	border-radius: var( --vpopup-radius );
	box-shadow: 0 18px 60px rgba( 0, 0, 0, 0.28 );
	padding: 32px 28px;
	pointer-events: auto;
	max-height: 90vh;
	overflow-y: auto;
}

.vpopup-content {
	font-size: 16px;
	line-height: 1.6;
}

.vpopup-content > :first-child { margin-top: 0; }
.vpopup-content > :last-child { margin-bottom: 0; }

/* Close button */
.vpopup-close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 34px;
	height: 34px;
	border: 0;
	background: transparent;
	color: currentColor;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	opacity: 0.6;
	border-radius: 50%;
}

.vpopup-close:hover,
.vpopup-close:focus {
	opacity: 1;
	background: rgba( 0, 0, 0, 0.07 );
}

/* ---- Layouts ---- */

/* Centered modal */
.vpopup-layout-center {
	align-items: center;
	justify-content: center;
	padding: 20px;
}

/* Top bar */
.vpopup-layout-top_bar {
	align-items: flex-start;
	justify-content: center;
}
.vpopup-layout-top_bar .vpopup-box {
	max-width: 100%;
	width: 100%;
	border-radius: 0;
	padding: 16px 48px 16px 24px;
	max-height: none;
}

/* Bottom bar */
.vpopup-layout-bottom_bar {
	align-items: flex-end;
	justify-content: center;
}
.vpopup-layout-bottom_bar .vpopup-box {
	max-width: 100%;
	width: 100%;
	border-radius: 0;
	padding: 16px 48px 16px 24px;
	max-height: none;
}

/* Bottom-right corner box */
.vpopup-layout-corner {
	align-items: flex-end;
	justify-content: flex-end;
	padding: 20px;
}
.vpopup-layout-corner .vpopup-box {
	max-width: min( var( --vpopup-width ), 380px );
}

/* ---- Animations ---- */

.vpopup-root[data-state="open"].vpopup-anim-fade .vpopup-box,
.vpopup-root[data-state="open"].vpopup-anim-fade .vpopup-overlay {
	animation: vpopup-fade 0.28s ease forwards;
}

.vpopup-root[data-state="open"].vpopup-anim-slide .vpopup-box {
	animation: vpopup-slide 0.32s cubic-bezier( 0.16, 1, 0.3, 1 ) forwards;
}

.vpopup-root[data-state="open"].vpopup-anim-slide .vpopup-overlay {
	animation: vpopup-fade 0.28s ease forwards;
}

@keyframes vpopup-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes vpopup-slide {
	from { opacity: 0; transform: translateY( 24px ); }
	to   { opacity: 1; transform: translateY( 0 ); }
}

@media ( prefers-reduced-motion: reduce ) {
	.vpopup-box,
	.vpopup-overlay {
		animation: none !important;
	}
}

/* Small screens: full-width bars and tighter modals */
@media screen and ( max-width: 600px ) {
	.vpopup-layout-center,
	.vpopup-layout-corner {
		padding: 12px;
	}
	.vpopup-layout-corner .vpopup-box {
		max-width: 100%;
	}
}
