/**
 * Veritas Property Listings Widget — Styles
 *
 * Grid + list view layouts, toolbar, pagination, and card design
 * matching the Veritas gold/black brand palette.
 *
 * @package PLVeritasHelper
 * @since   0.5.0
 */

/* ─── Design Tokens ───────────────────────────────────────────── */
.vpl-wrap {
	--vpl-gold:        #FFCC00;
	--vpl-gold-hover:  #E6B800;
	--vpl-gold-text:   #8B6914; /* Darkened gold for text on white — 5.8:1 contrast (WCAG AA) */
	--vpl-black:       #1A1A1A;
	--vpl-white:       #FFFFFF;
	--vpl-muted:       #666666; /* Darkened from #777 — 5.7:1 contrast (WCAG AA) */
	--vpl-border:      #E8E8E8;
	--vpl-shadow:      0 2px 16px rgba(0, 0, 0, 0.08);
	--vpl-shadow-hov:  0 8px 32px rgba(0, 0, 0, 0.14);
	--vpl-radius:      8px;
	--vpl-font-head:   'Cormorant Garamond', Georgia, serif;
	--vpl-font-body:   'Inter', sans-serif;
}

/* ─── Toolbar ─────────────────────────────────────────────────── */
.vpl-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--vpl-border);
}

.vpl-toolbar-left {
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
}

.vpl-result-count {
	font-family: var(--vpl-font-body);
	font-size: 15px;
	font-weight: 600;
	color: var(--vpl-black);
}

.vpl-filter-pills {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.vpl-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	background: rgba(255, 204, 0, 0.1);
	border: 1px solid rgba(255, 204, 0, 0.35);
	border-radius: 100px;
	font-family: var(--vpl-font-body);
	font-size: 12px;
	font-weight: 600;
	color: var(--vpl-black);
	text-decoration: none;
	line-height: 1.5;
	transition: all 0.15s ease;
	cursor: pointer;
}

.vpl-pill:hover {
	background: rgba(255, 204, 0, 0.2);
	border-color: var(--vpl-gold);
	color: var(--vpl-black);
}

.vpl-pill-x {
	width: 9px;
	height: 9px;
	flex-shrink: 0;
	color: var(--vpl-muted);
	transition: color 0.15s ease;
}

.vpl-pill:hover .vpl-pill-x {
	color: #cc3333;
}

.vpl-toolbar-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.vpl-view-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1.5px solid var(--vpl-border);
	border-radius: 6px;
	background: var(--vpl-white);
	cursor: pointer;
	color: var(--vpl-muted);
	transition: all 0.15s ease;
	padding: 0;
}

.vpl-view-btn svg {
	width: 16px;
	height: 16px;
}

.vpl-view-btn:hover {
	color: var(--vpl-black);
	border-color: #ccc;
}

.vpl-view-btn.is-active {
	color: var(--vpl-black);
	border-color: var(--vpl-gold);
	background: rgba(255, 204, 0, 0.08);
}

/* ─── Grid Layout ─────────────────────────────────────────────── */
.vpl-grid {
	display: grid;
	gap: 24px;
	width: 100%;
}

.vpl-grid.vpl-view--grid {
	grid-template-columns: repeat(var(--vpl-list-cols, 3), 1fr);
}

.vpl-split-body .vpl-grid.vpl-view--grid {
	grid-template-columns: repeat(var(--vpl-split-cols, 2), 1fr);
}

/* In list-only mode, use the full list columns */
.vpl-wrap--split[data-view-mode="list"] .vpl-grid.vpl-view--grid {
	grid-template-columns: repeat(var(--vpl-list-cols, 3), 1fr);
}

.vpl-grid.vpl-view--list {
	grid-template-columns: 1fr;
}

/* Instant restore of saved view preference (set by inline script before paint) */
[data-grid-view="list"] .vpl-grid {
	grid-template-columns: 1fr !important;
}

