/* Schilling Listings Filter — front-end styles.
   Replicates the prior Search & Filter Pro / Beaver Builder look. */

.slf-filter { width: 100%; }

/* ---------- Sidebar (fills the column it's placed in) ---------- */
.slf-sidebar {
	width: 100%;
	font-size: 14px;
}
.slf-sidebar-title {
	font-size: 26px;
	font-weight: 400;
	margin: 0 0 16px;
}
.slf-field { margin-bottom: 14px; }
.slf-search,
.slf-sort,
.slf-select {
	width: 100%;
	padding: 7px 9px;
	border: 1px solid #ccc;
	background: #fff;
	font-size: 14px;
	box-sizing: border-box;
}
.slf-group { margin: 18px 0; }
.slf-group-title {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 8px;
}
.slf-checklist {
	list-style: none;
	margin: 0;
	padding: 0;
}
.slf-checklist .slf-checklist { /* nested */
	margin-left: 18px;
}
.slf-checkitem { margin: 3px 0; }
.slf-checkitem label {
	display: inline-flex;
	align-items: baseline;
	gap: 6px;
	cursor: pointer;
	line-height: 1.3;
}
.slf-checkitem input { margin: 0; }
.slf-count { color: #888; font-size: 12px; }
.slf-hidden { display: none !important; }

/* Action buttons (Reset / View results). On desktop only Reset shows, with
   bottom breathing room so it never sits flush against the page footer/fold. */
.slf-actions {
	margin-top: 18px;
	padding-bottom: 28px;
}
.slf-reset {
	background: #fff;
	border: 1px solid #428bca;
	color: #428bca;
	padding: 8px 14px;
	cursor: pointer;
	font-size: 13px;
}
.slf-reset:hover { background: #428bca; color: #fff; }

/* ---------- Results ---------- */
.slf-results { flex: 1 1 0; min-width: 0; }
.slf-results-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
	min-height: 20px;
}
.slf-summary { color: #666; font-size: 14px; }

.slf-loading {
	display: none;
	width: 18px; height: 18px;
	border: 2px solid #ccc;
	border-top-color: #428bca;
	border-radius: 50%;
	animation: slf-spin .7s linear infinite;
}
.slf-container.is-loading .slf-loading { display: inline-block; }
.slf-container.is-loading .slf-results-grid { opacity: .45; transition: opacity .15s; }
@keyframes slf-spin { to { transform: rotate(360deg); } }

/* ---------- Grid + cards ---------- */
.slf-grid {
	display: grid;
	grid-template-columns: repeat(var(--slf-columns, 4), minmax(0, 1fr));
	gap: 20px;
}
.slf-card {
	background: #f4f4f4;
	padding: 10px;
	box-sizing: border-box;
}
.slf-card-image {
	display: block;
	margin: 0 0 10px;
}
.slf-card-image img,
.slf-card-thumb {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}
.slf-card-noimage {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #e2e2e2;
}
.slf-card-title {
	font-family: "Poppins", sans-serif;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.25;
	margin: 0 0 2px;
}
.slf-card-title a { color: #333; text-decoration: none; }
.slf-card-title a:hover { color: #000; }
.slf-card-status {
	display: inline-block;
	color: #428bca;
	font-size: 14px;
	text-decoration: none;
	margin-bottom: 8px;
}
.slf-card-status:hover { text-decoration: underline; }
.slf-card-body {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	font-size: 14px;
}
.slf-card-left { display: flex; flex-direction: column; }
.slf-card-type { color: #555; }
.slf-card-price { color: #a01231; font-weight: 700; }
.slf-card-specs { text-align: right; color: #555; }
.slf-card-specs .slf-spec { display: block; line-height: 1.4; }

.slf-no-results { padding: 40px 0; color: #666; font-size: 16px; }

/* ---------- Pagination ---------- */
.slf-pagination { margin-top: 26px; }
.slf-pagination ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0; margin: 0;
}
.slf-pagination a,
.slf-pagination span {
	display: inline-block;
	padding: 7px 12px;
	border: 1px solid #ddd;
	text-decoration: none;
	color: #333;
	font-size: 14px;
}
.slf-pagination .current {
	background: #428bca;
	border-color: #428bca;
	color: #fff;
}
.slf-pagination a:hover { background: #f0f0f0; }
.slf-pagination--loadmore { text-align: center; }
.slf-loadmore {
	padding: 10px 22px;
	border: 1px solid #428bca;
	background: #428bca;
	color: #fff;
	cursor: pointer;
	font-size: 14px;
}
.slf-loadmore:hover { background: #3279b6; }

/* ---------- Mobile filter menu (hidden on desktop) ---------- */
.slf-mobilebar,
.slf-filter-toggle,
.slf-overlay,
.slf-sidebar-close,
.slf-apply { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.slf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.slf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	/* Search bar + filter (funnel) button above the results */
	.slf-mobilebar {
		display: flex;
		gap: 8px;
		align-items: stretch;
		margin-bottom: 16px;
	}
	.slf-search-mobile {
		flex: 1 1 auto;
		min-width: 0;
		padding: 10px 12px;
		border: 1px solid #ccc;
		background: #fff;
		font-size: 15px;
	}
	.slf-filter-toggle {
		position: relative;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex: 0 0 auto;
		width: 48px;
		padding: 0;
		background: #428bca;
		color: #fff;
		border: 0;
		border-radius: 4px;
		cursor: pointer;
	}
	.slf-filter-toggle svg { width: 20px; height: 20px; }
	.slf-filter-toggle .slf-filter-count {
		position: absolute;
		top: -6px;
		right: -6px;
		min-width: 18px;
		height: 18px;
		line-height: 18px;
		padding: 0 4px;
		background: #a01231;
		color: #fff;
		font-size: 11px;
		font-weight: 700;
		text-align: center;
		border-radius: 10px;
	}
	.slf-filter-toggle .slf-filter-count:empty { display: none; }

	/* The drawer's own search is hidden on mobile; the top bar handles search. */
	.slf-field--search { display: none; }

	/* Sidebar becomes an off-canvas drawer */
	.slf-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: 86%;
		max-width: 340px;
		flex-basis: auto;
		background: #fff;
		z-index: 100000;
		padding: 20px 18px 0;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		transform: translateX(-100%);
		transition: transform .25s ease;
		box-shadow: 2px 0 16px rgba(0, 0, 0, .2);
	}
	body.slf-filters-open .slf-sidebar { transform: translateX(0); }

	/* Dimmed background overlay */
	.slf-overlay {
		display: block;
		position: fixed;
		top: 0; right: 0; bottom: 0; left: 0;
		background: rgba(0, 0, 0, .45);
		opacity: 0;
		visibility: hidden;
		transition: opacity .25s ease;
		z-index: 99999;
	}
	body.slf-filters-open .slf-overlay { opacity: 1; visibility: visible; }
	body.slf-noscroll { overflow: hidden; }

	/* Close (x) in the drawer header */
	.slf-sidebar-close {
		display: block;
		position: absolute;
		top: 12px;
		right: 14px;
		background: none;
		border: 0;
		font-size: 30px;
		line-height: 1;
		color: #666;
		cursor: pointer;
	}

	/* Sticky action bar (Reset + View results) pinned to the drawer bottom, so
	   both are always reachable no matter how long the filter list is. The
	   negative margins let it span the drawer's full width; the safe-area inset
	   keeps it clear of the iOS home indicator. */
	.slf-actions {
		position: sticky;
		bottom: 0;
		display: flex;
		gap: 10px;
		align-items: stretch;
		margin: 16px -18px 0;
		padding: 12px 18px calc(14px + env(safe-area-inset-bottom, 0px));
		background: #fff;
		border-top: 1px solid #e6e6e6;
	}
	.slf-actions .slf-reset {
		flex: 0 0 auto;
		margin-top: 0;
		padding: 13px 16px;
		font-size: 14px;
	}
	.slf-apply {
		display: block;
		flex: 1 1 auto;
		margin: 0;
		padding: 14px;
		background: #428bca;
		color: #fff;
		border: 0;
		font-size: 15px;
		cursor: pointer;
	}
}
@media (max-width: 540px) {
	.slf-grid { grid-template-columns: 1fr; }
}
