/* =====================================================================
 * Tiger 360 Product Viewer
 * ===================================================================== */

.tg-3d-stage {
	display: flex;
	width: 100%;
}

.tg-3d-cont {
	position: relative;
	max-width: 100%;
	cursor: grab;
	user-select: none;
	-webkit-touch-callout: none;
	background-color: transparent;
}

.tg-3d-cont.is-dragging { cursor: grabbing; }
.tg-3d-cont.is-zoomed   { cursor: zoom-out; }
.tg-3d-cont.is-panning  { cursor: grabbing; }

.tg-3d-cont.is-fullscreen {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100vw;
	height: 100vh;
	background: #0d0d0f;
}

.tg-3d-cont.is-fullscreen .tg-3d-img-wrap {
	width: min(90vw, 90vh) !important;
	height: 90vh !important;
}

/* ----- Image stage ----- */
.tg-3d-img-wrap {
	position: relative;
	width: 100%;
	height: 420px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	touch-action: pan-y;
}

.tg-3d-active-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	margin: 0 auto;
	pointer-events: none;
	transform-origin: center center;
	transition: transform 0.18s ease-out;
	-webkit-user-drag: none;
	user-drag: none;
}

.tg-3d-cont.is-panning .tg-3d-active-img,
.tg-3d-cont.is-dragging .tg-3d-active-img {
	transition: none;
}

/* ----- Loading spinner ----- */
.tg-3d-loader {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: rgba( 255, 255, 255, 0.65 );
	z-index: 5;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.tg-3d-loader.is-hidden {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.tg-3d-loader-ring {
	width: 44px;
	height: 44px;
	border: 4px solid rgba( 0, 0, 0, 0.12 );
	border-top-color: #f26522;
	border-radius: 50%;
	animation: tg-3d-spin 0.8s linear infinite;
}

@keyframes tg-3d-spin {
	to { transform: rotate( 360deg ); }
}

/* ----- Drag hint badge ----- */
.tg-3d-overlay {
	position: absolute;
	bottom: 20px;
	left: 50%;
	transform: translateX( -50% );
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	background-color: rgba( 0, 0, 0, 0.6 );
	color: #fff;
	border-radius: 20px;
	font-size: 14px;
	line-height: 1;
	white-space: nowrap;
	pointer-events: none;
	z-index: 4;
	transition: opacity 0.35s ease, transform 0.35s ease;
}

.tg-3d-overlay.is-gone {
	opacity: 0;
	transform: translate( -50%, 12px );
}

/* The control bar shares the bottom-center zone; fade the hint while the
 * bar is revealed so the two never overlap. */
.tg-3d-cont:hover .tg-3d-overlay,
.tg-3d-cont.is-fullscreen .tg-3d-overlay {
	opacity: 0;
	pointer-events: none;
}

.tg-3d-overlay i,
.tg-3d-overlay svg {
	width: 16px;
	height: 16px;
	font-size: 16px;
	animation: tg-3d-hint-pulse 1.8s ease-in-out infinite;
}

@keyframes tg-3d-hint-pulse {
	0%, 100% { transform: rotate( 0deg ); }
	50%      { transform: rotate( -40deg ); }
}

/* ----- Frame counter ----- */
.tg-3d-counter {
	position: absolute;
	top: 12px;
	right: 12px;
	padding: 4px 10px;
	background-color: rgba( 0, 0, 0, 0.55 );
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	border-radius: 14px;
	line-height: 1.4;
	pointer-events: none;
	z-index: 4;
}

/* ----- Control bar ----- */
.tg-3d-controls {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX( -50% );
	display: flex;
	align-items: center;
	gap: 8px;
	z-index: 6;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.tg-3d-cont:hover .tg-3d-controls,
.tg-3d-cont.is-fullscreen .tg-3d-controls,
.tg-3d-cont.is-zoomed .tg-3d-controls {
	opacity: 1;
}

.tg-3d-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background-color: rgba( 0, 0, 0, 0.55 );
	color: #fff;
	cursor: pointer;
	backdrop-filter: blur( 4px );
	-webkit-backdrop-filter: blur( 4px );
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.tg-3d-btn:hover  { background-color: #f26522; transform: translateY( -2px ); }
.tg-3d-btn:active { transform: translateY( 0 ); }

.tg-3d-btn svg {
	width: 18px;
	height: 18px;
	display: block;
	/* SVG flex items collapse to a 0 main-size in some layouts; pin them. */
	flex: none;
}

/* Play / pause glyph swap is driven by the .is-playing state class. */
.tg-3d-btn-play .tg-3d-ico-pause { display: none; }
.tg-3d-cont.is-playing .tg-3d-btn-play .tg-3d-ico-play  { display: none; }
.tg-3d-cont.is-playing .tg-3d-btn-play .tg-3d-ico-pause { display: block; }

/* ----- Rotation progress bar ----- */
.tg-3d-progress {
	position: relative;
	width: 100%;
	height: 4px;
	margin-top: 10px;
	background-color: rgba( 0, 0, 0, 0.12 );
	border-radius: 999px;
	overflow: hidden;
}

.tg-3d-progress-bar {
	position: absolute;
	inset: 0 auto 0 0;
	width: 0;
	background-color: #f26522;
	border-radius: 999px;
	transition: width 0.12s linear;
}

/* ----- Empty-state placeholder ----- */
.tg-3d-placeholder {
	padding: 40px;
	text-align: center;
	color: #6b7280;
	background: #f6f7f9;
	border: 2px dashed #d1d5db;
	border-radius: 8px;
	font-size: 14px;
}
