/**
 * Real Estate Core
 * Frontend Styles
 *
 * @package RealEstateCore
 */

/* =========================================================
   Variables
   ========================================================= */

:root {
	--real-estate-primary: #2271b1;
	--real-estate-primary-hover: #135e96;
	--real-estate-text: #1d2327;
	--real-estate-muted: #646970;
	--real-estate-border: #dcdcde;
	--real-estate-background: #f6f7f7;
	--real-estate-white: #ffffff;
	--real-estate-radius: 8px;
	--real-estate-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}


/* =========================================================
   General
   ========================================================= */

.real-estate-property-grid,
.real-estate-property-single,
.real-estate-lead-form,
.real-estate-property-filters {
	box-sizing: border-box;
}

.real-estate-property-grid *,
.real-estate-property-single *,
.real-estate-lead-form *,
.real-estate-property-filters * {
	box-sizing: border-box;
}


/* =========================================================
   Property Grid
   ========================================================= */

.real-estate-property-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	width: 100%;
}

.real-estate-property-grid.columns-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.real-estate-property-grid.columns-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}


/* =========================================================
   Property Card
   ========================================================= */

.real-estate-property-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	background: var(--real-estate-white);
	border: 1px solid var(--real-estate-border);
	border-radius: var(--real-estate-radius);
	box-shadow: var(--real-estate-shadow);
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

.real-estate-property-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.real-estate-property-card-image {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: var(--real-estate-background);
}

.real-estate-property-card-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.real-estate-property-card:hover .real-estate-property-card-image img {
	transform: scale(1.03);
}

.real-estate-property-card-image-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--real-estate-muted);
}

.real-estate-property-card-badges {
	position: absolute;
	top: 12px;
	left: 12px;
	right: 12px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.real-estate-property-badge {
	display: inline-flex;
	align-items: center;
	padding: 5px 9px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.95);
	color: var(--real-estate-text);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
}

.real-estate-property-badge.featured {
	background: var(--real-estate-primary);
	color: #fff;
}

.real-estate-property-card-content {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 18px;
}

.real-estate-property-card-title {
	margin: 0 0 10px;
	font-size: 19px;
	line-height: 1.4;
}

.real-estate-property-card-title a {
	color: var(--real-estate-text);
	text-decoration: none;
}

.real-estate-property-card-title a:hover {
	color: var(--real-estate-primary);
}

.real-estate-property-card-price {
	margin-bottom: 10px;
	color: var(--real-estate-primary);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
}

.real-estate-property-card-excerpt {
	margin: 0 0 15px;
	color: var(--real-estate-muted);
	font-size: 14px;
	line-height: 1.7;
}

.real-estate-property-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 7px 15px;
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px solid var(--real-estate-border);
	color: var(--real-estate-muted);
	font-size: 13px;
}

.real-estate-property-card-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}


/* =========================================================
   Single Property
   ========================================================= */

.real-estate-property-single {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
}

.real-estate-property-single-header {
	margin-bottom: 24px;
}

.real-estate-property-single-title {
	margin: 0 0 12px;
	color: var(--real-estate-text);
	font-size: clamp(28px, 4vw, 42px);
	line-height: 1.25;
}

.real-estate-property-single-reference {
	color: var(--real-estate-muted);
	font-size: 13px;
}

.real-estate-property-single-price {
	margin-top: 15px;
	color: var(--real-estate-primary);
	font-size: 28px;
	font-weight: 700;
}


/* =========================================================
   Property Gallery
   ========================================================= */

.real-estate-property-gallery {
	margin-bottom: 30px;
}

.real-estate-property-gallery-main {
	overflow: hidden;
	background: var(--real-estate-background);
	border-radius: var(--real-estate-radius);
}

.real-estate-property-gallery-main img {
	display: block;
	width: 100%;
	max-height: 650px;
	object-fit: cover;
}

.real-estate-property-gallery-thumbs {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 8px;
	margin-top: 10px;
}

.real-estate-property-gallery-thumb {
	display: block;
	padding: 0;
	overflow: hidden;
	border: 2px solid transparent;
	border-radius: 5px;
	background: none;
	cursor: pointer;
}

