/**
 * Property Filter Widget Styles
 * WP Property Listing Plugin
 */

/* -----------------------------------------------------------------------
   Filter bar wrapper
   -------------------------------------------------------------------- */
.wppl-filter {
	background-color: #ffffff;
	border-radius: 12px;
	border: 1px solid #e5e7eb;
	padding: 20px 24px;
	margin-bottom: 24px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.wppl-filter__form {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

/* -----------------------------------------------------------------------
   Search input
   -------------------------------------------------------------------- */
.wppl-filter__search-wrap {
	position: relative;
	flex: 2 1 240px;
	min-width: 200px;
}

.wppl-filter__search-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	color: #9ca3af;
	font-size: 16px;
	pointer-events: none;
	width: 16px;
	height: 16px;
}

.wppl-filter__input {
	width: 100%;
	height: 44px;
	padding: 0 14px 0 42px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 14px;
	color: #111827;
	background-color: #f9fafb;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
	outline: none;
}

.wppl-filter__input::placeholder {
	color: #9ca3af;
}

.wppl-filter__input:focus {
	border-color: #0da8b5;
	background-color: #fff;
	box-shadow: 0 0 0 3px rgba(13, 168, 181, 0.12);
}

/* -----------------------------------------------------------------------
   Select / Dropdown
   -------------------------------------------------------------------- */
.wppl-filter__select-wrap {
	flex: 1 1 160px;
	min-width: 140px;
	position: relative;
}

.wppl-filter__select {
	width: 100%;
	height: 44px;
	padding: 0 36px 0 14px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-size: 14px;
	color: #111827;
	background-color: #f9fafb;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
	outline: none;
}

.wppl-filter__select:focus {
	border-color: #0da8b5;
	background-color: #fff;
	box-shadow: 0 0 0 3px rgba(13, 168, 181, 0.12);
}

.wppl-filter__select-wrap::after {
	content: '';
	position: absolute;
	right: 13px;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 5px solid #6b7280;
	pointer-events: none;
}

/* -----------------------------------------------------------------------
   Amenities (checkbox group)
   -------------------------------------------------------------------- */
.wppl-filter__amenities-wrap {
	flex: 1 1 100%;
}

.wppl-filter__amenities-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #6b7280;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: 8px;
}

.wppl-filter__amenities-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wppl-filter__amenity-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #374151;
	cursor: pointer;
	padding: 6px 12px;
	border: 1px solid #e5e7eb;
	border-radius: 100px;
	background: #f9fafb;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
	user-select: none;
}

.wppl-filter__amenity-item input[type="checkbox"] {
	display: none;
}

.wppl-filter__amenity-item:hover {
	border-color: #0da8b5;
	color: #0da8b5;
}

.wppl-filter__amenity-item:has(input:checked) {
	background-color: #0da8b5;
	border-color: #0da8b5;
	color: #fff;
}

/* Fallback for browsers without :has() */
.wppl-filter__amenity-item.is-checked {
	background-color: #0da8b5;
	border-color: #0da8b5;
	color: #fff;
}

/* -----------------------------------------------------------------------
   Featured checkbox
   -------------------------------------------------------------------- */
.wppl-filter__featured-wrap {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
}

.wppl-filter__featured-check {
	width: 18px;
	height: 18px;
	accent-color: #0da8b5;
	cursor: pointer;
}

.wppl-filter__featured-label {
	font-size: 14px;
	color: #374151;
	cursor: pointer;
	white-space: nowrap;
}

/* -----------------------------------------------------------------------
   Reset button
   -------------------------------------------------------------------- */
.wppl-filter__reset {
	flex: 0 0 auto;
	height: 44px;
	padding: 0 16px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: transparent;
	color: #6b7280;
	font-size: 13px;
	cursor: pointer;
	transition: background-color 0.15s, color 0.15s;
}

.wppl-filter__reset:hover {
	background-color: #f3f4f6;
	color: #111827;
}

/* -----------------------------------------------------------------------
   Result count
   -------------------------------------------------------------------- */
.wppl-filter__footer {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #f3f4f6;
}

.wppl-filter__count {
	font-size: 13px;
	color: #6b7280;
}

/* -----------------------------------------------------------------------
   Listing wrapper loading state
   -------------------------------------------------------------------- */
.wppl-listing__inner {
	transition: opacity 0.2s ease;
}

.wppl-listing--loading .wppl-listing__inner {
	opacity: 0.45;
	pointer-events: none;
}

.wppl-listing--loading::after {
	content: '';
	display: block;
	width: 32px;
	height: 32px;
	margin: 32px auto;
	border: 3px solid #e5e7eb;
	border-top-color: #0da8b5;
	border-radius: 50%;
	animation: wppl-spin 0.65s linear infinite;
}

@keyframes wppl-spin {
	to { transform: rotate(360deg); }
}

/* -----------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------- */
.wppl-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin-top: 32px;
}

.wppl-pagination__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	color: #374151;
	font-size: 14px;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.wppl-pagination__btn:hover {
	border-color: #0da8b5;
	color: #0da8b5;
}

.wppl-pagination__btn.is-active {
	background-color: #0da8b5;
	border-color: #0da8b5;
	color: #fff;
}

/* -----------------------------------------------------------------------
   Property type badge on card image
   -------------------------------------------------------------------- */
.wppl-card__type-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	background: rgba(255, 255, 255, 0.92);
	color: #111827;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	padding: 4px 10px;
	border-radius: 100px;
	backdrop-filter: blur(4px);
	line-height: 1.4;
}

/* -----------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------- */
@media (max-width: 768px) {
	.wppl-filter {
		padding: 16px;
	}

	.wppl-filter__search-wrap {
		flex: 1 1 100%;
	}

	.wppl-filter__select-wrap {
		flex: 1 1 calc(50% - 6px);
	}
}

@media (max-width: 480px) {
	.wppl-filter__select-wrap {
		flex: 1 1 100%;
	}

	.wppl-filter__reset {
		width: 100%;
		justify-content: center;
	}
}
