/*
 * Marketplace preview popup (inc/marketplace/preview.php): the brand's dark look, as the home hero.
 * 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: #000 url("../../../../uploads/2025/12/bg-black-scaled.webp") center / cover no-repeat;
	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 {
	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[data-mode="images"] .wx-preview__devices {
	visibility: hidden;
}

.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[data-mode="images"] .wx-preview__stage,
.wx-preview[data-mode="live"] .wx-preview__gallery {
	display: none;
}

.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;
}

/* images */
.wx-preview__gallery {
	position: relative;
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
}

.wx-preview__view {
	display: flex;
	flex: 1;
	min-height: 0;
	padding: 28px 84px;
	overflow-y: auto;
}

/* margin auto centres a short image; a long screenshot scrolls from its top */
.wx-preview__view img {
	display: block;
	max-width: min(100%, 1200px);
	height: auto;
	margin: auto;
	border-radius: 12px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

/* a normal-shaped image fits the screen; only a long screenshot scrolls (preview.js) */
.wx-preview__view img.is-fit {
	max-height: 100%;
	object-fit: contain;
}

.wx-preview .wx-preview__arrow {
	position: absolute;
	top: calc(50% - 70px);
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(252, 246, 239, .22);
	border-radius: 50%;
	background: #131313;
	color: #fcf6ef;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
}

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

.wx-preview .wx-preview__arrow:hover {
	background: #fcf6ef;
	color: #131313;
}

.wx-preview__arrow--prev {
	left: 20px;
}

.wx-preview__arrow--next {
	right: 20px;
}

.wx-preview__foot {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 56px;
	padding: 10px 24px;
	border-top: 1px solid rgba(252, 246, 239, .12);
	background: #131313;
}

.wx-preview .wx-preview__caption {
	display: flex;
	flex: 0 1 auto;
	gap: 10px;
	min-width: 0;
	margin: 0;
	color: #bdbab4;
	font-size: 14px;
	white-space: nowrap;
}

.wx-preview__caption span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.wx-preview__caption b {
	flex: none;
	color: #fcf6ef;
	font-weight: 600;
}

.wx-preview__thumbs {
	display: flex;
	flex: none;
	gap: 8px;
	max-width: 60%;
	overflow-x: auto;
	scrollbar-width: none;
}

.wx-preview .wx-preview__thumbs button {
	flex: none;
	width: 64px;
	height: 44px;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 1px solid rgba(252, 246, 239, .22);
	border-radius: 8px;
	background: #000;
	cursor: pointer;
	opacity: .6;
	transition: opacity .2s ease, border-color .2s ease;
}

.wx-preview .wx-preview__thumbs button:hover {
	opacity: 1;
}

.wx-preview .wx-preview__thumbs button[aria-current="true"] {
	border-color: #fcf6ef;
	opacity: 1;
}

.wx-preview__thumbs img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top;
}

@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;
	}

	.wx-preview__view {
		padding: 20px 72px;
	}
}

/* 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;
	}

	.wx-preview__view {
		padding: 16px;
	}

	.wx-preview .wx-preview__arrow {
		top: auto;
		bottom: 72px;
		width: 42px;
		height: 42px;
	}

	.wx-preview__arrow--prev {
		left: 12px;
	}

	.wx-preview__arrow--next {
		right: 12px;
	}

	.wx-preview__foot {
		padding: 8px 16px;
	}

	.wx-preview .wx-preview__caption {
		font-size: 13px;
	}

	.wx-preview__thumbs {
		display: none;
	}
}
