/* =========================================================
   Nautica Web Shop — Nav Bar
   ========================================================= */

.nws-nav-bar {
	width: 100%;
	background: #fff;
	border-bottom: 1px solid rgba(0,0,0,.07);
	position: relative;
	z-index: 9998;
	margin: 0 !important;
	padding: 0 !important;
	display: block;
	overflow: visible !important;
}

.nws-nav-bar__inner {
	max-width: 1300px;
	margin: 0 auto;
	padding: 0 16px;
	display: flex;
	align-items: center;
	gap: 0;
	overflow: visible;
}

/* ── Trust badge ─────────────────────────────────────────── */
.nws-nav-trust {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	padding-left: 20px;
	margin-left: auto;
	border-left: 1px solid rgba(255,255,255,.25);
	white-space: nowrap;
	/* override button defaults */
	background: none;
	border-top: none;
	border-right: none;
	border-bottom: none;
	cursor: pointer;
	font-family: inherit;
	transition: opacity .15s;
}
.nws-nav-trust:hover { opacity: .8; }

.nws-nav-trust__label {
	font-size: 12px;
	font-weight: 700;
	color: #fff;
	line-height: 1.2;
	letter-spacing: 0.01em;
}

.nws-nav-trust__rating {
	display: flex;
	align-items: center;
	gap: 5px;
}

.nws-nav-trust__stars {
	display: inline-flex;
	align-items: center;
	gap: 1px;
	color: #ffc93c;
}

.nws-nav-trust__stars svg {
	width: 13px;
	height: 13px;
	flex-shrink: 0;
}

.nws-nav-trust__score {
	font-size: 12px;
	font-weight: 700;
	color: #fff;
	line-height: 1;
}


.nws-nav-bar__item {
	display: inline-flex;
	align-items: center;
	padding: 13px 18px;
	font-size: 16px;
	font-weight: 500;
	color: #ffffff;
	text-decoration: none;
	white-space: nowrap;
	position: relative;
	transition: color .2s ease;
	letter-spacing: .01em;
}

.nws-nav-bar__item::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 18px;
	right: 18px;
	height: 2px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: center;
	transition: transform .22s ease;
	border-radius: 2px;
}

.nws-nav-bar__item:hover {
	color: rgba(255, 255, 255, 0.75);
}

.nws-nav-bar__item-icon {
	width: 20px;
	padding-right: 10px;
	object-fit: contain;
	flex-shrink: 0;
	display: inline-block;
	vertical-align: middle;
	filter: brightness(0) invert(1);
}

.nws-nav-bar__item:hover::after,
.nws-nav-bar__item.is-active::after {
	transform: scaleX(1);
}

/* Nessuno spazio tra header e nav bar */
header.wp-block-template-part + .nws-nav-bar,
div.wp-block-template-part + .nws-nav-bar {
	margin-top: 0 !important;
}

/* ── Megamenu trigger ── */
.nws-nav-bar__item--mega {
	position: relative;
}

.nws-mega-trigger {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: none;
	border: none;
	cursor: pointer;
	padding: 13px 18px;
	font-size: 16px;
	font-weight: 500;
	color: #ffffff;
	white-space: nowrap;
	position: relative;
	letter-spacing: .01em;
	transition: color .2s ease;
}

.nws-mega-trigger:hover {
	color: rgba(255,255,255,.75);
}

.nws-mega-arrow {
	display: inline-block;
	transition: transform .2s ease;
	flex-shrink: 0;
}

.nws-mega-trigger[aria-expanded="true"] .nws-mega-arrow {
	transform: rotate(180deg);
}

/* ── Megamenu panel (portaled nel <body> via JS) ── */
.nws-megamenu {
	position: fixed;
	min-width: 560px;
	background: #fff;
	border-radius: 0 0 10px 10px;
	box-shadow: 0 12px 40px rgba(0,0,0,.18);
	z-index: 999999;
	padding: 24px;
	border-top: 3px solid #0d3ea3;
}

.nws-megamenu[hidden] {
	display: none !important;
}

.nws-megamenu__inner {
	display: flex;
	gap: 32px;
	flex-wrap: wrap;
}

/* ── Colonne ── */
.nws-megamenu__col {
	min-width: 140px;
	flex: 1;
}

.nws-megamenu__col-title {
	display: block;
	font-size: 13px;
	font-weight: 700;
	color: #1a1a2e;
	text-decoration: none;
	text-transform: uppercase;
	letter-spacing: .06em;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 2px solid #eee;
	transition: color .2s;
}

.nws-megamenu__col-title:hover {
	color: #0d3ea3;
}