[data-grid-view="grid"] .vpl-grid {
	grid-template-columns: repeat(var(--vpl-list-cols, 3), 1fr) !important;
}

[data-grid-view="grid"] .vpl-split-body .vpl-grid {
	grid-template-columns: repeat(var(--vpl-split-cols, 2), 1fr) !important;
}

[data-view-mode="list"][data-grid-view="grid"] .vpl-grid {
	grid-template-columns: repeat(var(--vpl-list-cols, 3), 1fr) !important;
}

/* ─── Card — Shared Base ──────────────────────────────────────── */
.vpl-card {
	background: var(--vpl-white);
	border-radius: var(--vpl-radius);
	box-shadow: var(--vpl-shadow);
	overflow: hidden;
	display: flex;
	transition: box-shadow 0.25s ease, transform 0.2s ease;
	border: 1.5px solid transparent;
}

.vpl-card:hover {
	box-shadow: var(--vpl-shadow-hov);
	transform: translateY(-4px);
	border-color: var(--vpl-gold);
}

/* ─── Card — Grid View ────────────────────────────────────────── */
.vpl-view--grid .vpl-card {
	flex-direction: column;
}

.vpl-view--grid .vpl-card-image-wrap {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 10;
}

.vpl-view--grid .vpl-card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.vpl-view--grid .vpl-card:hover .vpl-card-image {
	transform: scale(1.04);
}

.vpl-view--grid .vpl-card-body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

/* ─── Card — List View ────────────────────────────────────────── */
.vpl-view--list .vpl-card {
	flex-direction: row;
	align-items: stretch;
	height: 220px;
}

.vpl-view--list .vpl-card-image-wrap {
	position: relative;
	display: block;
	overflow: hidden;
	flex: 0 0 320px;
	min-height: 200px;
}

.vpl-view--list .vpl-card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.vpl-view--list .vpl-card:hover .vpl-card-image {
	transform: scale(1.04);
}

.vpl-view--list .vpl-card-body {
	padding: 24px 28px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	justify-content: center;
}

.vpl-view--list .vpl-title {
	font-size: 18px;
}

.vpl-view--list .vpl-card:hover {
	transform: translateY(0);
	transform: translateX(2px);
}

/* ─── Placeholder (no image) ──────────────────────────────────── */
.vpl-card-image--placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #1A1A1A 0%, #333 60%, #222 100%);
	display: flex;
	align-items: center;
	justify-content: center;
}

.vpl-card-image--placeholder::after {
	content: '';
	display: block;
	width: 48px;
	height: 48px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Crect x='2' y='3' width='20' height='18' rx='2' stroke='%23FFCC00' stroke-width='1.5'/%3E%3Ccircle cx='8.5' cy='9.5' r='2' stroke='%23FFCC00' stroke-width='1.5'/%3E%3Cpath d='M2 17l5-5 3 3 4-4 8 6' stroke='%23FFCC00' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: contain;
	opacity: 0.4;
}

/* ─── Badge ───────────────────────────────────────────────────── */
.vpl-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background-color: var(--vpl-gold);
	color: var(--vpl-black);
	font-family: var(--vpl-font-body);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 3px;
	line-height: 1.5;
	pointer-events: none;
	z-index: 1;
}

/* ─── Location ────────────────────────────────────────────────── */
.vpl-location {
	font-family: var(--vpl-font-body);
	font-size: 12px;
	font-weight: 500;
	color: var(--vpl-muted);
	text-transform: uppercase;
	letter-spacing: 0.07em;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 4px;
}

.vpl-pin {
	width: 9px;
	height: 12px;
	flex-shrink: 0;
	color: var(--vpl-muted);
}

/* ─── Title ───────────────────────────────────────────────────── */
.vpl-title {
	font-family: var(--vpl-font-body);
	font-size: 16px;
	font-weight: 600;
	color: var(--vpl-black);
	margin: 0;
	line-height: 1.4;
}

.vpl-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.vpl-title a:hover {
	color: #333;
}

