/* StayInRoom Map — base styles. Namespaced under .sir-map-* to avoid
   clashing with Elementor or theme styles. */

/* On desktop, the collapsible wrapper is invisible for layout purposes —
   its children (filters, split) behave exactly as if they were direct
   children of .sir-map-wrapper, same as before this feature was added. */
.sir-map-collapsible {
	display: contents;
}

.sir-map-mobile-toggle,
.sir-map-mobile-close {
	display: none; /* only relevant on tablet/mobile widths, see below */
}

/* Tablet and mobile: the map starts hidden, replaced by a floating
   "Mostra mappa" button. Tapping it opens the whole filters+map area as a
   true fullscreen overlay, with a "Chiudi mappa" button to close it again —
   there simply isn't room to show a persistent sidebar map on a phone. */
@media ( max-width: 1024px ) {
	.sir-map-mobile-toggle {
		display: block;
		position: fixed;
		bottom: 20px;
		left: 50%;
		transform: translateX( -50% );
		z-index: 9999;
		background: #1c2b3a;
		color: #fff;
		border: none;
		border-radius: 999px;
		padding: 14px 28px;
		font-size: 15px;
		font-weight: 600;
		cursor: pointer;
		box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.25 );
	}

	.sir-map-collapsible {
		display: none;
	}

	.sir-map-wrapper.sir-mobile-map-open .sir-map-mobile-toggle {
		display: none;
	}

	.sir-map-wrapper.sir-mobile-map-open .sir-map-collapsible {
		display: flex;
		flex-direction: column;
		position: fixed;
		inset: 0;
		z-index: 99999;
		background: #fff;
		padding: 16px;
		box-sizing: border-box;
		overflow-y: auto;
	}

	.sir-map-wrapper.sir-mobile-map-open .sir-map-split {
		flex: 1;
		min-height: 0;
	}

	.sir-map-mobile-close {
		align-self: flex-end;
	}

	.sir-map-wrapper.sir-mobile-map-open .sir-map-mobile-close {
		display: block;
		background: #1c2b3a;
		color: #fff;
		border: none;
		border-radius: 6px;
		padding: 10px 16px;
		font-size: 14px;
		cursor: pointer;
		margin-bottom: 12px;
	}
}

.sir-map-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 12px;
	font-family: inherit;
}

.sir-map-filters select,
.sir-map-filters input[type="number"] {
	padding: 8px 10px;
	border: 1px solid #dfe6ea;
	border-radius: 6px;
	font-size: 14px;
	background: #fff;
}

.sir-map-filters input[type="number"] {
	width: 90px;
}

.sir-map-filter-available-label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	color: #1c2b3a;
	cursor: pointer;
}

.sir-map-filter-reset {
	background: none;
	border: 1px solid #dfe6ea;
	border-radius: 6px;
	padding: 8px 14px;
	font-size: 14px;
	cursor: pointer;
	color: #5a6b78;
}

.sir-map-filter-reset:hover {
	background: #f4f7f9;
}

.sir-map-filter-count {
	margin-left: auto;
	color: #5a6b78;
	font-size: 14px;
}

.sir-map-view-toggle {
	display: none;
	gap: 8px;
	margin-bottom: 12px;
}

.sir-map-toggle-btn {
	flex: 1;
	padding: 10px;
	border: 1px solid #dfe6ea;
	border-radius: 6px;
	background: #fff;
	color: #5a6b78;
	font-size: 14px;
	cursor: pointer;
}

.sir-map-toggle-btn.sir-map-toggle-active {
	background: #2e6f95;
	color: #fff;
	border-color: #2e6f95;
}

.sir-map-split {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}

.sir-map-list-pane {
	flex: 0 0 38%;
	max-height: 600px;
	overflow-y: auto;
	border: 1px solid #dfe6ea;
	border-radius: 8px;
	padding: 8px;
	box-sizing: border-box;
}

.sir-map-map-pane {
	flex: 1;
	min-width: 0; /* prevents the map from overflowing its flex parent */
}

.sir-map-list-card {
	display: flex;
	gap: 10px;
	padding: 10px;
	border-radius: 6px;
	cursor: pointer;
	border: 2px solid transparent;
	margin-bottom: 6px;
}

.sir-map-list-card:hover {
	background: #f4f7f9;
}

.sir-map-list-card.sir-list-card-active {
	border-color: #2e6f95;
	background: #f4f7f9;
}

.sir-map-list-thumb {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
	background: #e5e5e5;
}

.sir-map-list-card-title {
	font-weight: 600;
	color: #1c2b3a;
	font-size: 14px;
	margin: 0 0 4px;
}

.sir-map-list-card-price {
	color: #2e6f95;
	font-weight: 600;
	font-size: 14px;
}

.sir-map-list-empty {
	padding: 20px;
	color: #5a6b78;
	text-align: center;
}

/* Mobile: stack list/map, hide one via the toggle instead of side-by-side. */
@media ( max-width: 1024px ) {
	.sir-map-view-toggle {
		display: flex;
	}
	.sir-map-split {
		flex-direction: column;
	}
	.sir-map-list-pane,
	.sir-map-map-pane {
		flex: 1 1 auto;
		width: 100%;
	}
	.sir-map-wrapper.sir-view-list .sir-map-map-pane {
		display: none;
	}
	.sir-map-wrapper.sir-view-map .sir-map-list-pane {
		display: none;
	}
}

.sir-map-container {
	width: 100%;
	height: 600px;
	border-radius: 8px;
	overflow: hidden;
}

.sir-map-placeholder {
	width: 100%;
	height: 600px;
	border-radius: 8px;
	background: #f4f7f9;
	border: 1px solid #dfe6ea;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	text-align: center;
	padding: 24px;
	box-sizing: border-box;
}

.sir-map-placeholder-text {
	max-width: 360px;
	color: #5a6b78;
	font-size: 15px;
	margin: 0;
}

.sir-map-consent-btn {
	background: #2e6f95;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 10px 20px;
	font-size: 15px;
	cursor: pointer;
}

.sir-map-consent-btn:hover {
	background: #24587a;
}

.sir-map-popup {
	max-width: 240px;
	font-family: inherit;
}

.sir-map-popup-list {
	list-style: none;
	margin: 8px 0 0;
	padding: 0;
	max-height: 220px;
	overflow-y: auto;
}

.sir-map-popup-item {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}

.sir-map-popup-thumb {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
}

.sir-map-popup-price {
	font-weight: 600;
	color: #2e6f95;
}
