/**
 * Search Results Page
 * Design: Figma node 2023-6970
 * Spaziature: search 70px top | titolo 50px sotto search | tab 40px sotto titolo | listing 80px sotto tab
 */

/* ========================================
   SEARCH BAR — 70px dal top della pagina
   ======================================== */

.s4w-search-page__search-bar {
	padding-top: 70px;
	padding-bottom: 0;
}

.s4w-search-page__search-bar .s4w-container {
	display: flex;
	justify-content: center;
}

.s4w-search-page__search-bar form {
	width: 649px;
	max-width: 100%;
}

.s4w-search-page__input-wrap {
	display: flex;
	align-items: center;
	gap: 4px;
	background-color: var(--bg-weak-100);
	border: 1px solid var(--stroke-soft-200);
	border-radius: 10000px;
	height: 40px;
	padding: 0 12px 0 7px;
	width: 100%;
	position: relative;
}

.s4w-search-page__icon {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	color: var(--text-soft-400);
	display: flex;
	align-items: center;
	justify-content: center;
}

.s4w-search-page__icon svg {
	width: 24px;
	height: 24px;
	display: block;
}

.s4w-search-page__input {
	flex: 1;
	background: none;
	border: none;
	outline: none;
	font-family: var(--font-secondary);
	font-size: var(--paragraph-medium);
	font-weight: var(--weight-regular);
	line-height: 24px;
	color: var(--text-main-900);
	padding: 0;
	min-width: 0;
}

.s4w-search-page__input::placeholder {
	color: var(--text-soft-400);
}

.s4w-search-page__input::-webkit-search-decoration,
.s4w-search-page__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.s4w-search-page__clear {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--text-soft-400);
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

.s4w-search-page__clear svg {
	width: 18px;
	height: 18px;
	display: block;
}

.s4w-search-page__input-wrap.has-value .s4w-search-page__clear {
	opacity: 1;
	pointer-events: auto;
}

@media (max-width: 768px) {
	.s4w-search-page__search-bar {
		padding-top: 32px;
	}

	.s4w-search-page__search-bar form {
		width: 100%;
	}
}

/* ========================================
   HEADING — 50px sotto la search bar, centrato
   ======================================== */

.s4w-search-page__heading {
	padding-top: 50px;
	text-align: center;
}

.s4w-search-page__title {
	font-family: var(--font-primary);
	font-size: 40px;
	font-weight: var(--weight-regular);
	text-transform: uppercase;
	letter-spacing: -0.8px;
	line-height: 1.1;
	color: var(--text-main-900);
	margin: 0;
}

.s4w-search-page__title em {
	font-style: normal;
}

@media (max-width: 768px) {
	.s4w-search-page__title {
		font-size: 28px;
	}

	.s4w-search-page__heading {
		padding-top: 32px;
	}
}

/* ========================================
   TAB — 40px sotto il titolo, centrati inline
   Tab attivo: bg-weak-100 + bordo strong-900 tutto intorno
   Tab inattivi: bordi soft-200 (collasso laterale)
   ======================================== */

.s4w-search-page__tabs {
	display: flex;
	justify-content: center;
	padding-top: 40px;
}

.s4w-search-page__tabs-inner {
	display: flex;
	align-items: stretch;
}

.s4w-search-page__tab {
	height: 75px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	font-family: var(--font-primary);
	font-size: var(--paragraph-small);
	font-weight: var(--weight-medium);
	text-transform: uppercase;
	letter-spacing: 0.42px;
	color: var(--text-main-900);
	text-decoration: none;
	white-space: nowrap;
	border: 1px solid var(--stroke-soft-200);
	margin-left: -1px;
	transition: background-color 0.2s ease;
}

.s4w-search-page__tab:first-child {
	margin-left: 0;
}

.s4w-search-page__tab:hover {
	background-color: var(--bg-weak-100);
}

.s4w-search-page__tab.is-active {
	background-color: var(--bg-weak-100);
	border-color: var(--stroke-strong-900);
	position: relative;
	z-index: 1;
}

@media (max-width: 768px) {
	.s4w-search-page__tabs {
		padding-top: 24px;
	}

	.s4w-search-page__tab {
		height: 56px;
		padding: 0 16px;
		font-size: 13px;
	}
}

/* ========================================
   RISULTATI — 80px sotto i tab
   ======================================== */

.s4w-search-page__results {
	padding-top: 80px;
	padding-bottom: 96px;
}

@media (max-width: 768px) {
	.s4w-search-page__results {
		padding-top: 40px;
	}
}

/* ========================================
   GRIGLIA: 3 colonne, bordi collapse, stessa altezza
   ======================================== */

.s4w-search-page__grid {
	display: flex;
	flex-wrap: wrap;
}

