/*
 * Live preview popup, the same one as the Wooprex Marketplace (wooprex-child/assets/marketplace/preview.css).
 * Site values only: Manrope, #131313, cream #fcf6ef, #bdbab4 text on dark, the hero's background, 30px pills.
 */
html.wx-preview-open,
html.wx-preview-open body {
	overflow: hidden;
}

.wx-preview {
	position: fixed;
	inset: 0;
	z-index: 99995; /* over the header and the cookie box, under the sign-in popup */
	display: flex;
	flex-direction: column;
	background: radial-gradient(900px 500px at 80% 20%, #1f1f1f 0%, #0e0e0e 60%);
	color: #fcf6ef;
	font-family: "Manrope", sans-serif;
	animation: wx-preview-in .2s ease;
}

.wx-preview[hidden] {
	display: none;
}

@keyframes wx-preview-in {
	from {
		opacity: 0;
	}
}

/* top bar */
.wx-preview__bar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 16px;
	flex: none;
	height: 72px;
	padding: 0 20px 0 24px;
	border-bottom: 1px solid rgba(252, 246, 239, .12);
	background: #131313;
}

.wx-preview__brand {
	display: flex;
	align-items: center;
	gap: 18px;
	min-width: 0;
}

.wx-preview .wx-preview__logo {
	display: block;
	flex: none;
	padding-right: 18px;
	border-right: 1px solid rgba(252, 246, 239, .18);
}

.wx-preview__logo img {
	object-fit: contain;
	display: block;
	width: auto;
	max-width: 130px;
	height: 34px;
}

.wx-preview__name {
	min-width: 0;
	line-height: 1.35;
}

.wx-preview__name small,
.wx-preview__name strong {
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.wx-preview__name small {
	color: #bdbab4;
	font-size: 12px;
}

.wx-preview__name strong {
	color: #fff;
	font-size: 15px;
	font-weight: 600;
}

.wx-preview__devices {
	display: flex;
	gap: 2px;
	padding: 4px;
	border-radius: 30px;
	background: rgba(252, 246, 239, .08);
}

.wx-preview .wx-preview__devices button {
	display: grid;
	place-items: center;
	width: 44px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 30px;
	background: transparent;
	color: #bdbab4;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}

.wx-preview .wx-preview__devices button:hover {
	color: #fff;
}

.wx-preview .wx-preview__devices button[aria-pressed="true"] {
	background: #fcf6ef;
	color: #131313;
}

.wx-preview__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	min-width: 0;
}

.wx-preview .wx-preview__icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 42px;
	height: 42px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fcf6ef;
	cursor: pointer;
	transition: background-color .2s ease;
}

.wx-preview .wx-preview__icon[hidden] {
	display: none;
}

.wx-preview .wx-preview__icon:hover {
	background: rgba(252, 246, 239, .12);
	color: #fff;
}

.wx-preview .wx-preview__cta {
	display: inline-flex;
	align-items: center;
	height: 42px;
	padding: 0 22px;
	border: 1px solid #fcf6ef;
	border-radius: 30px;
	background: #fcf6ef;
	color: #131313;
	font-size: 15px;
	font-weight: 500;
	white-space: nowrap;
	transition: background-color .2s ease, color .2s ease;
}

.wx-preview .wx-preview__cta:hover {
	background: transparent;
	color: #fcf6ef;
}

.wx-preview button:focus-visible,
.wx-preview a:focus-visible,
.wx-preview__view:focus-visible {
	outline: 2px solid #fcf6ef;
	outline-offset: 2px;
}

/* live demo */
.wx-preview__stage {
	display: flex;
	flex: 1;
	align-items: flex-start;
	justify-content: center;
	min-height: 0;
	overflow: hidden;
}

.wx-preview__frame {
	position: relative;
	width: 100%;
	height: 100%;
	max-width: 100%;
	overflow: hidden;
	background: #fff;
	transition: width .3s ease, height .3s ease, border-radius .3s ease;
}

.wx-preview__stage[data-device="tablet"],
.wx-preview__stage[data-device="phone"] {
	padding: 24px;
}

.wx-preview__stage[data-device="tablet"] .wx-preview__frame,
.wx-preview__stage[data-device="phone"] .wx-preview__frame {
	border-radius: 22px;
	box-shadow: 0 0 0 7px #131313, 0 0 0 8px rgba(252, 246, 239, .22), 0 24px 60px rgba(0, 0, 0, .5);
}

.wx-preview__stage[data-device="tablet"] .wx-preview__frame {
	width: 768px;
	height: min(1024px, 100%);
}

.wx-preview__stage[data-device="phone"] .wx-preview__frame {
	width: 390px;
	height: min(844px, 100%);
}

.wx-preview__frame iframe {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	opacity: 0;
	transition: opacity .25s ease;
}

.wx-preview__frame iframe.is-ready {
	opacity: 1;
}

.wx-preview__loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 20px;
	color: #575757;
	font-size: 15px;
	text-align: center;
}

.wx-preview__loading[hidden],
.wx-preview__slow[hidden] {
	display: none;
}

.wx-preview__spinner {
	width: 30px;
	height: 30px;
	border: 2px solid #ebebf9;
	border-top-color: #131313;
	border-radius: 50%;
	animation: wx-preview-spin .8s linear infinite;
}

@keyframes wx-preview-spin {
	to {
		transform: rotate(360deg);
	}
}

.wx-preview .wx-preview__slow {
	color: #131313;
	font-size: 14px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.wx-preview,
	.wx-preview__frame,
	.wx-preview__frame iframe {
		animation: none;
		transition: none;
	}
}

@media (max-width: 991px) {
	.wx-preview .wx-preview__logo {
		display: none;
	}
}

/* a phone already shows the phone layout, and has no room for the other sizes */
@media (max-width: 767px) {
	.wx-preview__bar {
		grid-template-columns: minmax(0, 1fr) auto;
		height: 60px;
		padding: 0 8px 0 16px;
		gap: 8px;
	}

	.wx-preview__devices,
	.wx-preview .wx-preview__newtab {
		display: none;
	}

	.wx-preview .wx-preview__cta {
		height: 38px;
		padding: 0 14px;
		font-size: 14px;
	}

	.wx-preview__stage[data-device] {
		padding: 0;
	}

	.wx-preview__stage[data-device] .wx-preview__frame {
		width: 100%;
		height: 100%;
		border-radius: 0;
		box-shadow: none;
	}
}
