/* =========================================================
   Nautica Web Shop — Product Archive / Category Page
   ========================================================= */

/* ── Reset / override tema per la pagina archivio ───────── */
body.woocommerce-page .woocommerce,
body.woocommerce .woocommerce,
body.woocommerce-shop .woocommerce,
body.tax-product_cat .woocommerce {
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Nasconde l'output WooCommerce nativo quando il plugin è attivo */
body.woocommerce-page .woocommerce-notices-wrapper,
body.tax-product_cat .woocommerce-notices-wrapper {
	max-width: 1300px;
	margin: 0 auto;
	padding: 0 16px;
}


/* ── Wrapper esterno ─────────────────────────────────────── */
.nws-archive-wrap {
	width: 100%;
	background: #f5f7fb;
	min-height: 60vh;
	margin-block-start: 0 !important;
}

/* ── Pagina centrata (1300px) ────────────────────────────── */
.nws-archive-page {
	max-width: 1300px;
	margin: 0 auto;
	padding: 0 16px 60px;
}

/* ── Hero categoria ──────────────────────────────────────── */
.nws-archive-hero {
	background: linear-gradient(135deg, #0d3ea3 0%, #1565c0 60%, #1976d2 100%);
	border-radius: 0 0 20px 20px;
	padding: 36px 32px 32px;
	margin-bottom: 32px;
	position: relative;
	overflow: hidden;
}

.nws-archive-hero--has-img {
	background-size: cover;
	background-position: center;
}

.nws-archive-hero--has-img::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgb(0 0 0 / 88%) 0%, rgb(59 151 255 / 75%) 100%);
}

.nws-archive-hero__inner {
	position: relative;
	z-index: 1;
}

.nws-archive-hero__title {
	font-size: 32px !important;
	font-weight: 800 !important;
	color: #fff !important;
	margin: 6px 0 0 !important;
	line-height: 1.2 !important;
	letter-spacing: -0.01em;
}

