/* TCH 3D Viewer — Frontend v1.0.0 */

.tch3dv-wrapper {
	position: relative;
	width: 100%;
	overflow: visible;
	display: block;
}

.tch3dv-wrapper model-viewer {
	width: 100%;
	height: 100%;
	display: block;
	border-radius: inherit;
}

/* ── Overlay de carga ── */
.tch3dv-overlay {
	position: absolute;
	inset: 0;
	z-index: 20;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: inherit;
}

.tch3dv-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid rgba(255, 255, 255, 0.2);
	border-top-color: var(--tch3dv-accent, #f0a500);
	border-radius: 50%;
	animation: tch3dv-spin 0.8s linear infinite;
}

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

/* ── Franja de thumbnails ── */
.tch3dv-strip {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 10;
	display: flex;
	flex-direction: row;
	gap: 8px;
	flex-wrap: nowrap;
	padding: 0;
	margin: 0;
}

.tch3dv-thumb {
	width: 72px;
	height: 72px;
	min-width: 72px;
	max-width: 72px;
	padding: 3px;
	border-radius: 8px;
	border: 2px solid rgba(255, 255, 255, 0.25);
	background: rgba(255, 255, 255, 0.55);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	cursor: pointer;
	transition: border-color 0.15s ease, transform 0.15s ease;
	overflow: hidden;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ccc;
	font-size: 0.75rem;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.tch3dv-thumb:hover {
	border-color: rgba(255, 255, 255, 0.6);
	transform: translateY(-2px);
}

.tch3dv-thumb.active,
.tch3dv-thumb[aria-pressed="true"] {
	border-color: var(--tch3dv-accent, #f0a500);
	background: rgba(255, 255, 255, 0.75);
}

.tch3dv-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 5px;
	display: block;
	pointer-events: none;
}

/* ── Botonera ── */
.tch3dv-toolbar {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 10;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 4px;
	border-radius: var(--tch3dv-dl-radius, 50px);
	border: var(--tch3dv-dl-bw, 1.5px) solid var(--tch3dv-dl-border, rgba(255, 255, 255, 0.2)) !important;
	background: var(--tch3dv-dl-bg, rgba(0, 0, 0, 0.45)) !important;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.tch3dv-tool-btn {
	width: 30px;
	height: 30px;
	display: flex !important;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	border: none !important;
	border-radius: 50% !important;
	padding: 0 !important;
	margin: 0;
	cursor: pointer;
	color: rgba(255, 255, 255, 0.75);
	transition: color 0.15s ease, background 0.15s ease;
	flex-shrink: 0;
}

.tch3dv-tool-btn svg {
	width: 15px;
	height: 15px;
	display: block;
	pointer-events: none;
}

.tch3dv-tool-btn img.tch3dv-dl-icon {
	width: 15px;
	height: 15px;
	object-fit: contain;
	display: block;
}

.tch3dv-tool-btn:hover {
	color: #fff !important;
	background: rgba(255, 255, 255, 0.12) !important;
}

.tch3dv-tool-btn.is-playing {
	color: var(--tch3dv-accent, #f0a500);
}

.tch3dv-toolbar-sep {
	width: 60%;
	height: 1px;
	background: rgba(255, 255, 255, 0.15);
	margin: 2px 0;
	flex-shrink: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
	.tch3dv-wrapper {
		display: flex;
		flex-direction: column;
		height: auto !important;
	}

	.tch3dv-wrapper model-viewer {
		height: 80vw;
		flex-shrink: 0;
	}

	.tch3dv-strip {
		position: static;
		transform: none;
		left: auto;
		bottom: auto;
		flex-shrink: 0;
		display: flex;
		flex-direction: row;
		justify-content: center;
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		gap: 8px;
		padding: 8px 4px;
		width: 100%;
		scrollbar-width: none;
	}

	.tch3dv-strip::-webkit-scrollbar {
		display: none;
	}

	.tch3dv-thumb {
		width: 64px;
		height: 64px;
		min-width: 64px;
		max-width: 64px;
		flex-shrink: 0;
	}

	.tch3dv-toolbar {
		top: 8px;
		right: 8px;
	}
}
