/* ═══════════════════════════════════════════════════════════════════
   ECLOGA ITALIA — HEADER
   Caricato globalmente su tutte le pagine.
   ═══════════════════════════════════════════════════════════════════ */


/* Neutralizza il padding Divi per la fixed nav — non usiamo la nav fissa di Divi */
.et_fixed_nav.et_show_nav #page-container {
	padding-top: 0 !important;
}

/* ─── Wrapper generale header ─── */
.ecloga-header {
	position: relative;
	z-index: 100;
	font-family: 'Outfit', sans-serif;
}


/* ═══════════════════════════════════════════
   BARRA 1 — TOPBAR (navy)
   ═══════════════════════════════════════════ */

.header-topbar {
	background: #0B1A32;
	padding: .4rem 0;
	font-size: .8rem;
}

/* Wrapper interno topbar */
.header-topbar .ecloga-wrap {
	max-width: 1440px;
	margin: auto;
	padding: 0 2rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

/* ─── Gruppo contatti (sinistra topbar) ─── */
.topbar-left {
	display: flex;
	gap: 1.25rem;
	align-items: center;
}

/* Singolo contatto: email, telefono, sede */
.topbar-contact {
	display: flex;
	gap: .4rem;
	align-items: center;
	color: #C5CCD8;
	text-decoration: none;
	font-size: .8rem;
}

.topbar-contact:hover {
	color: #fff;
	text-decoration: none;
}

.topbar-contact svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
	opacity: .7;
}

/* Span sede (non cliccabile) */
span.topbar-contact {
	cursor: default;
}

/* ─── Menu utilita (destra topbar) ─── */
.topbar-nav {
	margin-left: auto;
}

.topbar-nav ul.topbar-menu {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: .5rem;
}

.topbar-menu a {
	display: inline-block;
	border: 1px solid rgba(255, 255, 255, .3);
	border-radius: 4px;
	padding: .2rem .7rem;
	color: #fff;
	font-size: .78rem;
	text-decoration: none;
	white-space: nowrap;
}

.topbar-menu a:hover {
	background: rgba(255, 255, 255, .1);
	text-decoration: none;
}


/* ═══════════════════════════════════════════
   BARRA 2 — HEADER PRINCIPALE (bianco)
   ═══════════════════════════════════════════ */

.header-main {
	background: #fff;
	border-bottom: 1px solid #EEF1F5;
	padding: .75rem 0;
}

/* Wrapper interno header principale */
.header-main .ecloga-wrap {
	max-width: 1440px;
	margin: auto;
	padding: 0 2rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
}

/* ─── Logo ─── */
.header-logo-link {
	display: flex;
	flex-shrink: 0;
}

.header-logo-img {
	height: 42px !important;
	width: auto !important;
	max-height: 42px !important;
}


/* ═══════════════════════════════════════════
   MENU PRINCIPALE
   ═══════════════════════════════════════════ */

.header-nav {
	flex: 1;
}

ul.header-menu {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: .25rem;
	align-items: center;
	justify-content: flex-end;
}

/* Voci di primo livello */
.header-menu > li > a {
	display: block;
	position: relative;
	padding: .4rem .6rem;
	color: #1A1D26;
	font-size: .9rem;
	font-weight: 500;
	text-decoration: none;
	border-radius: 6px;
	white-space: nowrap;
}

/* Linea blu animata in crescita da sinistra */
.header-menu > li > a::before {
	content: "";
	position: absolute;
	left: .6rem;
	right: 100%;
	bottom: 3px;
	height: 2px;
	background: #1666C0;
	transition: right .3s ease-out;
}

.header-menu > li > a:hover::before,
.header-menu > li.current-menu-item > a::before,
.header-menu > li.current-menu-ancestor > a::before {
	right: .6rem;
}

.header-menu > li > a:hover {
	color: #1666C0;
	text-decoration: none;
}

/* Voce attiva */
.header-menu > li.current-menu-item > a,
.header-menu > li.current-menu-ancestor > a {
	color: #1666C0;
}

/* Posizionamento relativo per dropdown */
.header-menu > li {
	position: relative;
}

/* Freccia verso il basso sui link di primo livello con sottovoci */
.header-menu > li.menu-item-has-children > a::after {
	content: '';
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: .35rem;
	vertical-align: middle;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 4px solid currentColor;
	opacity: .6;
	position: relative;
	top: 1px;
}

/* ─── Dropdown primo e secondo livello ─── */
.header-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	background: #fff;
	border: 1px solid #EEF1F5;
	border-radius: 8px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
	min-width: 220px;
	padding: .4rem 0;
	list-style: none;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
	z-index: 200;
}

/* Apre il dropdown al hover sulla voce padre (primo livello) */
.header-menu > li:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* ─── Terzo livello: fly-out laterale ─── */
.header-menu .sub-menu li {
	position: relative;
}

.header-menu .sub-menu .sub-menu {
	top: 0;
	left: 100%;
	transform: translateX(4px);
}

