/**
 * EE 3D Product Viewer (Phase 13).
 *
 * @since 3.15.0
 */

.ee-3d-viewer {
	--ee-3d-hotspot-size: 28px;
	--ee-3d-hotspot-bg: #ffffff;
	--ee-3d-hotspot-color: #1d2327;
	--ee-3d-card-bg: #ffffff;
	--ee-3d-card-color: #1d2327;
	position: relative;
	width: 100%;
	height: 480px;
	overflow: hidden;
	isolation: isolate;
}

.ee-3d-viewer__stage {
	position: absolute;
	inset: 0;
	cursor: grab;
	touch-action: none;
}

.ee-3d-viewer__stage:active {
	cursor: grabbing;
}

.ee-3d-viewer__stage:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: -4px;
}

.ee-3d-viewer__stage canvas {
	display: block;
	width: 100% !important;
	height: 100% !important;
}

.ee-3d-viewer__poster {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	transition: opacity 0.4s ease;
	z-index: 1;
}

.ee-3d-viewer__poster img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ee-3d-viewer.is-loaded .ee-3d-viewer__poster {
	opacity: 0;
}

.ee-3d-viewer__load {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 3;
	padding: 0.7em 1.4em;
	border: 0;
	border-radius: 999px;
	background: rgba(17, 17, 17, 0.85);
	color: #ffffff;
	font: inherit;
	cursor: pointer;
}

.ee-3d-viewer__load:hover,
.ee-3d-viewer__load:focus-visible {
	background: #111111;
}

.ee-3d-viewer__status {
	position: absolute;
	left: 50%;
	bottom: 12px;
	transform: translateX(-50%);
	z-index: 3;
	max-width: calc(100% - 24px);
	padding: 0;
	border-radius: 4px;
	font-size: 13px;
	line-height: 1.4;
	text-align: center;
	pointer-events: none;
}

.ee-3d-viewer__status:not(:empty) {
	padding: 6px 12px;
	background: rgba(17, 17, 17, 0.75);
	color: #ffffff;
}

.ee-3d-viewer.is-picked .ee-3d-viewer__status {
	pointer-events: auto;
	user-select: all;
}

.ee-3d-viewer__hotspots {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
}

.ee-3d-viewer__hotspot {
	position: absolute;
	left: 0;
	top: 0;
	width: 0;
	height: 0;
	transition: opacity 0.2s ease;
}

.ee-3d-viewer__hotspot.is-offscreen {
	visibility: hidden;
}

.ee-3d-viewer__hotspot.is-behind:not(.is-open) {
	opacity: 0.35;
}

.ee-3d-viewer__marker {
	position: absolute;
	left: calc(var(--ee-3d-hotspot-size) / -2);
	top: calc(var(--ee-3d-hotspot-size) / -2);
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--ee-3d-hotspot-size);
	height: var(--ee-3d-hotspot-size);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--ee-3d-hotspot-bg);
	color: var(--ee-3d-hotspot-color);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	font-size: calc(var(--ee-3d-hotspot-size) * 0.45);
	line-height: 1;
	cursor: pointer;
	pointer-events: auto;
}

.ee-3d-viewer__marker svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.ee-3d-viewer__marker:focus-visible {
	outline: 2px solid var(--ee-3d-hotspot-color);
	outline-offset: 2px;
}

.ee-3d-viewer__card {
	position: absolute;
	left: calc(var(--ee-3d-hotspot-size) / 2 + 8px);
	top: 0;
	transform: translateY(-50%);
	width: max-content;
	max-width: min(260px, 60vw);
	padding: 10px 12px;
	border-radius: 6px;
	background: var(--ee-3d-card-bg);
	color: var(--ee-3d-card-color);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
	font-size: 14px;
	line-height: 1.45;
	pointer-events: auto;
}

.ee-3d-viewer__card-title {
	display: block;
}

.ee-3d-viewer__card-text {
	margin: 4px 0 0;
}

.ee-3d-viewer__sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ee-3d-viewer-placeholder {
	padding: 40px 20px;
	border: 1px dashed #c3c4c7;
	text-align: center;
	color: #50575e;
}

@media (prefers-reduced-motion: reduce) {
	.ee-3d-viewer__poster,
	.ee-3d-viewer__hotspot {
		transition: none;
	}
}
