/* Mpinfo Header — dalla bozza "Header Mpinfo New" di Max.
   Tutte le regole partono da #mphd / #mphd-drawer e usano !important dove BeTheme impone i suoi stili. */

@font-face{font-family:'Manrope';src:url('../fonts/Manrope-VariableFont_wght.ttf') format('truetype');font-weight:200 800;font-style:normal;font-display:swap}

#mphd,#mphd-drawer{
	--mphd-ink:#121633;
	--mphd-muted:#5d6280;
	--mphd-sale:#c8102e;
	--mphd-search:#eef0f4;
	--mphd-surface:#f5f6fa;
	--mphd-line:#e4e6ee;
	--mphd-font:'Manrope',system-ui,-apple-system,'Segoe UI',sans-serif;
	font-family:var(--mphd-font)!important;
	color:var(--mphd-ink);
	-webkit-font-smoothing:antialiased;
	line-height:1.5;
	letter-spacing:normal;
	text-transform:none;
}
#mphd *,#mphd *::before,#mphd *::after,#mphd-drawer *,#mphd-drawer *::before,#mphd-drawer *::after{box-sizing:border-box}
#mphd :focus-visible,#mphd-drawer :focus-visible{outline:2px solid var(--mphd-ink);outline-offset:2px}

/* header fisso in alto */
#mphd{position:sticky;top:var(--wp-admin--admin-bar--height,0px);z-index:9990;display:block;width:100%;background:#fff!important;border-bottom:1px solid var(--mphd-line);font-size:15px;transition:box-shadow .2s;margin:0;padding:0}
#mphd.is-compact{box-shadow:0 6px 20px rgba(11,26,72,.08)}
#mphd .mphd-in{max-width:1200px;margin:0 auto;padding:0 24px}
#mphd a{text-decoration:none!important;box-shadow:none}
#mphd svg{display:block;flex:none}

/* riga sottile */
#mphd .mphd-top{font-size:12.5px;font-weight:600;max-height:40px;overflow:hidden;transition:max-height .25s ease,opacity .2s}
#mphd .mphd-top .mphd-in{display:flex;align-items:center;gap:22px;padding-top:8px}
#mphd .mphd-top a,#mphd .mphd-top .mphd-perk{color:var(--mphd-ink)!important;display:flex;align-items:center;gap:6px;white-space:nowrap;font-size:12.5px;font-weight:600}
#mphd .mphd-top a:hover{text-decoration:underline!important;text-underline-offset:3px}
#mphd .mphd-rot{margin-left:auto;color:var(--mphd-muted);font-weight:500;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:opacity .3s}
#mphd .mphd-rot b{color:var(--mphd-ink);font-weight:700}
#mphd.is-compact .mphd-top{max-height:0;opacity:0}

/* riga logo · ricerca · icone */
#mphd .mphd-row{display:grid;grid-template-columns:minmax(max-content,1fr) minmax(0,560px) minmax(max-content,1fr);align-items:center;gap:28px;padding-top:2px;padding-bottom:6px}
#mphd .mphd-logo{justify-self:start;margin-left:-8px;display:block;line-height:0}
#mphd .mphd-logo img{height:92px!important;width:auto!important;max-width:none!important;display:block;margin:0;transition:height .25s ease}
#mphd.is-compact .mphd-logo img{height:60px!important}

#mphd .mphd-search{width:100%;display:flex;align-items:center;gap:10px;background:var(--mphd-search);border-radius:999px;padding:0 18px;margin:0;min-width:0;color:var(--mphd-ink);transition:box-shadow .15s,background-color .15s}
#mphd .mphd-search input[type=search]{flex:1;min-width:0;width:auto!important;height:44px!important;margin:0!important;padding:12px 0!important;border:0!important;border-radius:0!important;outline:0!important;background:transparent!important;box-shadow:none!important;font-family:var(--mphd-font)!important;font-size:15px!important;font-weight:400!important;line-height:20px!important;color:var(--mphd-ink)!important;-webkit-appearance:none;appearance:none}
#mphd .mphd-search input[type=search]::placeholder{color:#7d8199;opacity:1}
#mphd .mphd-search input[type=search]::-webkit-search-decoration{-webkit-appearance:none}
#mphd .mphd-search:focus-within{box-shadow:0 0 0 2px var(--mphd-ink);background:#fff}

