/* ==========================================================================
   Welcome Mat Ad — fullscreen first-visit popup
   ========================================================================== */

.ftn-welcome-mat[hidden] {
	display: none !important;
}

.ftn-welcome-mat {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.ftn-welcome-mat.is-open {
	opacity: 1;
}

.ftn-welcome-mat__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.7);
	cursor: pointer;
}

.ftn-welcome-mat__dialog {
	position: relative;
	z-index: 1;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
	width: 100%;
	max-width: var(--ftn-wm-max-width, 800px);
	max-height: 90vh;
	overflow: auto;
	transform: translateY(20px) scale(0.98);
	transition: transform 0.3s ease;
}

.ftn-welcome-mat.is-open .ftn-welcome-mat__dialog {
	transform: translateY(0) scale(1);
}

.ftn-welcome-mat__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.ftn-welcome-mat__close:hover,
.ftn-welcome-mat__close:focus {
	background: rgba(0, 0, 0, 0.85);
	outline: none;
}

.ftn-welcome-mat__content {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 100px;
	max-height: var(--ftn-wm-max-height, 600px);
}

/* Make sure ad images are responsive */
.ftn-welcome-mat__content img {
	display: block;
	max-width: 100%;
	height: auto;
	max-height: var(--ftn-wm-max-height, 600px);
	object-fit: contain;
}

/* AdRotate wrapper resets */
.ftn-welcome-mat__content .adrotate-group,
.ftn-welcome-mat__content .a-single {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin: 0;
	padding: 0;
}

/* Lock page scroll while open. Apply to both html and body so it wins
   over theme styles that may set overflow on either. */
html.ftn-welcome-mat-open,
body.ftn-welcome-mat-open {
	overflow: hidden !important;
	touch-action: none;
}

/* Mobile: tighter padding around the dialog */
@media (max-width: 640px) {
	.ftn-welcome-mat {
		padding: 10px;
	}

	.ftn-welcome-mat__dialog {
		max-width: 95vw;
	}

	.ftn-welcome-mat__close {
		top: 6px;
		right: 6px;
		width: 32px;
		height: 32px;
		font-size: 22px;
	}
}