/* ─── Meta Row ────────────────────────────────────────────────── */
.vpl-meta {
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 2px;
}

.vpl-price {
	font-family: var(--vpl-font-head);
	font-size: 22px;
	font-weight: 700;
	color: var(--vpl-gold-text);
	line-height: 1;
}

.vpl-acres {
	font-family: var(--vpl-font-body);
	font-size: 13px;
	color: var(--vpl-muted);
}

.vpl-ppa {
	font-family: var(--vpl-font-body);
	font-size: 13px;
	color: var(--vpl-muted);
	font-style: italic;
}

/* ─── CTA Link ────────────────────────────────────────────────── */
.vpl-card-cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: auto;
	padding-top: 12px;
	font-family: var(--vpl-font-body);
	font-size: 13px;
	font-weight: 600;
	color: var(--vpl-gold-text);
	text-decoration: none;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	transition: gap 0.15s ease, opacity 0.15s ease;
}

.vpl-card-cta svg {
	width: 14px;
	height: 10px;
	flex-shrink: 0;
	transition: transform 0.15s ease;
}

.vpl-card-cta:hover {
	opacity: 0.8;
}

.vpl-card-cta:hover svg {
	transform: translateX(3px);
}

/* ─── Empty State ─────────────────────────────────────────────── */
.vpl-empty {
	text-align: center;
	padding: 60px 20px;
}

.vpl-empty-icon {
	margin-bottom: 16px;
}

.vpl-empty-icon svg {
	width: 48px;
	height: 48px;
	color: var(--vpl-muted);
}

.vpl-empty-heading {
	font-family: var(--vpl-font-head);
	font-size: 28px;
	font-weight: 600;
	color: var(--vpl-black);
	margin: 0 0 8px;
}

.vpl-empty-message {
	font-family: var(--vpl-font-body);
	font-size: 15px;
	color: var(--vpl-muted);
	margin: 0 0 20px;
	max-width: 420px;
	margin-inline: auto;
	line-height: 1.6;
}

.vpl-empty-reset {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--vpl-font-body);
	font-size: 14px;
	font-weight: 600;
	color: var(--vpl-gold-text);
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.15s ease;
}

.vpl-empty-reset:hover {
	color: var(--vpl-gold-hover);
}

/* ─── Pagination ──────────────────────────────────────────────── */
.vpl-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid var(--vpl-border);
}

.vpl-pagination a,
.vpl-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 8px;
	font-family: var(--vpl-font-body);
	font-size: 14px;
	font-weight: 500;
	color: var(--vpl-black);
	background: var(--vpl-white);
	border: 1.5px solid var(--vpl-border);
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.15s ease;
}

.vpl-pagination a:hover {
	border-color: var(--vpl-gold);
	color: var(--vpl-black);
	background: rgba(255, 204, 0, 0.08);
}

.vpl-pagination .current {
	background-color: var(--vpl-gold);
	border-color: var(--vpl-gold);
	color: var(--vpl-black);
	font-weight: 700;
}

.vpl-pagination .dots {
	border: none;
	background: none;
	color: var(--vpl-muted);
	min-width: auto;
}

.vpl-pagination .prev,
.vpl-pagination .next {
	font-weight: 700;
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
	.vpl-grid.vpl-view--grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.vpl-view--list .vpl-card-image-wrap {
		flex: 0 0 240px;
	}
}

@media (max-width: 767px) {
	.vpl-grid.vpl-view--grid {
		grid-template-columns: 1fr;
	}

	.vpl-view--list .vpl-card {
		flex-direction: column;
		height: auto;
	}

	/* On mobile both views are single-column, so toggle is useless. */
	.vpl-view-btn {
		display: none;
	}

	.vpl-view--list .vpl-card-image-wrap {
		flex: none;
		aspect-ratio: 16 / 10;
		min-height: auto;
	}

	.vpl-view--list .vpl-card-body {
		padding: 20px;
	}

	.vpl-view--list .vpl-title {
		font-size: 16px;
	}

	.vpl-view--list .vpl-card:hover {
		transform: translateY(-4px);
	}

	.vpl-toolbar {
		flex-wrap: wrap;
	}

	.vpl-pagination a,
	.vpl-pagination span {
		min-width: 36px;
		height: 36px;
		font-size: 13px;
	}
}