#mphd .mphd-actions{justify-self:end;display:flex;align-items:center;gap:8px}
#mphd .mphd-link{color:var(--mphd-ink)!important;font-weight:600;font-size:15px;white-space:nowrap;padding:8px 10px;border-radius:8px;transition:background-color .15s}
#mphd .mphd-link:hover{background:var(--mphd-surface)}

#mphd .mphd-icon,#mphd-drawer .mphd-icon{width:42px!important;height:42px!important;min-width:0!important;display:grid!important;place-items:center;position:relative;margin:0!important;padding:0!important;border:0!important;border-radius:50%!important;background:transparent!important;box-shadow:none!important;color:var(--mphd-ink)!important;line-height:1!important;cursor:pointer;transition:background-color .15s}
#mphd .mphd-icon:hover,#mphd-drawer .mphd-icon:hover{background:var(--mphd-surface)!important;color:var(--mphd-ink)!important}
#mphd .mphd-burger,#mphd .mphd-search-btn{display:none!important}
#mphd .mphd-search-btn[aria-expanded="true"]{background:var(--mphd-surface)!important}
@keyframes mphd-popin{from{opacity:0;transform:translateY(-6px)}}

/* numerino del carrello (aggiornato da WooCommerce: classe header-cart-count) */
#mphd .mphd-cart .header-cart-count{position:absolute!important;top:3px!important;right:2px!important;left:auto!important;display:grid!important;place-items:center;min-width:18px;height:18px;padding:0 4px;margin:0!important;border:2px solid #fff;border-radius:9px;background:var(--mphd-sale)!important;color:#fff!important;font:700 11px/1 var(--mphd-font)!important;font-style:normal}
#mphd .mphd-cart.is-empty .header-cart-count{display:none!important}

/* menu */
#mphd .mphd-nav{display:block}
#mphd .mphd-menu{list-style:none!important;margin:0 auto!important;padding:0 24px!important;max-width:1200px;display:flex;justify-content:center;gap:clamp(18px,2.4vw,30px)}
#mphd .mphd-menu li{position:relative;list-style:none!important;margin:0!important;padding:0!important;background:none!important}
#mphd .mphd-menu li::before{content:none!important}
#mphd .mphd-menu > li > a{display:flex;align-items:center;gap:6px;padding:12px 0 13px;color:var(--mphd-ink)!important;font-weight:500;font-size:15px;line-height:1.5;white-space:nowrap;border-bottom:2px solid transparent;transition:border-color .15s,color .15s}
#mphd .mphd-menu > li > a:hover{border-bottom-color:#c9ccd8}
#mphd .mphd-menu > li > a.is-hot{color:var(--mphd-sale)!important;font-weight:600}
#mphd .mphd-menu > li > a.is-hot:hover{border-bottom-color:var(--mphd-sale)}
#mphd .mphd-menu > li > a.is-current{font-weight:700;border-bottom-color:var(--mphd-ink)}
#mphd .mphd-chev{transition:transform .2s}
#mphd .mphd-sub{position:absolute;top:100%;left:50%;transform:translate(-50%,6px);min-width:240px;margin:0!important;padding:8px!important;list-style:none!important;background:#fff;border-radius:12px;box-shadow:0 0 0 1px var(--mphd-line),0 16px 40px rgba(11,26,72,.14);opacity:0;visibility:hidden;transition:opacity .15s,transform .15s,visibility .15s;z-index:2}
#mphd .mphd-sub a{display:block;padding:10px 12px;border-radius:8px;color:var(--mphd-ink)!important;font-weight:500;font-size:14.5px;white-space:nowrap}
#mphd .mphd-sub a:hover{background:var(--mphd-surface)}
#mphd .has-sub:hover > .mphd-sub,#mphd .has-sub:focus-within > .mphd-sub{opacity:1;visibility:visible;transform:translate(-50%,0)}
#mphd .has-sub:hover .mphd-chev,#mphd .has-sub:focus-within .mphd-chev{transform:rotate(180deg)}

