/* ============================================================
   DESKTOP
   ============================================================ */

#mapSites {
	display: block;
	position: relative;
}

#chunamur-map-container {
	z-index: 1;
}

/* Loader — toujours dans le flux, caché via opacity */
#chunamur-map-loading {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 440px;
	background: rgba(255, 255, 255, 0.80);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.4s ease;
}

#chunamur-map-loading.is-hidden {
	opacity: 0;
}

.chunamur-spinner {
	width: 44px;
	height: 44px;
	border: 4px solid #cce0f5;
	border-top-color: #005EA8;
	border-radius: 50%;
	animation: chunamur-spin 0.75s linear infinite;
}

@keyframes chunamur-spin {
	to { transform: rotate(360deg); }
}

/* Panneau d'info — desktop */
.site-info {
	width: 310px;
	height: 440px;
	position: absolute;
	top: 0;
	color: white;
	background-color: #005EA8;
	z-index: 2;
	overflow-y: auto;
	/* Caché via opacity + visibility (compatible avec les transitions CSS) */
	opacity: 0;
	visibility: hidden;
	transform: translateX(-8px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
}

.site-info.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
}

#site-info a { color: white; }

/* Layout interne desktop : image pleine largeur, texte en dessous */
.site-info-inner {
	display: flex;
	flex-direction: column;
}

.site-info-img {
	width: 100%;
	height: 160px;
	object-fit: cover;
	display: block;
	flex-shrink: 0;
}

.info-text {
	padding: 12px 15px 4px;
}

.site-type {
	text-transform: uppercase;
	font-size: 0.75rem;
	opacity: 0.85;
}

.site-name {
	padding: 4px 0 6px;
	font-size: 1rem;
	line-height: 1.3;
}

.site-address {
	font-size: 0.875rem;
	opacity: 0.9;
	line-height: 1.4;
}

.site-phone {
	margin-top: 6px;
	font-size: 0.875rem;
}

.site-phone a { color: white; }

.site-info-actions {
	padding: 10px 15px 15px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.btn-cun {
	border: 1px solid white;
	border-radius: 30px;
	padding: 5px 18px;
	text-transform: uppercase;
	font-size: 0.8rem;
	color: white;
	white-space: nowrap;
}

.btn-close-info {
	background-color: #005EA8;
	position: absolute;
	top: 0;
	right: 0;
	z-index: 3;
	border: none;
}

.btn-close-info .fa {
	color: white;
}

.site-list {
	margin-top: 25px;
}

.site-name .fa {
	font-size: 14px;
	padding-right: 10px;
}

.mapsite {
	cursor: pointer;
}

/* Handle : invisible sur desktop */
.bottom-sheet-handle { display: none; }

/* Backdrop */
#site-info-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.40);
	z-index: 998;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

#site-info-backdrop.is-visible {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.2s ease, visibility 0s linear 0s;
}


/* ============================================================
   MOBILE — Bottom Sheet
   ============================================================ */

@media (max-width: 767px) {

	#chunamur-map-container {
		height: 280px !important;
	}

	#chunamur-map-loading {
		height: 280px;
	}

	/* Reset desktop transitions, remplacées par translateY */
	.site-info {
		display: block !important;       /* bat le display:none du thème */
		opacity: 1 !important;
		visibility: visible !important;
		transform: translateY(110%) !important;
		transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
		position: fixed !important;
		bottom: 0;
		left: 0;
		top: auto !important;
		width: 100% !important;
		height: auto !important;
		max-height: 65vh;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		z-index: 999 !important;
		border-radius: 18px 18px 0 0;
		box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.22);
	}

	.site-info.is-open {
		transform: translateY(0) !important;
	}

	/* Handle visuel */
	.bottom-sheet-handle {
		display: block;
		width: 38px;
		height: 4px;
		background: rgba(255, 255, 255, 0.45);
		border-radius: 2px;
		margin: 12px auto 8px;
	}

	.btn-close-info {
		top: 8px;
		right: 10px;
	}

	/* Layout interne : thumbnail à gauche, texte à droite */
	.site-info-inner {
		flex-direction: row;
		align-items: flex-start;
		padding: 10px 12px 6px;
		gap: 12px;
	}

	.site-info-img {
		width: 80px;
		height: 80px;
		border-radius: 8px;
		flex-shrink: 0;
		align-self: flex-start;
		object-position: top center;
	}

	.info-text {
		padding: 0;
		flex: 1;
		min-width: 0;
	}

	.site-name { font-size: 0.95rem; }

	/* Boutons côte à côte pleine largeur */
	.site-info-actions {
		padding: 6px 12px 20px;
	}

	.site-info-actions .btn-cun {
		flex: 1;
		text-align: center;
	}
}