.real-estate-property-gallery-thumb.active {
	border-color: var(--real-estate-primary);
}

.real-estate-property-gallery-thumb img {
	display: block;
	width: 100%;
	height: 80px;
	object-fit: cover;
}


/* =========================================================
   Property Layout
   ========================================================= */

.real-estate-property-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 30px;
	align-items: start;
}

.real-estate-property-main {
	min-width: 0;
}

.real-estate-property-sidebar {
	position: sticky;
	top: 30px;
}


/* =========================================================
   Property Details
   ========================================================= */

.real-estate-property-details {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	margin-bottom: 30px;
	border: 1px solid var(--real-estate-border);
	border-radius: var(--real-estate-radius);
	overflow: hidden;
	background: var(--real-estate-white);
}

.real-estate-property-detail {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--real-estate-border);
}

.real-estate-property-detail:nth-child(odd) {
	border-right: 1px solid var(--real-estate-border);
}

.real-estate-property-detail:nth-last-child(-n + 2) {
	border-bottom: 0;
}

.real-estate-property-detail-label {
	color: var(--real-estate-muted);
	font-size: 13px;
}

.real-estate-property-detail-value {
	color: var(--real-estate-text);
	font-weight: 600;
	text-align: right;
}


/* =========================================================
   Property Content
   ========================================================= */

.real-estate-property-description {
	margin-bottom: 30px;
	color: var(--real-estate-text);
	line-height: 1.8;
}

.real-estate-property-description h2,
.real-estate-property-description h3 {
	margin-top: 1.5em;
	margin-bottom: 0.7em;
}

.real-estate-property-description img {
	max-width: 100%;
	height: auto;
}


/* =========================================================
   Property Features
   ========================================================= */

.real-estate-property-features {
	margin-bottom: 30px;
}

.real-estate-property-features-title {
	margin: 0 0 15px;
	font-size: 22px;
}

.real-estate-property-features-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.real-estate-property-feature {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border: 1px solid var(--real-estate-border);
	border-radius: 5px;
	background: var(--real-estate-background);
}


/* =========================================================
   Sidebar
   ========================================================= */

.real-estate-property-sidebar-box {
	margin-bottom: 20px;
	padding: 20px;
	background: var(--real-estate-white);
	border: 1px solid var(--real-estate-border);
	border-radius: var(--real-estate-radius);
	box-shadow: var(--real-estate-shadow);
}

.real-estate-property-sidebar-box-title {
	margin: 0 0 15px;
	font-size: 19px;
	line-height: 1.4;
}

.real-estate-property-sidebar-box p:last-child {
	margin-bottom: 0;
}


/* =========================================================
   Lead Form
   ========================================================= */

.real-estate-lead-form {
	padding: 22px;
	background: var(--real-estate-white);
	border: 1px solid var(--real-estate-border);
	border-radius: var(--real-estate-radius);
}

.real-estate-lead-form-title {
	margin: 0 0 18px;
	font-size: 22px;
	line-height: 1.4;
}

.real-estate-lead-form-field {
	margin-bottom: 15px;
}

.real-estate-lead-form-field label {
	display: block;
	margin-bottom: 6px;
	color: var(--real-estate-text);
	font-size: 13px;
	font-weight: 600;
}

.real-estate-lead-form-field input,
.real-estate-lead-form-field textarea,
.real-estate-lead-form-field select {
	display: block;
	width: 100%;
	min-height: 42px;
	padding: 9px 11px;
	border: 1px solid var(--real-estate-border);
	border-radius: 5px;
	background: #fff;
	color: var(--real-estate-text);
	font: inherit;
}

.real-estate-lead-form-field textarea {
	min-height: 120px;
	resize: vertical;
}

.real-estate-lead-form-field input:focus,
.real-estate-lead-form-field textarea:focus,
.real-estate-lead-form-field select:focus {
	border-color: var(--real-estate-primary);
	outline: none;
	box-shadow: 0 0 0 1px var(--real-estate-primary);
}

.real-estate-lead-form-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 44px;
	padding: 10px 18px;
	border: 0;
	border-radius: 5px;
	background: var(--real-estate-primary);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
}

