/**
 * MH 360° Spinner Styles v1.4.0
 *
 * Single-image rendering. No crossfade (causes ghosting on 360° sequences).
 * Preloaded images swap instantly from browser cache.
 *
 * v1.4.0: Gallery overlay expand button z-index fix + mobile touch target 48px
 *         Double-tap to fullscreen (JS change in spielturm-360.js)
 * v1.3.0: Canvas background #fff (was #f8f7f5), loader overlay matches
 *
 * @package MH_Spielturm_Vergleich
 * @since   5.0.2
 */

/* ══════════════════════════════════════════════════
 *  Container + Canvas
 * ══════════════════════════════════════════════════ */
.mh-360-container {
	position: relative;
	width: 100%;
}

.mh-360-canvas {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	cursor: grab;
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
}

.mh-360-canvas.is-dragging { cursor: grabbing; }
.mh-360-canvas.is-autoplaying { cursor: default; }

/* ══════════════════════════════════════════════════
 *  Image
 * ══════════════════════════════════════════════════ */
.mh-360-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
	-webkit-user-drag: none;
}

/* ══════════════════════════════════════════════════
 *  Loading Overlay
 * ══════════════════════════════════════════════════ */
.mh-360-loader {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.85);
	transition: opacity .4s ease;
	z-index: 5;
}

.mh-360-loader.is-hidden {
	opacity: 0;
	pointer-events: none;
}

.mh-360-loader-ring {
	width: 36px;
	height: 36px;
	border: 3px solid #e5e3df;
	border-top-color: var(--mh-360-accent, #e8910c);
	border-radius: 50%;
	animation: mh360spin 1s linear infinite;
}

.mh-360-loader-text {
	margin-top: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #666;
	font-variant-numeric: tabular-nums;
}

@keyframes mh360spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════
 *  Badge + Hint + Progress
 * ══════════════════════════════════════════════════ */
.mh-360-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 5px 10px;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	border-radius: 6px;
	z-index: 3;
	pointer-events: none;
}

.mh-360-badge svg { flex-shrink: 0; }

.mh-360-hint {
	position: absolute;
	bottom: 16px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	border-radius: 20px;
	z-index: 4;
	pointer-events: none;
	transition: opacity .4s ease, transform .4s ease;
	animation: mh360hintPulse 2s ease-in-out infinite;
}

.mh-360-hint.is-hidden {
	opacity: 0;
	transform: translateX(-50%) translateY(8px);
}

@keyframes mh360hintPulse {
	0%, 100% { opacity: 0.85; }
	50%      { opacity: 1; }
}

.mh-360-hint svg {
	flex-shrink: 0;
	animation: mh360hintSlide 2s ease-in-out infinite;
}

@keyframes mh360hintSlide {
	0%, 100% { transform: translateX(-3px); }
	50%      { transform: translateX(3px); }
}

/* ══════════════════════════════════════════════════
 *  Expand / Fullscreen Button
 * ══════════════════════════════════════════════════ */
.mh-360-expand {
	position: absolute;
	bottom: 10px;
	right: 10px;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background: rgba(0, 0, 0, 0.55);
	border: none;
	border-radius: 8px;
	color: #fff;
	cursor: pointer;
	padding: 0;
	transition: background .2s ease, transform .15s ease;
}

.mh-360-expand:hover {
	background: rgba(0, 0, 0, 0.8);
	transform: scale(1.08);
}

.mh-360-expand:active {
	transform: scale(0.95);
}

.mh-360-expand svg {
	pointer-events: none;
}

/* ══════════════════════════════════════════════════
 *  Gallery Integration: 360° Thumbnail
 * ══════════════════════════════════════════════════ */
.mh-stv-thumb.mh-stv-thumb-360 { position: relative; }

.mh-stv-thumb-360-badge {
	position: absolute;
	bottom: 2px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	padding: 1px 5px;
	border-radius: 3px;
	line-height: 1.3;
	pointer-events: none;
	letter-spacing: 0.03em;
}

/* ══════════════════════════════════════════════════
 *  Gallery Overlay (spinner inside hero area)
 * ══════════════════════════════════════════════════ */
.mh-stv-360-overlay {
	position: absolute;
	inset: 0;
	z-index: 2;
}

.mh-stv-360-overlay .mh-360-canvas {
	position: absolute;
	inset: 0;
	aspect-ratio: auto;
	border-radius: 0;
}

/* v5.2.0: Ensure expand button is visible + tappable inside gallery overlay */
.mh-stv-360-overlay .mh-360-expand {
	z-index: 10;
	width: 44px;
	height: 44px;
	bottom: 12px;
	right: 12px;
}

.mh-stv-gallery.is-360-active .mh-stv-gallery-counter,
.mh-stv-gallery.is-360-active .mh-stv-gallery-zoom,
.mh-stv-gallery.is-360-active .mh-stv-gallery-hint {
	display: none !important;
}
.mh-stv-gallery.is-360-active { cursor: default; }

/* ══════════════════════════════════════════════════
 *  Lightbox 360° — match regular image sizing
 * ══════════════════════════════════════════════════ */
.mh-stv-lightbox .mh-360-canvas {
	width: 65vw;
	height: 70vh;
	max-width: 1200px;
	aspect-ratio: auto;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.3);
}

.mh-stv-lightbox .mh-360-badge { top: 16px; left: 16px; font-size: 14px; padding: 6px 14px; }
.mh-stv-lightbox .mh-360-hint { font-size: 15px; padding: 10px 20px; }

/* Tablet: allow larger */
@media (max-width: 1024px) {
	.mh-stv-lightbox .mh-360-canvas { width: 90vw; height: 78vh; }
}
/* Mobile: near fullscreen */
@media (max-width: 480px) {
	.mh-stv-lightbox .mh-360-canvas { width: 96vw; height: 78vh; border-radius: 0; }
}

/* ══════════════════════════════════════════════════
 *  Standalone Shortcode
 * ══════════════════════════════════════════════════ */
.mh-360-standalone { max-width: 800px; margin: 0 auto; }

/* ══════════════════════════════════════════════════
 *  Mobile
 * ══════════════════════════════════════════════════ */
@media (max-width: 1024px) {
	.mh-360-canvas { border-radius: 8px; }
	.mh-360-badge { top: 8px; left: 8px; font-size: 11px; padding: 4px 8px; }
	.mh-360-hint { font-size: 12px; padding: 6px 12px; bottom: 12px; }
	/* v5.2.0: Bigger expand button on mobile for touch */
	.mh-360-expand {
		width: 48px;
		height: 48px;
		bottom: 8px;
		right: 8px;
		background: rgba(0, 0, 0, 0.7);
	}
	.mh-stv-360-overlay .mh-360-expand {
		width: 48px;
		height: 48px;
	}
}
