/* Mapa interactivo — toolbar arriba + mapa full width */
.mapa-interactivo {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	font-family: var(--font-body, 'Montserrat', sans-serif);
	color: var(--text-color, #717973);
}

.mapa-interactivo--map-only .mapa-interactivo__map-wrap {
	border-radius: 20px;
}

/* Toolbar — fila compacta: buscador pill + filtro icono (PWA y web) */
.mapa-interactivo__toolbar {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: 8px;
	width: 100%;
}

.mapa-interactivo__search-field {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
}

.mapa-interactivo__search-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 12px;
	border: 1px solid #d9e1dd;
	border-radius: 22px;
	background: #fff;
	box-shadow: 0 0 10px 0 #d9e1dd;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mapa-interactivo__search-wrap:focus-within {
	border-color: var(--primary-color, #2d5a43);
	box-shadow: 0 0 0 3px rgba(45, 90, 67, 0.12);
}

.mapa-interactivo__search-icon {
	position: static;
	transform: none;
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	font-size: 22px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--primary-color, #2d5a43);
	pointer-events: none;
}

.mapa-interactivo__search,
.mapa-interactivo input.mapa-interactivo__search,
.mapa-interactivo input.mapa-interactivo__search:focus,
.mapa-interactivo input.mapa-interactivo__search:hover,
.mapa-interactivo input.mapa-interactivo__search:active {
	flex: 1;
	width: auto;
	min-width: 0;
	height: auto;
	padding: 0 !important;
	border: none !important;
	border-radius: 0;
	box-shadow: none !important;
	outline: none !important;
	background: transparent !important;
	-webkit-appearance: none;
	appearance: none;
	font-family: var(--font-headline, 'Montserrat', sans-serif);
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.2;
	color: var(--primary-color, #2d5a43);
}

.mapa-interactivo__search::-webkit-search-decoration,
.mapa-interactivo__search::-webkit-search-cancel-button,
.mapa-interactivo__search::-webkit-search-results-button,
.mapa-interactivo__search::-webkit-search-results-decoration {
	-webkit-appearance: none;
	appearance: none;
	display: none;
}

.mapa-interactivo__search::placeholder {
	color: #9aa39d;
}

.mapa-interactivo__search:focus {
	outline: none !important;
	box-shadow: none !important;
	border: none !important;
}

/* Sugerencias de búsqueda */
.mapa-interactivo__suggestions {
	position: absolute;
	top: calc(100% + 0.45rem);
	left: 0;
	right: 0;
	z-index: 30;
	margin: 0;
	padding: 0.4rem;
	list-style: none;
	max-height: 280px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #e8eeea;
	border-radius: 16px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.mapa-interactivo__suggestions[hidden] {
	display: none;
}

.mapa-interactivo__list-item {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
	text-align: left;
	padding: 0.65rem 0.85rem;
	border: none;
	background: transparent;
	border-radius: 10px;
	cursor: pointer;
	font-family: inherit;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--primary-color, #2d5a43);
	transition: background 0.2s ease;
}

.mapa-interactivo__list-num {
	flex: 0 0 auto;
	min-width: 1.65rem;
	height: 1.65rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: var(--primary-color, #2d5a43);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.mapa-interactivo__list-title {
	flex: 1 1 auto;
	min-width: 0;
}

.mapa-interactivo__list-item:hover,
.mapa-interactivo__list-item:focus {
	background: rgba(45, 90, 67, 0.08);
	outline: none;
}

.mapa-interactivo__list-empty {
	padding: 0.65rem 0.85rem;
	font-size: 0.88rem;
	color: var(--text-color, #717973);
}

/* Dropdown filtros */
.mapa-interactivo__filter-field {
	position: relative;
	flex: 0 0 44px;
}

.mapa-interactivo__filter-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	width: 44px;
	height: 44px;
	max-width: none;
	padding: 0;
	border: 1px solid #d9e1dd;
	border-radius: 22px;
	background: #fff;
	box-shadow: 0 0 10px 0 #d9e1dd;
	font-family: var(--font-headline, 'Montserrat', sans-serif);
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--primary-color, #2d5a43);
	cursor: pointer;
	white-space: nowrap;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.mapa-interactivo__filter-toggle:hover,
.mapa-interactivo__filter-toggle:focus {
	outline: none;
	border-color: var(--primary-color, #2d5a43);
	background: var(--neutral-color, #f5f2ed);
}

.mapa-interactivo__filter-field.is-open .mapa-interactivo__filter-toggle {
	border-color: var(--primary-color, #2d5a43);
	box-shadow: 0 0 0 3px rgba(45, 90, 67, 0.12);
}

.mapa-interactivo__filter-toggle-icon {
	font-size: 22px;
	line-height: 1;
}

.mapa-interactivo__filter-toggle-label,
.mapa-interactivo__filter-toggle-caret {
	display: none;
}

.mapa-interactivo__filter-menu {
	position: absolute;
	top: calc(100% + 0.45rem);
	left: auto;
	right: 0;
	z-index: 30;
	min-width: min(300px, calc(100vw - 32px));
	max-height: 320px;
	overflow-y: auto;
	padding: 0.65rem;
	background: #fff;
	border: 1px solid #e8eeea;
	border-radius: 16px;
	box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.mapa-interactivo__filter-menu[hidden] {
	display: none;
}

.mapa-interactivo__filter-menu-title {
	margin: 0.15rem 0.5rem 0.5rem;
	font-family: var(--font-headline, 'Montserrat', sans-serif);
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #8a9490;
}

.mapa-interactivo__filter-actions {
	display: flex;
	gap: 0.45rem;
	padding: 0 0.35rem 0.55rem;
	border-bottom: 1px solid #eef2ef;
	margin-bottom: 0.45rem;
}

.mapa-interactivo__filter-action {
	flex: 1 1 50%;
	padding: 0.35rem 0.5rem;
	border: 1px solid #d9e1dd;
	border-radius: 999px;
	background: #f8faf9;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--primary-color, #2d5a43);
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.mapa-interactivo__filter-action:hover,
.mapa-interactivo__filter-action:focus {
	outline: none;
	border-color: var(--primary-color, #2d5a43);
	background: rgba(45, 90, 67, 0.08);
}

.mapa-interactivo__filter-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.5rem 0.55rem;
	border-radius: 10px;
	font-size: 0.88rem;
	cursor: pointer;
	color: #3a4540;
	transition: background 0.2s ease;
}

.mapa-interactivo__filter-item:hover {
	background: rgba(45, 90, 67, 0.06);
}

.mapa-interactivo__filter-item input {
	accent-color: var(--primary-color, #2d5a43);
	width: 16px;
	height: 16px;
}

.mapa-interactivo__filter-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 8px;
	color: #fff;
	flex-shrink: 0;
}

.mapa-interactivo__filter-icon .material-symbols-outlined {
	font-size: 18px;
}

/* Mapa full width — clip solo en el wrap, no en toolbar/dropdowns */
.mapa-interactivo__map-wrap {
	position: relative;
	width: 100%;
	max-width: 100%;
	height: var(--mapa-altura, 600px);
	min-height: 280px;
	border-radius: 20px;
	overflow: hidden;
	background: var(--neutral-color, #f5f2ed);
	box-shadow: 0 0 10px 0 #d9e1dd;
	box-sizing: border-box;
	isolation: isolate;
}

.mapa-interactivo__map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-height: 0;
	z-index: 1;
}

.mapa-interactivo__map.leaflet-container {
	overflow: hidden;
	background: var(--neutral-color, #f5f2ed);
	font-family: var(--font-body, 'Montserrat', sans-serif);
}

/* Elementor/theme img { max-width:100% } rompe tiles de Leaflet */
.mapa-interactivo__map.leaflet-container img,
.mapa-interactivo__map.leaflet-container svg {
	max-width: none !important;
	max-height: none !important;
}

/* Popups: z-index alto para que se vean sobre otros elementos */
.mapa-interactivo__map .leaflet-popup-pane {
	z-index: 700;
}

/* Toolbar/dropdowns visibles; solo el mapa se recorta */
.mapa-interactivo {
	max-width: 100%;
	overflow: visible;
	position: relative;
	z-index: 1;
}

.mapa-interactivo__toolbar {
	position: relative;
	z-index: 2;
}

.mapa-interactivo__map .leaflet-control-zoom {
	border: none;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
	border-radius: 10px;
	overflow: hidden;
}

.mapa-interactivo__map .leaflet-control-zoom a {
	width: 34px;
	height: 34px;
	line-height: 34px;
	color: var(--primary-color, #2d5a43);
	font-size: 1.1rem;
	border-bottom: 1px solid #e8eeea;
}

.mapa-interactivo__map .leaflet-control-zoom a:hover {
	background: var(--neutral-color, #f5f2ed);
}

.mapa-interactivo__loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	background: rgba(245, 242, 237, 0.92);
	z-index: 2;
	font-size: 0.92rem;
	color: var(--text-color, #717973);
}

.mapa-interactivo__loading::before {
	content: '';
	width: 36px;
	height: 36px;
	border: 3px solid #d9e1dd;
	border-top-color: var(--primary-color, #2d5a43);
	border-radius: 50%;
	animation: mapa-spin 0.8s linear infinite;
}

.mapa-interactivo__loading.is-done {
	display: none;
}

.mapa-interactivo__empty {
	position: absolute;
	left: 50%;
	bottom: 1.25rem;
	transform: translateX( -50% );
	z-index: 3;
	max-width: min( 90%, 22rem );
	padding: 0.55rem 1rem;
	border-radius: 999px;
	background: rgba( 13, 17, 23, 0.82 );
	color: #fff;
	font-size: 0.85rem;
	text-align: center;
	pointer-events: none;
}

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

/* Marcadores */
.mapa-marker {
	background: transparent;
	border: none;
}

.mapa-marker__photo {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 3px solid var(--primary-color, #2d5a43);
	background-size: cover;
	background-position: center;
	box-shadow: 0 4px 12px rgba(45, 90, 67, 0.28);
	position: relative;
	overflow: hidden;
}

.mapa-marker__img {
	position: absolute !important;
	inset: 0 !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
	object-position: center !important;
	display: block;
	border-radius: 50%;
}

.mapa-marker__photo--empty {
	background: linear-gradient(135deg, #3d7258, #2d5a43);
}

.mapa-marker__num {
	position: absolute;
	bottom: -5px;
	right: -5px;
	background: var(--primary-color, #2d5a43);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	min-width: 20px;
	height: 20px;
	padding: 0 4px;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
}

.mapa-marker__icon {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
	border: 2px solid #fff;
}

.mapa-marker__icon .material-symbols-outlined {
	font-size: 20px;
}

/* Popups */
.mapa-leaflet-popup .leaflet-popup-content-wrapper {
	border-radius: 16px;
	padding: 0;
	overflow: hidden;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.mapa-leaflet-popup .leaflet-popup-content {
	margin: 0;
}

.mapa-leaflet-popup .leaflet-popup-tip {
	background: #fff;
}

.mapa-popup {
	padding: 0;
	min-width: 220px;
}

.mapa-popup__img {
	display: block;
	width: 100%;
	height: 130px;
	object-fit: cover;
}

.mapa-popup__title {
	display: block;
	padding: 0.75rem 0.9rem 0.25rem;
	font-family: var(--font-headline, 'Montserrat', sans-serif);
	font-size: 1rem;
	font-weight: 600;
	color: var(--primary-color, #2d5a43);
}

.mapa-popup__text,
.mapa-popup__addr {
	padding: 0 0.9rem;
	margin: 0.25rem 0;
	font-size: 0.86rem;
	line-height: 1.45;
	color: var(--text-color, #717973);
}

.mapa-popup__maps-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0.7rem 0.9rem 0.9rem;
	padding: 0.5rem 1rem;
	background: var(--primary-color, #2d5a43);
	color: #fff;
	border: none;
	border-radius: 50px;
	font-family: var(--font-headline, 'Montserrat', sans-serif);
	font-size: 0.84rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
}

.mapa-popup__maps-btn:hover {
	background: #234a36;
}

.mapa-interactivo__map .leaflet-control-attribution {
	font-size: 0.65rem;
	background: rgba(255, 255, 255, 0.85);
	border-radius: 4px 0 0 0;
	padding: 2px 6px;
}

@media (max-width: 768px) {
	.mapa-interactivo__map-wrap {
		border-radius: 16px;
		height: var(--mapa-altura, 60vh);
		min-height: 280px;
		max-height: none;
	}
}

/* Elementor shortcode widget — ancho completo del contenedor */
.elementor-widget-shortcode .elementor-shortcode,
.elementor-widget-shortcode .mapa-interactivo {
	width: 100%;
	max-width: 100%;
}

.elementor-widget-shortcode .mapa-interactivo__map-wrap {
	height: var(--mapa-altura, 600px);
}

.elementor-widget-shortcode .mapa-interactivo__search,
.elementor-widget-shortcode .mapa-interactivo input.mapa-interactivo__search,
.elementor-widget-shortcode .mapa-interactivo input.mapa-interactivo__search:focus {
	box-sizing: border-box;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	padding: 0 !important;
}

.elementor-widget-shortcode .mapa-interactivo__search-wrap {
	box-sizing: border-box;
}