.real-estate-lead-form-submit:hover {
	background: var(--real-estate-primary-hover);
}

.real-estate-lead-form-submit:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

.real-estate-lead-form-message {
	margin-top: 15px;
	padding: 11px 13px;
	border-radius: 5px;
	font-size: 14px;
	line-height: 1.6;
}

.real-estate-lead-form-message.success {
	background: #edf7ed;
	color: #216e39;
}

.real-estate-lead-form-message.error {
	background: #fbeaea;
	color: #b32d2e;
}


/* =========================================================
   Property Filters
   ========================================================= */

.real-estate-property-filters {
	margin-bottom: 25px;
	padding: 18px;
	background: var(--real-estate-white);
	border: 1px solid var(--real-estate-border);
	border-radius: var(--real-estate-radius);
}

.real-estate-property-filters-row {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	align-items: end;
}

.real-estate-property-filter {
	min-width: 0;
}

.real-estate-property-filter label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
}

.real-estate-property-filter input,
.real-estate-property-filter select {
	display: block;
	width: 100%;
	min-height: 40px;
	padding: 8px 10px;
	border: 1px solid var(--real-estate-border);
	border-radius: 5px;
	background: #fff;
	font: inherit;
}

.real-estate-property-filter-actions {
	display: flex;
	gap: 8px;
}

.real-estate-property-filter-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 8px 16px;
	border: 0;
	border-radius: 5px;
	background: var(--real-estate-primary);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}


/* =========================================================
   Pagination
   ========================================================= */

.real-estate-property-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: 30px;
}

.real-estate-property-pagination a,
.real-estate-property-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	min-height: 36px;
	padding: 0 10px;
	border: 1px solid var(--real-estate-border);
	border-radius: 5px;
	background: var(--real-estate-white);
	color: var(--real-estate-text);
	text-decoration: none;
}

.real-estate-property-pagination .current {
	background: var(--real-estate-primary);
	border-color: var(--real-estate-primary);
	color: #fff;
}


/* =========================================================
   Empty State
   ========================================================= */

.real-estate-property-empty {
	padding: 50px 20px;
	text-align: center;
	color: var(--real-estate-muted);
	background: var(--real-estate-background);
	border: 1px dashed var(--real-estate-border);
	border-radius: var(--real-estate-radius);
}

.real-estate-property-empty h2 {
	margin-top: 0;
	color: var(--real-estate-text);
}


/* =========================================================
   Responsive
   ========================================================= */

@media screen and (max-width: 1100px) {

	.real-estate-property-grid,
	.real-estate-property-grid.columns-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.real-estate-property-layout {
		grid-template-columns: minmax(0, 1fr) 300px;
	}

	.real-estate-property-filters-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}


@media screen and (max-width: 782px) {

	.real-estate-property-grid,
	.real-estate-property-grid.columns-2,
	.real-estate-property-grid.columns-4 {
		grid-template-columns: 1fr;
	}

	.real-estate-property-layout {
		grid-template-columns: 1fr;
	}

	.real-estate-property-sidebar {
		position: static;
	}

	.real-estate-property-details {
		grid-template-columns: 1fr;
	}

	.real-estate-property-detail:nth-child(odd) {
		border-right: 0;
	}

	.real-estate-property-detail:last-child {
		border-bottom: 0;
	}

	.real-estate-property-detail:not(:last-child) {
		border-bottom: 1px solid var(--real-estate-border);
	}

	.real-estate-property-features-list {
		grid-template-columns: 1fr;
	}

	.real-estate-property-gallery-thumbs {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.real-estate-property-gallery-thumb img {
		height: 65px;
	}

	.real-estate-property-filters-row {
		grid-template-columns: 1fr;
	}
}


@media screen and (max-width: 480px) {

	.real-estate-property-card-content {
		padding: 15px;
	}

	.real-estate-property-single-price {
		font-size: 24px;
	}

	.real-estate-property-gallery-thumbs {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.real-estate-property-gallery-thumb img {
		height: 60px;
	}

	.real-estate-lead-form {
		padding: 16px;
	}
}