/* ==================================================
   Base layout
================================================== */
html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}
#app {
	width: 100%;
	height: 100%;
	position: relative;
}
#map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100dvh;
	z-index: 1;
}
/* ==================================================
   Leaflet overrides
================================================== */
.leaflet-container {
	width: 100%;
	height: 100%;
	font-family: system-ui, sans-serif;
}
.leaflet-container img {
	max-width: none !important;
}
.leaflet-control img,
.leaflet-popup img,
.leaflet-marker-icon,
.leaflet-marker-shadow {
	max-width: none !important;
}
.leaflet-tile {
	width: auto !important;
	height: auto !important;
}
.leaflet-popup-content {
	margin: 13px 19px;
}
.leaflet-popup-content img {
	max-width: 100%;
	height: auto;
}
/* ==================================================
   Leyenda mapa
================================================== */
.map-legend {
	background: #fff;
	border-radius: 12px;
	padding: 14px;
	min-width: 170px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
	border: 1px solid #e5e7eb;
	font-family: system-ui, sans-serif;
	color: #1f2937;
}
.map-legend-title {
	font-size: 14px;
	font-weight: 700;
	margin-bottom: 10px;
}
.map-legend-scale {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.map-legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
}
.map-legend-item .color {
	width: 18px;
	height: 18px;
	border-radius: 4px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	flex: none;
}
.map-legend-footer {
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid #e5e7eb;
	font-size: 11px;
	color: #6b7280;
}
/* ==================================================
   Marcadores meteorológicos
================================================== */
.weather-divicon {
	background: none !important;
	border: none !important;
}
.weather-marker {
	min-width: 52px;
	color: white;
	text-shadow: #1f2937;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
}
/* Iconos SVG */
.weather-icon{
    width:42px;
    height:42px;
    display:block;

    image-rendering:auto;

    transform:translateZ(0);
    backface-visibility:hidden;
    will-change:transform;
}
/* Temperatura */
.weather-temp {
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 16px;
	margin-top: 2px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
/* Nombre estado cielo */
.weather-name {
	margin-top: 2px;
	font-size: 11px;
	font-weight: 600;
	line-height: 12px;
	white-space: nowrap;
}
/* ==================================================
   Etiquetas mapa
================================================== */
.map-label-icon {
	background: none !important;
	border: none !important;
}
.map-label-text {
	font-size: 1rem;
	font-weight: 400;
	color: white;
	white-space: nowrap;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
	margin-top: 3.6rem;
	margin-left: -0.65rem;
}
/* ==================================================
   Sidebar derecho mapa
================================================== */
.leaflet-top.leaflet-right {
	height: 100%;
}
/*
@media (max-width: 768px) {
	.leaflet-top.leaflet-right {
		display: none;
	}
}
*/
.map-sidebar {
	width: 280px;
	height: 100dvh;
	box-sizing: border-box;
	background: #ffffff;
	padding: 24px 20px;
	border-left: 1px solid #e5e7eb;
	box-shadow: -4px 0 18px rgba(0, 0, 0, 0.15);
	font-family: system-ui, sans-serif;
	color: #1f2937;
	overflow-y: auto;
}
.sidebar-section {
	padding-bottom: 20px;
	margin-bottom: 20px;
}
.sidebar-section:last-child {
	border-bottom: none;
}
.sidebar-title {
	font-size: 15px;
	font-weight: 700;
	margin-bottom: 14px;
}

/* ==================================================
   Toggle Sidebar (Mobile)
================================================== */

.sidebar-toggle {
	display: none;
}

@media (max-width: 768px) {

	.sidebar-toggle {
		display: flex;
		align-items: center;
		justify-content: center;

		position: absolute;
		top: 12px;
		right: 12px;

		width: 44px;
		height: 44px;

		padding: 0;

		border: 0;
		border-radius: 10px;

		background: #ffffff;
		color: #374151;

		box-shadow: 0 2px 10px rgba(0, 0, 0, .25);

		cursor: pointer;

		z-index: 2000;
	}

	.sidebar-toggle svg {
		display: block;
		pointer-events: none;
	}

	
	.map-sidebar {
		transition:
			transform .25s ease,
			opacity .25s ease;
	}

	.map-sidebar.collapsed {
		transform: translateX(calc(100% + 20px));
		opacity: 0;
		pointer-events: none;
	}


    .map-sidebar{
        width:240px;
    }
	.sidebar-section{
		padding-bottom:12px;
		margin-bottom:12px;
	}
	.sidebar-title{
		font-size:13px;
		margin-bottom:8px;
	}
	.weather-item img{
		width:28px;
		height:28px;
	}
	.weather-item,
	.population-scale{
		font-size:12px;
	}
	.weather-legend ,
	.weather-item,
	.population-scale,
	.population-scale div {
		gap: 6px;
	}
	.sidebar-toggle{
		position:absolute;
		top:12px;
		right:12px;
		z-index:5000;
	}
	.sidebar-toggle.open{
		right:252px;
	}
}

/* ==================================================
   Temperatura
================================================== */
.temperature-gradient {
	height: 16px;
	border-radius: 10px;
	background: linear-gradient(90deg, #2563eb, #22c55e, #facc15, #f97316, #dc2626);
}
.temperature-scale {
	display: flex;
	justify-content: space-between;
	margin-top: 8px;
	font-size: 12px;
	color: #6b7280;
}
/* ==================================================
   Iconos tiempo
================================================== */
.weather-legend {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.weather-item {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13px;
}
.weather-item img {
	width: 38px;
	height: 38px;
	object-fit: contain;
}
/* ==================================================
   Población
================================================== */
.population-scale {
	display: flex;
	flex-direction: column;
	gap: 12px;
	font-size: 13px;
}
.population-scale div {
	display: flex;
	align-items: center;
	gap: 12px;
}
.population-dot {
	display: inline-block;
	border-radius: 50%;
	background: #374151;
}
.population-dot.large {
	width: 18px;
	height: 18px;
}
.population-dot.medium {
	width: 11px;
	height: 11px;
}
.population-dot.small {
	width: 6px;
	height: 6px;
}
/* ==================================================
   Impacto poblaciones
================================================== */
.population-scale {
	display: flex;
	flex-direction: column;
	gap: 12px;
	font-size: 13px;
}
.population-scale div {
	display: flex;
	align-items: center;
	gap: 12px;
}
.impact-dot {
	display: inline-block;
	border-radius: 50%;
	flex: none;
}
.impact-dot.extreme {
	width: 18px;
	height: 18px;
	background: #991b1b;
}
.impact-dot.high {
	width: 14px;
	height: 14px;
	background: #dc2626;
}
.impact-dot.medium {
	width: 10px;
	height: 10px;
	background: #f97316;
}
.impact-dot.low {
	width: 7px;
	height: 7px;
	background: #facc15;
}
/**/
.sidebar-update {
	padding-top: 2rem;
	margin-top: 2rem;
}
.sidebar-update-content {
	font-size: 0.7rem;
	line-height: 1.125rem;
	color: #666666;
}
.sidebar-update-content strong {
	color: #374151;
	font-weight: 600;
}
