/**
 * 360度回転写真ビューア + 写真タブ
 */

/* =========================================================
 * タブ（360°ビュー / 写真）
 * ========================================================= */
.asada-360-tabs__nav {
	display: flex;
	gap: 8px;
	margin-bottom: 10px;
}

.asada-360-tabs__btn {
	flex: 1 1 0;
	appearance: none;
	background: #f2f3f5;
	border: 1px solid #e0e2e6;
	border-radius: 6px;
	color: #555;
	cursor: pointer;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	padding: 11px 8px;
	transition: background-color .15s, color .15s, border-color .15s;
}

.asada-360-tabs__btn:hover {
	background: #e9eaee;
}

.asada-360-tabs__btn.is-active {
	background: #036EB7; /* ロゴ・ヘッダーと同じブルー */
	border-color: #036EB7;
	color: #fff;
}

.asada-360-tabs__btn-icon {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .5px;
	margin-right: 6px;
	padding: 2px 6px;
	border: 1px solid currentColor;
	border-radius: 3px;
	vertical-align: 1px;
}

/* ぐるりとした回転矢印アイコン（タブの360°ピル・ステージ左上バッジ共通） */
.asada-360__spin-icon {
	width: 12px;
	height: 12px;
	vertical-align: -1.5px;
	margin-right: 3px;
}

.asada-360-tabs__panel {
	display: none;
}

.asada-360-tabs__panel.is-active {
	display: block;
}

/* =========================================================
 * ビューア本体
 * ========================================================= */
.asada-360 {
	position: relative;
	margin: 0 0 12px;
}

.asada-360__stage {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: #f4f5f7;
	border-radius: 8px;
	cursor: grab;
	outline: none;
	/* 横ドラッグは回転に使い、縦スクロールはページに渡す */
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.asada-360__stage:focus-visible {
	box-shadow: 0 0 0 3px rgba(221, 51, 51, .45);
}

.asada-360.is-dragging .asada-360__stage {
	cursor: grabbing;
}

.asada-360__img,
.asada-360__canvas {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
	user-select: none;
	-webkit-user-drag: none;
}

/* --- 360バッジ --- */
.asada-360__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	background: rgba(0, 0, 0, .62);
	border-radius: 4px;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1px;
	line-height: 1;
	padding: 6px 9px;
	pointer-events: none;
}

/* --- 読み込み中 --- */
.asada-360__loader {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: rgba(244, 245, 247, .82);
}

.asada-360__loader[hidden] {
	display: none;
}

.asada-360__loader-bar {
	width: min(180px, 50%);
	height: 4px;
	background: #dfe1e5;
	border-radius: 999px;
	overflow: hidden;
}

.asada-360__loader-bar i {
	display: block;
	width: 0;
	height: 100%;
	background: #dd3333;
	transition: width .2s linear;
}

.asada-360__loader-text {
	color: #666;
	font-size: 12px;
	font-weight: 700;
}

/* --- 操作ヒント --- */
.asada-360__hint {
	position: absolute;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	display: flex;
	align-items: center;
	gap: 8px;
	background: rgba(0, 0, 0, .62);
	border-radius: 999px;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	padding: 8px 16px;
	pointer-events: none;
	opacity: 0;
	transition: opacity .3s;
	white-space: nowrap;
}

.asada-360.show-hint .asada-360__hint {
	opacity: 1;
}

.asada-360__hint-icon {
	display: block;
	width: 16px;
	height: 16px;
	border: 2px solid #fff;
	border-radius: 8px 8px 6px 6px;
	animation: asada360Hand 1.6s ease-in-out infinite;
}

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

/* --- 左右の送りボタン --- */
.asada-360__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 38px;
	height: 38px;
	appearance: none;
	background: rgba(255, 255, 255, .86);
	border: none;
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .22);
	cursor: pointer;
	opacity: 0;
	transition: opacity .15s;
}

.asada-360.is-ready .asada-360__nav {
	opacity: .85;
}

.asada-360__nav:hover {
	opacity: 1;
}

.asada-360__nav--prev { left: 10px; }
.asada-360__nav--next { right: 10px; }

.asada-360__nav::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 9px;
	border-top: 2px solid #333;
	border-right: 2px solid #333;
}

.asada-360__nav--prev::before { transform: translate(-40%, -50%) rotate(-135deg); }
.asada-360__nav--next::before { transform: translate(-60%, -50%) rotate(45deg); }

/* --- 下部コントロール --- */
.asada-360__ctrl {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 8px;
}

.asada-360__spin,
.asada-360__fs {
	appearance: none;
	background: #fff;
	border: 1px solid #d9dbdf;
	border-radius: 5px;
	color: #555;
	cursor: pointer;
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	padding: 8px 12px;
	transition: background-color .15s, color .15s, border-color .15s;
}

.asada-360__spin:hover,
.asada-360__fs:hover {
	background: #f4f5f7;
}

.asada-360__spin.is-playing {
	background: #dd3333;
	border-color: #dd3333;
	color: #fff;
}

.asada-360__range {
	appearance: none;
	flex: 1 1 auto;
	height: 4px;
	background: #dfe1e5;
	border-radius: 999px;
	cursor: pointer;
	min-width: 60px;
}

.asada-360__range::-webkit-slider-thumb {
	appearance: none;
	width: 16px;
	height: 16px;
	background: #dd3333;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

.asada-360__range::-moz-range-thumb {
	width: 16px;
	height: 16px;
	background: #dd3333;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

/* =========================================================
 * 全画面表示
 * ========================================================= */
.asada-360:fullscreen {
	display: flex;
	flex-direction: column;
	justify-content: center;
	background: #111;
	padding: 20px;
}

.asada-360:fullscreen .asada-360__stage {
	background: #111;
	border-radius: 0;
	flex: 1 1 auto;
	aspect-ratio: auto;
}

.asada-360:fullscreen .asada-360__ctrl {
	flex: 0 0 auto;
}

.asada-360.is-pseudo-fullscreen {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	justify-content: center;
	background: #111;
	margin: 0;
	padding: 16px;
}

.asada-360.is-pseudo-fullscreen .asada-360__stage {
	background: #111;
	aspect-ratio: auto;
	flex: 1 1 auto;
}

body.asada-360-locked {
	overflow: hidden;
}

/* =========================================================
 * スマホ
 * ========================================================= */
@media (max-width: 600px) {
	.asada-360-tabs__btn {
		font-size: 13px;
		padding: 10px 6px;
	}

	.asada-360__nav {
		width: 32px;
		height: 32px;
	}

	.asada-360__hint {
		font-size: 12px;
		padding: 7px 13px;
	}

	.asada-360__ctrl {
		gap: 8px;
	}

	.asada-360__spin,
	.asada-360__fs {
		font-size: 11px;
		padding: 7px 9px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.asada-360__hint-icon {
		animation: none;
	}
}
