/* ==========================================================================
   VARIABILI GLOBALI
   ========================================================================== */
:root {
	--sidebar-width: 90px;
	--topbar-height: 80px;
	--toolbar-height: 40px; 
	--brand-box-height: 80px; /* Valore di default gestibile da Elementor */
}

/* ==========================================================================
   BRAND BOX (PITTOGRAMMA D'ANGOLO)
   ========================================================================== */
.custom-header-wrapper .brand-corner-box {
	position: fixed;
	top: 40px;
	left: 0;
	width: var(--sidebar-width);
	height: var(--brand-box-height);
	background-color: #ffffff; /* Sfondo bianco di default, sovrascrivibile */
	z-index: 10010; /* Sopra a tutto per creare l'incrocio visivo perfetto */
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	border-right: 1px solid #e5e5e5;
	border-bottom: 1px solid #e5e5e5;
	box-sizing: border-box;
}

.custom-header-wrapper .brand-corner-box img {
	max-width: 45px; /* Dimensione default, controllabile da Elementor */
	height: auto;
	display: block;
}

/* ==========================================================================
   BARRA LATERALE (SIDEBAR)
   ========================================================================== */
.custom-header-wrapper .side-nav {
	position: fixed; 
	top: var(--brand-box-height); /* Slitta sotto il Brand Box d'angolo! */
	left: 0; 
	width: var(--sidebar-width); 
	height: calc(100vh - var(--brand-box-height)); /* Adatta l'altezza */
	background-color: #1a1a1a; 
	color: #fff; 
	z-index: 10000;
	display: flex; 
	flex-direction: column; 
	align-items: center; 
	padding: 20px 0 40px 0;
	border-right: 1px solid rgba(255,255,255,0.1);
}

.custom-header-wrapper .side-nav-menu {
	display: flex;
	flex-direction: column;
	justify-content: center; 
	align-items: center;
	gap: 25px;
	flex: 1; 
	width: 100%;
}

.custom-header-wrapper .side-nav .nav-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	padding: 12px 5px;
	background: none; 
	border: none; 
	cursor: pointer; 
	color: inherit;
	transition: color 0.2s ease;
}

.custom-header-wrapper .side-nav .nav-btn-text {
	font-size: 0.85rem;
	text-align: center;
	white-space: normal; 
	word-wrap: break-word;
	line-height: 1.2;
	padding: 0 5px;
}

.custom-header-wrapper .nav-btn-icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

.custom-header-wrapper .nav-btn-icon svg {
	width: 40px;
	height: 40px;
	fill: currentColor; 
	transition: all 0.2s ease;
}

.custom-header-wrapper .nav-btn-icon i {
	font-size: 22px;
	transition: all 0.2s ease;
}

/* ==========================================================================
   TOOLBAR SUPERIORE
   ========================================================================== */
.custom-header-wrapper .top-toolbar {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: var(--toolbar-height);
	background-color: #f4f4f4; 
	z-index: 9990;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 0 40px;
}

.custom-header-wrapper .toolbar-items {
	display: flex;
	align-items: center;
	gap: 25px;
}

.custom-header-wrapper .toolbar-item {
	font-size: 0.8rem;
	text-decoration: none;
	color: #555;
	font-weight: 500;
	transition: all 0.2s ease;
}

