/**
 * Nexta Properties — Public Map-List View
 * Luxury real estate split-screen layout
 */

/* =================================================================
   Container
   ================================================================= */
.nexta-maplist {
	--nx-navy:        #0a1628;
	--nx-navy-2:      #1a2942;
	--nx-gold:        #c9a876;
	--nx-gold-soft:   #d7bc91;
	--nx-gold-deep:   #a88652;
	--nx-cream:       #f5f1ea;
	--nx-cream-2:     #faf6ed;
	--nx-line:        #e8e2d4;
	--nx-text:        #2a2a2a;
	--nx-text-soft:   #6a6a6a;
	--nx-text-mute:   #9a9a9a;

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Manrope, sans-serif;
	color: var(--nx-text);
	background: #fff;
	width: 100%;
	box-sizing: border-box;
}
.nexta-maplist *,
.nexta-maplist *::before,
.nexta-maplist *::after { box-sizing: border-box; }

/* =================================================================
   Top filter bar
   ================================================================= */
.nexta-ml-filters {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 24px;
	background: #fff;
	border-bottom: 1px solid var(--nx-line);
	flex-wrap: wrap;
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 2px 8px rgba(10, 22, 40, 0.04);
}

.nexta-ml-filter-group {
	position: relative;
}

.nexta-ml-filter-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	background: #fff;
	border: 1px solid var(--nx-line);
	border-radius: 6px;
	font-size: 13px;
	font-weight: 500;
	color: var(--nx-text);
	cursor: pointer;
	transition: all 0.15s ease;
	font-family: inherit;
	white-space: nowrap;
}
.nexta-ml-filter-btn:hover {
	border-color: var(--nx-gold);
	color: var(--nx-navy);
}
.nexta-ml-filter-btn.is-active {
	background: var(--nx-navy);
	color: #fff;
	border-color: var(--nx-navy);
}
.nexta-ml-filter-btn svg {
	width: 12px;
	height: 12px;
	flex-shrink: 0;
}

.nexta-ml-filter-dropdown {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	background: #fff;
	border: 1px solid var(--nx-line);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(10, 22, 40, 0.12);
	padding: 16px;
	min-width: 240px;
	z-index: 200;
	display: none;
}
.nexta-ml-filter-group.is-open .nexta-ml-filter-dropdown {
	display: block;
}
.nexta-ml-filter-dropdown label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	color: var(--nx-navy);
	margin-bottom: 6px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}
.nexta-ml-filter-dropdown input,
.nexta-ml-filter-dropdown select {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid var(--nx-line);
	border-radius: 4px;
	font-size: 13px;
	font-family: inherit;
	margin-bottom: 12px;
	background: #fff;
}
.nexta-ml-filter-dropdown input:focus,
.nexta-ml-filter-dropdown select:focus {
	outline: none;
	border-color: var(--nx-gold);
	box-shadow: 0 0 0 3px rgba(201, 168, 118, 0.15);
}
.nexta-ml-filter-dropdown .nexta-ml-range {
	display: flex;
	gap: 8px;
}
.nexta-ml-filter-dropdown .nexta-ml-range input {
	margin-bottom: 0;
}
.nexta-ml-filter-actions {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	padding-top: 12px;
	border-top: 1px solid var(--nx-line);
}
.nexta-ml-filter-actions button {
	flex: 1;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid var(--nx-line);
	background: #fff;
	color: var(--nx-text);
	font-family: inherit;
	transition: all 0.15s ease;
}
.nexta-ml-filter-actions button.is-primary {
	background: var(--nx-navy);
	color: #fff;
	border-color: var(--nx-navy);
}
.nexta-ml-filter-actions button:hover {
	border-color: var(--nx-gold);
}

/* Sort + view toggle on the right */
.nexta-ml-tools {
	margin-left: auto;
	display: flex;
	gap: 10px;
	align-items: center;
}
.nexta-ml-sort {
	padding: 10px 14px;
	border: 1px solid var(--nx-line);
	border-radius: 6px;
	font-size: 13px;
	background: #fff;
	color: var(--nx-text);
	cursor: pointer;
	font-family: inherit;
}
.nexta-ml-sort:focus {
	outline: none;
	border-color: var(--nx-gold);
}