/* ─── Filter Trigger Button ──────────────────────────────────── */
.vpl-filter-trigger {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	border-radius: 4px;
	background: transparent;
	color: var(--vpl-muted);
	cursor: pointer;
	transition: color 0.15s ease, background 0.15s ease;
}

.vpl-filter-trigger svg {
	width: 16px;
	height: 16px;
}

.vpl-filter-trigger:hover {
	color: var(--vpl-black);
	background: rgba(0, 0, 0, 0.04);
}

.vpl-filter-trigger.is-active,
.vpl-filter-trigger.has-filters {
	color: var(--vpl-gold);
}

/* ─── Sort Dropdown ─────────────────────────────────────────── */
.vpl-sort-select {
	font-family: var(--vpl-font-body);
	font-size: 13px;
	font-weight: 500;
	color: var(--vpl-black);
	padding: 4px 30px 4px 10px;
	border: 1.5px solid var(--vpl-border);
	border-radius: 6px;
	background: var(--vpl-white);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 6 5-6' stroke='%23777' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 10px;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	outline: none;
	transition: border-color 0.15s ease;
}

.vpl-sort-select:focus {
	border-color: var(--vpl-gold);
	box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.12);
}

/* ─── Location Autocomplete + Pills ──────────────────────────── */
.vpl-location-autocomplete {
	position: relative;
}

.vpl-loc-pills-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	background: var(--vpl-white);
	border: 1.5px solid var(--vpl-border);
	border-radius: 6px;
	padding: 6px 10px;
	min-height: 40px;
	cursor: text;
	transition: border-color 0.2s ease;
}

.vpl-loc-pills-wrap:focus-within {
	border-color: var(--vpl-gold);
	box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.12);
}

.vpl-loc-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: var(--vpl-gold);
	color: var(--vpl-black);
	font-family: var(--vpl-font-body);
	font-size: 12px;
	font-weight: 600;
	padding: 3px 6px 3px 10px;
	border-radius: 14px;
	white-space: nowrap;
}

.vpl-loc-pill-x {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	padding: 0;
	border: none;
	background: rgba(0, 0, 0, 0.15);
	border-radius: 50%;
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
	color: var(--vpl-black);
	transition: background 0.12s ease;
}

.vpl-loc-pill-x:hover {
	background: rgba(0, 0, 0, 0.3);
}

.vpl-loc-input {
	flex: 1 1 80px;
	border: none;
	outline: none;
	background: transparent;
	font-family: var(--vpl-font-body);
	font-size: 14px;
	color: var(--vpl-text);
	min-width: 80px;
	padding: 2px 0;
}

.vpl-loc-input::placeholder {
	color: #999;
}

.vpl-loc-suggestions {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	z-index: 9999;
	margin: 0;
	padding: 0;
	list-style: none;
	background: var(--vpl-white);
	border: 1.5px solid var(--vpl-gold);
	border-radius: 6px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
	max-height: 220px;
	overflow-y: auto;
	display: none;
}

.vpl-loc-suggestions.is-open {
	display: block;
}

.vpl-loc-suggestions li {
	padding: 10px 14px;
	font-family: var(--vpl-font-body);
	font-size: 13px;
	color: var(--vpl-text);
	cursor: pointer;
	border-bottom: 1px solid #f2f2f2;
	transition: background 0.12s ease;
}

.vpl-loc-suggestions li:last-child {
	border-bottom: none;
}

.vpl-loc-suggestions li:hover {
	background: rgba(255, 204, 0, 0.1);
}

