.p3d-viewer {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 4px;
	background: transparent;
	touch-action: none;
	cursor: grab;
}

.p3d-viewer:active {
	cursor: grabbing;
}

.p3d-viewer__canvas {
	display: block;
	position: relative;
	z-index: 1;
	width: 100% !important;
	height: 100% !important;
	outline: none;
}

.p3d-viewer[hidden],
.p3d-viewer [hidden] {
	display: none !important;
}

.p3d-viewer__loader,
.p3d-viewer__error {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	text-align: center;
	font-size: 14px;
	line-height: 1.5;
	pointer-events: none;
	z-index: 3;
}

.p3d-viewer__loader {
	background: rgba(255, 255, 255, 0.92);
	color: #333;
}

.p3d-viewer__loader::after {
	content: '';
	width: 32px;
	height: 32px;
	margin-left: 12px;
	border: 3px solid #ddd;
	border-top-color: #333;
	border-radius: 50%;
	animation: p3d-spin 0.8s linear infinite;
}

.p3d-viewer__error {
	z-index: 4;
	background: rgba(255, 235, 235, 0.95);
	color: #8b0000;
}

.p3d-viewer__hint {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	padding: 8px 12px;
	text-align: center;
	font-size: 12px;
	line-height: 1.4;
	color: rgba(0, 0, 0, 0.6);
	background: linear-gradient(to top, rgba(255, 255, 255, 0.35), transparent);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.p3d-viewer--dark-bg .p3d-viewer__hint {
	color: rgba(255, 255, 255, 0.75);
	background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent);
}

.p3d-viewer--loaded .p3d-viewer__loader {
	display: none !important;
}

.p3d-viewer--loaded .p3d-viewer__hint {
	opacity: 1;
}

.p3d-viewer--loaded:hover .p3d-viewer__hint {
	opacity: 0;
}

.p3d-viewer--error .p3d-viewer__loader {
	display: none !important;
}

.p3d-viewer-placeholder {
	padding: 40px 20px;
	text-align: center;
	color: #666;
	background: #f9f9f9;
	border: 2px dashed #ccc;
	border-radius: 4px;
	font-size: 14px;
}

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

.p3d-scene {
	width: 100%;
}

.p3d-scene__stage {
	position: relative;
	width: 100%;
	height: 500px;
	overflow: hidden;
	border-radius: 4px;
}

.p3d-viewer--in-scene {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	border-radius: 0;
}

.p3d-scene__media {
	position: absolute;
	inset: 0;
	z-index: 2;
	overflow: hidden;
}

.p3d-scene__media--image {
	background: transparent;
}

.p3d-scene__media--image.is-portrait {
	background: #e8e8e8;
}

.p3d-scene__media--video {
	background: #000;
}

.p3d-scene__image {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover !important;
	object-position: center;
	display: block;
}

.p3d-scene__image.is-portrait {
	object-fit: contain !important;
}

.p3d-scene__video-wrap {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.p3d-scene__video {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	background: #000;
	object-fit: cover;
	object-position: center;
}

.p3d-scene__iframe {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	background: #000;
}

.p3d-scene__gallery {
	display: grid;
	grid-template-columns: repeat(var(--p3d-gallery-cols, 5), minmax(0, 1fr));
	gap: var(--p3d-gallery-gap, 8px);
	margin-top: 12px;
}

.p3d-scene__gallery[hidden],
.p3d-scene__thumb[hidden] {
	display: none !important;
}

.p3d-scene__thumb {
	position: relative;
	display: block;
	width: 100%;
	min-width: 0;
	min-height: 0;
	height: var(--p3d-gallery-row-height, 80px);
	padding: 0;
	border: none;
	border-radius: 4px;
	overflow: hidden;
	background: #f3f3f3;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.p3d-scene__thumb::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: inherit;
	border: var(--p3d-gallery-thumb-border-width, 2px) solid transparent;
	box-sizing: border-box;
	pointer-events: none;
	z-index: 2;
	transition: border-color 0.2s ease;
}

.p3d-scene__thumb:hover::after,
.p3d-scene__thumb.is-active::after {
	border-color: var(--p3d-gallery-thumb-border-color, #111111);
}

.p3d-scene__thumb-inner {
	position: absolute;
	inset: 0;
	display: block;
	overflow: hidden;
	border-radius: inherit;
	background: #f3f3f3;
}

.p3d-scene__thumb--3d,
.p3d-scene__thumb--scene3d {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--p3d-thumb-bg, var(--p3d-gallery-3d-thumb-bg, #444444));
}

.p3d-scene__thumb--3d .p3d-scene__thumb-inner,
.p3d-scene__thumb--scene3d .p3d-scene__thumb-inner {
	background: transparent;
	display: flex;
	align-items: center;
	justify-content: center;
}

.p3d-scene__thumb-icon {
	position: relative;
	z-index: 1;
	width: var(--p3d-gallery-icon-size, 36%);
	aspect-ratio: 1;
	flex-shrink: 0;
	background-color: var(--p3d-thumb-icon, #ffffff);
	-webkit-mask: url('../images/icon-3d.svg') center / contain no-repeat;
	mask: url('../images/icon-3d.svg') center / contain no-repeat;
}

.p3d-scene__thumb-img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	max-height: none !important;
	object-fit: cover !important;
	object-position: center;
	display: block;
}

.p3d-scene__thumb-placeholder {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	background: #ddd;
	background-size: cover;
	background-position: center;
}

.p3d-scene__thumb-play {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	background: rgba(0, 0, 0, 0.25);
}

.p3d-scene__thumb-play::after {
	content: '';
	width: 0;
	height: 0;
	margin-left: 4px;
	border-top: 10px solid transparent;
	border-bottom: 10px solid transparent;
	border-left: 16px solid #fff;
}

.p3d-scene__thumb-label {
	position: relative;
	z-index: 1;
}