/* Language switcher */
.nexta-lang-switch {
	position: relative;
}
.nexta-lang-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 12px;
	background: #fff;
	border: 1px solid var(--nx-line);
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--nx-navy);
	cursor: pointer;
	font-family: inherit;
	transition: all 0.15s ease;
}
.nexta-lang-btn:hover {
	border-color: var(--nx-gold);
}
.nexta-lang-btn span { letter-spacing: 0.05em; }
.nexta-lang-dropdown {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	background: #fff;
	border: 1px solid var(--nx-line);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(10, 22, 40, 0.12);
	min-width: 160px;
	z-index: 200;
	display: none;
	overflow: hidden;
}
.nexta-lang-switch.is-open .nexta-lang-dropdown {
	display: block;
}
.nexta-lang-option {
	display: block;
	padding: 10px 14px;
	font-size: 13px;
	color: var(--nx-text);
	text-decoration: none;
	transition: background 0.15s ease;
}
.nexta-lang-option:hover {
	background: var(--nx-cream-2);
	color: var(--nx-navy);
}
.nexta-lang-option.is-active {
	background: var(--nx-cream);
	color: var(--nx-navy);
	font-weight: 600;
}

.nexta-ml-view-toggle {
	display: inline-flex;
	background: var(--nx-cream);
	border-radius: 6px;
	padding: 3px;
	gap: 2px;
}
.nexta-ml-view-btn {
	padding: 7px 12px;
	background: transparent;
	border: none;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	color: var(--nx-text-soft);
	cursor: pointer;
	font-family: inherit;
	transition: all 0.15s ease;
}
.nexta-ml-view-btn:hover { color: var(--nx-navy); }
.nexta-ml-view-btn.is-active {
	background: #fff;
	color: var(--nx-navy);
	box-shadow: 0 1px 3px rgba(10, 22, 40, 0.1);
}

/* =================================================================
   Result count bar
   ================================================================= */
.nexta-ml-count {
	padding: 16px 24px;
	background: var(--nx-cream-2);
	font-size: 13px;
	color: var(--nx-text-soft);
	border-bottom: 1px solid var(--nx-line);
}
.nexta-ml-count strong {
	color: var(--nx-navy);
	font-weight: 700;
	font-size: 15px;
}

/* =================================================================
   Split layout: list on left, map on right
   ================================================================= */
.nexta-ml-split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: calc(100vh - 200px);
	max-height: calc(100vh - 120px);
}

.nexta-ml-list-pane {
	overflow-y: auto;
	background: #fff;
	border-right: 1px solid var(--nx-line);
}

.nexta-ml-map-pane {
	position: sticky;
	top: 0;
	height: calc(100vh - 120px);
	background: var(--nx-cream-2);
}

#nexta-ml-map {
	width: 100%;
	height: 100%;
	z-index: 1;
}

/* =================================================================
   Property list
   ================================================================= */
.nexta-ml-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	padding: 24px;
}

.nexta-ml-card {
	display: block;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	box-shadow: 0 2px 12px rgba(10, 22, 40, 0.06);
	border: 2px solid transparent;
	transition: all 0.2s ease;
	cursor: pointer;
}
.nexta-ml-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(10, 22, 40, 0.12);
	border-color: var(--nx-gold);
}
.nexta-ml-card.is-highlighted {
	border-color: var(--nx-gold);
	box-shadow: 0 8px 24px rgba(201, 168, 118, 0.3);
	transform: translateY(-2px);
}

.nexta-ml-card-image {
	position: relative;
	aspect-ratio: 4/3;
	background: var(--nx-navy);
	overflow: hidden;
}
.nexta-ml-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}
.nexta-ml-card:hover .nexta-ml-card-image img {
	transform: scale(1.05);
}
.nexta-ml-card-empty {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--nx-gold);
	background: linear-gradient(135deg, var(--nx-navy), var(--nx-navy-2));
}

