/* Lotes & Mapa Interactivo — front-end styles */

/* ----- Map ----- */

.lm-map-wrap {
	position: relative;
	margin: 0 auto;
	font-family: inherit;
}

.lm-map-empty {
	padding: 24px;
	text-align: center;
	color: #666;
	background: #f5f5f5;
	border-radius: 8px;
}

.lm-map-inner {
	position: relative;
}

.lm-map-inner svg {
	width: 100%;
	height: auto;
	display: block;
}

/* Shape styling */
.lm-map-inner svg .lm-shape {
	transition: fill 0.2s ease, stroke 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
	cursor: pointer;
	stroke: rgba(0, 0, 0, 0.4);
	stroke-width: 1;
	fill-opacity: 0.85 !important;
	outline: none;
}

.lm-map-inner svg .lm-shape.lm-status-disponible { fill: var(--lm-color-disponible) !important; }
.lm-map-inner svg .lm-shape.lm-status-reservado  { fill: var(--lm-color-reservado) !important; }
.lm-map-inner svg .lm-shape.lm-status-vendido    { fill: var(--lm-color-vendido) !important; }
.lm-map-inner svg .lm-shape.lm-unmapped          { fill: var(--lm-color-unmapped) !important; opacity: 0.55; cursor: default; }

.lm-map-inner svg .lm-shape.lm-mapped:hover,
.lm-map-inner svg .lm-shape.lm-mapped:focus {
	stroke: var(--lm-color-hover);
	stroke-width: 2;
	fill-opacity: 1 !important;
}

.lm-map-inner svg .lm-shape.lm-active {
	stroke: var(--lm-color-hover);
	stroke-width: 3.5;
	fill-opacity: 1 !important;
	filter: drop-shadow(0 0 6px rgba(37, 99, 235, 0.55));
}

/* Filter dimming when a status filter is active */
.lm-map-wrap.lm-filter-active .lm-shape.lm-mapped:not(.lm-filtered-in) {
	opacity: 0.18;
}

/* Tooltip */
.lm-tooltip {
	position: absolute;
	z-index: 50;
	min-width: 180px;
	max-width: 260px;
	background: #1f2937;
	color: #fff;
	border-radius: 6px;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.45;
	pointer-events: none;
	opacity: 0;
	transform: translate(-50%, calc(-100% - 12px));
	transition: opacity 0.12s ease;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.lm-tooltip.is-visible {
	opacity: 1;
}

.lm-tooltip::after {
	content: '';
	position: absolute;
	left: 50%;
	top: 100%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: #1f2937;
}

.lm-tt-title {
	font-weight: 700;
	font-size: 14px;
	margin-bottom: 4px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.lm-tt-status {
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 999px;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.lm-tt-status.lm-s-disponible { background: var(--lm-color-disponible); }
.lm-tt-status.lm-s-reservado  { background: var(--lm-color-reservado); }
.lm-tt-status.lm-s-vendido    { background: var(--lm-color-vendido); }

.lm-tt-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 2px 0;
}

.lm-tt-row span:first-child {
	color: rgba(255, 255, 255, 0.7);
}

.lm-tt-row span:last-child {
	font-weight: 600;
}

/* ----- List ----- */

.lm-list-wrap {
	font-family: inherit;
	margin: 0 auto;
}

.lm-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 12px;
}

.lm-filter {
	background: #f3f4f6;
	border: 1px solid transparent;
	color: #374151;
	padding: 6px 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
	font-family: inherit;
}

.lm-filter:hover { background: #e5e7eb; }

.lm-filter.is-active {
	background: #111827;
	color: #fff;
}

.lm-filter .lm-count {
	font-weight: 400;
	opacity: 0.7;
	margin-left: 2px;
}

.lm-table-scroll {
	width: 100%;
	overflow-x: auto;
}

.lm-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
	background: #fff;
}

.lm-table th,
.lm-table td {
	padding: 10px 14px;
	text-align: left;
	border-bottom: 1px solid #e5e7eb;
}

.lm-table thead th {
	background: #f9fafb;
	font-weight: 600;
	color: #374151;
	font-size: 13px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	white-space: nowrap;
}

.lm-table thead th button {
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	color: inherit;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	text-transform: inherit;
	letter-spacing: inherit;
}

.lm-table thead th button:hover {
	color: #111827;
}

.lm-sort-ind {
	display: inline-block;
	width: 0;
	height: 0;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	opacity: 0.3;
	transition: opacity 0.15s ease, transform 0.15s ease;
	border-top: 5px solid currentColor;
	margin-top: 2px;
}

.lm-table th.lm-sorted-asc .lm-sort-ind {
	opacity: 1;
	transform: rotate(180deg);
}

.lm-table th.lm-sorted-desc .lm-sort-ind {
	opacity: 1;
}

.lm-row {
	transition: background-color 0.12s ease, box-shadow 0.12s ease;
	cursor: default;
}

.lm-row:hover,
.lm-row.lm-hover {
	background: #f0f9ff;
}

.lm-row.lm-active {
	background: #dbeafe;
	box-shadow: inset 4px 0 0 var(--lm-color-hover);
}

.lm-row.lm-active:hover,
.lm-row.lm-active.lm-hover {
	background: #bfdbfe;
}

.lm-row.lm-hidden {
	display: none;
}

.lm-status-pill {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	white-space: nowrap;
}

.lm-status-pill.lm-status-disponible { background: var(--lm-color-disponible); }
.lm-status-pill.lm-status-reservado  { background: var(--lm-color-reservado); }
.lm-status-pill.lm-status-vendido    { background: var(--lm-color-vendido); }

.lm-empty-row td {
	text-align: center;
	color: #6b7280;
	padding: 24px !important;
	font-style: italic;
}

/* Mobile responsive table */
@media (max-width: 640px) {
	.lm-table thead {
		display: none;
	}
	.lm-table,
	.lm-table tbody,
	.lm-table tr,
	.lm-table td {
		display: block;
		width: 100%;
	}
	.lm-table tr {
		margin-bottom: 12px;
		border: 1px solid #e5e7eb;
		border-radius: 6px;
		padding: 6px 0;
	}
	.lm-table td {
		padding: 6px 14px;
		border: 0;
		display: flex;
		justify-content: space-between;
		gap: 12px;
	}
	.lm-table td::before {
		content: attr(data-label);
		font-weight: 600;
		color: #6b7280;
		font-size: 12px;
		text-transform: uppercase;
		letter-spacing: 0.03em;
	}
}
