.exm-pmg {
	--exm-pmg-gap: 18px;
	--exm-pmg-thumbs-desktop: 4;
	--exm-pmg-thumbs-mobile: 4;
	--exm-pmg-border: rgba(17, 17, 17, 0.16);
	--exm-pmg-thumb-size: clamp(74px, 8.16vw, 115px);
}

.exm-pmg__stage {
	position: relative;
	background: transparent;
	border: 0;
	overflow: hidden;
	aspect-ratio: 1 / 1;
}

.exm-pmg[data-stage-ratio="4:3"] .exm-pmg__stage {
	aspect-ratio: 4 / 3;
}

.exm-pmg[data-stage-ratio="16:9"] .exm-pmg__stage {
	aspect-ratio: 16 / 9;
}

.exm-pmg__stage-item {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease;
	display: flex;
	align-items: center;
	justify-content: center;
}

.exm-pmg__stage-item.is-active {
	opacity: 1;
	visibility: visible;
}

.exm-pmg__stage-item img,
.exm-pmg__stage-item video,
.exm-pmg__stage-item iframe {
	width: 100%;
	height: 100%;
	display: block;
	border: 0;
}

.exm-pmg__stage-item img,
.exm-pmg__stage-item video {
	object-fit: contain;
	background: transparent;
}

.exm-pmg__spin-viewer {
	width: 100%;
	height: 100%;
	display: grid;
	place-items: center;
	overflow: hidden;
	background: transparent;
	cursor: grab;
	touch-action: pan-y;
	user-select: none;
}

.exm-pmg__spin-viewer.is-dragging {
	cursor: grabbing;
}

.exm-pmg__spin-image {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	pointer-events: none;
	-webkit-user-drag: none;
	user-select: none;
}

/* A non-interactive cue shown only while the 360 media is active. */
.exm-pmg__rotate-cue {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 2;
	display: grid;
	place-items: center;
	padding: 0;
	background: transparent;
	color: #111;
	pointer-events: none;
}

.exm-pmg__rotate-cue-icon {
	width: 38px;
	height: 38px;
	display: block;
	background: no-repeat center / contain url("../icons/rotate-axis-y.svg");
}

/* Centered first-use hint. It is dismissed after the customer rotates a frame. */
.exm-pmg__drag-prompt {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 3;
	width: 64px;
	height: 64px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: rgba(238, 238, 238, 0.45);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
	pointer-events: none;
	transform: translate(-50%, -50%);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.exm-pmg__drag-prompt.is-dismissed {
	opacity: 0;
	visibility: hidden;
	transform: translate(-50%, -50%) scale(0.86);
}

.exm-pmg__stage-image {
	cursor: zoom-in;
}

.exm-pmg__zoom-btn {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 40px;
	height: 40px;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 999px;
	background: rgba(17, 17, 17, 0.62);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
	z-index: 3;
	transition: transform 0.15s ease, background 0.15s ease;
}

.exm-pmg__zoom-btn:hover {
	transform: scale(1.04);
	background: rgba(17, 17, 17, 0.78);
}

.exm-pmg__zoom-btn:focus-visible {
	outline: 2px solid #111;
	outline-offset: 2px;
}

.exm-pmg__zoom-icon {
	width: 18px;
	height: 18px;
	display: block;
	background-repeat: no-repeat;
	background-size: contain;
	background-position: center;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E");
}

.exm-pmg__thumbs {
	margin-top: var(--exm-pmg-gap);
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 12px;
}

.exm-pmg__thumb {
	position: relative;
	padding: 0;
	border: 0;
	background: transparent !important;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	width: var(--exm-pmg-thumb-size);
	height: var(--exm-pmg-thumb-size);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.exm-pmg__thumb.is-active {
	outline: none;
	box-shadow: none !important;
	background: transparent !important;
}

.exm-pmg__thumb:focus-visible {
	outline: none;
	box-shadow: none !important;
	background: transparent !important;
}

.exm-pmg__thumb:hover,
.exm-pmg__thumb:active,
.exm-pmg__thumb:focus {
	background: transparent !important;
	color: inherit !important;
	border: 0 !important;
	outline: none !important;
}

.exm-pmg__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.exm-pmg__thumb-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: #ececec;
}

.exm-pmg__thumb-badge {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 48px;
	height: 48px;
	border-radius: 0;
	background-color: transparent;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	text-indent: -9999px;
	overflow: hidden;
	filter: none;
}

.exm-pmg__thumb-badge--video {
	background-image: url("../icons/video.svg");
}

.exm-pmg__thumb-badge--model {
	background-image: url("../icons/model.svg");
}

.exm-pmg__thumb-badge--spin {
	background-image: url("../icons/spin.svg");
}

.exm-pmg-loop-media {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: transparent;
}

.exm-pmg-loop-media .exm-pmg__spin-viewer--loop,
.exm-pmg-loop-media__image {
	width: 100%;
	height: 100%;
	display: block;
}

.exm-pmg-loop-media__image {
	object-fit: contain;
	background: transparent;
}

.woocommerce ul.products li.product a .exm-pmg-loop-media__image,
.woocommerce-page ul.products li.product a .exm-pmg-loop-media__image {
	width: 100%;
	height: 100%;
	margin: 0;
}

.exm-pmg-loop-media__badge {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	pointer-events: none;
	display: none;
}

.exm-pmg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0, 0, 0, 0.88);
	display: none;
	align-items: center;
	justify-content: center;
	padding: 40px;
}