/* ── Voci figlie ── */
.nws-megamenu__children {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.nws-megamenu__child {
	display: block;
	font-size: 16px;
	color: #444;
	text-decoration: none;
	padding: 5px 6px;
	border-radius: 5px;
	transition: background .15s, color .15s;
}

.nws-megamenu__child:hover {
	background: #f0f4ff;
	color: #0d3ea3;
}


/* ── Pulsante chiusura overlay (sempre nascosto su desktop) ── */
.nws-nav-bar__close {
	display: none;
}

/* ── Hamburger nell'header (iniettato via JS, solo mobile) ── */
.nws-hamburger-btn {
	display: none;
}

/* ── Blocco scroll quando overlay aperto ── */
html.nws-menu-open {
	overflow: hidden;
}

@media (max-width: 768px) {

	/* Overlay fullscreen: nascosto di default */
	.nws-nav-bar {
		position: fixed !important;
		inset: 0 !important;
		width: 100% !important;
		height: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		z-index: 99999 !important;
		display: flex !important;
		flex-direction: column !important;
		justify-content: center !important;
		align-items: center !important;
		opacity: 0;
		pointer-events: none;
		transition: opacity .25s ease;
		border-bottom: none !important;
	}

	/* Visibile quando aperto */
	.nws-nav-bar.is-open {
		opacity: 1;
		pointer-events: auto;
	}

	/* Voci menu centrate verticalmente */
	.nws-nav-bar__inner {
		display: flex !important;
		flex-direction: column !important;
		align-items: center !important;
		justify-content: center !important;
		gap: 4px !important;
		padding: 60px 24px 24px !important;
		width: 100% !important;
		max-width: 100% !important;
		overflow-y: auto;
	}

	.nws-nav-bar__item {
		font-size: 22px !important;
		font-weight: 500 !important;
		padding: 14px 24px !important;
		width: auto !important;
		text-align: center !important;
		border-top: none !important;
		border-bottom: 1px solid rgba(255,255,255,0.15) !important;
		width: 100% !important;
		letter-spacing: .02em !important;
	}

	.nws-nav-bar__item:last-child {
		border-bottom: none !important;
	}

	.nws-nav-bar__item::after {
		display: none !important;
	}

	/* Megamenu in overlay mobile: flat, senza dropdown */
	.nws-nav-bar__item--mega {
		width: 100%;
		flex-direction: column;
	}

	.nws-mega-trigger {
		font-size: 22px !important;
		font-weight: 500 !important;
		padding: 14px 24px !important;
		width: 100% !important;
		text-align: center !important;
		border-bottom: 1px solid rgba(255,255,255,0.15) !important;
		justify-content: center !important;
	}

	.nws-megamenu {
		position: static !important;
		min-width: 0 !important;
		box-shadow: none !important;
		background: rgba(0,0,0,.15) !important;
		border-radius: 0 !important;
		border-top: none !important;
		padding: 12px 24px 16px !important;
		width: 100% !important;
	}

	.nws-megamenu__inner {
		flex-direction: column !important;
		gap: 16px !important;
	}

	.nws-megamenu__col-title {
		color: #fff !important;
		border-bottom-color: rgba(255,255,255,.2) !important;
		font-size: 14px !important;
	}

	.nws-megamenu__child {
		color: rgba(255,255,255,.85) !important;
		font-size: 14px !important;
	}

	.nws-megamenu__child:hover {
		background: rgba(255,255,255,.1) !important;
		color: #fff !important;
	}

	/* Pulsante × chiudi in alto a destra */
	.nws-nav-bar__close {
		display: block;
		position: absolute;
		top: 20px;
		right: 20px;
		background: none;
		border: none;
		color: #fff;
		font-size: 28px;
		line-height: 1;
		cursor: pointer;
		padding: 6px 10px;
		opacity: .8;
		transition: opacity .2s;
	}

	.nws-nav-bar__close:hover {
		opacity: 1;
	}

	/* Hamburger visibile nell'header */
	.nws-hamburger-btn {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		gap: 5px;
		background: none;
		border: none;
		cursor: pointer;
		padding: 4px 6px;
		width: 36px;
		height: 36px;
		flex-shrink: 0;
		margin-left: 8px;
	}

	.nws-hamburger-btn span {
		display: block;
		width: 22px;
		height: 2px;
		background: #fff;
		border-radius: 2px;
		transition: transform .25s ease, opacity .2s ease;
		transform-origin: center;
	}

	/* Animazione → X quando aperto */
	.nws-hamburger-btn.is-open span:nth-child(1) {
		transform: translateY(7px) rotate(45deg);
	}
	.nws-hamburger-btn.is-open span:nth-child(2) {
		opacity: 0;
		transform: scaleX(0);
	}
	.nws-hamburger-btn.is-open span:nth-child(3) {
		transform: translateY(-7px) rotate(-45deg);
	}
}
