/* ============================================================
   Core Foam Map - Estilos del mapa (frontend)
   Encapsulado con prefijo .core-foam-map-*
   ============================================================ */

.core-foam-map-wrapper {
	position: relative;
	width: 100%;
	min-height: 200px;
	overflow: hidden;
	border-radius: 6px;
	background: #071B30;
	box-sizing: border-box;
}

.core-foam-map {
	width: 100%;
	height: 100%;
	min-height: 200px;
	background: #071B30;
	z-index: 1;
}

/* IMPORTANTE: NO aplicar ningún filter, opacity ni mix-blend-mode a los
   tiles de OpenStreetMap. Se muestran con sus colores originales.
   El estilo Core Foam solo se aplica a los elementos propios:
   marcadores, halo, etiquetas y popup. */

/* Atribución obligatoria de OpenStreetMap: debe permanecer visible. */
.core-foam-map .leaflet-control-attribution {
	background: rgba(7, 27, 48, 0.85) !important;
	color: #c7d0da !important;
	font-size: 10px !important;
	padding: 2px 6px !important;
	border-radius: 3px 0 0 0;
}

.core-foam-map .leaflet-control-attribution a {
	color: #F2C400 !important;
	text-decoration: underline;
}

/* Controles de zoom con estilo Core Foam */
.core-foam-map .leaflet-control-zoom {
	border: none !important;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

.core-foam-map .leaflet-control-zoom a {
	background: #071B30 !important;
	color: #F2C400 !important;
	border: 1px solid rgba(242, 196, 0, 0.25) !important;
	font-weight: 600 !important;
	width: 32px !important;
	height: 32px !important;
	line-height: 32px !important;
	font-size: 18px !important;
}

.core-foam-map .leaflet-control-zoom a:hover {
	background: #061A2C !important;
	color: #fff !important;
}

/* ============================================================
   Marcador personalizado (círculo amarillo + halo)
   ============================================================ */
.core-foam-map-marker {
	position: relative;
	width: 18px;
	height: 18px;
	z-index: 1000;
}

.core-foam-map-marker-dot {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #F2C400;
	transform: translate(-50%, -50%);
	box-shadow: 0 0 0 2px rgba(7, 27, 48, 0.9), 0 1px 4px rgba(0, 0, 0, 0.5);
}

.core-foam-map-marker-halo {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(242, 196, 0, 0.20);
	transform: translate(-50%, -50%);
	animation: core-foam-map-pulse 2.4s ease-out infinite;
	z-index: -1;
}

@keyframes core-foam-map-pulse {
	0%   { transform: translate(-50%, -50%) scale(0.8); opacity: 0.9; }
	70%  { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
	100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}

/* El contenedor divIcon de Leaflet debe permitir eventos y no clipping */
.core-foam-map .leaflet-marker-icon.core-foam-map-divicon {
	background: transparent;
	border: none;
	z-index: 1000;
}

/* ============================================================
   Etiqueta de nombre junto al marcador
   ============================================================ */
.core-foam-map-label {
	display: inline-block;
	margin-left: 18px;
	padding: 2px 8px;
	background: rgba(7, 27, 48, 0.85);
	color: #FFFFFF;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	white-space: nowrap;
	border-radius: 3px;
	border: 1px solid rgba(242, 196, 0, 0.25);
	pointer-events: auto;
	cursor: pointer;
	/* Sombra de texto para garantizar legibilidad sobre los tiles
	   originales de OpenStreetMap (que ahora muestran sus colores). */
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
	transition: background 0.15s ease, color 0.15s ease;
}

.core-foam-map-label:hover,
.core-foam-map-label.is-active {
	background: #F2C400;
	color: #071B30;
	border-color: #F2C400;
	text-shadow: none;
}

/* Contenedor del icono + etiqueta */
.core-foam-map-icon-wrap {
	display: flex;
	align-items: center;
	white-space: nowrap;
}

/* ============================================================
   Popup personalizado (estilo Core Foam)
   ============================================================ */
.core-foam-map .leaflet-popup-content-wrapper {
	background: #071B30 !important;
	color: #FFFFFF !important;
	border: 1px solid rgba(242, 196, 0, 0.25) !important;
	border-radius: 6px !important;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5) !important;
	padding: 0 !important;
}

.core-foam-map .leaflet-popup-content {
	margin: 0 !important;
	padding: 0 !important;
	width: auto !important;
	line-height: 1.5 !important;
}

.core-foam-map .leaflet-popup-tip {
	background: #071B30 !important;
	border: 1px solid rgba(242, 196, 0, 0.25) !important;
}

.core-foam-map .leaflet-popup-close-button {
	color: #F2C400 !important;
	font-size: 20px !important;
	padding: 6px 8px 0 0 !important;
}

.core-foam-map-popup {
	min-width: 220px;
	max-width: 280px;
	padding: 16px 18px;
	font-size: 13px;
	color: #FFFFFF;
	box-sizing: border-box;
}

.core-foam-map-popup-title {
	margin: 0 0 4px 0;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #F2C400;
}

.core-foam-map-popup-loc {
	margin: 0 0 8px 0;
	font-size: 13px;
	color: #FFFFFF;
	opacity: 0.9;
}

.core-foam-map-popup-type {
	display: inline-block;
	margin: 0 0 12px 0;
	padding: 2px 8px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #071B30;
	background: #F2C400;
	border-radius: 3px;
}

.core-foam-map-popup-row {
	margin: 6px 0;
	font-size: 13px;
	line-height: 1.5;
}

.core-foam-map-popup-row-label {
	display: block;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #8fa0b5;
	margin-bottom: 2px;
}

.core-foam-map-popup-row-value {
	color: #FFFFFF;
}

.core-foam-map-popup-row-value a {
	color: #F2C400;
	text-decoration: none;
}

.core-foam-map-popup-row-value a:hover {
	text-decoration: underline;
}

.core-foam-map-popup-wa {
	display: inline-block;
	margin-top: 12px;
	padding: 8px 14px;
	background: #F2C400;
	color: #071B30 !important;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border-radius: 4px;
	text-decoration: none !important;
	transition: background 0.15s ease;
}

.core-foam-map-popup-wa:hover {
	background: #fff;
}

/* Enlace "Abrir en Google Maps" */
.core-foam-map-popup-gmaps {
	display: inline-block;
	margin-top: 12px;
	padding: 0;
	color: #F2C400;
	font-size: 12px;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid rgba(242, 196, 0, 0.35);
	transition: color 0.15s ease, border-color 0.15s ease;
}

.core-foam-map-popup-gmaps:hover {
	color: #fff;
	border-bottom-color: #fff;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
	.core-foam-map-label {
		font-size: 11px;
		padding: 1px 6px;
	}
	.core-foam-map-popup {
		min-width: 180px;
		max-width: 240px;
		padding: 14px 14px;
	}
}

@media (max-width: 480px) {
	.core-foam-map-label {
		font-size: 10px;
		padding: 1px 5px;
		margin-left: 14px;
	}
	.core-foam-map-popup {
		min-width: 160px;
		max-width: 200px;
		font-size: 12px;
	}
	/* Evitar overflow horizontal del popup en móvil */
	.core-foam-map .leaflet-popup-content-wrapper {
		max-width: calc(100vw - 40px);
	}
}
