/**
 * Property archive layouts and full-width map workspace.
 */

.property-archive-results .archive-count {
	margin-bottom: 0;
}

.archive-results-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.archive-view-switch {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	flex: 0 1 340px;
	width: min(100%, 340px);
	min-width: 0;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: #e9efec;
	padding: 3px;
}

.archive-view-switch button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-width: 0;
	min-height: 40px;
	border: 0;
	border-radius: 5px;
	background: transparent;
	color: var(--muted);
	padding: 7px 10px;
	font: inherit;
	font-size: 0.84rem;
	font-weight: 900;
	cursor: pointer;
}

.archive-view-switch button:hover,
.archive-view-switch button:focus-visible {
	background: rgba(255, 255, 255, 0.72);
	color: var(--primary-strong);
}

.archive-view-switch button[aria-pressed="true"] {
	background: #fff;
	color: var(--primary-strong);
	box-shadow: 0 2px 8px rgba(21, 26, 31, 0.09);
}

.archive-view-switch .lucide-icon {
	width: 17px;
	height: 17px;
}

[data-property-collection-panel][hidden],
.property-map-panel[hidden] {
	display: none;
}

[data-property-collection-panel].is-view-entering,
.property-map-panel.is-view-entering {
	animation: property-view-enter 240ms ease both;
}

