/*
 * Metric Horizon - catalog search form (design layer, child theme)
 * Aligned 12-column grid, premium fields/pills/buttons on --mh-* tokens.
 * Scoped selectors override the theme's inline form styles.
 */

.mh-search-form .mh-search-form__grid {
	display: grid;
	grid-template-columns: repeat(12, 1fr);
	gap: 18px 20px;
	align-items: start;
	background: var(--mh-white, #fff);
	border: 1px solid var(--mh-border, #e1e5ee);
	border-radius: var(--mh-radius-l, 24px);
	box-shadow: 0 20px 50px rgba(10, 27, 77, 0.07);
	padding: 28px 30px;
}

/* Row 1: Название | Город | Район */
.mh-search-form .mh-search-form__field--keyword,
.mh-search-form .mh-search-form__field--city,
.mh-search-form .mh-search-form__field--district {
	grid-column: span 4;
}

/* Row 2: Тип | Комнатность | Цена (поля + ползунок) */
.mh-search-form .mh-search-form__field--type {
	grid-column: span 3;
}
.mh-search-form .mh-search-form__field--rooms {
	grid-column: span 5;
}
.mh-search-form .mh-search-form__field--price {
	grid-column: span 4;
}

/* Row 3: actions, right-aligned */
.mh-search-form .mh-search-form__actions {
	grid-column: 1 / -1;
	display: flex;
	gap: 12px;
	justify-content: flex-end;
}

/* Field label + control */
.mh-search-form .mh-search-form__field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.mh-search-form .mh-search-form__field > label {
	font-family: "Manrope", sans-serif;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--mh-text-muted, #5a6473);
	margin: 0;
}

.mh-search-form .mh-search-form__field input:not([type="range"]):not(.mh-price__input),
.mh-search-form .mh-search-form__field select {
	width: 100%;
	height: 50px;
	padding: 0 14px;
	border: 1px solid var(--mh-border, #e1e5ee);
	border-radius: var(--mh-radius-s, 12px);
	background: var(--mh-white, #fff);
	color: var(--mh-text, #1c1f26);
	font-size: 15px;
	line-height: 1.2;
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
	appearance: none;
}

/* Select caret */
.mh-search-form .mh-search-form__field select {
	padding-right: 40px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6473' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 18px;
	cursor: pointer;
}

.mh-search-form .mh-search-form__field input:not([type="range"]):not(.mh-price__input):focus,
.mh-search-form .mh-search-form__field select:focus {
	outline: none;
	border-color: var(--mh-primary, #0a1b4d);
	box-shadow: 0 0 0 3px rgba(10, 27, 77, 0.12);
}

.mh-search-form .mh-search-form__field input:not(.mh-price__input)::placeholder {
	color: #9aa3b2;
}

/* Rooms pills */
.mh-search-form .mh-room-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.mh-search-form .mh-room-pill {
	margin: 0;
	cursor: pointer;
}

.mh-search-form .mh-room-pill input {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.mh-search-form .mh-room-pill span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 50px;
	height: 50px;
	padding: 0 14px;
	border: 1px solid var(--mh-border, #e1e5ee);
	border-radius: var(--mh-radius-s, 12px);
	background: var(--mh-white, #fff);
	color: var(--mh-text, #1c1f26);
	font-size: 15px;
	font-weight: 600;
	transition: all 0.18s ease;
	user-select: none;
}

.mh-search-form .mh-room-pill:hover span {
	border-color: var(--mh-primary, #0a1b4d);
}

.mh-search-form .mh-room-pill input:checked + span {
	background: var(--mh-primary, #0a1b4d);
	border-color: var(--mh-primary, #0a1b4d);
	color: #fff;
}

.mh-search-form .mh-room-pill input:focus-visible + span {
	box-shadow: 0 0 0 3px rgba(10, 27, 77, 0.18);
}

/* Buttons */
.mh-search-form .mh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 50px;
	padding: 0 28px;
	border-radius: var(--mh-radius-s, 12px);
	font-family: "Manrope", sans-serif;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
	border: 1px solid transparent;
}

.mh-search-form .mh-btn--primary {
	background: var(--mh-primary, #0a1b4d);
	color: #fff;
}

.mh-search-form .mh-btn--primary:hover {
	background: var(--mh-primary-hover, #0d3b8e);
	transform: translateY(-1px);
}

.mh-search-form .mh-btn--ghost {
	background: transparent;
	color: var(--mh-primary, #0a1b4d);
	border-color: var(--mh-border, #e1e5ee);
}

.mh-search-form .mh-btn--ghost:hover {
	border-color: var(--mh-primary, #0a1b4d);
}

/* Responsive */
@media (max-width: 991px) {
	.mh-search-form .mh-search-form__field--keyword,
	.mh-search-form .mh-search-form__field--city,
	.mh-search-form .mh-search-form__field--district,
	.mh-search-form .mh-search-form__field--type,
	.mh-search-form .mh-search-form__field--price {
		grid-column: span 6;
	}
	.mh-search-form .mh-search-form__field--rooms {
		grid-column: span 12;
	}
}

@media (max-width: 575px) {
	.mh-search-form .mh-search-form__grid {
		padding: 22px 18px;
	}
	.mh-search-form .mh-search-form__grid > * {
		grid-column: 1 / -1 !important;
	}
	.mh-search-form .mh-search-form__actions {
		flex-direction: column;
	}
	.mh-search-form .mh-search-form__actions .mh-btn {
		width: 100%;
	}
}

/* Row alignment: every control starts on the same line, regardless of height. */
.mh-search-form .mh-search-form__field {
	height: 100%;
}

.mh-search-form .mh-search-form__field--price .mh-price {
	margin-top: auto;
}