.nws-archive-hero__desc {
	font-size: 15px;
	color: rgba(255,255,255,.75);
	margin: 8px 0 0;
	max-width: 600px;
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.nws-archive-breadcrumb {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: rgba(255,255,255,.6);
	margin-bottom: 4px;
}

.nws-archive-breadcrumb__link {
	color: rgba(255,255,255,.65);
	text-decoration: none;
	transition: color .15s;
}

.nws-archive-breadcrumb__link:hover {
	color: #fff;
}

.nws-archive-breadcrumb__current {
	color: rgba(255,255,255,.9);
	font-weight: 600;
}

.nws-archive-breadcrumb__sep {
	color: rgba(255,255,255,.4);
}

/* ── Layout: sidebar + main ──────────────────────────────── */
.nws-archive-layout {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 28px;
	align-items: start;
}
.nws-archive-layout--no-sidebar {
	grid-template-columns: 1fr;
}
.nws-archive-layout--no-sidebar .nws-archive-grid {
	grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1100px) {
	.nws-archive-layout--no-sidebar .nws-archive-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
@media (max-width: 768px) {
	.nws-archive-layout--no-sidebar .nws-archive-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ── Sidebar ─────────────────────────────────────────────── */
.nws-archive-sidebar {
	position: sticky;
	top: 24px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #d0d8ea transparent;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 2px 16px rgba(13, 62, 163, 0.07);
	padding: 0 0 8px;
}

.nws-archive-sidebar::-webkit-scrollbar {
	width: 4px;
}
.nws-archive-sidebar::-webkit-scrollbar-track {
	background: transparent;
}
.nws-archive-sidebar::-webkit-scrollbar-thumb {
	background: #d0d8ea;
	border-radius: 4px;
}

/* Intestazione sidebar */
.nws-sidebar-head {
	padding: 20px 20px 16px;
	border-bottom: 1px solid #f0f3fa;
}

.nws-sidebar-head__label {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #8fa3c4;
	margin-bottom: 4px;
}

.nws-sidebar-head__title {
	font-size: 17px;
	font-weight: 800;
	color: #0d3ea3;
	line-height: 1.2;
}

.nws-sidebar-head__desc {
	font-size: 12px;
	color: #6b7fa0;
	margin-top: 6px;
	line-height: 1.5;
}

/* ── Accordion nav ───────────────────────────────────────── */
.nws-sidebar-nav {
	padding: 8px 0 12px;
}

/* Item senza figli (link diretto) */
.nws-acc-item > .nws-acc-item__link {
	display: block;
	padding: 8px 20px;
	font-size: 14px;
	color: #333d4e;
	text-decoration: none;
	transition: color .15s, background .15s;
	border-radius: 0;
}

.nws-acc-item > .nws-acc-item__link:hover,
.nws-acc-item.is-active > .nws-acc-item__link {
	color: #0d3ea3;
	background: #eef2ff;
}

/* Header row accordion (link + chevron) */
.nws-acc-item__hd {
	display: flex;
	align-items: center;
	padding: 0 12px 0 20px;
}

.nws-acc-item__link {
	flex: 1;
	display: block;
	padding: 8px 0;
	font-size: 14px;
	font-weight: 500;
	color: #333d4e;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	transition: color .15s;
}

.nws-acc-item__link:hover {
	color: #0d3ea3;
}

/* Bottone chevron */
.nws-acc-item__toggle {
	flex-shrink: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: transparent;
	cursor: pointer;
	color: #9aaac4;
	border-radius: 6px;
	transition: color .15s, background .15s, transform .2s;
}

.nws-acc-item__toggle:hover {
	color: #0d3ea3;
	background: #f0f3fa;
}

.nws-acc-item.is-open > .nws-acc-item__hd .nws-acc-item__toggle {
	transform: rotate(180deg);
	color: #0d3ea3;
}

/* Stato attivo (categoria corrente top-level) */
.nws-acc-item.is-active > .nws-acc-item__hd .nws-acc-item__link,
.nws-acc-item.is-open > .nws-acc-item__hd .nws-acc-item__link {
	color: #0d3ea3;
	font-weight: 700;
}

/* Body accordion (collassabile) */
.nws-acc-item__body {
	padding: 0 0 6px 0;
}

.nws-acc-item__body[hidden] {
	display: none;
}

/* ── Lista categorie nel body accordion ─────────────────── */
.nws-sidebar-catlist {
	list-style: none;
	margin: 0;
	padding: 0 0 0 20px;
}

.nws-sidebar-cat {
	display: block;
	margin-bottom: 1px;
}

.nws-sidebar-cat__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-radius: 6px;
	transition: background .15s;
}

.nws-sidebar-cat__row:hover {
	background: #f5f7fb;
}

.nws-sidebar-cat a,
.nws-sidebar-cat__row a {
	flex: 1;
	display: block;
	padding: 6px 8px;
	font-size: 16px;
	color: #4a5568;
	text-decoration: none;
	border-radius: 6px;
	transition: color .15s;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nws-sidebar-cat a:hover,
.nws-sidebar-cat__row a:hover {
	color: #0d3ea3;
}

.nws-sidebar-cat.is-active > .nws-sidebar-cat__row,
.nws-sidebar-cat.is-active > a {
	background: #eef2ff;
	border-radius: 6px;
}

.nws-sidebar-cat.is-active > .nws-sidebar-cat__row a,
.nws-sidebar-cat.is-active > a {
	color: #0d3ea3 !important;
	font-weight: 700;
}

.nws-sidebar-cat.is-ancestor > .nws-sidebar-cat__row a {
	color: #0d3ea3;
	font-weight: 600;
}

.nws-sidebar-cat__count {
	font-size: 11px;
	color: #9aaac4;
	background: #f0f3fa;
	border-radius: 20px;
	padding: 1px 6px;
	margin-right: 6px;
	flex-shrink: 0;
}

.nws-sidebar-cat.is-active .nws-sidebar-cat__count {
	background: #d8e0f8;
	color: #0d3ea3;
}

/* Lista annidata (sottocategorie) */
.nws-sidebar-catlist--nested {
	padding-left: 12px;
	margin: 2px 0 4px;
	border-left: 2px solid #e8edf8;
}

.nws-sidebar-catlist--nested .nws-sidebar-cat a,
.nws-sidebar-catlist--nested .nws-sidebar-cat__row a {
	font-size: 16px;
	padding: 4px 8px;
}

/* ── Toolbar ─────────────────────────────────────────────── */
.nws-archive-toolbar {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	margin-bottom: 20px;
	padding: 10px 16px;
	border-radius: 12px;
	position: relative;
}

/* ── Bottone Filtri ───────────────────────────────────────── */
.nws-toolbar-filter-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: 10px;
	border: none;
	background: #fff;
	color: #0d3ea3;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, border-color .15s;
	white-space: nowrap;
}

.nws-toolbar-filter-btn:hover,
.nws-toolbar-filter-btn.is-active {
	background: #0d3ea3;
	border-color: #0d3ea3;
	color: #fff;
}

.nws-toolbar-filter-btn.is-active svg {
	stroke: #fff;
}

.nws-filter-btn__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 20px;
	background: #ff3b30;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

/* ── Filter modal (slide-up) ─────────────────────────────── */
.nws-filter-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(10, 20, 50, 0.55);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	align-items: center;
	justify-content: center;
}

.nws-filter-modal.is-open {
	display: flex;
}

.nws-filter-modal__inner {
	width: 100%;
	max-width: 480px;
	max-height: 85vh;
	background: #fff;
	border-radius: 20px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: nwsModalFadeIn .2s ease;
	margin: 16px;
}

@keyframes nwsModalFadeIn {
	from { transform: scale(.96); opacity: 0; }
	to   { transform: scale(1);   opacity: 1; }
}

/* Su mobile torna slide-up dal basso */
@media (max-width: 768px) {
	.nws-filter-modal {
		align-items: flex-end;
		justify-content: stretch;
	}

	.nws-filter-modal__inner {
		width: 100%;
		max-width: none;
		border-radius: 20px 20px 0 0;
		margin: 0;
		animation: nwsModalSlideUp .25s ease;
	}
}

.nws-filter-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px 14px;
	border-bottom: 1px solid #e8edf8;
	flex-shrink: 0;
}

