/*
 * "Dove vuoi andare?" search widget — see inc/search-widget.php.
 * Figma "Daplace Website 26": Widget - Città / Widget - date / Widget - ospiti (393px frames).
 * Every rule starts from #dp-search: Astra and the Elementor kit style all buttons and
 * inputs site-wide, and an ID keeps those rules out without !important.
 */

html.dp-s-open {
	overflow: hidden;
}

#dp-search {
	--dp-s-navy: #21394D;
	--dp-s-beige: #EAE6DD;
	--dp-s-lilac: #D9C5D4;
	--dp-s-range: #C8C8C8;
	--dp-s-muted: #A9A9A9;

	position: fixed;
	inset: 0;
	z-index: 100000;
	font-family: 'FuturaStd', 'Futura Std', sans-serif;
	color: var(--dp-s-navy);
	-webkit-font-smoothing: antialiased;
}

#dp-search[hidden] {
	display: none;
}

#dp-search *,
#dp-search *::before,
#dp-search *::after {
	box-sizing: border-box;
}

#dp-search button,
#dp-search input {
	all: unset;
	box-sizing: border-box;
	font: inherit;
	color: inherit;
}

#dp-search button {
	cursor: pointer;
}

#dp-search button:focus-visible,
#dp-search .dp-s__pill:focus-within {
	outline: 2px solid var(--dp-s-navy);
	outline-offset: 2px;
}

#dp-search input:focus-visible {
	outline: 0;
}

#dp-search button[disabled] {
	cursor: default;
}

/* !important: component rules like .dp-s__icon-btn { display: flex } share this specificity. */
#dp-search [hidden] {
	display: none !important;
}

#dp-search svg {
	display: block;
	width: 24px;
	height: 24px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

/* Layout: full screen on phones, a centred window from tablet up. */

#dp-search .dp-s__backdrop {
	position: absolute;
	inset: 0;
	background: var(--dp-s-beige);
}

#dp-search .dp-s__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 20px 25px 24px;
	background: var(--dp-s-beige);
}

@media (min-width: 768px) {
	#dp-search .dp-s__backdrop {
		background: rgba(33, 57, 77, 0.6);
	}

	#dp-search .dp-s__panel {
		width: 460px;
		height: auto;
		max-height: calc(100% - 64px);
		margin: 32px auto;
		padding: 28px 28px 32px;
		border-radius: 24px;
		box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
	}
}

/* Head: title as in the Figma section heading, back + close. */

#dp-search .dp-s__head {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 24px;
}

#dp-search .dp-s__title {
	flex: 1;
	margin: 0;
	padding-top: 4px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.15;
	text-transform: uppercase;
}

#dp-search .dp-s__icon-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	flex: 0 0 36px;
	border-radius: 50%;
}

#dp-search .dp-s__back {
	margin-left: -8px;
}

/* Card: the pill sits on top, the white body starts behind its lower half. */

#dp-search .dp-s__card {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
}

#dp-search .dp-s__pill {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 0 0 auto;
	height: 56px;
	padding: 0 22px;
	border: 2px solid var(--dp-s-navy);
	border-radius: 999px;
	background: #fff;
	font-size: 19px;
}

#dp-search .dp-s__pill-icon {
	flex: 0 0 26px;
	width: 26px;
	height: 26px;
	stroke-width: 2.4;
}

#dp-search .dp-s__input {
	flex: 1;
	min-width: 0;
	height: 100%;
}

#dp-search .dp-s__input::placeholder {
	color: var(--dp-s-navy);
	opacity: 1;
}

#dp-search .dp-s__pill-dates,
#dp-search .dp-s__pill-label {
	display: none;
	flex: 1;
	align-items: center;
	gap: 14px;
	height: 100%;
}

#dp-search .dp-s__in,
#dp-search .dp-s__out {
	white-space: nowrap;
}

#dp-search .dp-s__in.is-set,
#dp-search .dp-s__out.is-set {
	font-weight: 700;
}

#dp-search:not([data-step="city"]) .dp-s__input {
	display: none;
}

#dp-search[data-step="dates"] .dp-s__pill-dates,
#dp-search[data-step="type"] .dp-s__pill-label,
#dp-search[data-step="guests"] .dp-s__pill-label {
	display: flex;
}