.exm-pmg-lightbox.is-open {
	display: flex;
}

.exm-pmg-lightbox__content {
	width: min(94vw, 1400px);
	height: min(90vh, 960px);
	display: flex;
	align-items: center;
	justify-content: center;
}

.exm-pmg-lightbox__content img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.exm-pmg-lightbox__close {
	position: absolute;
	top: 14px;
	right: 16px;
	width: 42px;
	height: 42px;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 30px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0 0 2px;
}

body.exm-pmg-lightbox-open {
	overflow: hidden;
}

.single-product div.product .images .exm-pmg {
	width: 100%;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-si,
.dgwt-wcas-suggestions-wrapp .dgwt-wcas-si * {
	background: transparent !important;
	box-shadow: none !important;
	border: 0 !important;
	outline: none !important;
}

.dgwt-wcas-suggestions-wrapp .dgwt-wcas-si img {
	object-fit: contain !important;
	background: transparent !important;
	border: 0 !important;
	outline: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
}

@media (max-width: 767px) {
	/* Elementor initially gives its product-image widget a short fixed layout height. */
	body.single-product .elementor-widget-woocommerce-product-images,
	body.single-product .elementor-widget-woocommerce-product-images > .elementor-widget-container {
		min-height: calc(100vw + 75px) !important;
	}

	/* Elementor must account for the custom gallery's full stage + thumbnail height. */
	body.single-product .e-con-inner:has(> .e-con .elementor-widget-woocommerce-product-images .exm-pmg) {
		flex-direction: column !important;
		flex-wrap: nowrap !important;
		gap: 24px !important;
	}

	body.single-product .e-con-inner:has(> .e-con .elementor-widget-woocommerce-product-images .exm-pmg) > .e-con {
		width: 100% !important;
		max-width: 100% !important;
		flex-basis: auto !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	/* Reserve the square stage before the product image is available. */
	body.single-product .e-con:has(.elementor-widget-woocommerce-product-images .exm-pmg) {
		min-height: calc(100vw - 20px) !important;
	}

	/* Standard image galleries also reserve their thumbnail rail. */
	body.single-product .e-con:has(.elementor-widget-woocommerce-product-images .exm-pmg .exm-pmg__thumb) {
		min-height: calc(100vw + 75px) !important;
	}

	.exm-pmg__thumbs {
		gap: 8px;
	}

	.exm-pmg {
		--exm-pmg-thumb-size: 77px;
	}

	.exm-pmg__zoom-btn {
		width: 34px;
		height: 34px;
		top: 10px;
		right: 10px;
	}

	.exm-pmg__rotate-cue {
		top: 10px;
		right: 10px;
	}

	.exm-pmg__rotate-cue-icon {
		width: 32px;
		height: 32px;
	}

	.exm-pmg__drag-prompt {
		width: 54px;
		height: 54px;
	}

	.exm-pmg__drag-prompt .exm-pmg__rotate-cue-icon {
		width: 36px;
		height: 36px;
	}

	.exm-pmg-lightbox {
		padding: 16px;
	}

	.exm-pmg-lightbox__content {
		width: 96vw;
		height: 88vh;
	}
}
