/* ==========================================================================
   SHOP LISTING PAGE
   Pagina archivio prodotti WooCommerce — allineata al pattern news listing
   ========================================================================== */

/* --------------------------------------------------------------------------
   BREADCRUMBS
   -------------------------------------------------------------------------- */

.s4w-shop-listing-page .s4w-breadcrumbs {
	border-top: 1px solid var(--stroke-soft-200);
	border-bottom: 1px solid var(--stroke-soft-200);
}

.s4w-shop-listing-page .s4w-breadcrumbs__container {
	display: flex;
	align-items: stretch;
}

.s4w-shop-listing-page .s4w-breadcrumbs__item {
	display: flex;
	align-items: center;
	border-left: 1px solid var(--stroke-soft-200);
	border-right: 1px solid var(--stroke-soft-200);
	margin-right: -1px;
	padding: 10px;
}

.s4w-shop-listing-page .s4w-breadcrumbs__separator {
	display: none;
}

.s4w-shop-listing-page .s4w-breadcrumbs__link,
.s4w-shop-listing-page .s4w-breadcrumbs__current {
	font-size: var(--paragraph-xsmall);
	line-height: 16px;
	font-family: var(--font-secondary);
	white-space: nowrap;
	text-decoration: none;
	color: var(--text-soft-400);
}

.s4w-shop-listing-page .s4w-breadcrumbs__current {
	color: var(--text-main-900);
}

/* --------------------------------------------------------------------------
   HEADER PRIMARIO
   -------------------------------------------------------------------------- */

.s4w-shop-header-primary {
	background-color: var(--bg-white-0);
	padding-top: 112px;
	padding-bottom: 96px;
}

.s4w-shop-header-primary__inner {
	display: flex;
	flex-direction: column;
	gap: 48px;
}

.s4w-shop-header-primary__text-block {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.s4w-shop-header-primary__title-row {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 8px;
}

.s4w-shop-header-primary__title {
	font-size: 96px;
	line-height: 0.9;
	letter-spacing: -0.04em;
	text-transform: uppercase;
	font-family: var(--font-primary);
	font-weight: var(--weight-regular);
	color: var(--text-main-900);
	margin: 0;
}

.s4w-shop-header-primary__count {
	font-family: var(--font-primary);
	font-size: var(--label-large);
	line-height: 1;
	letter-spacing: -0.03em;
	text-transform: uppercase;
	color: var(--text-main-900);
	white-space: nowrap;
}

.s4w-shop-header-primary__desc {
	color: var(--text-soft-400);
	margin: 0;
}

/* Navigazione categorie tab */
.s4w-shop-header-primary__nav {
	display: flex;
	align-items: stretch;
	flex-wrap: wrap;
}

.s4w-shop-nav-item {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 75px;
	padding: 12px 24px;
	border: 1px solid var(--stroke-soft-200);
	margin-left: -1px;
	font-family: var(--font-primary);
	font-size: var(--paragraph-small);
	font-weight: var(--weight-medium);
	letter-spacing: 0.03em;
	text-transform: uppercase;
	color: var(--text-main-900);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.s4w-shop-nav-item:first-child {
	margin-left: 0;
}

.s4w-shop-nav-item.is-active {
	background-color: var(--bg-weak-100);
	border-color: var(--stroke-strong-900);
	z-index: 1;
}

.s4w-shop-nav-item:hover:not(.is-active) {
	border-color: var(--stroke-sub-300);
	z-index: 1;
}

/* --------------------------------------------------------------------------
   BODY LISTING
   -------------------------------------------------------------------------- */

.s4w-shop-listing {
	padding-bottom: 96px;
}

/* Wrapper flex sidebar + content */
.s4w-shop-listing__wrapper {
	display: flex;
	gap: 0;
	align-items: flex-start;
}

.s4w-shop-listing__content {
	flex: 1;
	min-width: 0;
}

/* --------------------------------------------------------------------------
   TOOLBAR
   -------------------------------------------------------------------------- */

.s4w-shop-toolbar {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	margin-bottom: 16px;
	gap: 6px;
}

/* Bottone toggle filtri */
.s4w-shop-toolbar__toggle-filters {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 12px 16px;
	background: transparent;
	border: 1px solid var(--stroke-sub-300);
	cursor: pointer;
	transition: all 0.2s ease;
	font-family: var(--font-primary);
	font-size: var(--paragraph-small);
	font-weight: var(--weight-book);
	line-height: 20px;
	letter-spacing: 0.56px;
	text-transform: uppercase;
	color: var(--text-main-900);
}

.s4w-shop-toolbar__toggle-filters:hover,
.s4w-shop-toolbar__toggle-filters.is-active {
	background: var(--bg-weak-100);
	border-color: var(--stroke-sub-300);
}

.s4w-shop-toolbar__toggle-filters svg {
	width: 16px;
	height: 16px;
	color: var(--text-main-900);
	flex-shrink: 0;
}

.s4w-shop-toolbar__filter-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	margin-left: 4px;
	font-family: var(--font-primary);
	font-size: 11px;
	font-weight: var(--weight-medium);
	line-height: 1;
	color: var(--text-white-0);
	background: var(--color-orange);
	flex-shrink: 0;
}

/* Sort dropdown wrapper */
.s4w-shop-toolbar__sort-wrapper {
	position: relative;
}

/* Sort toggle button */
.s4w-shop-toolbar__sort {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 12px 16px;
	color: var(--text-main-900);
	background: transparent;
	border: 1px solid var(--stroke-soft-200);
	cursor: pointer;
	transition: all 0.2s ease;
	text-decoration: none;
	white-space: nowrap;
}

.s4w-shop-toolbar__sort:hover,
.s4w-shop-toolbar__sort[aria-expanded="true"] {
	background: var(--bg-soft-200);
	border-color: var(--stroke-strong-900);
}

.s4w-shop-toolbar__sort-icon {
	width: 16px;
	height: 16px;
	color: var(--text-main-900);
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.s4w-shop-toolbar__sort[aria-expanded="true"] .s4w-shop-toolbar__sort-icon {
	transform: rotate(180deg);
}

/* Sort dropdown menu */
.s4w-shop-toolbar__sort-dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 2px);
	right: 0;
	min-width: 100%;
	background: var(--bg-white-0);
	border: 1px solid var(--stroke-strong-900);
	list-style: none;
	margin: 0;
	padding: 0;
	z-index: 100;
}

