/* Around 360° viewer 2.1 */
.a360 {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 0 1em;
	outline: none;
	-webkit-user-select: none;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}
.a360:focus-visible { box-shadow: 0 0 0 3px rgba(204, 28, 17, .35); border-radius: 10px; }
.a360-stage {
	position: relative;
	background: #fff;
	border: 1px solid #e8e4e3;
	border-radius: 10px;
	overflow: hidden;
	cursor: grab;
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
}
.a360-dragging .a360-stage { cursor: grabbing; }
.a360-img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto !important;
	height: auto;
	object-fit: contain;
	pointer-events: none;
	-webkit-user-drag: none;
}
/* 2.1: кадри на canvas поверх першого фото — без білого блимання */
.a360-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
	opacity: 0;
}
.a360-canvas-on .a360-canvas { opacity: 1; }
.a360-canvas-on .a360-img { visibility: hidden; }
.a360-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px 4px 6px;
	border-radius: 999px;
	background: rgba(20, 20, 23, .78);
	color: #fff;
	font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	letter-spacing: .02em;
	pointer-events: none;
}
.a360-badge svg { width: 18px; height: 18px; fill: #fff; }
.a360-hint {
	position: absolute;
	left: 50%;
	bottom: 58px;
	transform: translateX(-50%);
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .92);
	color: #141417;
	font: 500 13px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
	white-space: nowrap;
	pointer-events: none;
	transition: opacity .4s;
}
.a360-touched .a360-hint { opacity: 0; }
.a360-progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: rgba(0, 0, 0, .06);
	transition: opacity .5s;
}
.a360-progress span { display: block; height: 100%; width: 0; background: #cc1c11; transition: width .2s; }
.a360-ready .a360-progress { opacity: 0; }
.a360-controls {
	position: absolute;
	right: 10px;
	bottom: 10px;
	display: flex;
	gap: 8px;
}
.a360-btn {
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(20, 20, 23, .78);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .2s, transform .1s;
	-webkit-appearance: none;
	appearance: none;
}
.a360-btn:hover { background: #cc1c11; }
.a360-btn:active { transform: scale(.94); }
.a360-btn:focus-visible { outline: 2px solid #cc1c11; outline-offset: 2px; }
.a360-btn svg { width: 20px; height: 20px; fill: currentColor; }

/* Повноекранний режим (власне вікно — працює і на iPhone) */
.a360-noscroll, .a360-noscroll body { overflow: hidden !important; }
.a360-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(10, 10, 12, .92);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}
.a360-in-modal { width: min(92vw, 92vh); margin: 0; }
.a360-in-modal .a360-stage { border: 0; }
.a360-close { position: absolute; top: max(14px, env(safe-area-inset-top)); right: 14px; background: rgba(255, 255, 255, .16); }

/* Тема ховала основне фото товару, коли є 360 — залишаємо галерею як є, переглядач над нею */
.a360-has-viewer > .a360 + .woocommerce-product-gallery__wrapper { margin-top: 0; }

@media (max-width: 600px) {
	.a360-btn { width: 44px; height: 44px; }
	.a360-hint { bottom: 64px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.a360-hint, .a360-progress, .a360-btn { transition: none; }
}