/* telefono e tablet stretto */
@media (max-width:899px){
	#mphd .mphd-in{padding:0 16px}
	#mphd .mphd-top .mphd-in{justify-content:center;padding-top:7px}
	#mphd .mphd-top a,#mphd .mphd-top .mphd-perk{display:none}
	#mphd .mphd-rot{margin-left:0;text-align:center}
	#mphd .mphd-row{grid-template-columns:44px 1fr auto;gap:8px 10px;padding-top:4px;padding-bottom:6px}
	#mphd .mphd-burger,#mphd .mphd-search-btn{display:grid!important}
	#mphd .mphd-logo{justify-self:center;margin-left:0}
	/* su telefono l'header resta sempre della stessa misura scorrendo */
	#mphd .mphd-logo img,#mphd.is-compact .mphd-logo img{height:64px!important}
	#mphd.is-compact .mphd-top{max-height:40px;opacity:1}
	/* la ricerca compare solo toccando la lente */
	#mphd .mphd-search{grid-column:1 / -1;grid-row:2;display:none}
	#mphd.is-search-open .mphd-search{display:flex;animation:mphd-popin .2s ease}
	#mphd .mphd-search input[type=search]{font-size:16px!important}
	#mphd .mphd-link,#mphd .mphd-nav{display:none}
	#mphd .mphd-actions{gap:2px}
}
/* Su telefono e tablet BeTheme mette body{overflow-x:hidden} (classe responsive-overflow-x-*),
   che impedisce all'header di restare fisso. "clip" taglia allo stesso modo ma lascia funzionare lo sticky. */
@supports (overflow:clip){
	@media (max-width:959px){
		body.mphd-on{overflow-x:clip!important}
	}
}

/* pannello laterale (telefono) */
#mphd-drawer{position:fixed;inset:0;z-index:2147483000;font-size:15px}
#mphd-drawer[hidden]{display:none!important}
#mphd-drawer .mphd-scrim{position:absolute;inset:0;background:rgba(11,26,72,.45)}
#mphd-drawer .mphd-panel{position:absolute;top:0;bottom:0;left:0;width:min(340px,88%);background:#fff;display:flex;flex-direction:column;box-shadow:12px 0 40px rgba(11,26,72,.18);animation:mphd-slide .22s ease}
@keyframes mphd-slide{from{transform:translateX(-24px);opacity:.4}}
#mphd-drawer .mphd-dhead{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 12px 18px;border-bottom:1px solid var(--mphd-line)}
#mphd-drawer .mphd-dhead img{height:44px!important;width:auto!important;max-width:none!important;display:block}
#mphd-drawer .mphd-dbody{overflow:auto;padding:10px 10px 18px;display:flex;flex-direction:column;gap:2px}
#mphd-drawer .mphd-dbody a,#mphd-drawer .mphd-dsub-btn{display:flex!important;align-items:center;justify-content:space-between;width:100%;margin:0!important;padding:13px 10px!important;border:0!important;border-radius:10px!important;background:transparent!important;box-shadow:none!important;color:var(--mphd-ink)!important;font-family:var(--mphd-font)!important;font-size:15.5px!important;font-weight:600!important;line-height:1.4!important;letter-spacing:normal!important;text-transform:none!important;text-align:left;text-decoration:none!important;cursor:pointer;height:auto!important}
#mphd-drawer .mphd-dbody a:hover,#mphd-drawer .mphd-dsub-btn:hover{background:var(--mphd-surface)!important}
#mphd-drawer .mphd-dbody a.is-hot{color:var(--mphd-sale)!important}
#mphd-drawer .mphd-chev{transition:transform .2s}
#mphd-drawer .mphd-dsub-btn[aria-expanded="true"] .mphd-chev{transform:rotate(180deg)}
#mphd-drawer .mphd-dsub{display:flex;flex-direction:column;padding-left:10px}
#mphd-drawer .mphd-dsub[hidden]{display:none!important}
#mphd-drawer .mphd-dsub a{font-weight:500!important;font-size:14.5px!important;color:var(--mphd-muted)!important;padding:10px!important}
#mphd-drawer .mphd-dfoot{margin-top:auto;border-top:1px solid var(--mphd-line);padding:14px 18px;display:flex;flex-direction:column;gap:2px;font-size:14px}
#mphd-drawer .mphd-dfoot span{color:var(--mphd-muted)}
#mphd-drawer .mphd-dfoot a{color:var(--mphd-ink)!important;font-weight:700;text-decoration:none!important}
html.mphd-locked,html.mphd-locked body{overflow:hidden!important}

/* etichetta anteprima (solo amministratore) */
.mphd-preview-flag{position:fixed;right:16px;bottom:16px;z-index:100040;background:#121633;color:#fff;font:600 13px/1.3 system-ui,sans-serif;padding:10px 14px;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.25)}
.mphd-preview-flag a{color:#fff!important;text-decoration:underline!important}

@media (prefers-reduced-motion:reduce){
	#mphd *,#mphd-drawer *,#mphd{animation:none!important;transition:none!important}
}
