/**
 * Header - Donna Fugata
 * Design: Figma NavabarClassic (Node 2013-24206)
 * Desktop: 1440px × 70px | Mobile: 402px × 70px
 */

/* ========================================
   BASE HEADER
   ======================================== */

.s4w-header {
	background-color: var(--bg-white-0);
	position: sticky;
	top: 0;
	z-index: 900;
	width: 100%;
}

.s4w-header + #primary,
.s4w-header + main {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

#primary > .page,
#primary > .post,
#primary > article:first-child {
	margin-top: 0 !important;
}

#primary > .page > .entry-content,
#primary > .post > .entry-content,
#primary > article:first-child > .entry-content {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

/* ========================================
   INNER GRID: left | center | right
   ======================================== */

.s4w-header__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	height: 70px;
}

@media (max-width: 768px) {
	.s4w-header__inner {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		height: 70px;
		border-bottom: 1px solid var(--stroke-soft-200);
	}
}

/* ========================================
   SINISTRA
   ======================================== */

.s4w-header__left {
	justify-self: start;
}

.s4w-header__menu-trigger {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	font-family: var(--font-primary);
	font-size: var(--paragraph-medium);
	font-weight: var(--weight-regular);
	font-style: normal;
	text-transform: uppercase;
	letter-spacing: 0.64px;
	color: var(--text-main-900);
	line-height: 24px;
	font-feature-settings: 'calt' 0, 'liga' 0;
	transition: color 0.2s ease;
}

.s4w-header__menu-trigger:hover {
	color: var(--text-sub-500);
}

.s4w-header__menu-trigger:focus-visible {
	outline: 2px solid var(--text-main-900);
	outline-offset: 4px;
}

/* "CHIUDI" nascosto di default, "MENU" visibile */
.s4w-header__menu-label--close {
	display: none;
}

.s4w-header__menu-label--open {
	display: block;
}

/* Quando aperto: mostra CHIUDI, nascondi MENU */
.s4w-header__menu-trigger[aria-expanded="true"] .s4w-header__menu-label--open {
	display: none;
}

.s4w-header__menu-trigger[aria-expanded="true"] .s4w-header__menu-label--close {
	display: block;
}

/* ========================================
   CENTRO: Logo
   ======================================== */

.s4w-header__logo {
	justify-self: center;
}

.s4w-header__logo a {
	display: block;
	line-height: 0;
	text-decoration: none;
}

.s4w-header__logo-img {
	display: block;
	width: 250px;
	height: auto;
	max-height: 26px;
}

@media (max-width: 768px) {
	.s4w-header__logo-img {
		width: 160px;
		max-height: 16px;
	}
}

/* ========================================
   DESTRA: Icone utility
   ======================================== */

.s4w-header__right {
	justify-self: end;
	display: flex;
	flex-direction: row;
	align-items: center;
}

.s4w-header__icon {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--text-main-900);
	text-decoration: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 0;
	position: relative;
	flex-shrink: 0;
	transition: color 0.2s ease;
}

.s4w-header__icon:hover {
	color: var(--text-sub-500);
}

.s4w-header__icon:focus-visible {
	outline: 2px solid var(--text-main-900);
	outline-offset: 2px;
}

.s4w-header__icon svg {
	width: 24px;
	height: 24px;
	display: block;
	flex-shrink: 0;
}

/* Carrello: stessa dimensione delle altre icone, count in posizione assoluta */
.s4w-header__icon--cart {
	width: 44px;
}

/* Count desktop: "(2)" — posizionato in assoluto a destra dell'icona */
.s4w-header__cart-count--inline {
	font-family: var(--font-primary);
	font-size: var(--paragraph-medium);
	font-weight: var(--weight-regular);
	font-style: normal;
	text-transform: uppercase;
	letter-spacing: 0.64px;
	color: var(--text-main-900);
	line-height: 24px;
	white-space: nowrap;
	font-feature-settings: 'calt' 0, 'liga' 0;
	position: absolute;
	left: 100%;
	top: 50%;
	transform: translateY(-50%);
	margin-left: -4px;
}

/* Badge mobile: cerchio scuro con numero bianco */
.s4w-header__cart-badge {
	display: none;
	position: absolute;
	top: 5px;
	right: 5px;
	background-color: var(--text-main-900);
	color: var(--text-white-0);
	font-family: var(--font-primary);
	font-size: 10px;
	font-weight: var(--weight-regular);
	letter-spacing: 0.48px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

@media (max-width: 768px) {
	.s4w-header__icon--account {
		display: none;
	}

	.s4w-header__cart-count--inline {
		display: none;
	}

	.s4w-header__cart-badge {
		display: flex;
	}

	.s4w-header__icon--cart {
		width: 44px;
		padding: 0;
	}
}

/* ========================================
   MEGAMENU
   ======================================== */

.s4w-megamenu {
	display: none;
	background-color: var(--bg-white-0);
	border-top: 1px solid var(--stroke-soft-200);
	width: 100%;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.s4w-megamenu.is-open {
	display: block;
}

.s4w-megamenu__nav {
	list-style: none;
	margin: 0;
	padding: 40px 48px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px 32px;
}

.s4w-megamenu__nav > li > a {
	font-family: var(--font-primary);
	font-size: var(--paragraph-medium);
	font-weight: var(--weight-regular);
	text-transform: uppercase;
	letter-spacing: 0.64px;
	color: var(--text-main-900);
	text-decoration: none;
	display: block;
	padding: 8px 0;
	transition: color 0.2s ease;
}

.s4w-megamenu__nav > li > a:hover {
	color: var(--text-sub-500);
}

.s4w-megamenu__nav .sub-menu {
	display: none;
}

@media (max-width: 768px) {
	.s4w-megamenu__nav {
		flex-direction: column;
		padding: 24px 13px;
		gap: 0;
	}

	.s4w-megamenu__nav > li > a {
		padding: 12px 0;
		border-bottom: 1px solid var(--stroke-soft-200);
	}
}

/* ========================================
   SKIP LINK
   ======================================== */

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999999;
	padding: 8px 16px;
	background: var(--bg-strong-900);
	color: var(--text-white-0);
	text-decoration: none;
	font-family: var(--font-primary);
}

.skip-link:focus {
	left: 0;
}
