/* Terra Listing Filter — uses the Terra Elementor variables, with fallbacks. */
.terra-filter {
	--tf-ink: var(--e-global-color-terra-panel, #0B0F16);
	--tf-line: rgba(255, 255, 255, 0.09);
	--tf-text: #F1F1F1;
	--tf-soft: #C8D5DC;
	--tf-mute: #8FA3AE;
	--tf-amber: #FFC107;
	--tf-ember: #FF7043;
	--tf-cyan: #26C6DA;
	font-family: Poppins, sans-serif;
	color: var(--tf-text);
	background: linear-gradient(180deg, rgba(255, 193, 7, 0.08), rgba(255, 112, 67, 0.03)), var(--tf-ink);
	border: 1px solid rgba(255, 193, 7, 0.35);
	border-radius: 18px;
	padding: 1.25rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.terra-filter .tf-fields {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
	gap: 1rem;
	align-items: end;
}
.terra-filter .tf-buttons { grid-column: span 2; }
.terra-filter fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.terra-filter label,
.terra-filter legend {
	display: block;
	font-size: 0.68rem;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--tf-amber);
	margin-bottom: 0.4rem;
	padding: 0;
}
.terra-filter select,
.terra-filter input[type="number"],
.terra-filter input[type="search"] {
	width: 100%;
	box-sizing: border-box;
	font: 400 0.82rem "Space Mono", monospace;
	color: var(--tf-text);
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--tf-line);
	border-radius: 10px;
	padding: 0.6rem 0.7rem;
	min-height: 44px;
}
.terra-filter select option { color: #0B0F16; }
.terra-filter :is(select, input):focus-visible,
.terra-filter .tf-btn input:focus-visible + span,
.terra-filter .tf-check input:focus-visible + span {
	outline: 2px solid var(--tf-cyan);
	outline-offset: 2px;
}
.terra-filter .tf-range { display: flex; align-items: center; gap: 0.4rem; }
.terra-filter .tf-range span { color: var(--tf-mute); }
.terra-filter .tf-btns { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.terra-filter .tf-btn,
.terra-filter .tf-check {
	margin: 0;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}
.terra-filter .tf-btn input,
.terra-filter .tf-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.terra-filter .tf-btn span {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	font: 400 0.75rem "Space Mono", monospace;
	color: var(--tf-soft);
	padding: 0 0.8rem;
	border: 1px solid var(--tf-line);
	border-radius: 999px;
}
.terra-filter .tf-btn input:checked + span {
	color: var(--tf-cyan);
	border-color: rgba(38, 198, 218, 0.6);
	background: rgba(38, 198, 218, 0.08);
}
.terra-filter .tf-check span {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-height: 44px;
	font: 400 0.8rem Poppins, sans-serif;
	color: var(--tf-soft);
}
.terra-filter .tf-check span::before {
	content: "";
	width: 18px;
	height: 18px;
	border: 1px solid rgba(38, 198, 218, 0.6);
	border-radius: 5px;
}
.terra-filter .tf-check input:checked + span { color: var(--tf-cyan); }
.terra-filter .tf-check input:checked + span::before {
	background: var(--tf-cyan);
	box-shadow: inset 0 0 0 3px var(--tf-ink);
}
.terra-filter .tf-actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.terra-filter .tf-submit {
	font: 600 0.875rem Poppins, sans-serif;
	color: #0B0F16;
	background: var(--tf-amber);
	border: 0;
	border-radius: 10px;
	padding: 0.75rem 1.4rem;
	min-height: 44px;
	cursor: pointer;
	transition: background-color 0.2s;
}
.terra-filter .tf-reset { font-size: 0.8rem; color: var(--tf-mute); text-decoration: underline; }
.terra-filter .tf-count { margin-left: auto; font: 400 0.75rem "Space Mono", monospace; color: var(--tf-mute); }

@media (max-width: 767px) {
	.terra-filter { padding: 1rem; }
	.terra-filter .tf-fields { grid-template-columns: 1fr 1fr; }
	.terra-filter .tf-buttons,
	.terra-filter .tf-search,
	.terra-filter .tf-range { grid-column: 1 / -1; }
	.terra-filter .tf-count { margin-left: 0; width: 100%; }
}

/* ---------- Listing pages: hide empty dynamic chips ---------- */
.elementor .e-paragraph-base:empty { display: none; }

/* ---------- Gallery: Photos / Floor plans ---------- */
.terra-gallery { font-family: Poppins, sans-serif; color: #F1F1F1; display: flex; flex-direction: column; gap: 0.75rem; }
.terra-gallery .tg-radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.terra-gallery .tg-tabs { display: flex; gap: 0.4rem; }
.terra-gallery .tg-tab {
	display: inline-flex; align-items: center; gap: 0.45rem; min-height: 40px; padding: 0 0.95rem;
	font: 500 0.8rem Poppins, sans-serif; color: #C8D5DC; cursor: pointer;
	border: 1px solid rgba(255,255,255,0.09); border-radius: 999px; background: rgba(255,255,255,0.03);
}
.terra-gallery .tg-tab span { font: 400 0.7rem "Space Mono", monospace; color: #8FA3AE; }
.terra-gallery .tg-pane { display: none; }
.terra-gallery .tg-radio:nth-of-type(1):checked ~ .tg-pane-p,
.terra-gallery .tg-radio:nth-of-type(2):checked ~ .tg-pane-f { display: flex; flex-direction: column; gap: 0.6rem; }
.terra-gallery .tg-radio:nth-of-type(1):checked ~ .tg-tabs .tg-tab-p,
.terra-gallery .tg-radio:nth-of-type(2):checked ~ .tg-tabs .tg-tab-f { color: #0B0F16; background: #FFC107; border-color: #FFC107; }
.terra-gallery .tg-radio:nth-of-type(1):checked ~ .tg-tabs .tg-tab-p span,
.terra-gallery .tg-radio:nth-of-type(2):checked ~ .tg-tabs .tg-tab-f span { color: #0B0F16; }
.terra-gallery .tg-radio:focus-visible ~ .tg-tabs .tg-tab { outline: 2px solid #26C6DA; outline-offset: 2px; }
.terra-gallery .tg-main { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid rgba(255,255,255,0.09); background: #0B0F16; aspect-ratio: 16 / 8; max-height: 62vh; width: 100%; }
.terra-gallery .tg-main-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.terra-gallery .tg-main-img.tg-contain { object-fit: contain; background: #F4F2EE; }
.terra-gallery .tg-count { position: absolute; right: 12px; bottom: 12px; font: 700 0.7rem "Space Mono", monospace; color: #fff; background: rgba(0,0,0,0.6); padding: 4px 9px; border-radius: 7px; }
.terra-gallery .tg-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.5rem; }
.terra-gallery .tg-thumb { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer; background: none; aspect-ratio: 4 / 3; }
.terra-gallery .tg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.7; transition: opacity 0.2s; }
.terra-gallery .tg-thumb:hover img, .terra-gallery .tg-thumb.is-on img { opacity: 1; }
.terra-gallery .tg-thumb.is-on { border-color: #FFC107; }
.terra-gallery .tg-empty {
	aspect-ratio: 16 / 6; border-radius: 18px; display: flex; align-items: center; justify-content: center;
	border: 1px dashed rgba(38,198,218,0.45); background: rgba(38,198,218,0.05);
	font: 400 0.8rem "Space Mono", monospace; color: #8FA3AE;
}
@media (max-width: 767px) {
	.terra-gallery .tg-main { aspect-ratio: 4 / 3; border-radius: 12px; }
	.terra-gallery .tg-thumbs { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Maps ---------- */
.terra-map-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.terra-map { height: 340px; border-radius: 18px; overflow: hidden; border: 1px solid rgba(255,255,255,0.09); background: #0A1322; z-index: 0; }
.terra-map.is-single { height: 300px; }
.terra-map-note { margin: 0; font: 400 0.72rem "Space Mono", monospace; color: #8FA3AE; }
.terra-pin { background: none; border: 0; }
.terra-pin span {
	display: inline-block; transform: translate(-50%, -120%); white-space: nowrap;
	font: 700 11px "Space Mono", monospace; color: #0B0F16; background: #fff;
	padding: 5px 8px; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,0.45); position: relative;
}
.terra-pin span::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); border-radius: 2px; z-index: -1; }
.terra-pin.is-on span { background: #FFC107; }
.terra-map .leaflet-control-attribution { background: rgba(0,0,0,0.5); color: #8FA3AE; font-size: 10px; }
.terra-map .leaflet-control-attribution a { color: #C8D5DC; }
.terra-map .leaflet-popup-content a { color: #0B0F16; font: 600 13px Poppins, sans-serif; }
@media (max-width: 767px) { .terra-map { height: 260px; border-radius: 12px; } }
/* Dark map from standard OSM tiles (no API key). Swap for a keyed dark style in production. */
.terra-map .leaflet-tile-pane { filter: invert(100%) hue-rotate(180deg) brightness(0.9) contrast(0.85) saturate(0.6); }
.terra-cluster { background: none; border: 0; }
.terra-cluster span { display: inline-block; transform: translate(-50%, -50%); white-space: nowrap; font: 700 11px "Space Mono", monospace; color: #0B0F16; background: #FFC107; padding: 7px 11px; border-radius: 999px; box-shadow: 0 0 0 5px rgba(255,193,7,0.25), 0 6px 18px rgba(0,0,0,0.45); cursor: pointer; }