.vpl-loc-suggestions li.vpl-loc-no-results,
.vpl-loc-suggestions li.vpl-loc-loading {
	color: #999;
	cursor: default;
	font-style: italic;
}

/* ─── Dual-Thumb Range Slider ─────────────────────────────────── */
.vpl-range-slider {
	padding: 4px 0 8px;
}

.vpl-range-values {
	display: flex;
	justify-content: space-between;
	font-family: var(--vpl-font-body);
	font-size: 13px;
	font-weight: 600;
	color: var(--vpl-black);
	margin-bottom: 12px;
}

.vpl-range-track {
	position: relative;
	height: 28px;
}

.vpl-range-track::before {
	content: '';
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	left: 0;
	right: 0;
	height: 4px;
	background: #e0e0e0;
	border-radius: 2px;
	pointer-events: none;
}

.vpl-range-fill {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	height: 4px;
	background: var(--vpl-gold);
	border-radius: 2px;
	pointer-events: none;
}

.vpl-range-input {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	left: 0;
	width: 100%;
	height: 4px;
	appearance: none;
	-webkit-appearance: none;
	background: transparent;
	pointer-events: none;
	outline: none;
	margin: 0;
}

.vpl-range-input::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--vpl-gold);
	border: 2px solid var(--vpl-white);
	cursor: pointer;
	pointer-events: all;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
	transition: transform 0.1s ease;
}

.vpl-range-input::-webkit-slider-thumb:hover {
	transform: scale(1.15);
	background: #E6B800;
}

.vpl-range-input::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--vpl-gold);
	border: 2px solid var(--vpl-white);
	cursor: pointer;
	pointer-events: all;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.vpl-range-input::-moz-range-track {
	background: transparent;
	border: none;
}


.vpl-drawer-backdrop {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.vpl-drawer-backdrop.is-open {
	opacity: 1;
	visibility: visible;
}

/* ─── Drawer Panel ────────────────────────────────────────────── */
.vpl-drawer {
	position: fixed;
	top: 0;
	z-index: 9999;
	width: 380px;
	max-width: 90vw;
	height: 100vh;
	background: var(--vpl-white);
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
	overflow: hidden; /* Scroll is on .vpl-drawer-form, not here */
}

/* Right side (default) */
.vpl-drawer--right {
	right: 0;
	transform: translateX(100%);
	box-shadow: -8px 0 40px rgba(0, 0, 0, 0.15);
}

.vpl-drawer--right.is-open {
	transform: translateX(0);
}

/* Left side */
.vpl-drawer--left {
	left: 0;
	transform: translateX(-100%);
	box-shadow: 8px 0 40px rgba(0, 0, 0, 0.15);
}

.vpl-drawer--left.is-open {
	transform: translateX(0);
}

/* WP Admin bar compensation (CSS fallback; JS also handles this) */
.admin-bar .vpl-drawer {
	top: 32px;
	height: calc(100vh - 32px);
}

@media (max-width: 782px) {
	.admin-bar .vpl-drawer {
		top: 46px;
		height: calc(100vh - 46px);
	}
}

/* ─── Drawer Header ───────────────────────────────────────────── */
.vpl-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24px 28px 20px;
	border-bottom: 1px solid var(--vpl-border);
	flex-shrink: 0;
}

.vpl-drawer-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--vpl-font-body);
	font-size: 16px;
	font-weight: 700;
	color: var(--vpl-black);
	margin: 0;
}

.vpl-drawer-title svg {
	width: 18px;
	height: 18px;
	color: var(--vpl-gold);
}

.vpl-drawer-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 6px;
	background: transparent;
	color: var(--vpl-muted);
	cursor: pointer;
	transition: all 0.15s ease;
	padding: 0;
}

.vpl-drawer-close svg {
	width: 12px;
	height: 12px;
}

.vpl-drawer-close:hover {
	background: #f5f5f5;
	color: var(--vpl-black);
}

