/**
 * Glider Popups – front-end styles.
 *
 * Bottom-right card with image on the left and content on the right.
 * Colours pull from the theme's CSS custom properties where available,
 * falling back to the GliderTech palette.
 */

.gp-popups-root {
	position: fixed;
	z-index: 9999;
	display: flex;
	gap: 16px;
	max-width: calc(100vw - 48px);
	pointer-events: none;
}

/* Corner placements. column-reverse keeps the newest popup nearest a
   bottom corner; column keeps it nearest a top corner. */
.gp-popups-root--bottom-right {
	right: 24px;
	bottom: 24px;
	flex-direction: column-reverse;
	align-items: flex-end;
}

.gp-popups-root--bottom-left {
	left: 24px;
	bottom: 24px;
	flex-direction: column-reverse;
	align-items: flex-start;
}

.gp-popups-root--top-right {
	right: 24px;
	top: 24px;
	flex-direction: column;
	align-items: flex-end;
}

.gp-popups-root--top-left {
	left: 24px;
	top: 24px;
	flex-direction: column;
	align-items: flex-start;
}

/* Centered popups are not positioned by the root; each one lives inside a
   full-screen dimmed overlay (.gp-popup-overlay). */
.gp-popups-root--center {
	position: static;
	display: contents;
}

.gp-popup-overlay {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(0, 0, 0, 0.6);
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: auto;
}

.gp-popup-overlay.is-visible {
	opacity: 1;
}

.gp-popup {
	pointer-events: auto;
	display: flex;
	align-items: stretch;
	width: 440px;
	max-width: 100%;
	background: var(--color-light, #ffffff);
	color: var(--color-dark, #181818);
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
	overflow: hidden;
	position: relative;

	/* Entrance animation */
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.gp-popup.is-visible {
	opacity: 1;
	transform: translateY(0);
}

.gp-popup__close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 28px;
	height: 28px;
	line-height: 26px;
	text-align: center;
	font-size: 22px;
	color: var(--color-dark, #181818);
	background: rgba(255, 255, 255, 0.85);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
	z-index: 2;
	transition: background 0.2s ease, color 0.2s ease;
}

.gp-popup__close:hover,
.gp-popup__close:focus {
	background: var(--color-primary, #e31c79);
	color: #ffffff;
	outline: none;
}

.gp-popup__media {
	flex: 0 0 40%;
	max-width: 40%;
	background: var(--color-off-white, #f7f7f7);
}

.gp-popup__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gp-popup__content {
	flex: 1 1 auto;
	padding: 20px 22px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}

.gp-popup--no-image .gp-popup__content {
	padding-right: 36px;
}

.gp-popup__title {
	margin: 0;
	font-size: 18px;
	line-height: 1.25;
	color: var(--color-dark, #181818);
}

.gp-popup__body {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
}

.gp-popup__body p {
	margin: 0 0 8px;
}

.gp-popup__body p:last-child {
	margin-bottom: 0;
}

.gp-popup__cta {
	align-self: flex-start;
	margin-top: 4px;
	display: inline-block;
	padding: 8px 22px;
	background: var(--color-primary, #e31c79);
	color: #ffffff;
	border-radius: 999px;
	text-decoration: none;
	font-weight: 600;
	font-size: 14px;
	transition: filter 0.2s ease;
}

.gp-popup__cta:hover,
.gp-popup__cta:focus {
	filter: brightness(0.92);
	color: #ffffff;
}

/* Mobile: stack image on top, full-width card */
@media (max-width: 600px) {
	.gp-popups-root {
		right: 12px;
		left: 12px;
		bottom: 12px;
		max-width: none;
	}

	.gp-popup {
		width: 100%;
		flex-direction: column;
	}

	.gp-popup__media {
		flex-basis: auto;
		max-width: 100%;
		height: 140px;
	}
}