.s4w-shop-toolbar__sort-dropdown.is-open {
	display: block;
}

.s4w-shop-toolbar__sort-option {
	display: block;
	padding: 12px 16px;
	font-family: var(--font-primary);
	font-size: var(--paragraph-small);
	font-weight: var(--weight-book);
	line-height: 20px;
	letter-spacing: 0.56px;
	color: var(--text-main-900);
	text-decoration: none;
	white-space: nowrap;
	transition: background 0.15s ease;
}

.s4w-shop-toolbar__sort-option:hover {
	background: var(--bg-weak-100);
}

.s4w-shop-toolbar__sort-option.is-active {
	background: var(--bg-weak-100);
	font-weight: 600;
}

/* --------------------------------------------------------------------------
   SIDEBAR FILTRI — sticky su desktop, slide-in su mobile
   -------------------------------------------------------------------------- */

.s4w-shop-filters-sidebar {
	position: sticky;
	top: 40px;
	width: 280px;
	max-width: 280px;
	flex-shrink: 0;
	overflow: hidden;
	transition: max-width 0.4s ease, margin-right 0.4s ease;
}

.s4w-shop-filters-sidebar.is-hidden {
	max-width: 0;
	margin-right: 0;
	pointer-events: none;
}

.s4w-shop-filters-sidebar__inner {
	width: 280px;
	flex-shrink: 0;
	padding-right: 25px;
}

/* Filtri attivi */
.s4w-shop-filters-sidebar__active-filters {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 16px;
}

.s4w-shop-filters-sidebar__active-filters .btn.btn--link {
	width: fit-content;
}

.s4w-shop-filters-sidebar__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.s4w-shop-filter-chip {
	display: inline-flex;
	align-items: center;
	text-decoration: none !important;
	gap: 4px;
	padding: 10px 12px;
	background: var(--bg-surface-700);
	color: var(--text-white-0);
	transition: opacity var(--transition-fast);
	white-space: nowrap;
}

.s4w-shop-filter-chip:hover {
	opacity: 0.8;
}

.s4w-shop-filter-chip svg {
	flex-shrink: 0;
	width: 20px;
	height: 20px;
}

/* Gruppi filtro */
.s4w-shop-filters-sidebar__groups {
	display: flex;
	flex-direction: column;
}

.s4w-shop-filters-sidebar__group {
	display: flex;
	flex-direction: column;
}

.s4w-shop-filters-sidebar__separator {
	height: 1px;
	background: var(--stroke-soft-200);
	margin-bottom: 8px;
}

.s4w-shop-filters-sidebar__group-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	background: transparent;
	border: none;
	padding: 4px 0;
	cursor: pointer;
	text-align: left;
	margin-bottom: 8px;
}

.s4w-shop-filters-sidebar__group-title {
	font-family: var(--font-primary);
	font-size: var(--paragraph-small);
	line-height: 20px;
	letter-spacing: 0.04em;
	font-weight: var(--weight-medium);
	text-transform: uppercase;
	color: var(--text-main-900);
}

