/* Vehicle 360 Studio — viewer */

.v360 {
	--v360-accent: #2563eb;
	--v360-bg: #f3f4f6;
	--v360-dark: #0e0f11;
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 100%;
	margin: 0 0 1.5em;
	border-radius: 14px;
	overflow: hidden;
	background: var(--v360-bg);
	color: #111;
	line-height: 1.3;
	box-sizing: border-box;
	isolation: isolate;
}

.v360 *,
.v360 *::before,
.v360 *::after {
	box-sizing: border-box;
}

.v360__stage {
	position: relative;
	width: 100%;
	aspect-ratio: var(--v360-ar, 1.5);
	overflow: hidden;
	cursor: grab;
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
	outline: none;
}

.v360__stage:focus-visible {
	box-shadow: inset 0 0 0 3px var(--v360-accent);
}

.v360__stage.is-grabbing {
	cursor: grabbing;
}

.v360.is-interior .v360__stage,
.v360.is-video .v360__stage {
	background: var(--v360-dark);
}

.v360.is-video .v360__stage {
	cursor: auto;
}

.v360 .v360__poster,
.v360 .v360__canvas,
.v360 .v360__video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	border: 0;
	border-radius: 0;
}

.v360 .v360__poster {
	object-fit: contain;
}

.v360 .v360__video {
	object-fit: contain;
	background: #000;
	z-index: 2;
}

.v360 [hidden] {
	display: none !important;
}

/* Badge */
.v360__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	padding: 5px 10px;
	border-radius: 999px;
	background: var(--v360-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	pointer-events: none;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.v360.is-video .v360__badge {
	display: none;
}

/* Hint */
.v360__hint {
	position: absolute;
	left: 50%;
	bottom: 16px;
	z-index: 3;
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 8px 14px;
	border-radius: 999px;
	background: rgba(17, 17, 17, 0.72);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	pointer-events: none;
	transform: translateX(-50%);
	transition: opacity 0.4s ease;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.v360__hint:empty,
.v360.is-interacted .v360__hint,
.v360.is-video .v360__hint {
	opacity: 0;
}

.v360__hint svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	animation: v360-nudge 1.6s ease-in-out infinite;
}

/* Loader */
.v360__loader {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 4;
	height: 3px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.08);
}

.v360__loader span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--v360-accent);
	transition: width 0.2s ease;
}

.v360__loader.is-indeterminate span {
	width: 30%;
	animation: v360-indeterminate 1.1s linear infinite;
}

/* Controls */
.v360__controls {
	position: absolute;
	right: 12px;
	bottom: 12px;
	z-index: 3;
	display: flex;
	gap: 6px;
}

.v360.is-video .v360__controls {
	display: none;
}

.v360 .v360__btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #111;
	font: inherit;
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	transition: transform 0.15s ease, background 0.15s ease;
}

.v360 .v360__btn:hover {
	transform: scale(1.06);
	background: #fff;
}

.v360 .v360__btn:focus-visible {
	outline: 2px solid var(--v360-accent);
	outline-offset: 2px;
}

.v360 .v360__btn svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Tabs */
.v360__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	justify-content: center;
	padding: 10px;
	background: var(--v360-bg);
}

.v360 .v360__tab {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	gap: 7px;
	align-items: center;
	margin: 0;
	padding: 8px 16px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 999px;
	background: #fff;
	color: #111;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.v360 .v360__tab svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.v360 .v360__tab:hover {
	border-color: var(--v360-accent);
}

.v360 .v360__tab[aria-selected="true"] {
	background: var(--v360-accent);
	border-color: var(--v360-accent);
	color: #fff;
}

.v360 .v360__tab:focus-visible {
	outline: 2px solid var(--v360-accent);
	outline-offset: 2px;
}

/* No-WebGL fallback */
.v360__strip {
	position: absolute;
	inset: 0;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-x pan-y;
}

.v360 .v360__strip img {
	display: block;
	width: auto !important;
	max-width: none !important;
	height: 100% !important;
}

/* Full screen */
.v360.is-fullscreen {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	margin: 0;
	border-radius: 0;
	background: var(--v360-dark);
}

.v360.is-fullscreen .v360__stage {
	flex: 1 1 auto;
	min-height: 0;
	height: auto;
	aspect-ratio: auto;
	touch-action: none;
	background: var(--v360-dark);
}

.v360.is-fullscreen .v360__tabs {
	background: var(--v360-dark);
	padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.v360.is-fullscreen .v360__tab {
	background: #1c1d21;
	border-color: #2c2d33;
	color: #fff;
}

html.v360-lock,
html.v360-lock body {
	overflow: hidden !important;
}

@keyframes v360-indeterminate {
	from { transform: translateX(-100%); }
	to { transform: translateX(340%); }
}

@keyframes v360-nudge {
	0%, 100% { transform: translateX(-2px); }
	50% { transform: translateX(2px); }
}

@media (max-width: 480px) {
	.v360 .v360__btn {
		width: 34px;
		height: 34px;
	}
	.v360 .v360__btn--zoom-in,
	.v360 .v360__btn--zoom-out {
		display: none;
	}
	.v360 .v360__tab {
		padding: 7px 12px;
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.v360 *,
	.v360 *::before,
	.v360 *::after {
		animation: none !important;
		transition: none !important;
	}
}
