/**
 * Rael Property Manager - Property Search shortcode.
 * Modern full-width search bar with optional Type/State filters.
 * Desktop: text left, filters right, button. Mobile: text then filters then button.
 */

.rpm-search {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
}

.rpm-search__form {
	display: flex;
	align-items: stretch;
	flex-wrap: wrap;
	gap: 0;
	width: 100%;
	min-height: 56px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 9999px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rpm-search--has-filters .rpm-search__form {
	gap: 0;
}

.rpm-search__form:hover {
	border-color: #cbd5e1;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rpm-search__form:focus-within {
	border-color: #0f172a;
	box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
	outline: none;
}

.rpm-search__label.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.rpm-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 62px;
	padding: 0 20px 0 24px;
	border: 0;
	background: transparent;
	font-size: 1rem;
	color: #0f172a;
	letter-spacing: -0.01em;
}

/* Filter dropdowns (Type, State) - right of input on desktop */
.rpm-search__filters {
	display: flex;
	align-items: stretch;
	flex-shrink: 0;
	gap: 0;
	border-left: 1px solid #e2e8f0;
}

.rpm-search__select {
	height: 54px;
	padding: 0 14px 0 16px;
	margin: 4px 0;
	border: 0;
	background: transparent;
	font-size: 0.9375rem;
	color: #0f172a;
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 32px;
	min-width: 0;
}

.rpm-search__select:focus {
	outline: none;
}

.rpm-search__select:hover {
	background-color: rgba(0, 0, 0, 0.02);
}

.rpm-search__filters .rpm-search__select {
	border-left: 1px solid #e2e8f0;
}

.rpm-search__filters .rpm-search__select:first-child {
	border-left: 0;
}

.rpm-search__input::placeholder {
	color: #94a3b8;
}

.rpm-search__input:focus {
	outline: none;
}

.rpm-search__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex-shrink: 0;
	min-width: 56px;
	height: 54px;
	padding: 0 20px;
	margin: 4px;
	border: 0;
	border-radius: 9999px;
	background: #0f172a;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease;
}

.rpm-search__btn:hover {
	background: #1e293b;
}

.rpm-search__btn:active {
	transform: scale(0.98);
}

.rpm-search__btn:focus {
	outline: none;
	box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0f172a;
}

.rpm-search__btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.rpm-search__btn-icon svg {
	display: block;
}

.rpm-search__btn-text {
	font-size: 0.9375rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

/* Icon-only button (default): compact padding */
.rpm-search__btn:not(:has(.rpm-search__btn-text)) {
	padding: 0;
	min-width: 54px;
}

/* Mobile: stack input, then filters, then button for better responsiveness */
@media (max-width: 767px) {
	.rpm-search__form {
		flex-direction: column;
		flex-wrap: nowrap;
		border-radius: 12px;
		min-height: 0;
	}

	.rpm-search__input {
		width: 100%;
		height: 52px;
		border-bottom: 1px solid #e2e8f0;
		border-radius: 12px 12px 0 0;
	}

	.rpm-search__filters {
		width: 100%;
		border-left: 0;
		border-bottom: 1px solid #e2e8f0;
		display: flex;
		flex-wrap: wrap;
	}

	.rpm-search__filters .rpm-search__select {
		flex: 1 1 0;
		min-width: 120px;
		height: 48px;
		margin: 0;
		border-left: 0;
		border-bottom: 0;
		border-right: 1px solid #e2e8f0;
	}

	.rpm-search__filters .rpm-search__select:last-child {
		border-right: 0;
	}

	.rpm-search__btn {
		width: 100%;
		min-width: 0;
		height: 52px;
		margin: 0;
		border-radius: 0 0 12px 12px;
	}
}

/* Optional: subtle variant for light backgrounds */
.rpm-search.rpm-search--light .rpm-search__form {
	background: #f8fafc;
	border-color: #e2e8f0;
}

.rpm-search.rpm-search--light .rpm-search__form:focus-within {
	background: #fff;
}