.s4w-shop-filters-sidebar__chevron {
	width: 24px;
	height: 24px;
	transition: transform 0.2s ease;
	color: var(--text-main-900);
}

.s4w-shop-filters-sidebar__group-header[aria-expanded="false"] .s4w-shop-filters-sidebar__chevron {
	transform: rotate(-90deg);
}

/* Accordion content */
.s4w-shop-filters-sidebar__group-content {
	overflow: hidden;
	transition: max-height 0.35s ease, opacity 0.2s ease;
	max-height: 500px;
	opacity: 1;
}

.s4w-shop-filters-sidebar__group-content.is-collapsed {
	max-height: 0;
	opacity: 0;
	margin-bottom: 0;
}

/* Checkbox list */
.s4w-shop-filters-sidebar__checkboxes {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 16px;
}

/* Checkbox custom (identico al news) */
.s4w-shop-filters-sidebar__checkbox {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	user-select: none;
}

.s4w-shop-filters-sidebar__checkbox input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.s4w-shop-filters-sidebar__checkbox-box {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 17px;
	height: 17px;
	border: 1px solid var(--stroke-sub-300);
	background: transparent;
	transition: all 0.15s ease;
	position: relative;
	flex-shrink: 0;
}

.s4w-shop-filters-sidebar__checkbox input[type="checkbox"]:checked + .s4w-shop-filters-sidebar__checkbox-box {
	background: var(--color-orange);
	border-color: var(--color-orange);
}

.s4w-shop-filters-sidebar__checkbox input[type="checkbox"]:checked + .s4w-shop-filters-sidebar__checkbox-box::after {
	content: '';
	position: absolute;
	width: 10px;
	height: 6px;
	border-left: 2px solid var(--bg-white-0);
	border-bottom: 2px solid var(--bg-white-0);
	transform: rotate(-45deg) translateY(-1px);
}

.s4w-shop-filters-sidebar__checkbox-label {
	font-family: var(--font-secondary);
	font-size: var(--paragraph-small);
	line-height: 1.5;
	color: var(--text-sub-500);
}

.s4w-shop-filters-sidebar__checkbox-count {
	color: var(--text-soft-400);
	margin-left: 2px;
}

/* --------------------------------------------------------------------------
   OVERLAY (creato da JS)
   -------------------------------------------------------------------------- */

.s4w-shop-filters-sidebar-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100vh;
	background: rgba(0, 0, 0, 0.5);
	z-index: 999;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.s4w-shop-filters-sidebar-overlay.is-visible {
	display: block;
	opacity: 1;
}

/* --------------------------------------------------------------------------
   GRIGLIA PRODOTTI
   -------------------------------------------------------------------------- */

.s4w-shop-loop {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* Gli stili della card sono in assets/css/blocks/product-card.css */

/* --------------------------------------------------------------------------
   BANNER COLLEZIONE IN EVIDENZA
   -------------------------------------------------------------------------- */

.s4w-shop-grid__item--banner {
	flex: 0 0 33.333%;
	max-width: 33.333%;
	box-sizing: border-box;
	align-self: stretch;
	display: flex;
	flex-direction: column;
}

/* Struttura banner identica alla card prodotto */
.s4w-shop-banner {
	display: flex;
	flex-direction: column;
	flex: 1;
	border: 1px solid var(--stroke-soft-200);
	box-sizing: border-box;
}

.s4w-shop-banner--bg-yellow { background-color: var(--color-yellow); }
.s4w-shop-banner--bg-green  { background-color: var(--color-green); }
.s4w-shop-banner--bg-pink   { background-color: var(--color-pink); }
.s4w-shop-banner--bg-orange { background-color: var(--color-orange); }
.s4w-shop-banner--bg-blue   { background-color: var(--color-blu); }
.s4w-shop-banner--bg-weak   { background-color: var(--bg-weak-100); }

/* Wrapper immagine: stesse proporzioni della card prodotto */
.s4w-shop-banner__media {
	padding: 20px;
	box-sizing: border-box;
	flex-shrink: 0;
}


.s4w-shop-banner__media .s4w-product-card__image {
	object-fit: cover;
}

/* Contenuto: cresce per riempire spazio, padding identico a __body della card */
.s4w-shop-banner__content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 0 20px 20px;
}

.s4w-shop-banner__title {
	font-family: var(--font-primary);
	font-size: 40px;
	font-weight: var(--weight-regular);
	line-height: 1.1;
	letter-spacing: -0.02em;
	text-transform: uppercase;
	color: var(--text-main-900);
	margin: 0;
}

.s4w-shop-banner__btn {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	margin-top: 8px;
}

