/**
 * Property Search - Find Property widget styles
 *
 * Self-contained port of the static find-property page. Bootstrap's
 * 3/9 column grid, form controls, cards and pagination are recreated
 * here with editable CSS variables driven by Elementor controls.
 *
 * @package PropertySearch
 */

.ps-find-property {
	--ps-find-card-bg: #ffffff;
	--ps-find-card-border: rgba(0, 0, 0, 0.04);
	--ps-find-card-shadow: rgba(0, 61, 43, 0.1);
	--ps-find-primary: #003d2b;
	--ps-find-primary-hover: #00291d;
	--ps-find-gold: #ffcc00;
	--ps-find-muted: #6c757d;
	--ps-find-input-border: #e8ede9;
	--ps-find-badge-verified-bg: rgba(0, 61, 43, 0.9);
	--ps-find-badge-verified-color: #ffcc00;
	--ps-find-badge-featured-bg: rgba(255, 204, 0, 0.9);
	--ps-find-badge-featured-color: #003d2b;
	--ps-find-price-color: #003d2b;
	--ps-find-fav-active: #dc3545;

	font-family: inherit;
	line-height: 1.5;
	color: #333333;
}

.ps-find-property,
.ps-find-property * {
	box-sizing: border-box;
}

/* Bootstrap .row.g-4 replacement: 3/9 columns. */
.ps-find-layout {
	display: grid;
	grid-template-columns: 3fr 9fr;
	gap: 24px;
	align-items: start;
}

.ps-find-sidebar {
	min-width: 0;
}

.ps-find-results {
	min-width: 0;
}

/* ------------------------------------------------------------------ */
/* Filter card (mirrors .filter-card)                                  */
/* ------------------------------------------------------------------ */

.ps-filter-card {
	background: var(--ps-find-card-bg);
	border-radius: 16px;
	padding: 28px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
	border: 1px solid var(--ps-find-card-border);
	position: sticky;
	top: 90px;
	display: block;
}

.ps-filter-title {
	font-weight: 700;
	color: var(--ps-find-primary);
	border-bottom: 2px solid var(--ps-find-gold);
	padding-bottom: 12px;
	margin: 0 0 20px;
	font-size: 1.1rem;
	display: flex;
	align-items: center;
	gap: 8px;
}

.ps-filter-field {
	margin-bottom: 16px;
}

.ps-form-label {
	font-weight: 600;
	font-size: 0.82rem;
	color: var(--ps-find-primary);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	display: inline-block;
	margin-bottom: 6px;
}