@keyframes property-view-enter {
	from {
		opacity: 0.72;
		transform: translateY(6px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	[data-property-collection-panel].is-view-entering,
	.property-map-panel.is-view-entering {
		animation: none;
	}
}

.archive-property-collection[data-layout="list"] {
	grid-template-columns: minmax(0, 1fr);
}

.archive-property-collection[data-layout="list"] .property-card {
	display: grid;
	grid-template-columns: clamp(118px, 34vw, 210px) minmax(0, 1fr);
	min-width: 0;
}

.archive-property-collection[data-layout="list"] .property-card-media,
.archive-property-collection[data-layout="list"] .property-card-image {
	height: 100%;
	min-height: 166px;
}

.archive-property-collection[data-layout="list"] .property-card-image {
	aspect-ratio: auto;
}

.archive-property-collection[data-layout="list"] .property-card-body {
	align-content: center;
	min-width: 0;
}

.archive-property-collection[data-layout="list"] .property-card h2 {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.property-archive-results[data-current-view="map"] {
	padding-bottom: 0;
}

.property-map-panel {
	min-width: 0;
	overflow: hidden;
	border-block: 1px solid var(--line);
	background: #fff;
}

.property-map-panel__header {
	position: relative;
	z-index: 800;
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 18px;
	min-height: 78px;
	border-bottom: 1px solid var(--line);
	background: #fff;
	padding: 12px max(14px, calc((100vw - 1160px) / 2));
}

.property-map-panel__title {
	min-width: 0;
}

.property-map-panel__header h2 {
	margin: 2px 0 0;
	color: var(--ink);
	font-size: 1.12rem;
	line-height: 1.4;
}

.property-map-panel__header .section-kicker {
	color: var(--accent);
	font-size: 0.74rem;
	font-weight: 900;
}

.property-map-controls {
	display: grid;
	grid-template-columns: minmax(170px, 220px) auto;
	align-items: end;
	gap: 8px;
	min-width: 0;
}

.property-map-controls label {
	display: grid;
	gap: 3px;
	min-width: 0;
	color: var(--muted);
	font-size: 0.7rem;
	font-weight: 900;
}

.property-map-controls select,
.property-map-locate {
	min-height: 42px;
}

.property-map-controls select {
	min-width: 0;
	padding-block: 7px;
	font-size: 0.82rem;
}

.property-map-locate {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: #fff;
	color: var(--primary-strong);
	padding: 8px 12px;
	font: inherit;
	font-size: 0.82rem;
	font-weight: 900;
	white-space: nowrap;
	cursor: pointer;
}

.property-map-locate:hover,
.property-map-locate:focus-visible {
	border-color: var(--primary);
	background: #edf6f2;
}

.property-map-locate:disabled {
	cursor: progress;
	opacity: 0.6;
}

.property-map-locate .lucide-icon {
	width: 17px;
	height: 17px;
}

.property-map-workspace {
	display: grid;
	direction: ltr;
	grid-template-columns: minmax(0, 1fr) clamp(372px, 31vw, 440px);
	grid-template-areas: "map sidebar";
	height: max(620px, calc(100dvh - 128px));
	min-width: 0;
	background: #dce6e2;
}

.property-map-sidebar {
	position: relative;
	z-index: 650;
	display: grid;
	direction: rtl;
	grid-template-rows: auto minmax(0, 1fr);
	grid-area: sidebar;
	min-width: 0;
	overflow: hidden;
	border-inline-end: 1px solid var(--line);
	background: #f6f8f7;
	box-shadow: -8px 0 26px rgba(21, 26, 31, 0.08);
}

.property-map-sidebar__header {
	display: grid;
	gap: 6px;
	min-height: 82px;
	border-bottom: 1px solid var(--line);
	background: #fff;
	padding: 16px;
}

.property-map-sidebar__header > div {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

.property-map-sidebar__header h3 {
	margin: 0;
	color: var(--ink);
	font-size: 0.98rem;
	line-height: 1.4;
}

.property-map-sidebar__header [data-property-map-list-count] {
	color: var(--primary-strong);
	font-size: 0.74rem;
	font-weight: 900;
	white-space: nowrap;
}

.property-map-status {
	min-height: 22px;
	margin: 0;
	color: var(--muted);
	font-size: 0.76rem;
	font-weight: 800;
	line-height: 1.5;
}

.property-map-status[data-state="loading"] {
	color: var(--primary-strong);
}

.property-map-status[data-state="error"] {
	color: var(--danger);
}

.property-map-list {
	display: grid;
	align-content: start;
	grid-auto-rows: minmax(152px, max-content);
	gap: 12px;
	min-height: 0;
	overflow-y: auto;
	padding: 14px;
	scrollbar-gutter: stable;
	overscroll-behavior: contain;
}

.property-map-list[aria-busy="true"] {
	opacity: 0.62;
}

.property-map-result {
	position: relative;
	display: grid;
	grid-template-columns: 124px minmax(0, 1fr);
	min-height: 152px;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: #fff;
	box-shadow: 0 3px 12px rgba(21, 26, 31, 0.05);
	cursor: pointer;
	transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
	scroll-margin: 12px;
}

.property-map-result:hover,
.property-map-result:focus-within,
.property-map-result.is-active {
	border-color: rgba(23, 105, 95, 0.72);
	box-shadow: 0 8px 22px rgba(21, 71, 63, 0.13);
}

.property-map-result.is-active {
	transform: translateY(-1px);
}

.property-map-result__media {
	display: block;
	min-width: 0;
	min-height: 152px;
	background: var(--surface-soft);
}

.property-map-result__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.property-map-result__placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	min-height: inherit;
	color: var(--primary);
}

.property-map-result__placeholder .lucide-icon {
	width: 28px;
	height: 28px;
}

.property-map-result__body {
	display: grid;
	align-content: center;
	gap: 7px;
	min-width: 0;
	padding: 13px 13px 13px 50px;
}

.property-map-result__meta,
.property-map-result__specs {
	margin: 0;
	color: var(--muted);
	font-size: 0.72rem;
	font-weight: 800;
	line-height: 1.45;
}

.property-map-result h4 {
	display: -webkit-box;
	overflow: hidden;
	margin: 0;
	color: var(--ink);
	font-size: 0.91rem;
	line-height: 1.5;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.property-map-result h4 a {
	color: inherit;
}

.property-map-result__price {
	overflow: hidden;
	color: var(--primary-strong);
	font-size: 0.94rem;
	font-weight: 900;
	line-height: 1.45;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.property-map-result__focus {
	position: absolute;
	inset-inline-end: 9px;
	inset-block-end: 9px;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border: 1px solid rgba(23, 105, 95, 0.28);
	border-radius: var(--radius);
	background: #edf6f2;
	color: var(--primary-strong);
	padding: 0;
	cursor: pointer;
}

.property-map-result__focus:hover,
.property-map-result__focus:focus-visible,
.property-map-result.is-active .property-map-result__focus {
	border-color: var(--primary);
	background: var(--primary);
	color: #fff;
}

.property-map-result__focus .lucide-icon {
	width: 16px;
	height: 16px;
}

.property-map-list__empty {
	align-self: start;
	margin: 12px;
	border: 1px dashed var(--line);
	border-radius: var(--radius);
	background: #fff;
	color: var(--muted);
	padding: 18px;
	font-size: 0.84rem;
	font-weight: 800;
	line-height: 1.7;
	text-align: center;
}

.property-map-list__empty[hidden] {
	display: none;
}

.property-map-stage {
	position: relative;
	grid-area: map;
	min-width: 0;
	min-height: 0;
	background: #dce6e2;
}

.property-map-canvas {
	width: 100%;
	height: 100%;
	min-width: 0;
	min-height: 0;
	background: #dce6e2;
}

.property-map-search-area {
	position: absolute;
	top: 14px;
	left: 50%;
	z-index: 500;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	max-width: calc(100% - 118px);
	min-height: 42px;
	border: 1px solid rgba(21, 71, 63, 0.25);
	border-radius: var(--radius);
	background: #fff;
	color: var(--primary-strong);
	padding: 8px 13px;
	box-shadow: 0 8px 24px rgba(21, 26, 31, 0.2);
	font: inherit;
	font-size: 0.82rem;
	font-weight: 900;
	line-height: 1.3;
	transform: translateX(-50%);
	cursor: pointer;
	direction: rtl;
}

.property-map-search-area[hidden] {
	display: none;
}

.property-map-search-area:hover,
.property-map-search-area:focus-visible {
	background: var(--primary);
	color: #fff;
}

.property-map-search-area .lucide-icon {
	width: 16px;
	height: 16px;
}

.property-map-show-all {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 500;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 42px;
	border: 1px solid rgba(21, 71, 63, 0.25);
	border-radius: var(--radius);
	background: #fff;
	color: var(--primary-strong);
	padding: 8px 13px;
	box-shadow: 0 8px 24px rgba(21, 26, 31, 0.2);
	font: inherit;
	font-size: 0.82rem;
	font-weight: 900;
	line-height: 1.3;
	white-space: nowrap;
	cursor: pointer;
	direction: rtl;
}

.property-map-show-all:hover,
.property-map-show-all:focus-visible {
	border-color: var(--primary);
	background: var(--primary);
	color: #fff;
}

.property-map-show-all:disabled {
	cursor: progress;
	opacity: 0.62;
}

.property-map-show-all .lucide-icon {
	width: 16px;
	height: 16px;
}

.property-map-panel .leaflet-container {
	font-family: inherit;
	font-size: 14px;
}

.property-map-panel .leaflet-bar,
.property-map-panel .leaflet-control-attribution,
.property-map-panel .leaflet-popup-content-wrapper,
.property-map-panel .leaflet-popup-tip {
	box-shadow: 0 6px 20px rgba(21, 26, 31, 0.18);
}

.property-map-panel .leaflet-bar,
.property-map-panel .leaflet-popup-content-wrapper {
	border-radius: var(--radius);
}

.property-map-panel .leaflet-popup-content {
	width: min(250px, calc(100vw - 76px)) !important;
	margin: 0;
}

.property-map-popup {
	display: grid;
	min-width: 0;
	overflow: hidden;
	border-radius: var(--radius);
	background: #fff;
}

.property-map-popup__media {
	display: block;
	min-width: 0;
	aspect-ratio: 16 / 8;
	background: var(--surface-soft);
}

.property-map-popup__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.property-map-popup__body {
	display: grid;
	gap: 7px;
	padding: 12px;
}

.property-map-popup__meta {
	margin: 0;
	color: var(--muted);
	font-size: 0.76rem;
	font-weight: 800;
	line-height: 1.45;
}

.property-map-popup h3 {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
}

.property-map-popup h3 a {
	color: var(--ink);
}

.property-map-popup__price {
	color: var(--primary-strong);
	font-size: 0.92rem;
	line-height: 1.4;
}

.property-map-panel .leaflet-container a.property-map-popup__action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	border-radius: var(--radius);
	background: var(--primary);
	color: #fff;
	padding: 7px 12px;
	font-size: 0.82rem;
	font-weight: 900;
}

.property-map-panel .leaflet-container a.property-map-popup__action:hover,
.property-map-panel .leaflet-container a.property-map-popup__action:focus-visible {
	background: var(--primary-strong);
	color: #fff;
}

.property-map-panel .leaflet-marker-icon.is-active {
	z-index: 900 !important;
}

.property-map-price-marker {
	overflow: visible;
	border: 0;
	background: transparent;
}

.property-map-price-marker__label {
	position: absolute;
	inset-block-end: 5px;
	left: 50%;
	display: block;
	overflow: hidden;
	max-width: 150px;
	border: 1px solid rgba(13, 76, 69, 0.26);
	border-radius: 6px;
	background: #fff;
	color: var(--primary-strong);
	padding: 5px 8px;
	box-shadow: 0 4px 14px rgba(21, 26, 31, 0.18);
	direction: rtl;
	font-size: 0.72rem;
	font-weight: 900;
	line-height: 1.2;
	text-overflow: ellipsis;
	transform: translateX(-50%);
	white-space: nowrap;
}

.property-map-price-marker.is-colliding:not(.is-active) .property-map-price-marker__label {
	width: 16px;
	height: 16px;
	min-width: 16px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: var(--accent);
	color: transparent;
	padding: 0;
	box-shadow: 0 3px 10px rgba(21, 26, 31, 0.28);
}

.property-map-price-marker.is-colliding:not(.is-active):hover .property-map-price-marker__label,
.property-map-price-marker.is-colliding:not(.is-active):focus .property-map-price-marker__label {
	width: auto;
	height: auto;
	min-width: 0;
	border: 1px solid var(--accent);
	border-radius: 6px;
	background: var(--primary-strong);
	color: #fff;
	padding: 5px 8px;
}

.property-map-price-marker:hover .property-map-price-marker__label,
.property-map-price-marker:focus .property-map-price-marker__label,
.property-map-price-marker.is-active .property-map-price-marker__label {
	border-color: var(--accent);
	background: var(--primary-strong);
	color: #fff;
}

@media (max-width: 919px) {
	.archive-results-toolbar {
		align-items: stretch;
		flex-direction: column;
	}

	.archive-view-switch {
		flex-basis: auto;
		width: 100%;
	}

	.property-map-panel__header {
		align-items: stretch;
		flex-direction: column;
		gap: 10px;
		padding-block: 12px;
	}

	.property-map-panel__title {
		display: none;
	}

	.property-map-controls {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.property-map-workspace {
		position: relative;
		display: block;
		height: max(560px, calc(100dvh - 112px));
	}

	.property-map-stage {
		height: 100%;
	}

	.property-map-sidebar {
		position: absolute;
		inset-inline: 10px;
		inset-block-end: 10px;
		z-index: 650;
		display: grid;
		grid-template-rows: auto minmax(0, 1fr);
		height: clamp(232px, 38dvh, 300px);
		max-height: calc(100% - 86px);
		border: 1px solid rgba(21, 71, 63, 0.18);
		border-radius: var(--radius);
		box-shadow: 0 16px 40px rgba(21, 26, 31, 0.24);
	}

	.property-map-sidebar__header {
		gap: 2px;
		min-height: 60px;
		padding: 9px 11px;
	}

	.property-map-sidebar__header > div {
		align-items: center;
	}

	.property-map-status {
		display: none;
	}

	.property-map-list {
		display: flex;
		align-items: stretch;
		grid-auto-rows: unset;
		overflow-x: auto;
		overflow-y: hidden;
		padding: 9px;
		scroll-padding-inline: 9px;
		scroll-snap-type: inline mandatory;
		scrollbar-gutter: auto;
	}

	.property-map-result {
		flex: 0 0 min(82vw, 320px);
		grid-template-columns: 96px minmax(0, 1fr);
		min-height: 148px;
		scroll-snap-align: start;
	}

	.property-map-result__media {
		min-height: 148px;
	}

	.property-map-result__body {
		padding: 9px 9px 42px;
	}

	.property-map-list__empty {
		position: absolute;
		inset-inline: 12px;
		inset-block-start: 62px;
	}

	.property-map-search-area {
		top: 12px;
	}

	.property-map-show-all {
		top: 62px;
		left: 12px;
	}
}

@media (max-width: 479px) {
	.archive-view-switch button {
		gap: 5px;
		padding-inline: 6px;
		font-size: 0.78rem;
	}

	.archive-property-collection[data-layout="list"] .property-card {
		grid-template-columns: 112px minmax(0, 1fr);
	}

	.archive-property-collection[data-layout="list"] .property-card-media,
	.archive-property-collection[data-layout="list"] .property-card-image {
		min-height: 158px;
	}

	.archive-property-collection[data-layout="list"] .property-card-body {
		gap: 5px;
		padding: 9px;
	}

	.archive-property-collection[data-layout="list"] .property-card-meta {
		gap: 3px;
		font-size: 0.72rem;
	}

	.archive-property-collection[data-layout="list"] .property-card-meta span {
		padding-inline: 5px;
	}

	.archive-property-collection[data-layout="list"] .property-card h2 {
		font-size: 0.88rem;
	}

	.archive-property-collection[data-layout="list"] .price {
		font-size: 0.94rem;
	}

	.archive-property-collection[data-layout="list"] .property-specs {
		display: none;
	}

	.archive-property-collection[data-layout="list"] .property-card-favorite {
		width: 34px;
		min-height: 34px;
		padding: 6px;
	}

	.archive-property-collection[data-layout="list"] .property-card-favorite span {
		display: none;
	}

	.property-map-controls {
		grid-template-columns: minmax(0, 1fr) 88px;
	}

	.property-map-locate {
		padding-inline: 9px;
	}

	.property-map-workspace {
		height: max(540px, calc(100dvh - 106px));
	}

	.property-map-sidebar {
		inset-inline: 8px;
		inset-block-end: 8px;
		height: clamp(220px, 40dvh, 270px);
	}

	.property-map-result {
		flex-basis: min(86vw, 300px);
		grid-template-columns: 88px minmax(0, 1fr);
	}

	.property-map-result__meta {
		display: -webkit-box;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}
}

@media (min-width: 680px) {
	.archive-property-collection[data-layout="list"] .property-card {
		grid-template-columns: minmax(220px, 31%) minmax(0, 1fr);
	}

	.archive-property-collection[data-layout="list"] .property-card-media,
	.archive-property-collection[data-layout="list"] .property-card-image {
		min-height: 220px;
	}

	.archive-property-collection[data-layout="list"] .property-card-body {
		gap: 10px;
		padding: 18px;
	}

	.archive-property-collection[data-layout="list"] .property-card h2 {
		font-size: 1.12rem;
	}
}
