/**
 * MH Stay search (Figma Apartments "Dates, guests and accommodation").
 * Three 70px boxes and the button in equal columns between two rules, 24px section padding.
 */

.mh-stay {
	padding-top: var(--mh-pad-t, 24px);
	padding-bottom: var(--mh-pad-b, 24px);
}

.mh-stay__form {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin: 0;
	padding: 16px 0;
	border-top: 1px solid var(--mh-line);
	border-bottom: 1px solid var(--mh-line);
}

.mh-stay .mh-stay__box {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: center;
	gap: 4px;
	min-width: 0;
	min-height: 70px;
	padding: 12px 13px;
	border: 1px solid var(--mh-c-line);
	border-radius: 0;
	background: var(--mh-c-white);
	color: var(--mh-c-ink);
	cursor: pointer;
}

.mh-stay .mh-stay__box:focus-within {
	border-color: var(--mh-c-ink);
	outline: 2px solid var(--mh-c-blue);
	outline-offset: 2px;
}

.mh-stay .mh-stay__box:hover {
	border-color: var(--mh-c-ink);
}

.mh-stay__label {
	color: var(--mh-c-muted);
	cursor: pointer;
}

/* Chosen value with the arrow right after it (shown once JS keeps it in sync). */
.mh-stay .mh-stay__value {
	display: none;
	align-items: center;
	gap: 8px;
	min-width: 0;
	color: var(--mh-c-ink);
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
	white-space: nowrap;
}

.mh-js .mh-stay .mh-stay__value {
	display: flex;
}

.mh-stay__value > span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mh-stay__arrow {
	flex: none;
}

/* Without JS the native controls show; with JS they sit invisibly over the box. */
.mh-stay__box select,
.mh-stay .mh-stay__box input[type="date"] {
	width: 100%;
	height: 24px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--mh-c-ink);
	font-family: var(--mh-sans);
	font-size: 16px;
	line-height: 24px;
	font-weight: 600;
}

.mh-js .mh-stay__box select,
.mh-js .mh-stay .mh-stay__box input[type="date"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
}

.mh-stay .mh-stay__submit {
	width: 100%;
	min-height: 70px;
}

@media (max-width: 767px) {
	.mh-stay__form {
		grid-template-columns: minmax(0, 1fr);
	}

	.mh-stay .mh-stay__submit {
		min-height: 48px;
	}
}