.ps-form-select,
.ps-form-control {
	width: 100%;
	border: 2px solid var(--ps-find-input-border);
	border-radius: 12px;
	padding: 10px 14px;
	font-size: 0.95rem;
	font-family: inherit;
	background-color: #ffffff;
	color: #333333;
	outline: none;
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.ps-form-select:focus,
.ps-form-control:focus {
	border-color: var(--ps-find-primary);
	box-shadow: 0 0 0 3px rgba(0, 61, 43, 0.1);
}

.ps-area-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

/* Budget range */
.ps-budget-range {
	width: 100%;
	accent-color: var(--ps-find-primary);
	cursor: pointer;
}

.ps-budget-scale {
	display: flex;
	justify-content: space-between;
	font-size: 0.82rem;
	color: var(--ps-find-muted);
	margin-top: 4px;
}

.ps-budget-val {
	font-weight: 700;
	color: var(--ps-find-primary);
}

/* Amenity checkboxes */
.ps-check-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ps-form-check {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
}

.ps-form-check-input {
	width: 16px;
	height: 16px;
	accent-color: var(--ps-find-primary);
	margin: 0;
	cursor: pointer;
}

.ps-form-check-label {
	font-size: 0.88rem;
}

/* Filter actions */
.ps-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.ps-btn-filter {
	background: var(--ps-find-primary);
	color: #ffffff;
	border: none;
	border-radius: 50px;
	padding: 12px;
	font-weight: 700;
	width: 100%;
	font-size: 0.95rem;
	margin-bottom: 8px;
}

.ps-btn-filter:hover {
	background: var(--ps-find-primary-hover);
	color: #ffffff;
}

.ps-btn-reset {
	background: transparent;
	color: var(--ps-find-primary);
	border: 2px solid var(--ps-find-primary);
	border-radius: 50px;
	padding: 10px;
	font-weight: 600;
	width: 100%;
	font-size: 0.95rem;
}

.ps-btn-reset:hover {
	background: var(--ps-find-primary);
	color: #ffffff;
}

/* ------------------------------------------------------------------ */
/* Sort bar                                                            */
/* ------------------------------------------------------------------ */

.ps-sort-bar {
	background: var(--ps-find-card-bg);
	border-radius: 16px;
	padding: 18px 24px;
	margin-bottom: 24px;
	border: 1px solid var(--ps-find-card-border);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
}

.ps-sort-count {
	font-weight: 700;
	margin: 0;
	font-size: 1.05rem;
	color: #222222;
}

.ps-sort-total {
	color: var(--ps-find-primary);
}

.ps-sort-controls {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.ps-sort-label {
	font-size: 0.85rem;
	color: var(--ps-find-muted);
}

.ps-sort-select {
	width: auto;
	min-width: 160px;
	padding: 8px 12px;
	font-size: 0.88rem;
}

.ps-view-toggle {
	display: flex;
	gap: 6px;
}

.ps-view-btn {
	width: 38px;
	height: 38px;
	border-radius: 10px;
	border: 1px solid var(--ps-find-input-border);
	background: #f8f9fa;
	color: #333333;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.ps-view-btn:hover,
.ps-view-btn.is-active {
	background: var(--ps-find-primary);
	border-color: var(--ps-find-primary);
	color: #ffffff;
}

/* ------------------------------------------------------------------ */
/* List cards                                                          */
/* ------------------------------------------------------------------ */

.ps-list-card {
	background: var(--ps-find-card-bg);
	border-radius: 16px;
	overflow: hidden;
	border: 1px solid var(--ps-find-card-border);
	transition: box-shadow 0.4s ease, transform 0.4s ease;
	margin-bottom: 24px;
}

.ps-list-card:hover {
	box-shadow: 0 12px 40px var(--ps-find-card-shadow);
	transform: translateY(-4px);
}

/* Bootstrap .col-md-4 / .col-md-8 replacement. */
.ps-list-card-inner {
	display: grid;
	grid-template-columns: 4fr 8fr;
}

.ps-list-card-img {
	position: relative;
	overflow: hidden;
}

.ps-list-card-img img {
	width: 100%;
	height: 100%;
	min-height: 220px;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.ps-list-card:hover .ps-list-card-img img {
	transform: scale(1.05);
}

.ps-list-badge {
	position: absolute;
	top: 14px;
	left: 14px;
	display: flex;
	gap: 6px;
	z-index: 2;
}

.ps-list-badge span {
	padding: 5px 14px;
	border-radius: 50px;
	font-size: 0.72rem;
	font-weight: 700;
	backdrop-filter: blur(8px);
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.ps-badge-f {
	background: var(--ps-find-badge-featured-bg);
	color: var(--ps-find-badge-featured-color);
}

.ps-badge-v {
	background: var(--ps-find-badge-verified-bg);
	color: var(--ps-find-badge-verified-color);
}

.ps-list-body {
	padding: 24px;
	min-width: 0;
}

.ps-list-head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
}

.ps-list-title {
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0 0 4px;
}

.ps-list-title a {
	color: #222222;
	text-decoration: none;
}

.ps-list-title a:hover {
	color: var(--ps-find-primary);
}

.ps-list-fav {
	width: 38px;
	height: 38px;
	flex-shrink: 0;
	border-radius: 50%;
	border: 1px solid var(--ps-find-input-border);
	background: #ffffff;
	color: #333333;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: color 0.3s ease, border-color 0.3s ease;
}

.ps-list-fav:hover,
.ps-list-fav.is-active {
	color: var(--ps-find-fav-active);
	border-color: var(--ps-find-fav-active);
}

.ps-list-loc {
	color: var(--ps-find-muted);
	font-size: 0.88rem;
	margin: 0 0 16px;
	display: flex;
	align-items: center;
	gap: 6px;
}

.ps-list-loc :is(i, svg) {
	color: #dc3545;
}

.ps-list-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 16px;
}

.ps-list-meta div {
	text-align: center;
}

.ps-list-meta small {
	display: block;
	color: var(--ps-find-muted);
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	margin-bottom: 2px;
}

.ps-list-meta strong {
	font-size: 0.92rem;
	color: var(--ps-find-primary);
}

.ps-list-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	padding-top: 16px;
	border-top: 1px solid #f0f0f0;
}

.ps-list-price {
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--ps-find-price-color);
}

.ps-list-price small {
	font-size: 0.78rem;
	color: var(--ps-find-muted);
	font-weight: 400;
}

.ps-btn-detail {
	background: var(--ps-find-primary);
	color: #ffffff;
	border: none;
	padding: 10px 24px;
	border-radius: 50px;
	font-weight: 600;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	transition: background 0.3s ease, color 0.3s ease;
	flex-shrink: 0;
}

.ps-btn-detail:hover {
	background: var(--ps-find-gold);
	color: var(--ps-find-primary);
}

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

.ps-pagination {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 24px;
}

.ps-page-link {
	min-width: 42px;
	height: 42px;
	padding: 0 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	background: #f8f9fa;
	color: #222222;
	text-decoration: none;
	font-weight: 600;
	border: 1px solid var(--ps-find-input-border);
	transition: background 0.3s ease, color 0.3s ease;
}

.ps-page-link:hover {
	background: var(--ps-find-gold);
	color: var(--ps-find-primary);
}

.ps-page-link.is-active {
	background: var(--ps-find-primary);
	color: #ffffff;
	border-color: var(--ps-find-primary);
}

.ps-page-link.is-disabled {
	opacity: 0.5;
	pointer-events: none;
}

/* Empty state */
.ps-find-empty {
	background: #f0f7f4;
	color: var(--ps-find-primary);
	border-radius: 16px;
	padding: 48px 24px;
	text-align: center;
	font-weight: 600;
	border: 1px dashed var(--ps-find-input-border);
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 991.98px) {
	.ps-find-layout {
		grid-template-columns: 1fr;
	}

	.ps-filter-card {
		position: static;
	}
}

@media (max-width: 767.98px) {
	.ps-list-card-inner {
		grid-template-columns: 1fr;
	}

	.ps-list-card-img img {
		min-height: 200px;
	}

	.ps-list-body {
		padding: 20px;
	}

	.ps-list-footer {
		flex-direction: column;
		align-items: stretch;
	}

	.ps-btn-detail {
		justify-content: center;
	}

	.ps-filter-card {
		padding: 22px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ps-list-card,
	.ps-list-card-img img,
	.ps-form-select,
	.ps-form-control,
	.ps-btn,
	.ps-view-btn,
	.ps-page-link {
		transition: none;
	}
}

/* Only cards participate in the grid: toolbar, empty state and pagination stay full width.
   List remains the original HTML design; both modes reuse the same live property cards. */
.ps-find-property[data-view="grid"] .ps-find-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.ps-find-property[data-view="grid"] .ps-find-cards > .ps-list-card { margin-bottom: 0; min-width: 0; }
.ps-find-property[data-view="grid"] .ps-list-card-inner { display: flex; flex-direction: column; height: 100%; }
.ps-find-property[data-view="grid"] .ps-list-card-img { flex-shrink: 0; }
.ps-find-property[data-view="grid"] .ps-list-card-img > a { display: block; height: 220px; }
.ps-find-property[data-view="grid"] .ps-list-card-img img { height: 100%; min-height: 0; }
.ps-find-property[data-view="grid"] .ps-list-body { display: flex; flex-direction: column; flex: 1; }
.ps-find-property[data-view="grid"] .ps-list-title { overflow-wrap: anywhere; }
.ps-find-property[data-view="grid"] .ps-list-footer { margin-top: auto; flex-wrap: wrap; }
.ps-find-property[data-view="grid"] .ps-list-price { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 767.98px) {
    .ps-find-property[data-view="grid"] .ps-find-cards { grid-template-columns: minmax(0, 1fr); }
}
