/**
 * MWD WooCommerce 360 — Frontend Viewer Styles.
 *
 * @package MWD_Woo_360
 */

/* === Preview Badge === */
.mwd-woo-360-preview {
	position: relative;
	display: block;
}

.mwd-woo-360-badge {
	position: absolute;
	bottom: 10px;
	left: 10px;
	background: rgba(255, 255, 255, 0.85);
	padding: 5px 7px;
	border-radius: 4px;
	pointer-events: none;
	line-height: 0;
}

.mwd-woo-360-badge img {
	width: 30px;
	height: auto;
	display: block;
}

/* 360-Badge auf dem FlexSlider-Thumbnail */
.flex-control-thumbs .mwd-woo-360-thumb-overlay {
	position: absolute;
	bottom: 6px;
	left: 2px;
	pointer-events: none !important;
	background: rgba(255, 255, 255, 0.85);
	border-radius: 3px;
	padding: 2px 4px;
	line-height: 0;
	z-index: 1;
}

.flex-control-thumbs .mwd-woo-360-thumb-overlay * {
	pointer-events: none !important;
}

.flex-control-thumbs .mwd-woo-360-thumb-overlay img {
	width: 20px !important;
	height: auto !important;
	display: block;
	max-width: 20px;
}

/* === Viewer Container === */
.mwd-360-viewer {
	position: relative;
	overflow: hidden;
	user-select: none;
	-webkit-user-select: none;
}

.mwd-360-viewer.mwd-360-dragging {
	cursor: grabbing !important;
}

/* === Canvas === */
.mwd-360-canvas {
	position: relative;
	width: 100%;
	cursor: grab;
	line-height: 0;
}

.mwd-360-canvas img.mwd-360-frame {
	width: 100%;
	height: auto;
	display: block;
	pointer-events: none;
}

.mwd-360-dragging .mwd-360-canvas {
	cursor: grabbing;
}

/* === Loader === */
.mwd-360-loader {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 3px;
	background: rgba(0, 0, 0, 0.1);
	z-index: 5;
}

.mwd-360-loader-bar {
	height: 100%;
	width: 0;
	background: #0073aa;
	transition: width 0.15s ease;
}

/* === Controls === */
.mwd-360-controls {
	position: absolute;
	bottom: 10px;
	right: 10px;
	display: flex;
	gap: 4px;
	z-index: 10;
}

.mwd-360-btn {
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 0.15s;
}

.mwd-360-btn:hover {
	background: rgba(0, 0, 0, 0.85);
}

.mwd-360-btn.is-playing {
	background: #0073aa;
}

.mwd-360-btn svg {
	width: 16px;
	height: 16px;
	display: block;
	flex-shrink: 0;
}

/* === Drag Hint === */
.mwd-360-hint {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.65);
	color: #fff;
	font-size: 13px;
	padding: 8px 16px;
	border-radius: 6px;
	pointer-events: none;
	z-index: 10;
	white-space: nowrap;
}

/* === Gallery Integration === */
.mwd-360-gallery-viewer {
	width: 100%;
	position: relative;
}

/* Viewer als Overlay über den FlexSlider-Viewport.
   Wird als direktes Kind von .woocommerce-product-gallery eingefügt,
   damit FlexSlider's Clone-Prozess ihn nicht zerstört.
   Höhe wird dynamisch per JS gesetzt. */
.mwd-360-gallery-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 5;
}

/* Thumbnail für 360 Slide im FlexSlider */
.flex-control-thumbs .mwd-woo-360-slide img {
	position: relative;
}

/* === PhotoSwipe 360-Viewer === */
.mwd-360-pswp-viewer {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Eigene Pointer-Events — blockiert PhotoSwipe's Swipe-Handler */
	touch-action: none;
}

.mwd-360-pswp-viewer .mwd-360-viewer {
	width: 100%;
	max-width: 100%;
	background: #111;
}

.mwd-360-pswp-viewer .mwd-360-canvas img.mwd-360-frame {
	max-height: 80vh;
	width: auto;
	max-width: 100%;
	margin: 0 auto;
}

.mwd-360-pswp-viewer .mwd-360-controls {
	bottom: 20px;
}

.mwd-360-pswp-viewer .mwd-360-btn {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	padding: 0;
}

.mwd-360-pswp-viewer .mwd-360-btn svg {
	width: 20px;
	height: 20px;
	display: block;
	flex-shrink: 0;
}

/* === Responsive === */
@media (max-width: 768px) {
	.mwd-360-controls {
		bottom: 6px;
		right: 6px;
	}

	.mwd-360-btn {
		width: 36px;
		height: 36px;
	}

	.mwd-360-hint {
		font-size: 11px;
		padding: 6px 12px;
	}
}
