/* Mapas Estarseguros Leaflet - Frontend */
.mesl-map-container {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	width: 100%;
	max-width: 1200px;
	min-height: 400px;
	margin: 1em 0;
	border: 1px solid #ddd;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
	font-family: "Nunito", sans-serif;
	--mesl-map-accent: #e74c3c;
}
.mesl-sidebar {
	flex: 0 0 320px;
	max-width: 320px;
	align-self: stretch;
	min-height: 400px;
	max-height: 600px;
	overflow-y: auto;
	background: #f9f9f9;
	border-right: 1px solid #ddd;
	padding: 12px;
}
.mesl-list { list-style: none; margin: 0; padding: 0; }
.mesl-sidebar-title {
	margin: 0 0 10px 0;
	padding: 0 0 8px 0;
	font-size: 1.1em;
	font-weight: 600;
	color: #1d2327;
	border-bottom: 1px solid #c3c4c7;
}
.mesl-group { margin-bottom: 0; }
/* Acordeón: fondo 5% mapa + 95% blanco; hover fondo 100% color mapa; texto #667674 */
.mesl-accordion-header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin: 0;
	padding: 8px 10px;
	font-size: 10px;
	font-family: "Nunito", sans-serif;
	font-weight: 900;
	color: #667674;
	text-align: left;
	/* Fallback sin color-mix; navegadores modernos: 5% mapa + 95% blanco */
	background: var(--mesl-map-accent, #e74c3c);
	background: color-mix(in srgb, var(--mesl-map-accent, #e74c3c) 5%, white);
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 0;
	cursor: pointer;
	overflow: hidden;
	transition: background 0.18s ease;
}
.mesl-accordion-header:hover {
	background: var(--mesl-map-accent, #e74c3c);
}
.mesl-accordion-header:focus-visible {
	outline: 2px solid var(--mesl-map-accent, #e74c3c);
	outline-offset: 2px;
	z-index: 1;
}
.mesl-accordion-title {
	flex: 1;
	position: relative;
	z-index: 1;
}
.mesl-accordion-icon {
	position: relative;
	z-index: 1;
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: 8px;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid currentColor;
	transition: transform 0.2s;
}
.mesl-accordion-group--expanded .mesl-accordion-icon {
	transform: rotate(180deg);
}
.mesl-accordion-header[aria-expanded="true"] {
	border-bottom: none;
}
/* Pila de tabs: primero solo redondeo arriba; intermedios sin radio; último solo redondeo abajo (colapsado); uno solo = las 4 esquinas */
.mesl-list > .mesl-group:first-child:not(:last-child) .mesl-accordion-header {
	border-radius: 4px 4px 0 0;
}
.mesl-list > .mesl-group:first-child:not(:last-child) .mesl-accordion-header[aria-expanded="true"] {
	border-radius: 4px 4px 0 0;
}
.mesl-list > .mesl-group:not(:first-child):not(:last-child) .mesl-accordion-header,
.mesl-list > .mesl-group:not(:first-child):not(:last-child) .mesl-accordion-header[aria-expanded="true"] {
	border-radius: 0;
}
.mesl-list > .mesl-group:last-child:not(:first-child) .mesl-accordion-header {
	border-radius: 0 0 4px 4px;
}
.mesl-list > .mesl-group:last-child:not(:first-child) .mesl-accordion-header[aria-expanded="true"] {
	border-radius: 0;
}
.mesl-list > .mesl-group:first-child:last-child .mesl-accordion-header {
	border-radius: 4px;
}
.mesl-list > .mesl-group:first-child:last-child .mesl-accordion-header[aria-expanded="true"] {
	border-radius: 4px 4px 0 0;
}
.mesl-accordion-content {
	overflow: hidden;
	border: 1px solid #c3c4c7;
	border-top: none;
	border-radius: 0;
	background: #fff;
}
.mesl-list > .mesl-group:last-child .mesl-accordion-content {
	border-radius: 0 0 4px 4px;
}
.mesl-accordion-group--collapsed .mesl-accordion-content {
	display: none;
}
.mesl-markers-list { list-style: none; margin: 0; padding: 8px; }
.mesl-marker-item {
	margin: 0;
	padding: 6px 8px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-bottom: none;
	border-radius: 0;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, border 0.15s;
	font-size: 10px;
}
.mesl-markers-list > .mesl-marker-item:first-child:not(:last-child) {
	border-radius: 4px 4px 0 0;
}
.mesl-markers-list > .mesl-marker-item:not(:first-child):not(:last-child) {
	border-radius: 0;
}
.mesl-markers-list > .mesl-marker-item:last-child:not(:first-child) {
	border-radius: 0 0 4px 4px;
	border-bottom: 1px solid #e0e0e0;
}
.mesl-markers-list > .mesl-marker-item:first-child:last-child {
	border-radius: 4px;
	border-bottom: 1px solid #e0e0e0;
}
.mesl-marker-item:hover,
.mesl-marker-item.active {
	position: relative;
	z-index: 1;
	background: var(--mesl-map-accent, #e74c3c);
	background: color-mix(in srgb, var(--mesl-map-accent, #e74c3c) 5%, white);
	/* Borde completo: el base usa border-bottom:none entre filas */
	border: 1px solid var(--mesl-map-accent, #e74c3c);
}
.mesl-marker-title { display: block; font-size: 10px; font-weight: 500; line-height: 1.35; }
.mesl-marker-location,
.mesl-marker-parroquia {
	display: block;
	font-size: 9px;
	font-weight: 700;
	color: #667674;
	line-height: 1.3;
	margin-top: 2px;
}
.mesl-marker-location:empty,
.mesl-marker-parroquia:empty {
	display: none;
	margin: 0;
}
.mesl-marker-address,
.mesl-marker-phone { display: block; font-size: 0.9em; color: #50575e; margin-top: 4px; }
.mesl-list-directions {
	display: inline-block;
	margin-top: 6px;
	font-size: 0.9em;
	color: #2271b1;
	text-decoration: underline;
}
.mesl-list-directions:hover { color: #135e96; }
.mesl-map-column {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-self: stretch;
	min-width: 0;
	min-height: 0;
}
.mesl-tipo-filter {
	padding: 0;
	background: transparent;
	font-size: 12px;
}
.mesl-tipo-filter--above-list {
	margin: 0 0 12px 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}
.mesl-tipo-filter-inner {
	display: flex;
	flex-direction: row;
	align-items: stretch;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	overflow: hidden;
	box-sizing: border-box;
}
.mesl-tipo-filter-heading {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px 10px;
	min-width: 4.5em;
	font-family: "Nunito", sans-serif;
	font-weight: 900;
	font-size: 10px;
	letter-spacing: 0.02em;
	color: #667674;
	/* Mismo fondo que tabs: 5% mapa + 95% blanco */
	background: var(--mesl-map-accent, #e74c3c);
	background: color-mix(in srgb, var(--mesl-map-accent, #e74c3c) 5%, white);
	border-right: 1px solid rgba(0, 0, 0, 0.2);
}
.mesl-tipo-filter--above-list .mesl-tipo-filter-radios {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 6px;
	padding: 8px 10px;
	flex-wrap: nowrap;
}
.mesl-center-map-wrap {
	margin: 0 0 10px 0;
}
.mesl-center-map-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	font-family: inherit;
	font-size: 11px;
	font-weight: 600;
	color: #1d2327;
	/* Mismo fondo que tabs: 5% mapa + 95% blanco */
	background: var(--mesl-map-accent, #e74c3c);
	background: color-mix(in srgb, var(--mesl-map-accent, #e74c3c) 5%, white);
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.15s, color 0.15s;
}
.mesl-center-map-btn:hover {
	background: #f0f6fc;
	border-color: #2271b1;
}
.mesl-center-map-btn:hover .mesl-center-map-btn-text {
	color: #135e96;
}
.mesl-center-map-btn:focus {
	outline: 2px solid var(--mesl-map-accent, #2271b1);
	outline-offset: 1px;
}
.mesl-center-map-btn .fa-solid {
	font-size: 13px;
	line-height: 1;
	color: var(--mesl-map-accent, #e74c3c);
}
.mesl-center-map-btn:hover .fa-solid {
	filter: brightness(0.88);
}
.mesl-center-map-btn-text {
	line-height: 1.2;
	color: #1d2327;
}
.mesl-tipo-filter-label {
	cursor: pointer;
	font-weight: 500;
	font-size: 10px;
	color: #2c3338;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	line-height: 1.3;
}
.mesl-tipo-filter-label input {
	margin: 0;
	flex-shrink: 0;
	vertical-align: middle;
	accent-color: var(--mesl-map-accent, #e74c3c);
}
.mesl-marker-item.mesl-tipo-hidden,
.mesl-accordion-group.mesl-accordion-group--tipo-empty {
	display: none !important;
}
.mesl-map-canvas {
	flex: 1 1 auto;
	align-self: stretch;
	min-height: 400px;
	height: auto;
	min-width: 0;
}
.mesl-marker-icon { background: none !important; border: none !important; }
.mesl-marker-icon .mesl-pin-wrap svg { display: block; vertical-align: top; }
/* Popup del marcador (~20% más ancho: 200→240px; Leaflet limita el content ~301px → ~360px) */
.mesl-popup { min-width: 240px; }
.mesl-map-container .leaflet-popup-content {
	min-width: 240px;
	max-width: 360px;
}
.mesl-popup p { margin: 0 0 8px 0; line-height: 1.4; }
.mesl-popup p:last-child { margin-bottom: 0; }
.mesl-popup-directions {
	color: #2271b1;
	text-decoration: underline;
}
.mesl-popup-directions:hover { color: #135e96; }

@media (max-width: 768px) {
	.mesl-map-container { flex-direction: column; align-items: stretch; min-height: 0; }
	.mesl-sidebar { flex: 0 1 auto; max-width: none; max-height: 300px; }
	.mesl-map-column { width: 100%; }
	.mesl-map-canvas { flex: 1 1 auto; align-self: stretch; min-height: 300px; height: 320px; }
}