.nexta-ml-card-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: var(--nx-gold);
	color: var(--nx-navy);
	padding: 5px 11px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	border-radius: 2px;
}
.nexta-ml-card-badge.is-rent { background: #1565c0; color: #fff; }
.nexta-ml-card-badge.is-sold,
.nexta-ml-card-badge.is-rented { background: #555; color: #fff; }

.nexta-ml-card-fav {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(4px);
	border: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s ease;
	color: var(--nx-text-soft);
	padding: 0;
}
.nexta-ml-card-fav:hover {
	color: #e74c3c;
	transform: scale(1.1);
}
.nexta-ml-card-fav.is-fav {
	color: #e74c3c;
	background: #fff;
}

.nexta-ml-card-photos {
	position: absolute;
	bottom: 12px;
	right: 12px;
	background: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(4px);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 12px;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.nexta-ml-card-body {
	padding: 16px;
}
.nexta-ml-card-price {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 22px;
	font-weight: 600;
	color: var(--nx-navy);
	margin: 0 0 4px;
	line-height: 1.2;
}
.nexta-ml-card-price-period {
	font-size: 13px;
	color: var(--nx-text-soft);
	font-weight: 400;
	font-family: inherit;
}
.nexta-ml-card-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--nx-text);
	margin: 0 0 4px;
	line-height: 1.3;
	font-family: 'Playfair Display', Georgia, serif;
}
.nexta-ml-card-address {
	font-size: 13px;
	color: var(--nx-text-soft);
	margin: 0 0 12px;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.nexta-ml-card-meta {
	display: flex;
	gap: 16px;
	padding-top: 12px;
	border-top: 1px solid var(--nx-line);
	font-size: 12px;
	color: var(--nx-text-soft);
}
.nexta-ml-card-meta span {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}
.nexta-ml-card-meta svg {
	color: var(--nx-gold);
	flex-shrink: 0;
}

/* =================================================================
   Map markers (price pins)
   ================================================================= */
.nexta-ml-pin {
	background: var(--nx-navy);
	color: #fff;
	padding: 6px 10px;
	border-radius: 16px;
	font-size: 12px;
	font-weight: 700;
	font-family: 'Playfair Display', Georgia, serif;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba(10, 22, 40, 0.4);
	border: 2px solid #fff;
	cursor: pointer;
	transition: all 0.15s ease;
}
.nexta-ml-pin:hover,
.nexta-ml-pin.is-active {
	background: var(--nx-gold);
	color: var(--nx-navy);
	transform: scale(1.1);
	z-index: 1000;
}

/* Custom marker icon override (Leaflet div icon) */
.leaflet-div-icon.nexta-pin-wrap {
	background: transparent !important;
	border: none !important;
}

/* Map popup */
.leaflet-popup-content-wrapper {
	border-radius: 10px;
	padding: 0;
	overflow: hidden;
	box-shadow: 0 8px 30px rgba(10, 22, 40, 0.25);
}
.leaflet-popup-content {
	margin: 0;
	width: 240px !important;
}
.leaflet-popup-tip { box-shadow: 0 4px 12px rgba(10, 22, 40, 0.15); }

.nexta-ml-popup {
	display: block;
	text-decoration: none;
	color: inherit;
}
.nexta-ml-popup-img {
	aspect-ratio: 16/10;
	background: var(--nx-navy);
	overflow: hidden;
}
.nexta-ml-popup-img img {
	width: 100%; height: 100%; object-fit: cover; display: block;
}
.nexta-ml-popup-body { padding: 10px 12px; }
.nexta-ml-popup-price {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 16px;
	font-weight: 600;
	color: var(--nx-navy);
	margin: 0 0 2px;
}
.nexta-ml-popup-title {
	font-size: 12px;
	color: var(--nx-text-soft);
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* =================================================================
   Empty state
   ================================================================= */
.nexta-ml-empty {
	text-align: center;
	padding: 80px 20px;
	color: var(--nx-text-soft);
	grid-column: 1 / -1;
}
.nexta-ml-empty svg {
	color: var(--nx-gold);
	opacity: 0.5;
	margin-bottom: 16px;
}
.nexta-ml-empty h3 {
	font-family: 'Playfair Display', Georgia, serif;
	font-size: 22px;
	color: var(--nx-navy);
	margin: 0 0 8px;
}
.nexta-ml-empty p { margin: 0; font-size: 14px; }

/* =================================================================
   View modes (list-only / map-only on mobile)
   ================================================================= */
.nexta-maplist[data-view="list"] .nexta-ml-map-pane { display: none; }
.nexta-maplist[data-view="list"] .nexta-ml-list-pane { border-right: none; }
.nexta-maplist[data-view="list"] .nexta-ml-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.nexta-maplist[data-view="map"] .nexta-ml-list-pane { display: none; }
.nexta-maplist[data-view="map"] .nexta-ml-map-pane { width: 100%; }

/* =================================================================
   Responsive
   ================================================================= */
@media (max-width: 1100px) {
	.nexta-ml-list { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
	.nexta-ml-split { grid-template-columns: 1fr; max-height: none; }
	.nexta-ml-map-pane { display: none; }
	.nexta-maplist[data-view="map"] .nexta-ml-map-pane {
		display: block;
		position: fixed;
		inset: 60px 0 0 0;
		height: auto;
		z-index: 50;
	}
	.nexta-maplist[data-view="map"] .nexta-ml-list-pane { display: none; }
	.nexta-ml-filters { padding: 12px 16px; }
	.nexta-ml-filter-btn { padding: 8px 12px; font-size: 12px; }
	.nexta-ml-tools { width: 100%; margin-left: 0; justify-content: space-between; }
	.nexta-ml-list { padding: 16px; gap: 14px; grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
	.nexta-ml-filter-btn span { display: none; }
}