/* ─── Drawer Form ─────────────────────────────────────────────── */
.vpl-drawer-form {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0; /* Allow flex child to shrink below content height */
	overflow: hidden;
}

.vpl-drawer-fields {
	padding: 24px 28px;
	display: flex;
	flex-direction: column;
	gap: 20px;
	flex: 1;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.vpl-drawer-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.vpl-drawer-label {
	font-family: var(--vpl-font-body);
	font-size: 12px;
	font-weight: 700;
	color: var(--vpl-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.vpl-drawer-input,
.vpl-drawer-select {
	font-family: var(--vpl-font-body);
	font-size: 14px;
	color: var(--vpl-black);
	padding: 10px 14px;
	border: 1.5px solid var(--vpl-border);
	border-radius: 6px;
	background: #fafafa;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	outline: none;
	width: 100%;
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
}

.vpl-drawer-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 6 5-6' stroke='%23777' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	background-size: 10px;
	padding-right: 36px;
}

.vpl-drawer-input:focus,
.vpl-drawer-select:focus {
	border-color: var(--vpl-gold);
	box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.12);
}

.vpl-drawer-input::placeholder {
	color: #bbb;
}

.vpl-drawer-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* ─── Drawer Actions (always visible at bottom) ───────────────── */
.vpl-drawer-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex-shrink: 0;
	padding: 20px 28px;
	padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--vpl-border);
	background: var(--vpl-white);
}

.vpl-drawer-apply {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 12px 24px;
	font-family: var(--vpl-font-body);
	font-size: 14px;
	font-weight: 700;
	color: var(--vpl-black);
	background: var(--vpl-gold);
	border: none;
	border-radius: 6px;
	cursor: pointer;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	transition: background 0.15s ease, transform 0.1s ease;
}

.vpl-drawer-apply:hover {
	background: var(--vpl-gold-hover);
}

.vpl-drawer-apply:active {
	transform: scale(0.98);
}

.vpl-drawer-reset {
	display: block;
	text-align: center;
	font-family: var(--vpl-font-body);
	font-size: 13px;
	font-weight: 600;
	color: var(--vpl-muted);
	text-decoration: none;
	transition: color 0.15s ease;
}

.vpl-drawer-reset:hover {
	color: #cc3333;
}

/* ─── Drawer Body Scroll Lock ─────────────────────────────────── */
body.vpl-drawer-open {
	overflow: hidden;
}

/* ═══ Google Maps Panel ═══════════════════════════════════════════ */

/* ─── Map Container ──────────────────────────────────────────────── */
.vpl-map {
	width: 100%;
	border-radius: var(--vpl-radius);
	overflow: hidden;
	box-shadow: var(--vpl-shadow);
	border: 1.5px solid var(--vpl-border);
	background: #f5f5f5;
}

.vpl-map--top {
	height: 450px;
	margin-bottom: 24px;
}

/* ─── Split Layout ───────────────────────────────────────────────── */
.vpl-wrap--split .vpl-toolbar {
	width: 100%;
}

.vpl-split-body {
	display: flex;
	gap: 24px;
	align-items: stretch;
	width: 100%;
	height: calc(100vh - 180px);
}

/* Map left (default) */
.vpl-wrap--map-left .vpl-split-body {
	flex-direction: row;
}

/* Map right */
.vpl-wrap--map-right .vpl-split-body {
	flex-direction: row-reverse;
}

.vpl-split-body .vpl-map {
	flex: 0 0 50%;
	height: 100%;
	border-radius: var(--vpl-radius);
}