.header-menu .sub-menu li:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}

/* Indicatore freccia destra sulle voci di secondo livello con sottovoci */
.header-menu .sub-menu li.menu-item-has-children > a::after {
	content: '';
	display: inline-block;
	width: 0;
	height: 0;
	margin-left: auto;
	float: right;
	margin-top: .35rem;
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	border-left: 4px solid currentColor;
	opacity: .5;
}

/* Link dentro il dropdown */
.header-menu .sub-menu a {
	display: block;
	padding: .45rem 1rem;
	font-size: .85rem;
	color: #3A4560;
	text-decoration: none;
}

.header-menu .sub-menu a:hover {
	background: #EEF1F5;
	color: #1666C0;
	text-decoration: none;
}


/* ═══════════════════════════════════════════
   AZIONI DESTRA (carrello + CTA + hamburger)
   ═══════════════════════════════════════════ */

.header-actions {
	display: flex;
	align-items: center;
	gap: .75rem;
	flex-shrink: 0;
}

/* ─── Icona carrello WooCommerce ─── */
.header-cart {
	position: relative;
	color: #1A1D26;
	display: flex;
	align-items: center;
	padding: .3rem;
	text-decoration: none;
}

.header-cart:hover {
	color: #1666C0;
}

.header-cart svg {
	width: 22px;
	height: 22px;
}

/* Badge contatore articoli nel carrello */
.header-cart-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: #1666C0;
	color: #fff;
	border-radius: 50%;
	width: 18px;
	height: 18px;
	font-size: .65rem;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	line-height: 1;
}

/* ─── Link extra solo mobile (es. Test Formativo) ─── */
.header-nav-mobile-extra {
	display: none;
}

/* ─── Link CTA Contattaci ─── */
.header-cta {
	display: inline-block;
	background: #1666C0;
	color: #fff;
	padding: .5rem 1.2rem;
	border-radius: 8px;
	font-size: .9rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.header-cta:hover {
	background: #124E94;
	color: #fff;
	text-decoration: none;
}

/* Sopprime la freccia che Divi aggiunge ai link */
.header-cta::after {
	display: none !important;
}


/* ═══════════════════════════════════════════
   HAMBURGER BUTTON (mobile)
   ═══════════════════════════════════════════ */

.header-hamburger {
	display: none; /* nascosto su desktop */
	background: none;
	border: none;
	cursor: pointer;
	flex-direction: column;
	gap: 5px;
	padding: .25rem;
}

/* Singola stanghetta dell'hamburger */
.hamburger-bar {
	display: block;
	width: 22px;
	height: 2px;
	background: #1A1D26;
	border-radius: 2px;
	transition: transform .2s ease, opacity .2s ease;
}

/* Animazione hamburger -> X quando il menu e aperto */
.header-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(1) {
	transform: rotate(45deg) translate(5px, 5px);
}

.header-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(2) {
	opacity: 0;
}

.header-hamburger[aria-expanded="true"] .hamburger-bar:nth-child(3) {
	transform: rotate(-45deg) translate(5px, -5px);
}


/* ═══════════════════════════════════════════
   RESPONSIVE — MOBILE (max 1100px)
   ═══════════════════════════════════════════ */

@media (max-width: 1100px) {

	/* Topbar nascosta su mobile */
	.header-topbar {
		display: none;
	}

	/* Hamburger visibile su mobile */
	.header-hamburger {
		display: flex;
	}

	/* Il logo si riduce un po' */
	.header-logo-img {
		height: 36px;
	}

	/* Wrapper barra principale adattato */
	.header-main .ecloga-wrap {
		flex-wrap: wrap;
		gap: .5rem;
	}

	/* Menu principale: pannello a scomparsa sotto la barra */
	.header-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: #fff;
		border-bottom: 1px solid #EEF1F5;
		padding: 1rem;
		z-index: 99;
	}

	.header-nav.is-open {
		display: block;
	}

	/* Menu in colonna su mobile */
	ul.header-menu {
		flex-direction: column;
		align-items: flex-start;
		gap: 0;
	}

	.header-menu > li > a {
		padding: .7rem .5rem;
		border-bottom: 1px solid #EEF1F5;
		width: 100%;
		border-radius: 0;
	}

	/* Dropdown su mobile: inline (nessuna posizione assoluta) */
	.header-menu .sub-menu {
		position: static;
		box-shadow: none;
		border: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		padding-left: 1rem;
	}

	/* Terzo livello nascosto su mobile */
	.header-menu .sub-menu .sub-menu {
		display: none !important;
	}

	/* Link extra mobile visibile solo nell'hamburger */
	.header-nav-mobile-extra {
		display: block;
		padding: .7rem .5rem;
		border-bottom: 1px solid #EEF1F5;
		color: #1A1D26;
		font-size: .9rem;
		font-weight: 500;
		text-decoration: none;
	}

	.header-nav-mobile-extra:hover {
		color: #1666C0;
	}
}