#dp-search .dp-s__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
	margin-top: -28px;
	padding-top: 28px;
	border-radius: 0 0 20px 20px;
	background: #fff;
}

#dp-search .dp-s__step {
	display: none;
	flex: 1;
	flex-direction: column;
	min-height: 0;
}

#dp-search[data-step="city"] .dp-s__step[data-step="city"],
#dp-search[data-step="type"] .dp-s__step[data-step="type"],
#dp-search[data-step="dates"] .dp-s__step[data-step="dates"],
#dp-search[data-step="guests"] .dp-s__step[data-step="guests"] {
	display: flex;
}

/* City and type lists */

#dp-search .dp-s__list {
	flex: 1;
	min-height: 0;
	margin: 0;
	padding: 4px 19px 12px;
	overflow-y: auto;
	list-style: none;
}

#dp-search .dp-s__list li {
	margin: 0;
	border-bottom: 1px solid var(--dp-s-navy);
}

#dp-search .dp-s__list li:nth-last-child(2),
#dp-search .dp-s__list li:last-child {
	border-bottom: 0;
}

#dp-search .dp-s__option {
	display: block;
	width: 100%;
	padding: 15px 12px 14px;
	font-size: 23px;
	line-height: 1.3;
}

#dp-search .dp-s__option[aria-pressed="true"] {
	font-weight: 700;
}

#dp-search .dp-s__option--all {
	margin-top: 8px;
	font-size: 17px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

#dp-search .dp-s__empty {
	margin: 0;
	padding: 16px 31px;
	font-size: 17px;
}

/* Calendar */

#dp-search .dp-s__weekdays,
#dp-search .dp-s__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	text-align: center;
}

#dp-search .dp-s__weekdays {
	margin-top: 12px;
	padding: 10px 24px;
	border-top: 2px solid var(--dp-s-navy);
	border-bottom: 2px solid var(--dp-s-navy);
	font-size: 15px;
	font-weight: 700;
}

#dp-search .dp-s__months {
	flex: 1;
	min-height: 0;
	padding: 0 24px 16px;
	overflow-y: auto;
}

@media (min-width: 768px) {
	#dp-search .dp-s__months {
		max-height: 380px;
	}
}

#dp-search .dp-s__month-title {
	margin: 0;
	padding: 18px 6px 8px;
	font-size: 19px;
	font-weight: 700;
}

#dp-search .dp-s__grid span,
#dp-search .dp-s__day {
	height: 46px;
}

#dp-search .dp-s__day {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

#dp-search .dp-s__day[disabled] {
	color: var(--dp-s-muted);
}

#dp-search .dp-s__day.is-in {
	background: var(--dp-s-range);
}

#dp-search .dp-s__day.is-edge {
	background: var(--dp-s-navy);
	color: #fff;
}

#dp-search .dp-s__day:not([disabled]):not(.is-edge):hover {
	background: var(--dp-s-beige);
}

/* Guests: a short card, so the bar sits right under the stepper. */

#dp-search[data-step="guests"] .dp-s__body {
	flex: 0 0 auto;
}

#dp-search .dp-s__stepper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 20px;
	font-size: 26px;
}

#dp-search .dp-s__step-btn {
	width: 48px;
	height: 48px;
	font-size: 32px;
	line-height: 48px;
	text-align: center;
}

#dp-search .dp-s__step-btn[disabled] {
	color: var(--dp-s-muted);
}

/* Bottom bar: nights and who on top, the CTA on its own row (as in the Figma) */

#dp-search .dp-s__bar {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: auto;
	padding: 14px 22px 20px;
	border-top: 2px solid var(--dp-s-navy);
}

#dp-search .dp-s__sum {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	padding-left: 34px;
}

#dp-search .dp-s__sum-dates {
	font-size: 18px;
	font-weight: 700;
}

#dp-search .dp-s__sum-who {
	font-size: 16px;
}

#dp-search .dp-s__sum button:hover {
	text-decoration: underline;
}

#dp-search .dp-s__cta {
	align-self: flex-end;
	padding: 10px 22px;
	border-radius: 999px;
	background: var(--dp-s-navy);
	color: var(--dp-s-lilac);
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
}

#dp-search .dp-s__cta:hover {
	color: #fff;
}