/* Tutte le card: 4 bordi — il JS (search.js) nasconde i duplicati */
.s4w-search-page__grid .s4w-product-card,
.s4w-search-page__grid .s4w-search-page__card--article,
.s4w-search-page__grid .s4w-search-page__card--page {
	flex: 0 0 33.333%;
	max-width: 33.333%;
	border: 1px solid var(--stroke-soft-200);
}

@media (max-width: 1024px) {
	.s4w-search-page__grid .s4w-product-card,
	.s4w-search-page__grid .s4w-search-page__card--article,
	.s4w-search-page__grid .s4w-search-page__card--page {
		flex: 0 0 50%;
		max-width: 50%;
	}
}

/* Desktop: price-row è trasparente, annate inline nascosta */
.s4w-search-page__grid .s4w-product-card .s4w-product-card__price-row {
	display: contents;
}

.s4w-search-page__grid .s4w-product-card .s4w-product-card__annate--inline {
	display: none;
}

@media (max-width: 768px) {
	/* 2 colonne */
	.s4w-search-page__grid .s4w-product-card,
	.s4w-search-page__grid .s4w-search-page__card--article,
	.s4w-search-page__grid .s4w-search-page__card--page {
		flex: 0 0 50%;
		max-width: 50%;
	}

	/* Card wrapper: 12px padding, gap 24px (immagine → body) */
	.s4w-search-page__grid .s4w-product-card {
		padding: 12px;
		gap: 24px;
	}

	/* Rimuovi padding da media-link e body (il padding è sulla card wrapper) */
	.s4w-search-page__grid .s4w-product-card .s4w-product-card__media-link {
		padding: 0;
	}

	.s4w-search-page__grid .s4w-product-card .s4w-product-card__body {
		padding: 0;
		gap: 16px;
	}

	/* Immagine: aspect-ratio 407/509 */
	.s4w-search-page__grid .s4w-product-card .s4w-product-card__media {
		width: 100%;
		aspect-ratio: 407 / 509;
		height: auto;
		margin-bottom: 0;
	}

	.s4w-search-page__grid .s4w-product-card .s4w-product-card__image {
		width: 100%;
		height: 100%;
		aspect-ratio: unset;
		object-fit: cover;
	}

	/* Bottoni formato: 40px, 12px, inattivo border grigio chiaro + no bg */
	.s4w-search-page__grid .s4w-product-card .s4w-product-card__formato-btn {
		font-size: var(--paragraph-xsmall);
		letter-spacing: 0.48px;
		line-height: 20px;
		padding: 4px 6px;
		width: auto;
		min-width: unset;
		white-space: nowrap;
		background: transparent;
		border: 1px solid #dddddb;
	}

	.s4w-search-page__grid .s4w-product-card .s4w-product-card__formato-btn:hover,
	.s4w-search-page__grid .s4w-product-card .s4w-product-card__formato-btn.is-active {
		background: var(--bg-white-0);
		border-color: rgba(0, 0, 0, 0.5);
	}

	/* Nome: 16px, tracking -0.32px, lh 1.4 */
	.s4w-search-page__grid .s4w-product-card .s4w-product-card__name {
		font-size: var(--paragraph-medium);
		letter-spacing: -0.32px;
		line-height: 1.4;
		margin: 0;
	}

	/* Denominazione: 12px, lh 1.6 */
	.s4w-search-page__grid .s4w-product-card .s4w-product-card__denominazione {
		font-size: var(--paragraph-xsmall);
		line-height: 1.6;
		margin: 0;
	}

	/* Descrizione: 12px, 2 righe */
	.s4w-search-page__grid .s4w-product-card .s4w-product-card__desc {
		font-size: var(--paragraph-xsmall);
		line-height: 1.6;
		height: auto;
		-webkit-line-clamp: 2;
		margin: 0;
	}

	/* Price row: flex row con gap 10px e padding-top 8px */
	.s4w-search-page__grid .s4w-product-card .s4w-product-card__price-row {
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 10px;
		padding-top: 8px;
	}

	/* Prezzo: flex 1, tutto Futura PT Medium 16px uppercase */
	.s4w-search-page__grid .s4w-product-card .s4w-product-card__price-row .s4w-product-card__price {
		flex: 1 0 0;
		padding-top: 0;
		display: flex;
		align-items: baseline;
		gap: 4px;
		margin: 0;
	}

	.s4w-search-page__grid .s4w-product-card .s4w-product-card__price-row .s4w-product-card__price-prefix,
	.s4w-search-page__grid .s4w-product-card .s4w-product-card__price-row .s4w-product-card__price-value {
		font-family: var(--font-primary);
		font-size: var(--paragraph-medium);
		font-weight: var(--weight-medium);
		text-transform: uppercase;
		letter-spacing: 0.64px;
		line-height: 20px;
		color: var(--text-main-900);
	}

	/* Nasconde annate dalla meta row su mobile */
	.s4w-search-page__grid .s4w-product-card .s4w-product-card__meta .s4w-product-card__annate {
		display: none;
	}

	/* Annate inline accanto al prezzo: 12px Merriweather, colore soft-400 */
	.s4w-search-page__grid .s4w-product-card .s4w-product-card__annate--inline {
		display: block;
		font-family: var(--font-secondary);
		font-size: var(--paragraph-xsmall);
		font-weight: var(--weight-regular);
		line-height: 1.6;
		color: var(--text-soft-400);
		flex-shrink: 0;
		white-space: nowrap;
	}
}