.nws-filter-modal__title {
	font-size: 17px;
	font-weight: 700;
	color: #0d3ea3;
}

.nws-filter-modal__body {
	overflow-y: auto;
	padding: 20px 20px 32px;
	-webkit-overflow-scrolling: touch;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* ── Sezioni filtri ──────────────────────────────────────── */
.nws-filter-section__title {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: #8898b8;
	margin-bottom: 10px;
}

.nws-filter-sort,
.nws-filter-brands {
	display: flex;
	flex-direction: column;
}

/* ── Filter pills ────────────────────────────────────────── */
.nws-filter-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.nws-filter-pill {
	display: inline-flex;
	align-items: center;
	padding: 7px 16px;
	border-radius: 20px;
	border: 1.5px solid #e0e6f5;
	background: #f5f7fb;
	color: #333d4e;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: all .15s;
	white-space: nowrap;
}

.nws-filter-pill:hover {
	border-color: #0d3ea3;
	color: #0d3ea3;
}

.nws-filter-pill.is-active {
	background: #0d3ea3;
	border-color: #0d3ea3;
	color: #fff;
	font-weight: 700;
}

/* ── Azioni filtri ───────────────────────────────────────── */
.nws-filter-actions {
	display: flex;
	gap: 10px;
	margin-top: 4px;
}

.nws-filter-reset {
	flex: 1;
	padding: 12px;
	border-radius: 10px;
	border: 1.5px solid #e0e6f5;
	background: #fff;
	color: #555e7a;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all .15s;
}

.nws-filter-reset:hover {
	border-color: #c9d4f0;
	background: #f5f7fb;
}

.nws-filter-apply {
	flex: 2;
	padding: 12px;
	border-radius: 10px;
	border: none;
	background: #0d3ea3;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: background .15s;
}

.nws-filter-apply:hover {
	background: #0a2d80;
}

.nws-archive-sort {
	appearance: none;
	-webkit-appearance: none;
	background: #f5f7fb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%230d3ea3' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center;
	border: 1.5px solid #e0e6f5;
	border-radius: 8px;
	padding: 7px 30px 7px 10px;
	font-size: 13px;
	font-weight: 500;
	color: #333d4e;
	cursor: pointer;
	transition: border-color .2s;
	min-width: 0;
	width: auto;
}

.nws-archive-sort:focus {
	border-color: #0d3ea3;
}

/* ── Griglia prodotti ────────────────────────────────────── */
.nws-archive-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 18px;
	min-height: 200px;
	position: relative;
	transition: opacity .25s ease;
}

/* Override stili slider per le card nell'archivio */
.nws-archive-grid .nws-product-card {
	width: 100% !important;
	min-width: 0 !important;
	flex: none !important;
}

/* ── Stato vuoto ─────────────────────────────────────────── */
.nws-archive-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	color: #6b7fa0;
	font-size: 15px;
}

/* ── Loader ──────────────────────────────────────────────── */
.nws-archive-loader {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(245, 247, 251, 0.75);
	border-radius: 12px;
	z-index: 10;
}

.nws-archive-loader[hidden] {
	display: none;
}

.nws-archive-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e0e6f5;
	border-top-color: #0d3ea3;
	border-radius: 50%;
	animation: nws-spin 0.7s linear infinite;
}

@keyframes nws-spin {
	to { transform: rotate(360deg); }
}

/* ── Paginazione ─────────────────────────────────────────── */
.nws-archive-pagination {
	margin-top: 36px;
	display: flex;
	justify-content: center;
}

.nws-pagination {
	display: flex;
	align-items: center;
	gap: 6px;
}

