/**
 * mod_image_text_link — timed popup with a minimized balloon.
 *
 * Served separately from the module package (the module manifest does not
 * include this file). The popup shell intentionally reuses the site's
 * .form-popup / .form-popup__content and .buy-btn templates.
 */

.mod-image-text-link {
	position: relative;
	z-index: 9990;
}

/* The hidden attribute must win over the display rules below. */
.mod-image-text-link [hidden] {
	display: none !important;
}

/* Page overlay */
.mod-image-text-link__overlay {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	background-color: rgba(0, 0, 0, 0.55);
}

/* Popup shell, centered in the viewport.
 * When a background image is present, the JS sets an explicit width/height
 * that preserves the image's aspect ratio and fits the viewport. */
.mod-image-text-link .mod-image-text-link__popup {
	position: fixed;
	top: 50%;
	left: 50%;
	z-index: 2;
	display: flex;
	flex-direction: column;
	width: calc(100% - 32px);
	max-width: 464px;
	height: auto;
	min-height: 360px;
	max-height: calc(100vh - 32px);
	margin: 0;
	padding: 0;
	overflow: hidden;
	background-color: #292d32;
	border-radius: 12px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
	transform: translate(-50%, -50%);
}

/* Background image layer. */
.mod-image-text-link__bg {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 0;
	overflow: hidden;
}

.mod-image-text-link__bg-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Content sits above the image; the CTA is pinned to the bottom edge. */
.mod-image-text-link .mod-image-text-link__popup .mod-image-text-link__content {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	box-sizing: border-box;
	margin: 0;
	padding: 24px;
	overflow-x: hidden;
	overflow-y: auto;
}

.mod-image-text-link__footer {
	margin: 0;
}

/* Close control inside the popup. */
.mod-image-text-link__close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	line-height: 1;
	cursor: pointer;
}

.mod-image-text-link__balloon {
	position: fixed;
	right: 20px;
    bottom: 220px;
	z-index: 3;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background-color: #fff;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.mod-image-text-link__balloon-open {
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	padding: 0;
	overflow: hidden;
	border: 2px solid #fff;
	border-radius: 50%;
	background-color: #292d32;
	line-height: 0;
	cursor: pointer;
}

.mod-image-text-link__balloon-image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mod-image-text-link__balloon-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: #fff;
	font-size: 32px;
	line-height: 1;
}

.mod-image-text-link__balloon-open:focus {
	outline: 2px solid #292d32;
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.mod-image-text-link .mod-image-text-link__popup .mod-image-text-link__content {
		padding: 20px;
	}

	.mod-image-text-link__text {
		font-size: 20px;
	}

	.mod-image-text-link__balloon {
		right: 19px;
        bottom: 162px;
		width: 60px;
		height: 60px;
	}
}