/* --------------------------------------------------------------------------
   NESSUN RISULTATO
   -------------------------------------------------------------------------- */

.s4w-shop-no-results {
	padding: 64px 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 24px;
	text-align: center;
}

/* --------------------------------------------------------------------------
   PAGINAZIONE
   -------------------------------------------------------------------------- */

.s4w-shop-pagination {
	margin-top: 60px;
	display: flex;
	justify-content: center;
}

.s4w-shop-pagination ul {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 0;
}

.s4w-shop-pagination li {
	margin: 0;
}

.s4w-shop-pagination a,
.s4w-shop-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 20px 24px;
	height: 75px;
	min-width: 75px;
	font-family: var(--font-primary);
	font-size: var(--paragraph-small);
	font-weight: var(--weight-medium);
	line-height: 20px;
	letter-spacing: 0.42px;
	text-transform: uppercase;
	white-space: nowrap;
	border-top: 1px solid var(--stroke-soft-200);
	border-right: 1px solid var(--stroke-soft-200);
	border-bottom: 1px solid var(--stroke-soft-200);
	border-left: none;
	background: transparent;
	color: var(--text-main-900);
	transition: all 0.2s ease;
}

.s4w-shop-pagination li:first-child a,
.s4w-shop-pagination li:first-child span {
	border-left: 1px solid var(--stroke-soft-200);
}

.s4w-shop-pagination a:hover {
	background: var(--bg-weak-100);
}

.s4w-shop-pagination .current {
	background: var(--bg-weak-100);
	color: var(--text-main-900);
}

/* --------------------------------------------------------------------------
   RESPONSIVE — TABLET (<=1024px)
   -------------------------------------------------------------------------- */

@media (max-width: 1024px) {

	.s4w-shop-listing-page .s4w-breadcrumbs__container {
		padding-left: 24px;
	}

	.s4w-shop-header-primary {
		padding-top: 64px;
		padding-bottom: 48px;
	}

	.s4w-shop-header-primary__title {
		font-size: 56px;
	}

	.s4w-shop-header-primary__count {
		font-size: var(--paragraph-small);
	}

	.s4w-shop-listing {
		padding-bottom: 64px;
	}

	.s4w-shop-listing__wrapper {
		flex-direction: column;
	}

	.s4w-shop-grid__item--banner {
		flex: 0 0 50%;
		max-width: 50%;
	}

	/* Mobile: sidebar fixed slide-in */
	.s4w-shop-filters-sidebar {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		max-width: 320px;
		height: 100vh;
		background: var(--bg-white-0);
		z-index: 1000;
		padding: 40px 24px;
		overflow-y: auto;
		transform: translateX(-100%);
		opacity: 1;
		transition: transform 0.3s ease;
	}

	.s4w-shop-filters-sidebar.is-visible {
		transform: translateX(0);
		pointer-events: all;
	}

	.s4w-shop-filters-sidebar.is-hidden {
		transform: translateX(-100%);
		max-width: 320px;
		pointer-events: none;
	}

	.s4w-shop-filters-sidebar__inner {
		width: 100%;
		padding-right: 0;
	}

	.s4w-shop-nav-item {
		height: 56px;
		padding: 8px 16px;
	}

}

/* --------------------------------------------------------------------------
   RESPONSIVE — MOBILE (<=768px)
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {

	.s4w-shop-listing-page .s4w-breadcrumbs__container {
		padding-left: 16px;
	}

	.s4w-shop-header-primary {
		padding-top: 40px;
		padding-bottom: 32px;
	}

	.s4w-shop-header-primary__title {
		font-size: 40px;
	}

	.s4w-shop-header-primary__inner {
		gap: 24px;
	}

	.s4w-shop-header-primary__nav {
		overflow-x: auto;
		flex-wrap: nowrap;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.s4w-shop-header-primary__nav::-webkit-scrollbar {
		display: none;
	}

	.s4w-shop-listing {
		padding-bottom: 48px;
	}

	.s4w-shop-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.s4w-shop-toolbar__sort-wrapper {
		width: 100%;
	}

	.s4w-shop-toolbar__sort {
		justify-content: center;
		width: 100%;
	}

	.s4w-shop-toolbar__sort-dropdown {
		left: 0;
		right: 0;
		min-width: unset;
	}

	.s4w-shop-grid__item--banner {
		flex: 0 0 100%;
		max-width: 100%;
	}


	.s4w-shop-banner__title {
		font-size: 28px;
	}

	.s4w-shop-pagination a,
	.s4w-shop-pagination span {
		height: auto;
		padding: 12px 16px;
		min-width: 50px;
		font-size: var(--paragraph-xsmall);
	}

}
