/*
 * PanoramaNav — carousel + optional floor-plan overlay for the panorama viewer.
 * Additive layer only: does not modify Pannellum's own viewer.css.
 * Brand tokens reused from css/375da.css (no new palette introduced):
 *   brown  rgba(94,87,75,1)     cream  rgba(227,221,210,1)     tan rgba(235,217,185,0.9)
 */

.panonav-carousel,
.panonav-plano-toggle,
.panonav-plano-panel,
.panonav-plano-panel * {
	box-sizing: border-box;
}

/* ---------- Thumbnail carousel ---------- */

.panonav-carousel {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10;
	padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
	background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
	pointer-events: none;
}

.panonav-carousel-track {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	pointer-events: auto;
	padding-bottom: 2px;
}

.panonav-thumb {
	position: relative;
	flex: 0 0 auto;
	width: 84px;
	height: 56px;
	padding: 0;
	margin: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.35);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.panonav-thumb-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.panonav-thumb-active {
	border-color: rgba(227, 221, 210, 1);
	box-shadow: 0 0 0 2px rgba(94, 87, 75, 0.85);
}

.panonav-thumb-label {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4px;
	text-align: center;
	font-family: Comfortaa, Arial, sans-serif;
	font-size: 11px;
	line-height: 1.2;
	color: rgba(227, 221, 210, 1);
	background: rgba(94, 87, 75, 0.88);
	opacity: 0;
	transition: opacity 0.15s ease;
	pointer-events: none;
}

.panonav-thumb:hover .panonav-thumb-label,
.panonav-thumb:focus-visible .panonav-thumb-label {
	opacity: 1;
}

/* Pannellum's own title/author box (.pnlm-panorama-info) also docks bottom-left by
   default and would otherwise sit directly under the carousel — lift it clear. Loaded
   after viewer.css, so this wins on equal specificity without needing !important. */
.pnlm-panorama-info {
	bottom: 96px;
}

/* Desktop: the strip docks on the right edge as a vertical column, vertically centred,
   so the title/author box keeps the lower-left corner to itself. Phones keep the
   horizontal strip along the bottom (see the mobile block at the end). */
@media (min-width: 641px) {
	.panonav-carousel {
		left: auto;
		right: 12px;
		top: 56px;
		bottom: 16px;
		width: auto;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		padding: 0;
		background: none;
	}

	.panonav-carousel-track {
		flex-direction: column;
		max-height: 100%;
		overflow-x: hidden;
		overflow-y: auto;
		padding: 4px;
		border-radius: 10px;
		background: rgba(0, 0, 0, 0.35);
		backdrop-filter: blur(4px);
		-webkit-backdrop-filter: blur(4px);
	}

	.panonav-thumb {
		width: 100px;
		height: 66px;
	}

	.pnlm-panorama-info {
		bottom: 16px;
		max-width: calc(100% - 150px);
	}
}

/* ---------- Floor plan ---------- */

.panonav-plano-toggle {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 11;
	padding: 8px 16px;
	border: none;
	border-radius: 20px;
	background: rgba(94, 87, 75, 0.85);
	color: rgba(227, 221, 210, 1);
	font-family: Comfortaa, Arial, sans-serif;
	font-size: 13px;
	cursor: pointer;
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
}

.panonav-plano-toggle[aria-pressed="true"] {
	background: rgba(235, 217, 185, 0.95);
	color: rgba(94, 87, 75, 1);
}

.panonav-plano-panel {
	position: absolute;
	inset: 0;
	z-index: 12;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 16px 100px;
	background: rgba(0, 0, 0, 0.35);
}

/* Explicit, higher-specificity than the display:flex rule above so the [hidden]
   attribute reliably wins regardless of stylesheet load order. */
.panonav-plano-panel[hidden] {
	display: none;
}

.panonav-plano-card {
	position: relative;
	max-width: min(600px, 90%);
	max-height: 100%;
	padding: 20px;
	border-radius: 12px;
	background: rgba(227, 221, 210, 0.92);
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.panonav-plano-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 28px;
	height: 28px;
	border: none;
	border-radius: 50%;
	background: rgba(94, 87, 75, 0.85);
	color: rgba(227, 221, 210, 1);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.panonav-plano-imgwrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* The plan drawing is commonly a transparent PNG/SVG — it's never given an opaque
   background so the card's brand-cream backing shows through instead of a white box. */
.panonav-plano-img {
	display: block;
	max-width: 100%;
	max-height: 60vh;
	object-fit: contain;
	background: transparent;
}

.panonav-plano-pin {
	position: absolute;
	transform: translate(-50%, -50%);
	width: 26px;
	height: 26px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid rgba(227, 221, 210, 1);
	border-radius: 50%;
	background: rgba(94, 87, 75, 0.9);
	cursor: pointer;
}

.panonav-plano-pin-active {
	background: rgba(235, 217, 185, 0.95);
	border-color: rgba(94, 87, 75, 1);
}

.panonav-plano-arrow {
	display: block;
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-bottom: 10px solid rgba(227, 221, 210, 1);
	transform-origin: 50% 70%;
}

.panonav-plano-pin-active .panonav-plano-arrow {
	border-bottom-color: rgba(94, 87, 75, 1);
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
	.panonav-thumb {
		width: 68px;
		height: 46px;
	}

	.pnlm-panorama-info {
		bottom: 78px;
	}

	.panonav-plano-panel {
		padding: 0 0 96px;
		background: rgba(0, 0, 0, 0.55);
	}

	.panonav-plano-card {
		max-width: 100%;
		width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}

	.panonav-plano-imgwrap {
		height: 100%;
	}

	.panonav-plano-img {
		max-height: 100%;
	}
}
