/*
 * StayRent destination and guest picker controls.
 * Kept as a standalone plugin layer so theme layout styles stay independent.
 */

.srm-search [hidden] {
	display: none !important;
}

.srm-search-where:focus-within,
.srm-guests-field:has(.srm-guests-toggle[aria-expanded="true"]) {
	z-index: 70;
	border-radius: 12px;
	background: rgba(213, 33, 71, 0.035);
	box-shadow: inset 0 0 0 1px rgba(213, 33, 71, 0.1);
}

.srm-location-popover,
.srm-guests-popover {
	position: absolute;
	z-index: 80;
	top: calc(100% + 13px);
	overflow: hidden;
	border: 1px solid #e1e4e7;
	border-radius: 18px;
	background: #fff;
	box-shadow:
		0 24px 65px rgba(20, 24, 28, 0.16),
		0 4px 16px rgba(20, 24, 28, 0.06);
	color: #17191c;
}

.srm-location-popover {
	left: -9px;
	width: min(410px, calc(100vw - 32px));
	padding: 10px;
}

.srm-location-popover > header,
.srm-guests-popover-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0;
	padding: 10px 10px 12px;
	border-bottom: 1px solid #eceeef;
}

.srm-location-popover > header > div,
.srm-guests-popover-header > div {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.srm-location-popover > header strong,
.srm-guests-popover-header strong {
	color: #20252a;
	font-size: 13px;
	font-weight: 760;
	line-height: 1.3;
}

.srm-location-popover > header small,
.srm-guests-popover-header small {
	color: #737b83;
	font-size: 10px;
	font-weight: 520;
	line-height: 1.4;
}

.srm-location-popover > header > span,
.srm-guests-popover-header > span {
	display: grid;
	flex: 0 0 auto;
	min-width: 29px;
	height: 29px;
	padding: 0 7px;
	place-items: center;
	border-radius: 999px;
	background: rgba(213, 33, 71, 0.09);
	color: var(--srm-brand, #d52147);
	font-size: 10px;
	font-weight: 780;
}

.srm-location-options {
	display: grid;
	gap: 3px;
	max-height: 286px;
	margin-top: 6px;
	padding-right: 3px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-color: #cbd0d4 transparent;
	scrollbar-width: thin;
}

.srm-location-options > button {
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr) 20px;
	align-items: center;
	gap: 11px;
	width: 100%;
	min-height: 58px;
	margin: 0;
	padding: 8px 10px;
	border: 1px solid transparent;
	border-radius: 13px;
	background: transparent;
	color: #20252a;
	font-family: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.srm-location-options > button:hover,
.srm-location-options > button:focus-visible,
.srm-location-options > button[aria-selected="true"] {
	border-color: rgba(213, 33, 71, 0.13);
	outline: 0;
	background: linear-gradient(135deg, rgba(213, 33, 71, 0.075), rgba(213, 33, 71, 0.025));
}

.srm-location-options > button:hover {
	transform: translateX(2px);
}

.srm-location-option-icon {
	display: grid;
	width: 38px;
	height: 38px;
	place-items: center;
	border: 1px solid #e7e9eb;
	border-radius: 12px;
	background: #f7f8f8;
	color: var(--srm-brand, #d52147);
}

.srm-location-options > button[aria-selected="true"] .srm-location-option-icon {
	border-color: rgba(213, 33, 71, 0.18);
	background: #fff;
	box-shadow: 0 5px 14px rgba(213, 33, 71, 0.1);
}

.srm-location-option-icon svg {
	width: 17px;
	height: 17px;
}

.srm-location-options > button > span:nth-child(2) {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.srm-location-options > button strong,
.srm-location-options > button small {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.srm-location-options > button strong {
	color: #282e34;
	font-size: 12px;
	font-weight: 720;
}

.srm-location-options > button small {
	color: #7a828a;
	font-size: 9px;
	font-weight: 540;
}

.srm-location-options > button > i {
	display: inline-flex;
	color: #99a0a6;
	font-style: normal;
}

.srm-location-options > button > i svg {
	width: 14px;
	height: 14px;
}

.srm-location-empty {
	margin: 7px 0 0;
	padding: 13px;
	border-radius: 12px;
	background: #f7f8f8;
	color: #69727a;
	font-size: 10px;
	line-height: 1.5;
	text-align: center;
}

.srm-guests-popover {
	right: -18px;
	width: min(390px, calc(100vw - 32px));
	padding: 10px 14px 12px;
}

.srm-guests-popover-header {
	padding-right: 4px;
	padding-left: 4px;
}

.srm-counter-row {
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr) auto;
	align-items: center;
	gap: 11px;
	min-height: 68px;
	margin: 0;
	padding: 9px 4px;
	border-bottom: 1px solid #eceeef;
}

.srm-counter-type-mark {
	display: grid;
	width: 38px;
	height: 38px;
	place-items: center;
	border: 1px solid rgba(213, 33, 71, 0.12);
	border-radius: 12px;
	background: linear-gradient(145deg, rgba(213, 33, 71, 0.09), rgba(213, 33, 71, 0.035));
	color: var(--srm-brand, #d52147);
	font-size: 11px;
	font-weight: 800;
}

.srm-counter-copy {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.srm-counter-row .srm-counter-copy strong {
	color: #2a3036;
	font-size: 12px;
	font-weight: 730;
	line-height: 1.3;
}

.srm-counter-row .srm-counter-copy small {
	margin: 0;
	color: #788088;
	font-size: 9px;
	font-weight: 520;
	line-height: 1.4;
}

.srm-counter {
	display: grid;
	grid-template-columns: 42px 32px 42px;
	align-items: center;
	gap: 5px;
}

.srm-counter button {
	display: grid;
	width: 42px;
	height: 42px;
	min-width: 42px;
	min-height: 42px;
	margin: 0;
	padding: 0;
	place-items: center;
	border: 1px solid #d9dde0;
	border-radius: 12px;
	outline: 0;
	background: #fff;
	box-shadow: 0 2px 7px rgba(20, 24, 28, 0.035);
	color: var(--srm-brand, #d52147);
	font-size: 18px;
	font-weight: 620;
	line-height: 1;
	cursor: pointer;
	transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.srm-counter button:hover:not(:disabled),
.srm-counter button:focus-visible {
	border-color: rgba(213, 33, 71, 0.4);
	background: rgba(213, 33, 71, 0.055);
	box-shadow: 0 5px 14px rgba(213, 33, 71, 0.1);
	transform: translateY(-1px);
}

.srm-counter button:disabled {
	border-color: #eceeef;
	background: #f5f6f6;
	box-shadow: none;
	color: #858d94;
	cursor: not-allowed;
	opacity: 1;
}

.srm-search .srm-counter input {
	width: 32px;
	min-width: 32px;
	min-height: 42px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #252b31;
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	font-weight: 760;
	line-height: 42px;
	text-align: center;
	appearance: textfield;
	pointer-events: none;
}

.srm-search .srm-counter input::-webkit-inner-spin-button,
.srm-search .srm-counter input::-webkit-outer-spin-button {
	margin: 0;
	appearance: none;
}

.srm-guests-popover-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 4px 0;
}

.srm-guests-popover-footer > small {
	max-width: 190px;
	color: #7d858d;
	font-size: 8px;
	line-height: 1.4;
}

.srm-guests-popover .srm-guests-done {
	float: none;
	flex: 0 0 auto;
	min-height: 42px;
	margin: 0;
	padding: 9px 13px;
	border: 0;
	border-radius: 11px;
	background: #252a2f;
	box-shadow: none;
	color: #fff;
	font-size: 10px;
	font-weight: 720;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.srm-guests-popover .srm-guests-done:hover {
	background: #111417;
}

.srm-guests-summary {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@media (max-width: 820px) {
	.srm-location-popover {
		left: 0;
	}

	.srm-guests-popover {
		right: 0;
	}
}

@media (max-width: 600px) {
	.srm-search-where,
	.srm-guests-field {
		z-index: auto;
	}

	.srm-search-where:focus-within,
	.srm-guests-field:has(.srm-guests-toggle[aria-expanded="true"]) {
		z-index: 70;
	}

	.srm-location-popover,
	.srm-guests-popover {
		top: calc(100% + 8px);
		right: auto;
		left: -7px;
		width: calc(100% + 14px);
		max-width: none;
		border-radius: 16px;
	}

	.srm-location-options {
		max-height: 250px;
	}

	.srm-guests-popover {
		position: fixed;
		top: auto;
		right: 12px;
		bottom: 12px;
		left: 12px;
		width: auto;
		max-width: none;
		max-height: calc(100dvh - 92px);
		padding-right: 11px;
		padding-left: 11px;
		overflow-y: auto;
		border-radius: 18px;
	}

	.srm-counter-row {
		grid-template-columns: 34px minmax(0, 1fr) auto;
		gap: 9px;
	}

	.srm-counter-type-mark {
		width: 34px;
		height: 34px;
	}

	.srm-counter {
		grid-template-columns: 42px 28px 42px;
		gap: 4px;
	}

	.srm-search .srm-counter input {
		width: 28px;
		min-width: 28px;
	}

	.srm-guests-popover-footer > small {
		max-width: 160px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.srm-location-popover *,
	.srm-guests-popover * {
		transition-duration: 0.01ms !important;
	}
}
