/* Ricerca — pannello desktop */
.g2-search {
	display: none;
	position: absolute;
	top: 182px;
	left: 0;
	right: 0;
	height: 278px;
	background-color: var(--g2-bg, #f2ebe0);
	border-top: 1px solid #786f69;
	z-index: 191;
	color: #423831;
	font-family: "Lato", sans-serif;
}

.g2-search.is-open {
	display: block;
}

.g2-search__inner {
	box-sizing: border-box;
	width: min(100% - 288px, 1152px);
	margin: 0 auto;
}

.g2-search__label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.g2-search__form {
	position: relative;
	display: flex;
	align-items: center;
	height: 52px;
	padding-top: 12px;
	box-sizing: border-box;
	border-bottom: 1px solid #786f69;
}

.g2-search__field {
	flex: 1 1 auto;
	width: 100%;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #423831;
	font: 400 18px/40px "Lato", sans-serif;
	-webkit-appearance: none;
	appearance: none;
}

.g2-search__field:focus {
	outline: none;
}

.g2-search__field::-webkit-search-cancel-button,
.g2-search__field::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.g2-search__field::placeholder {
	color: #786f69;
	opacity: 1;
}

.g2-search__close {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: #423831;
	cursor: pointer;
}

/* Stato vuoto */
.g2-search__suggestions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 12px;
	font: 400 18px/26px "Lato", sans-serif;
}

.g2-search__suggestions a {
	color: #423831;
	text-decoration: none;
}

.g2-search__suggestions a:hover,
.g2-search__suggestions a:focus {
	text-decoration: underline;
}

.g2-search__featured {
	display: flex;
	gap: 12px;
	margin-top: 12px;
}

.g2-search__featured a {
	display: block;
	width: 150px;
	height: 152px;
	overflow: hidden;
}

.g2-search__featured img {
	display: block;
	width: 150px;
	height: 152px;
	object-fit: cover;
}

/* Risultati */
.g2-search__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 24px;
	margin-top: 8px;
}

.g2-search__message {
	margin: 0;
	color: #6f665f;
	font: 400 14px/24px "Lato", sans-serif;
}

.g2-search__arrows {
	display: flex;
	gap: 4px;
}

.g2-search__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 24px;
	padding: 0;
	border: 0;
	background: none;
	color: #423831;
	cursor: pointer;
}

.g2-search__arrow[disabled] {
	opacity: 0.3;
	cursor: default;
}

.g2-search__swiper {
	width: 100%;
	margin-top: 4px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.g2-search__swiper::-webkit-scrollbar {
	display: none;
}

.g2-search__swiper .swiper-wrapper {
	display: flex;
	align-items: flex-start;
}

.g2-search__swiper .swiper-slide {
	flex: 0 0 150px;
	width: 150px;
	margin-right: 24px;
	scroll-snap-align: start;
}

.g2-search__swiper .swiper-slide:last-child {
	margin-right: 0;
}

.g2-search__pagination {
	display: none;
}

.g2-search__card {
	display: block;
	color: #423831;
	text-decoration: none;
}

.g2-search__card-media {
	display: block;
	width: 150px;
	height: 110px;
	overflow: hidden;
	background-color: #e6dbca;
}

.g2-search__card-media img {
	display: block;
	width: 150px;
	height: 110px;
	object-fit: cover;
}

.g2-search__card-title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin-top: 6px;
	font: 400 16px/22px "Lato", sans-serif;
}

.g2-search__card-type {
	display: block;
	margin-top: 2px;
	color: #6f665f;
	font: 400 12px/18px "Lato", sans-serif;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.g2-search__card:hover .g2-search__card-title,
.g2-search__card:focus .g2-search__card-title {
	text-decoration: underline;
}

/* Mobile — overlay pieno */
@media (max-width: 1023px) {
	.g2-search {
		position: fixed;
		inset: 0;
		height: 100vh;
		height: 100dvh;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		border-top: 0;
		z-index: 401;
	}

	.g2-search__inner {
		width: auto;
		margin: 0;
		padding: 8px 24px 32px;
	}

	.g2-search__form {
		height: 64px;
		padding-top: 8px;
	}

	.g2-search__field {
		font-size: 18px;
	}

	.g2-search__close {
		display: flex;
		flex: 0 0 44px;
	}

	.g2-search__suggestions {
		font-size: 16px;
		line-height: 24px;
		gap: 14px;
	}

	.g2-search__featured {
		gap: 12px;
	}

	.g2-search__featured a {
		width: calc((100% - 24px) / 3);
		height: auto;
		aspect-ratio: 150 / 152;
	}

	.g2-search__featured img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.g2-search__meta {
		margin-top: 14px;
	}

	.g2-search__arrows {
		display: none;
	}

	.g2-search__swiper {
		margin-top: 8px;
	}

	.g2-search__swiper .swiper-slide {
		flex: 0 0 100%;
		width: 100%;
		margin-right: 0;
	}

	.g2-search__card-media,
	.g2-search__card-media img {
		width: 100%;
		height: auto;
		aspect-ratio: 4 / 3;
	}

	.g2-search__pagination {
		display: flex;
		justify-content: center;
		gap: 6px;
		margin-top: 16px;
	}

	.g2-search__pagination .swiper-pagination-bullet {
		width: 6px;
		height: 6px;
		margin: 0 !important;
		background: #786f69;
		opacity: 0.4;
	}

	.g2-search__pagination .swiper-pagination-bullet-active {
		opacity: 1;
	}

	.g2-search__card-title {
		font-size: 18px;
		line-height: 24px;
	}

	body.g2-search-open {
		overflow: hidden;
	}
}