.nws-pagination__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border-radius: 8px;
	border: 1.5px solid #e0e6f5;
	background: #fff;
	font-size: 14px;
	font-weight: 500;
	color: #333d4e;
	cursor: pointer;
	transition: all .15s;
}

.nws-pagination__btn:hover {
	border-color: #0d3ea3;
	color: #0d3ea3;
}

.nws-pagination__btn.is-active {
	background: #0d3ea3;
	border-color: #0d3ea3;
	color: #fff;
	font-weight: 700;
}

.nws-pagination__btn--nav {
	background: #f5f7fb;
	border-color: #e0e6f5;
}

.nws-pagination__dots {
	color: #9aaac4;
	font-size: 14px;
	padding: 0 4px;
}

/* ── Main container: relativo per il loader ──────────────── */
#nws-archive-main {
	position: relative;
}

/* ── Toolbar icon buttons (solo mobile) ──────────────────── */
.nws-toolbar-icon-btn {
	display: none; /* mostrato solo su mobile via media query */
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	border-radius: 10px;
	border: none;
	background: #fff;
	color: #0d3ea3;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, border-color .15s;
	white-space: nowrap;
	flex-shrink: 0;
}

.nws-toolbar-icon-btn:hover,
.nws-toolbar-icon-btn.is-active {
	background: #0d3ea3;
	border-color: #0d3ea3;
	color: #fff;
}

.nws-toolbar-icon-btn.is-active svg {
	stroke: #fff;
}

/* ── Pannello sort mobile ─────────────────────────────────── */
.nws-mobile-sort-panel {
	background: #fff;
	border: 1.5px solid #e0e6f5;
	border-radius: 12px;
	padding: 12px 16px;
	margin-bottom: 16px;
	display: none;
}

.nws-mobile-sort-panel:not([hidden]) {
	display: block;
}

.nws-mobile-sort-select {
	width: 100%;
	min-width: 0;
}

/* ── Modal fullscreen categorie ──────────────────────────── */
.nws-cat-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(10, 20, 50, 0.55);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	align-items: flex-end;
}

.nws-cat-modal.is-open {
	display: flex;
}

.nws-cat-modal__inner {
	width: 100%;
	max-height: 90vh;
	background: #fff;
	border-radius: 20px 20px 0 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: nwsModalSlideUp .25s ease;
}

@keyframes nwsModalSlideUp {
	from { transform: translateY(100%); opacity: 0; }
	to   { transform: translateY(0);    opacity: 1; }
}

.nws-cat-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px 14px;
	border-bottom: 1px solid #e8edf8;
	flex-shrink: 0;
}

.nws-cat-modal__title {
	font-size: 17px;
	font-weight: 700;
	color: #0d3ea3;
}

.nws-cat-modal__close {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1.5px solid #e0e6f5;
	background: #f5f7fb;
	color: #555e7a;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all .15s;
	flex-shrink: 0;
}

.nws-cat-modal__close:hover {
	background: #fee2e2;
	border-color: #fca5a5;
	color: #dc2626;
}

.nws-cat-modal__body {
	overflow-y: auto;
	padding: 12px 20px 32px;
	-webkit-overflow-scrolling: touch;
}

/* Nasconde l'intestazione "Stai navigando in" nel modal mobile
   perché è già visibile nel titolo del bottone */
.nws-cat-modal__body .nws-sidebar-head {
	display: none;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1200px) {
	.nws-archive-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 960px) {
	.nws-archive-layout {
		grid-template-columns: 220px 1fr;
		gap: 20px;
	}
}

@media (max-width: 768px) {
	.nws-archive-layout {
		grid-template-columns: 1fr;
	}

	.nws-archive-sidebar {
		display: none;
	}

	/* Mostra icona categorie mobile */
	.nws-toolbar-icon-btn {
		display: flex;
	}

	/* Toolbar mobile: categorie sx, filtri dx */
	.nws-archive-toolbar {
		justify-content: space-between;
		padding: 10px 12px;
		border-radius: 12px;
		margin-bottom: 20px;
	}

	.nws-archive-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.nws-archive-hero {
		padding: 24px 16px 20px;
		border-radius: 0 0 14px 14px;
	}

	.nws-archive-hero__title {
		font-size: 24px !important;
	}
}

@media (max-width: 420px) {
	.nws-archive-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.nws-pagination__btn {
		min-width: 34px;
		height: 34px;
		font-size: 13px;
	}
}

/* ── Rimuove max-width di blocco temi sul contenuto archivio */
.nws-archive-wrap .wp-block-group,
.nws-archive-wrap .is-layout-constrained {
	max-width: none !important;
}