/* ========================================
   CARD ARTICOLO / PAGINA
   ======================================== */

.s4w-search-page__card--article {
	background-color: var(--bg-white-0);
}

.s4w-article-card__link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	height: 100%;
	gap: 20px;
	padding: 20px 20px 32px;
}

.s4w-article-card__link:hover,
.s4w-article-card__link:visited,
.s4w-article-card__link:focus {
	text-decoration: none;
	color: inherit;
}

/* Immagine: aspect-ratio 4:5, cover */
.s4w-article-card__image {
	width: 100%;
	overflow: hidden;
	aspect-ratio: 4 / 5;
	flex-shrink: 0;
	background-color: var(--bg-weak-100);
}

.s4w-article-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

/* Placeholder: nessuna immagine in evidenza */
.s4w-article-card__image--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
}

.s4w-article-card__link:hover .s4w-article-card__image img {
	transform: scale(1.03);
}

/* Body: meta + content */
.s4w-article-card__body {
	display: flex;
	flex-direction: column;
	gap: 20px;
	width: 100%;
}

/* Meta: categoria + data, space-between */
.s4w-article-card__meta {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	width: 100%;
	font-family: var(--font-primary);
	font-size: var(--paragraph-small);
	font-weight: var(--weight-medium);
	line-height: 20px;
	letter-spacing: 0.56px;
	text-transform: uppercase;
	color: var(--text-sub-500);
}

/* Content: titolo + excerpt */
.s4w-article-card__content {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
}

.s4w-article-card__title {
	font-family: var(--font-secondary);
	font-size: 20px;
	font-weight: var(--weight-regular);
	line-height: 1.6;
	color: var(--text-main-900);
	margin: 0;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.s4w-article-card__link:hover .s4w-article-card__title {
	text-decoration: underline;
}

.s4w-article-card__excerpt {
	font-family: var(--font-secondary);
	font-size: var(--paragraph-medium);
	font-weight: var(--weight-regular);
	line-height: 1.6;
	color: var(--text-sub-500);
	margin: 0;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

@media (max-width: 768px) {
	.s4w-article-card__link {
		padding: 12px 12px 20px;
		gap: 12px;
	}

	.s4w-article-card__body {
		gap: 12px;
	}

	.s4w-article-card__meta {
		font-size: 10px;
		letter-spacing: 0.4px;
		line-height: 1.4;
		gap: 4px;
		flex-wrap: wrap;
	}

	.s4w-article-card__title {
		font-size: var(--paragraph-small);
		line-height: 1.4;
	}

	.s4w-article-card__excerpt {
		font-size: var(--paragraph-xsmall);
		-webkit-line-clamp: 2;
	}
}

/* ========================================
   NESSUN RISULTATO
   ======================================== */

.s4w-search-page__no-results {
	padding: 64px 0;
	text-align: center;
}

/* ========================================
   PAGINAZIONE
   ======================================== */

.s4w-search-page__pagination {
	display: flex;
	justify-content: center;
	margin-top: 64px;
	flex-wrap: wrap;
}

.s4w-search-page__pagination .page-numbers {
	font-family: var(--font-primary);
	font-size: var(--paragraph-small);
	font-weight: var(--weight-regular);
	text-transform: uppercase;
	letter-spacing: 0.56px;
	color: var(--text-main-900);
	text-decoration: none;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--stroke-soft-200);
	margin-left: -1px;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
	flex-shrink: 0;
}

.s4w-search-page__pagination .page-numbers:first-child {
	margin-left: 0;
}

/* dots */
.s4w-search-page__pagination .page-numbers.dots {
	border-color: transparent;
	pointer-events: none;
}

.s4w-search-page__pagination .page-numbers:hover,
.s4w-search-page__pagination .page-numbers.current {
	background-color: var(--bg-strong-900);
	color: var(--text-white-0);
	border-color: var(--bg-strong-900);
	position: relative;
	z-index: 1;
}
