/**
 * Rael Property Manager - Archive / Listing page.
 * Modern listing inspired by Airbnb & Booking.com.
 */

.rpm-archive {
	font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
	color: #1a1d23;
	padding-bottom: 60px;
}

.rpm-archive__container {
	width: 100%;
	max-width: 1080px;
	margin: 0 auto;
	box-sizing: border-box;
}

.rpm-archive__container--with-sidebar {
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	max-width: 1280px;
	align-items: flex-start;
}

.rpm-archive__header {
	padding: 32px 0 40px;
	border-bottom: 1px solid #e5e7eb;
	margin-bottom: 40px;
}

.rpm-archive__title {
	margin: 0 0 8px;
	font-size: clamp(1.75rem, 4vw, 2.25rem);
	font-weight: 700;
	color: #fff;
	letter-spacing: -0.02em;
}

.rpm-archive__description {
	margin: 0;
	font-size: 1rem;
	color: #64748b;
	line-height: 1.5;
}

/* Sidebar (filters) */
.rpm-sidebar {
	flex: 0 0 280px;
	min-width: 0;
}

.rpm-sidebar .rpm-filters {
	margin-bottom: 0;
	position: sticky;
	top: 24px;
}

.rpm-sidebar .rpm-filters__panel {
	display: block;
}

.rpm-sidebar .rpm-filters__form {
	grid-template-columns: 1fr;
}

.rpm-sidebar .rpm-filters__row--price {
	grid-column: 1;
}

.rpm-sidebar .rpm-filters__actions {
	grid-column: 1;
}

.rpm-main {
	flex: 1 1 0;
	min-width: 0;
}

/* Sort bar */
.rpm-sort {
	margin-bottom: 24px;
}

