/* ============================================================
   Listing pages — search filter bar, property cards, pagination
   ============================================================ */

/* ---- Search filter bar -------------------------------------- */

#search {
	background-color: var(--green);
	width: 100%;
	text-align: left;
	border-radius: var(--radius-sm);
	margin-top: 22px;
	box-shadow: var(--shadow-soft);
}

.searchGrid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
	gap: 12px 16px;
	padding: 16px 18px;
	align-items: end;
}

.searchItem {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin: 0;
	min-width: 0;
}

.searchLabel {
	color: #083b20;
	font-size: 0.82rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

html[data-theme="dark"] .searchLabel {
	color: #062815;
}

.selects select,
.searchInput input {
	display: block;
	width: 100%;
	padding: 8px 10px;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 7px;
	background-color: #ffffff;
	color: #101010;
	font-size: 0.95rem;
	outline: none;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

.selects select:focus,
.searchInput input:focus {
	border-color: var(--purple-deep);
	box-shadow: 0 0 0 3px rgba(91, 41, 94, 0.25);
}

.rangeInputs {
	display: flex;
	gap: 8px;
}

.rangeInputs input {
	min-width: 0;
	flex: 1;
}

#searchButton {
	grid-column: -2 / -1;
	justify-self: stretch;
	align-self: end;
	background-color: var(--purple-deep);
	color: #ffffff;
	border: none;
	border-radius: 7px;
	padding: 10px 18px;
	font-size: 1.05rem;
	font-weight: 800;
	cursor: pointer;
	margin: 0;
	transition:
		background-color 0.2s ease,
		transform 0.15s ease;
}

#searchButton:hover {
	background-color: #6f3473;
	transform: translateY(-1px);
}

@media screen and (max-width: 800px) {
	.searchGrid {
		grid-template-columns: repeat(2, 1fr);
	}

	#searchButton {
		grid-column: 1 / -1;
	}
}

/* ---- Listing page heading ------------------------------------ */

.listingTitle {
	text-align: left;
	color: var(--purple-deep);
	font-size: clamp(1.2rem, 2.5vw, 1.6rem);
	font-weight: 800;
	margin: 26px 0 0;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--border);
}

html[data-theme="dark"] .listingTitle {
	color: var(--purple-deep);
}

/* ---- Property cards grid ------------------------------------- */

.blackText {
	color: var(--text);
	text-decoration: none;
}

#imoveis {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr));
	gap: 20px;
	margin-top: 26px;
	text-align: left;
}

.imovel {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: row-reverse;
	gap: 16px;
	background-color: var(--surface-alt);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	padding: 0;
	clear: both;
	box-shadow: var(--shadow-soft);
	transition:
		transform 0.18s ease,
		box-shadow 0.18s ease,
		border-color 0.18s ease;
}

a:hover .imovel {
	transform: translateY(-3px);
	box-shadow: var(--shadow);
	border-color: var(--purple);
}

.imageContainer {
	position: relative;
	width: 42%;
	flex-shrink: 0;
	display: block;
	overflow: hidden;
}

.imovelImage {
	max-width: 100%;
	max-height: 260px;
	object-fit: cover;
}

.imageDesktop {
	width: 100%;
	height: 100%;
	min-height: 220px;
	object-fit: cover;
	display: block;
}

.dataContainer {
	position: static;
	width: auto;
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	padding: 14px 16px 14px 4px;
	text-align: left;
}

.imovelTitulo {
	color: var(--purple-deep);
	font-weight: 800;
	font-size: 1.05rem;
	line-height: 1.35;
	margin: 0 0 2px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

html[data-theme="dark"] .imovelTitulo {
	color: var(--purple-deep);
}

.imovelHeader {
	color: var(--muted);
	font-size: 0.88rem;
	margin: 0 0 8px;
	display: block;
}

.imovelPreco {
	color: var(--green);
	font-size: 1.35rem;
	font-weight: 800;
	margin: auto 0 8px;
}

html[data-theme="dark"] .imovelPreco {
	color: var(--green-bright);
}

.imovelAttrs {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.imovelAttrs li {
	background-color: var(--surface);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 2px 10px;
	font-size: 0.8rem;
	color: var(--muted);
	white-space: nowrap;
}

.imovelCodigo {
	margin-top: 8px;
	font-size: 0.78rem;
	color: var(--muted);
	letter-spacing: 0.03em;
}

/* ---- Pagination ------------------------------------------------ */

#pagination {
	display: block;
	font-size: 1rem;
	text-align: center;
	height: auto;
	width: auto;
	margin-top: 30px;
}

.paginationList {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 0;
}

.pageItem {
	display: inline-block;
	margin: 0;
}

.pageButton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	color: var(--green);
	background-color: var(--surface-alt);
	border: 1px solid var(--border);
	border-radius: 999px;
	cursor: pointer;
	text-decoration: none;
	font-weight: 600;
	transition:
		background-color 0.2s ease,
		color 0.2s ease,
		border-color 0.2s ease;
}

.pageButton:hover {
	background-color: var(--green-soft);
	border-color: var(--green);
}

#currentPage {
	color: #ffffff !important;
	background-color: var(--green);
	border-color: var(--green);
	text-decoration: none;
	cursor: default;
}

#currentPage:hover {
	background-color: var(--green);
}

.pageButton.navButton {
	font-weight: 500;
}

.pageButton.ellipsis {
	border: none;
	background: transparent;
	cursor: pointer;
	color: var(--muted);
}

.pageButton.ellipsis:hover {
	background: transparent;
	color: var(--text);
}

/* ---- Mobile ------------------------------------------------------ */

@media screen and (max-width: 800px) {
	.imageContainer {
		display: block;
		width: 100%;
		border-radius: var(--radius-sm);
		overflow: hidden;
	}

	.imageDesktop {
		width: 100%;
		height: auto;
		min-height: 0;
		max-height: 210px;
		object-fit: cover;
	}

	.imovel {
		flex-direction: column;
	}

	.dataContainer {
		padding: 0 14px 14px;
	}

}