.vpl-split-body .vpl-listings-panel {
	flex: 1;
	min-width: 0;
	height: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

/* Admin bar compensation */
.admin-bar .vpl-split-body {
	height: calc(100vh - 212px);
}

/* ─── View Mode States ──────────────────────────────────────────── */
.vpl-wrap--split[data-view-mode="map"] .vpl-split-body .vpl-map {
	flex: 1 1 100%;
}

.vpl-wrap--split[data-view-mode="map"] .vpl-split-body .vpl-listings-panel {
	display: none;
}

.vpl-wrap--split[data-view-mode="list"] .vpl-split-body .vpl-map {
	display: none;
}

.vpl-wrap--split[data-view-mode="list"] .vpl-split-body {
	height: auto;
}

.vpl-wrap--split[data-view-mode="list"] .vpl-split-body .vpl-listings-panel {
	flex: 1 1 100%;
	height: auto;
	overflow-y: visible;
}

/* ─── Mode Toggle Buttons ───────────────────────────────────────── */
.vpl-mode-toggle {
	display: inline-flex;
	gap: 4px;
	margin-right: 12px;
}

.vpl-mode-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1.5px solid var(--vpl-border);
	border-radius: 6px;
	background: var(--vpl-white);
	color: var(--vpl-muted);
	cursor: pointer;
	transition: all 0.15s ease;
	padding: 0;
}

.vpl-mode-btn svg {
	width: 16px;
	height: 16px;
}

.vpl-mode-btn:hover {
	color: var(--vpl-black);
	border-color: #ccc;
}

.vpl-mode-btn.is-active,
[data-view-mode="list"] .vpl-mode-btn[data-mode="list"],
[data-view-mode="split"] .vpl-mode-btn[data-mode="split"],
[data-view-mode="map"] .vpl-mode-btn[data-mode="map"] {
	color: var(--vpl-black);
	border-color: var(--vpl-gold);
	background: rgba(255, 204, 0, 0.08);
	box-shadow: none;
}

/* ─── Price Pins ─────────────────────────────────────────────────── */
.vpl-price-pin {
	padding: 4px 10px;
	font-family: var(--vpl-font-body);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.3;
	white-space: nowrap;
	border-radius: 16px;
	cursor: pointer;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	background: var(--vpl-black);
	color: var(--vpl-white);
	position: relative;
}

/* Triangle pointer */
.vpl-price-pin::after {
	content: '';
	position: absolute;
	bottom: -5px;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 5px solid var(--vpl-black);
}

.vpl-price-pin--featured {
	background: var(--vpl-gold);
	color: var(--vpl-black);
}

.vpl-price-pin--featured::after {
	border-top-color: var(--vpl-gold);
}

.vpl-price-pin:hover,
.vpl-price-pin--active {
	transform: scale(1.15);
	z-index: 10 !important;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* ─── Info Window ────────────────────────────────────────────────── */
/* Scope overrides to our map container to avoid bleeding into other elements */
#vpl-map .gm-style-iw-c {
	border-radius: 12px !important;
	padding: 0 !important;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18) !important;
	max-width: 300px !important;
	overflow: visible !important;
}

#vpl-map .gm-style-iw-d {
	overflow: hidden !important;
	padding: 0 !important;
	max-width: 280px !important;
}

#vpl-map .gm-style-iw-tc::after {
	background: #fff !important;
}

/* Hide Google's default close button — we use our own inside the card */
#vpl-map .gm-style-iw-c > button,
#vpl-map .gm-style-iw-c button.gm-ui-hover-effect {
	display: none !important;
}

/* Our custom close button inside the card */
.vpl-iw-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 26px;
	height: 26px;
	background: rgba(0, 0, 0, 0.6);
	border: none;
	border-radius: 50%;
	cursor: pointer;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	line-height: 1;
	transition: background 0.15s ease;
}

.vpl-iw-close:hover {
	background: rgba(0, 0, 0, 0.8);
}

.vpl-iw-close svg {
	width: 12px;
	height: 12px;
	color: #fff;
}

.vpl-info-window {
	font-family: 'Inter', sans-serif;
	width: 260px;
	background: #fff;
	overflow: hidden;
	border-radius: 12px;
	position: relative;
}

.vpl-iw-thumb {
	width: 100%;
	height: 140px;
	min-height: 140px;
	max-height: 140px;
	object-fit: cover;
	display: block;
	margin: 0;
	border-radius: 0;
}