.rpm-sort__form {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.rpm-sort__label {
	font-size: 0.875rem;
	font-weight: 600;
	color: #475569;
}

.rpm-sort__select {
	padding: 10px 36px 10px 14px;
	font-size: 0.9rem;
	color: #0f172a;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	cursor: pointer;
	min-width: 180px;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}

.rpm-sort__select:focus {
	outline: none;
	border-color: #0f172a;
}

/* Filters */
.rpm-filters {
	margin-bottom: 32px;
}

.rpm-filters__toggle {
	display: none;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 14px 18px;
	font-size: 0.95rem;
	font-weight: 600;
	color: #0f172a;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	cursor: pointer;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.rpm-filters__toggle-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #0f172a;
}

.rpm-filters__panel {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 24px;
	box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.rpm-filters__form {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 16px 20px;
	align-items: end;
}

.rpm-filters__row {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rpm-filters__row--price {
	grid-column: span 2;
}

.rpm-filters__range {
	display: flex;
	align-items: stretch;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	background: #f8fafc;
	overflow: hidden;
	padding: 10px 0;
}

.rpm-filters__range:focus-within {
	border-color: #0f172a;
	background: #fff;
}

.rpm-filters__range .rpm-filters__input--price {
	flex: 1 1 0;
	min-width: 0;
	border: none;
	background: transparent;
	border-radius: 0;
	padding-left: 12px;
	padding-right: 12px;
}

.rpm-filters__range .rpm-filters__input--price:focus {
	box-shadow: none;
	outline: none;
}

.rpm-filters__range-line {
	width: 1px;
	background: #e2e8f0;
	flex-shrink: 0;
	align-self: stretch;
}

.rpm-filters__range:focus-within .rpm-filters__range-line {
	background: #cbd5e1;
}

.rpm-filters__label {
	font-size: 0.8rem;
	font-weight: 600;
	color: #475569;
}

.rpm-filters__input,
.rpm-filters__select {
	width: 100%;
	padding: 10px 12px;
	font-size: 0.9rem;
	color: #0f172a;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	box-sizing: border-box;
}

.rpm-filters__input--small {
	min-width: 0;
}

.rpm-filters__input--price {
	font-variant-numeric: tabular-nums;
}

.rpm-filters__input:focus,
.rpm-filters__select:focus {
	outline: none;
	border-color: #0f172a;
	background: #fff;
}

.rpm-filters__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	grid-column: 1 / -1;
	margin-top: 8px;
}

.rpm-filters__submit {
	padding: 10px 20px;
	font-size: 0.9rem;
	font-weight: 600;
	color: #fff;
	background: #0f172a;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.2s ease;
}

.rpm-filters__submit:hover {
	background: #1e293b;
}

.rpm-filters__clear {
	font-size: 0.9rem;
	color: #64748b;
	text-decoration: none;
}

.rpm-filters__clear:hover {
	color: #0f172a;
}

/* Card grid */
.rpm-listing {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
}

.rpm-listing__card {
	margin: 0;
	padding: 0;
}

.rpm-listing__link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	height: 100%;
	background: #fff;
	border-radius: 20px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.rpm-listing__link:hover {
	box-shadow: 0 20px 40px rgba(15, 23, 42, 0.1);
	transform: translateY(-4px);
}

.rpm-listing__image-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 11;
	background: #f8fafc;
	overflow: hidden;
}

.rpm-listing__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.rpm-listing__link:hover .rpm-listing__image {
	transform: scale(1.04);
}

.rpm-listing__image--placeholder {
	background: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
}

.rpm-listing__badge {
	position: absolute;
	padding: 6px 12px;
	border-radius: 10px;
	font-size: 0.7rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	line-height: 1.2;
}

.rpm-listing__badge--featured {
	top: 12px;
	left: 12px;
	background: #0f172a;
	color: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.rpm-listing__badge--status {
	bottom: 12px;
	left: 12px;
	background: rgba(255, 255, 255, 0.96);
	color: #0f172a;
	backdrop-filter: blur(8px);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}


.rpm-listing__body {
	padding: 22px 22px 26px;
	display: flex;
	flex-direction: column;
	gap: 0;
	flex: 1;
}

.rpm-listing__head {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.rpm-listing__type {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: #94a3b8;
	font-weight: 600;
}

.rpm-listing__pill {
	font-size: 0.65rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 3px 8px;
	border-radius: 6px;
	background: #0f172a;
	color: #fff;
	font-weight: 600;
}

.rpm-listing__title {
	margin: 0 0 10px;
	font-size: 1.2rem;
	font-weight: 600;
	color: #0f172a;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	letter-spacing: -0.01em;
	margin-bottom: 0px;
}

.rpm-listing__location {
	margin: 0 0 14px;
	font-size: 0.9rem;
	color: #64748b;
	line-height: 1.45;
	-webkit-line-clamp: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	margin-bottom: 0px;
}

.rpm-listing__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 20px;
	margin-bottom: 16px;
	padding-top: 14px;
	border-top: 1px solid #f1f5f9;
}

.rpm-listing__stat {
	font-size: 0.875rem;
	color: #475569;
}

.rpm-listing__stat-value {
	font-weight: 600;
	color: #0f172a;
}

.rpm-listing__price {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 700;
	color: #0f172a;
	letter-spacing: -0.02em;
}

/* Pagination */
.rpm-archive__pagination {
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid #e5e7eb;
}

.rpm-archive__empty {
	text-align: center;
	padding: 60px 24px;
	color: #64748b;
	font-size: 1.1rem;
}

/* Wishlist button (listing cards & shortcode) */
.rpm-wishlist-btn {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	color: #64748b;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
	transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.rpm-wishlist-btn:hover {
	color: #0f172a;
	background: #fff;
	transform: scale(1.08);
}

.rpm-wishlist-btn.is-saved {
	color: #dc2626;
}

.rpm-wishlist-btn.is-saved:hover {
	color: #b91c1c;
}

.rpm-wishlist-btn__icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

.rpm-wishlist-btn__icon svg {
	width: 22px;
	height: 22px;
}

.rpm-wishlist-btn .rpm-wishlist-btn__heart {
	fill: none;
	stroke: currentColor;
}

.rpm-wishlist-btn.is-saved .rpm-wishlist-btn__heart {
	fill: currentColor;
	stroke: currentColor;
}

/* Shortcode: featured_properties & wishlist */
.rpm-shortcode {
	margin-bottom: 2rem;
}

.rpm-wishlist-empty {
	text-align: center;
	padding: 48px 24px;
	color: #64748b;
	font-size: 1.1rem;
	margin: 0;
}

@media (max-width: 1024px) {
	.rpm-listing {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 900px) {
	.rpm-archive__container--with-sidebar {
		flex-direction: column;
	}

	.rpm-sidebar {
		flex: 0 0 auto;
		width: 100%;
	}

	.rpm-sidebar .rpm-filters {
		position: static;
	}

	.rpm-sidebar .rpm-filters__panel {
		display: none;
		margin-top: 12px;
	}

	.rpm-sidebar .rpm-filters__panel.is-open {
		display: block;
	}

	.rpm-filters__toggle {
		display: flex;
	}
}

@media (max-width: 768px) {
	.rpm-filters__toggle {
		display: flex;
	}

	.rpm-filters__panel {
		display: none;
		margin-top: 12px;
		padding: 20px;
	}

	.rpm-filters__panel.is-open {
		display: block;
	}

	.rpm-filters__form {
		grid-template-columns: 1fr;
	}

	.rpm-filters__row--price {
		grid-column: 1;
	}

	.rpm-filters__actions {
		grid-column: 1;
		flex-wrap: wrap;
	}

	.rpm-sort__form {
		width: 100%;
	}

	.rpm-sort__select {
		flex: 1;
		min-width: 0;
	}
}

@media (max-width: 640px) {
	.rpm-archive__container {
		max-width: 80%;
	}

	.rpm-listing {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.rpm-listing__body {
		padding: 16px 16px 20px;
	}
}
