/**
 * TCH 3D Viewer Addon — Estilos frontend v2.1.0
 */

/* El wrapper necesita overflow visible para que los elementos absolutos no se corten */
.b3dviewer-wrapper {
	overflow: visible !important;
}

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

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

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

/* ── Franja de thumbnails — dentro del visor, parte inferior ── */
.tch-angle-strip {
	position: absolute !important;
	bottom: 16px !important;
	left: 50% !important;
	transform: translateX( -50% ) !important;
	z-index: 10 !important;
	display: flex !important;
	flex-direction: row !important;
	gap: 8px !important;
	flex-wrap: nowrap !important;
	background: transparent !important;
	padding: 0 !important;
	margin: 0 !important;
	list-style: none !important;
}

/* ── Thumbnail individual ── */
.tch-thumb {
	width: 72px !important;
	height: 72px !important;
	max-width: 72px !important;
	min-width: 72px !important;
	padding: 3px !important;
	border-radius: 8px !important;
	border: 2px solid rgba( 255, 255, 255, 0.25 ) !important;
	/* Fondo blanco translúcido */
	background: rgba( 255, 255, 255, 0.55 ) !important;
	-webkit-backdrop-filter: blur( 6px ) !important;
	backdrop-filter: blur( 6px ) !important;
	cursor: pointer !important;
	transition: border-color 0.15s ease, transform 0.15s ease !important;
	overflow: hidden !important;
	flex-shrink: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	color: #ccc !important;
	font-size: 0.75rem !important;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.4 ) !important;
	float: none !important;
}

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

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

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

/* ── Botón descarga — esquina superior derecha del visor ── */
.tch-dl-btn {
	position: absolute !important;
	top: 12px !important;
	right: 12px !important;
	z-index: 10 !important;
	width: 36px !important;
	height: 36px !important;
	border-radius: 8px !important;
	border: 1.5px solid var( --tch-dl-border, rgba( 255, 255, 255, 0.25 ) ) !important;
	background: var( --tch-dl-bg, rgba( 0, 0, 0, 0.45 ) ) !important;
	-webkit-backdrop-filter: blur( 4px ) !important;
	backdrop-filter: blur( 4px ) !important;
	color: #ccc !important;
	cursor: pointer !important;
	transition: border-color 0.15s ease, color 0.15s ease !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-shadow: 0 2px 6px rgba( 0, 0, 0, 0.35 ) !important;
	padding: 0 !important;
	line-height: 1 !important;
}

.tch-dl-btn:hover {
	border-color: var( --tch3d-accent, #f0a500 ) !important;
	color: var( --tch3d-accent, #f0a500 ) !important;
}

.tch-dl-icon {
	display: block !important;
	width: 18px !important;
	height: 18px !important;
	object-fit: contain !important;
	visibility: visible !important;
	opacity: 1 !important;
	flex-shrink: 0 !important;
	/* Cuando el SVG es blanco sobre fondo oscuro puede necesitar filter:invert */
}

/* Variante con texto: el botón se ensancha */
.tch-dl-btn--with-text {
	width: auto !important;
	padding: 0 12px !important;
	gap: 6px !important;
}

.tch-dl-label {
	display: block !important;
	font-size: 0.78rem !important;
	white-space: nowrap !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* ── Responsive ── */
@media ( max-width: 600px ) {
	.tch-thumb {
		width: 56px !important;
		height: 56px !important;
		min-width: 56px !important;
		max-width: 56px !important;
	}

	.tch-angle-strip {
		gap: 6px !important;
		bottom: 10px !important;
	}
}
