/* ==========================================================================
   Search Bar – Element Custom Bricks Builder
   Nomenclatura BEM: .search-bar__[element]--[modifier]
   ========================================================================== */

/* ── Root ─────────────────────────────────────────────────────────────────── */

.search-bar {
	width: 100%;
	max-width: 120rem;
}

.search-bar__form {
	width: 100%;
}

/* ── Wrapper (la "pillola" che contiene tutto) ────────────────────────────── */

.search-bar__wrapper {
	display: flex;
	align-items: stretch;
	width: 100%;
	background-color: #ffffff;
	border-radius: 99px;
	overflow: hidden;
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.search-bar__wrapper:focus-within {
	border-color: #8aaec8;
	box-shadow: 0 0 0 3px rgba(100, 160, 200, 0.15);
}

/* ── Input ────────────────────────────────────────────────────────────────── */

.search-bar__input-wrap {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	width: 100%;
}

.search-bar__input {
	width: 100%;
	border: none;
	outline: none;
	background: transparent;
	padding: 1.6rem 4rem 1.6rem 4rem;
	font-size: 1.6rem;
	line-height: 1;
	color: #1a2535;
	-webkit-appearance: none;
	appearance: none;
}

/* rimuove l'icona search nativa su webkit */
.search-bar__input::-webkit-search-decoration,
.search-bar__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.search-bar__input::placeholder {
	color: #8595a8;
}

/* ── Dropdown ─────────────────────────────────────────────────────────────── */

.search-bar__dropdown-wrap {
	position: relative;
	display: flex;
	align-items: center;
	flex-shrink: 0;
	border-left: 1.5px solid #c8d4e0;
	padding: 0 2rem 0;
	cursor: pointer;
	min-width: 220px;
}

.search-bar__select {
	width: 100%;
	border: none;
	outline: none;
	background: transparent;
	font-size: 16px;
	letter-spacing: 0.32px;
	line-height: 1;
	text-transform: uppercase;
	color: #6D6D6D;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	padding: 0;
	padding-right: 2rem;
}

.search-bar__select option {
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
}

/* Chevron */
.search-bar__dropdown-icon {
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	pointer-events: none;
	display: flex;
	align-items: center;
	color: #1a2535;
	transition: transform 0.2s ease;
}

.search-bar__dropdown-wrap:focus-within .search-bar__dropdown-icon {
	transform: translateY(-50%) rotate(180deg);
}

/* ── Button ───────────────────────────────────────────────────────────────── */

.search-bar__submit {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	padding: 1.6rem 2rem;
	border: none;
	border-top-right-radius: 99px;
	border-bottom-right-radius: 99px;
	background-color: #1a2535;
	color: #ffffff;
	font-size: 1.6rem;
	line-height: 1;
	font-weight: 700;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease, opacity 0.2s ease;
	white-space: nowrap;
	/* Il bordo-radius visivo del wrapper si sovrappone al btn */
}

.search-bar__submit:hover {
	background-color: #2e3f58;
}

.search-bar__submit:active {
	opacity: 0.85;
}

.search-bar__submit-icon {
	display: flex;
	align-items: center;
	line-height: 1;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
	.search-bar__wrapper {
		flex-direction: column;
		border-radius: 16px;
		overflow: visible;
		gap: 0;
	}

	.search-bar__input-wrap {
		border-bottom: 1.5px solid #c8d4e0;
	}

	.search-bar__input {
		padding: 14px 20px;
	}

	.search-bar__dropdown-wrap {
		border-left: none;
		border-bottom: 1.5px solid #c8d4e0;
		padding: 0 40px 0 20px;
		min-width: unset;
	}

	.search-bar__select {
		padding: 14px 0;
	}

	.search-bar__submit {
		margin: 8px;
		justify-content: center;
		border-radius: 12px;
	}
}