.custom-header-wrapper .toolbar-item.tb-text:hover { color: #ffca28; }

.custom-header-wrapper .toolbar-item.tb-btn {
	background-color: #1a1a1a;
	color: #fff;
	padding: 6px 18px;
	border-radius: 4px;
	font-weight: 600;
}

.custom-header-wrapper .toolbar-item.tb-btn:hover {
	background-color: #ffca28;
	color: #1a1a1a;
}

/* ==========================================================================
   BARRA SUPERIORE (TOPBAR) A 3 COLONNE
   ========================================================================== */
.custom-header-wrapper .top-nav {
	position: fixed; 
	top: 0; 
	left: var(--sidebar-width); 
	width: calc(100% - var(--sidebar-width));
	height: var(--topbar-height); 
	background-color: #ffffff; 
	z-index: 9980; 
	display: flex; 
	align-items: center; 
	justify-content: space-between; 
	padding: 0 40px; 
	transition: top 0.3s ease;
}

.custom-header-wrapper.has-toolbar .top-nav {
	top: var(--toolbar-height);
}

.custom-header-wrapper .top-nav-left {
	flex: 1;
	display: flex;
	justify-content: flex-start;
	align-items: center;
}

.custom-header-wrapper .top-nav-logo img {
	max-height: 40px; 
	width: auto;
	display: block;
}

.custom-header-wrapper .top-nav-center {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 30px;
}

.custom-header-wrapper .top-nav-center .nav-btn {
	background: none; 
	border: none; 
	font-weight: 600; 
	font-size: 0.95rem; 
	cursor: pointer; 
	color: #333; 
	padding: 10px 5px;
	display: inline-block;
	transition: color 0.2s ease;
}

.custom-header-wrapper .top-nav-center .nav-btn:hover { color: #ffca28; }

.custom-header-wrapper .top-nav-right {
	flex: 1;
	display: flex;
	justify-content: flex-end;
	align-items: center;
	gap: 20px;
}

.custom-header-wrapper .top-icon-btn {
	color: #333;
	cursor: pointer;
	text-decoration: none;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
}

.custom-header-wrapper .top-icon-btn:hover { color: #ffca28; }

.custom-header-wrapper .top-icon-btn svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
	transition: fill 0.2s ease;
}

.custom-header-wrapper .top-icon-btn i { font-size: 20px; }

/* ==========================================================================
   OVERLAY E PANNELLI MODALI
   ========================================================================== */
.custom-header-wrapper .menu-overlay {
	position: fixed; bottom: 0; left: 0; width: 100%; height: calc(100% - 120px);
	background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); z-index: 9991;
	opacity: 0; visibility: hidden; transition: all 0.3s ease;
}

.custom-header-wrapper .menu-overlay.active { opacity: 1; visibility: visible; }

.custom-header-wrapper .mega-panel {
	position: fixed; bottom: 0; left: var(--sidebar-width); height: calc(100vh - 120px);
	width: max-content; background-color: #ffffff; z-index: 9995; 
	box-shadow: 15px 0 40px rgba(0,0,0,0.15);
	transform: translateX(-100%); opacity: 0; visibility: hidden;
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.custom-header-wrapper .mega-panel.active { transform: translateX(0); opacity: 1; visibility: visible; }

.custom-header-wrapper .close-panel {
	position: absolute; top: 5px; right: 5px; background: none; border: none;
	font-size: 1.1rem; cursor: pointer; color: #000000; font-weight: 700; z-index: 10;
}

.custom-header-wrapper .close-panel:hover { color: #111; }

.custom-header-wrapper .panel-columns { display: flex; height: 100%; }

.custom-header-wrapper .col-info { 
	width: 350px; padding: 70px 40px; background-color: #ffffff;
	display: flex; flex-direction: column; gap: 15px; 
}
.custom-header-wrapper .col-info h3 { margin: 0; font-size: 1.6rem; color: #000000; font-family: 'Montserrat'; font-weight: 500; }
.custom-header-wrapper .col-info p { margin: 0; color: #000000; line-height: 1.5; font-size: 0.95rem; font-family: 'Montserrat'; }

.custom-header-wrapper .cta-button {
	align-self: flex-start; padding: 12px 24px; background: #f39005; color: #fff; text-decoration: none; font-weight: 600;
    font-family: 'Montserrat'; font-size: 1rem; border-radius: 4px; transition: background 0.2s; margin-top: 10px; border-radius: 50px; }
.custom-header-wrapper .cta-button:hover { background: #000000; color: #ffffff; }

.custom-header-wrapper .col-submenu { 
	width: 300px; padding: 70px 40px; background-color: #fafafa; border-left: 1px solid #eee; 
}

.custom-header-wrapper .col-submenu-tertiary { 
	width: 0; padding: 70px 0; background-color: #f4f4f4; border-left: none; 
	opacity: 0; visibility: hidden; overflow: hidden; transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1); 
}
.custom-header-wrapper .col-submenu-tertiary.active { 
	width: 300px; padding: 70px 40px; border-left: 1px solid #e0e0e0; opacity: 1; visibility: visible; 
}

.custom-header-wrapper .col-submenu ul, .custom-header-wrapper .col-submenu-tertiary ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 15px; }
.custom-header-wrapper .col-submenu ul li a, .custom-header-wrapper .col-submenu-tertiary ul li a { 
	text-decoration: none; color: #000000; font-family: 'Montserrat'; font-weight: 500; 
	transition: all 0.2s; display: block; font-size: 0.9rem; }
.custom-header-wrapper .col-submenu ul li a:hover, .custom-header-wrapper .col-submenu-tertiary ul li a:hover { color: #f39005; }

.custom-header-wrapper .menu-item-with-submenu { display: flex; align-items: baseline; justify-content: space-between; }
.custom-header-wrapper .submenu-toggle { background: none; border: none; font-size: 0.9rem; cursor: pointer; color: #000; transition: all 0.3s ease; padding: 5px; }
.custom-header-wrapper .submenu-toggle:hover, .custom-header-wrapper .submenu-toggle.active { color: #f39005; }
.custom-header-wrapper .submenu-container { display: none; }