.vpl-iw-body {
	padding: 12px 14px 14px;
}

.vpl-iw-title {
	font-size: 13px;
	font-weight: 700;
	color: #1A1A1A;
	line-height: 1.35;
	min-height: 35px;
	margin: 0 0 8px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.vpl-iw-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.vpl-iw-price {
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 20px;
	font-weight: 700;
	color: #FFCC00;
	line-height: 1;
}

.vpl-iw-acres {
	font-size: 11px;
	font-weight: 600;
	color: #777;
	background: #f3f3f3;
	padding: 3px 8px;
	border-radius: 10px;
	letter-spacing: 0.02em;
}

.vpl-iw-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 36px;
	min-height: 36px;
	padding: 0 14px;
	font-family: 'Inter', sans-serif;
	font-size: 11px;
	font-weight: 700;
	color: #1A1A1A !important;
	background: #FFCC00;
	text-decoration: none !important;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	border-radius: 6px;
	transition: background 0.15s ease;
	box-sizing: border-box;
}

.vpl-iw-cta:hover {
	background: #E6B800;
	color: #1A1A1A !important;
}

/* ─── Card Map Highlight ─────────────────────────────────────────── */
.vpl-card--map-active {
	border-color: var(--vpl-gold) !important;
	box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.3), var(--vpl-shadow-hov) !important;
}

/* ─── Mobile Map Toggle (FAB) ────────────────────────────────────── */
.vpl-map-toggle-wrap {
	display: none; /* Hidden on desktop */
}

.vpl-map-toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	background: var(--vpl-black);
	color: var(--vpl-white);
	border: none;
	border-radius: 24px;
	font-family: var(--vpl-font-body);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
	transition: background 0.15s ease;
}

.vpl-map-toggle svg {
	width: 16px;
	height: 16px;
}

.vpl-map-toggle:hover {
	background: #333;
}

/* ─── Map Responsive ─────────────────────────────────────────────── */
@media (max-width: 1024px) {
	.vpl-split-body {
		flex-direction: column !important;
		height: auto;
	}

	.vpl-split-body .vpl-map {
		flex: none;
		width: 100%;
		height: 350px;
		display: none; /* hidden by default on mobile, toggle shows it */
	}

	.vpl-split-body .vpl-listings-panel {
		height: auto;
		max-height: none;
		overflow-y: visible;
	}

	.vpl-mode-toggle {
		display: none;
	}

	/* Override desktop view-mode rules on mobile */
	.vpl-wrap--split[data-view-mode="map"] .vpl-split-body .vpl-listings-panel {
		display: block;
	}
	.vpl-wrap--split[data-view-mode="list"] .vpl-split-body .vpl-listings-panel {
		flex: auto;
	}

	/* When map is shown via mobile toggle */
	.vpl-split-body.vpl-map-visible .vpl-map {
		display: block !important;
	}
}

@media (max-width: 767px) {
	.vpl-map--top {
		height: 300px;
		margin-bottom: 16px;
	}

	.vpl-map-toggle-wrap {
		display: flex;
		justify-content: center;
		position: fixed;
		bottom: calc(20px + env(safe-area-inset-bottom, 0px));
		left: 50%;
		transform: translateX(-50%);
		z-index: 100;
	}

	.vpl-map-toggle {
		display: flex;
		align-items: center;
		gap: 8px;
		padding: 10px 20px;
		border: none;
		border-radius: 24px;
		background: var(--vpl-black, #222);
		color: var(--vpl-white, #fff);
		font-size: 14px;
		font-weight: 600;
		cursor: pointer;
		box-shadow: 0 2px 12px rgba(0,0,0,0.3);
	}

	.vpl-map-toggle svg {
		width: 16px;
		height: 16px;
	}

	/* When map is hidden on mobile */
	.vpl-map-hidden .vpl-map {
		display: none;
	}
}
