/* Estilos compartidos por las vistas de mapa (map-view y map-split-view).
   El layout propio de cada vista vive en su .ejs; aqui van la barra de filtros,
   la tarjeta de proyecto y los ajustes sobre el marcado de Google Maps. */

/* ---------- Barra de filtros ---------- */
.msv-filterbar-title {
	color: var(--text-color);
	font-size: 20px;
	font-weight: 700;
	margin: 0;
}

.msv-filterbar-subtitle {
	color: #8a8f98;
	font-size: 13px;
	margin: 0;
}

/* El subtitulo es la salida al listado: se comporta como enlace sin cambiar de tono. */
.msv-filterbar-link {
	display: inline-block;
	text-decoration: underline;
}

.msv-filterbar-link:hover {
	color: var(--primary-color);
}

.msv-filterbar-controls {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.msv-select {
	appearance: none;
	-webkit-appearance: none;
	background-color: #f1f3f6;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%236b7280' d='M0 0h10L5 6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 10px 6px;
	border: 0;
	border-radius: 999px;
	color: #4b5563;
	font-size: 14px;
	height: 40px;
	min-width: 180px;
	padding: 0 38px 0 18px;
}

.msv-select:focus {
	outline: 2px solid var(--primary-color-transparent);
}

.msv-select:disabled {
	opacity: .55;
}

.msv-apply {
	background: var(--primary-color);
	border: 0;
	border-radius: 999px;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	height: 40px;
	padding: 0 28px;
}

.msv-apply:hover {
	filter: brightness(.93);
}

/* ---------- Ficha (envoltorio comun a todas las tarjetas) ----------
   La tarjeta interna la define cada portal en partials/_tarjetaMapa; aqui solo
   se controla el comportamiento compartido: click, resaltado y ocultamiento. */
.msv-item {
	cursor: pointer;
	transition: box-shadow .2s ease, transform .2s ease;
}

.msv-item[hidden] {
	display: none !important;
}

.msv-item:hover,
.msv-item.is-active {
	box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
	transform: translateY(-2px);
}

.msv-item > .card {
	height: 100%;
}

/* ---------- Tarjeta generica (portales sin plantilla propia) ---------- */
.msv-card {
	background: #fff;
	border: 1px solid #e6e8ec;
	border-radius: 6px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.msv-item:hover .msv-card,
.msv-item.is-active .msv-card {
	border-color: var(--primary-color);
}

.msv-card-image {
	height: 150px;
	overflow: hidden;
	position: relative;
}

.msv-card-image img {
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.msv-chip {
	border-radius: 3px;
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .2px;
	padding: 3px 9px;
}

.msv-card-comuna {
	background: var(--primary-color);
	left: 10px;
	position: absolute;
	top: 10px;
}

.msv-card-tags {
	bottom: 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	left: 10px;
	position: absolute;
}

.msv-tag-tipo {
	background: var(--primary-color);
}

.msv-tag-destacado {
	background: var(--secondary-color);
}

.msv-card-body {
	flex: 1 1 auto;
	padding: 14px 16px 16px;
}

.msv-card-address {
	color: #9aa0a8;
	font-size: 11px;
	margin-bottom: 2px;
}

.msv-card-name {
	color: var(--text-color);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
	margin-bottom: 8px;
}

.msv-card-price-label {
	color: #9aa0a8;
	font-size: 10px;
	margin-bottom: 0;
}

.msv-card-price {
	color: var(--primary-color);
	font-size: 19px;
	font-weight: 700;
	margin-bottom: 8px;
}

.msv-card-description {
	color: #9aa0a8;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	font-size: 11px;
	line-height: 1.5;
	margin: 0;
	overflow: hidden;
}

.msv-card-metrics {
	align-items: center;
	background: #22262b;
	color: #fff;
	display: flex;
	flex-wrap: wrap;
	font-size: 11px;
	gap: 8px;
	padding: 9px 16px;
}

.msv-card-metrics i {
	color: var(--primary-color);
	margin-right: 4px;
}

.msv-card-metric-divider {
	background: rgba(255, 255, 255, .25);
	height: 14px;
	width: 1px;
}

/* ---------- Control propio del mapa ---------- */
.msv-map-control {
	background: #fff;
	border: 0;
	border-radius: 999px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
	color: #5f6368;
	height: 38px;
	margin: 10px;
	width: 38px;
}

.msv-map-control:hover {
	color: var(--primary-color);
}

/* ---------- Ventana del marcador ----------
   La ficha del mapa es la misma caluga del portal, pero reducida. Se usa zoom y no
   transform porque zoom si achica la caja: asi la ventana de Google mide lo que se ve. */
:root {
	--msv-escala-ficha: .86;
}

/* Google fija font-family: Roboto en .gm-style y la ficha lo heredaba, quedando con
   una tipografia distinta a la del resto del portal. --portal-font viaja desde body,
   que si es antecesor del mapa, porque las variables CSS no las pisa Google.
   Se declara solo en la raiz de la ficha: sus hijos la heredan y los <i> conservan
   la suya, que es la de Font Awesome y es lo que dibuja los iconos. */
.msv-infowindow {
	font-family: var(--portal-font, sans-serif);
	width: 260px;
}

.msv-infowindow .msv-item {
	cursor: pointer;
}

.msv-infowindow .msv-item:hover {
	box-shadow: none;
	transform: none;
}

.msv-infowindow .card {
	border: 0;
	border-radius: 0;
	box-shadow: none !important;
	margin: 0;
}

/* Contenedor propio de Google: se anula su relleno para que la tarjeta quede a ras. */
.gm-style .gm-style-iw-c {
	border-radius: 6px;
	overflow: visible;
	padding: 0;
}

.gm-style .gm-style-iw-d {
	max-height: none !important;
	overflow: hidden !important;
	padding: 0;
}

/* La franja del boton de cierre se saca del flujo: ocupaba 48 px sobre la tarjeta. */
.gm-style .gm-style-iw-chr {
	height: auto;
	min-height: 0;
	position: absolute;
	right: -10px;
	top: -10px;
	z-index: 2;
}

.gm-style .gm-style-iw-ch {
	display: none;
	padding: 0;
}

.gm-style .gm-style-iw-c button.gm-ui-hover-effect {
	background: var(--primary-color) !important;
	border-radius: 50%;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
	height: 26px !important;
	margin: 0 !important;
	min-width: 0 !important;
	opacity: 1 !important;
	padding: 0 !important;
	width: 26px !important;
}

.gm-style .gm-style-iw-c button.gm-ui-hover-effect > span {
	background-color: #fff !important;
	height: 14px !important;
	margin: 6px !important;
	width: 14px !important;
}

/* La ventana se corre a la derecha del marcador (por defecto Google la apoya encima):
   translate deja el borde izquierdo junto al pin y la centra verticalmente en el.
   El desplazamiento va dividido por la escala porque el zoom tambien lo reduce. */
.gm-style .gm-style-iw-c {
	transform: translate(33px, -50%) !important;
	zoom: var(--msv-escala-ficha, .86);
}

/* Sin punta: la ventana no cuelga sobre el marcador, va a su derecha. */
.gm-style .gm-style-iw-tc,
.gm-style .gm-style-iw-t::after {
	display: none;
}
