/* Header nativo Techno Bridge */
:root{
  --tb-blue:#1478ff;
  --tb-violet:#8d7cf6;
  --tb-ink:#0d0a23;
  --tb-muted:#686779;
  --tb-border:#dde2ef;
}

.tb-skip-link{
  position:absolute;
  left:-9999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.tb-skip-link:focus{
  left:18px;
  top:18px;
  width:auto;
  height:auto;
  z-index:100000;
  padding:12px 16px;
  background:#fff;
  border-radius:12px;
}

.tb-site-header{
  position:fixed;
  top:18px;
  left:0;
  right:0;
  z-index:9999;
  padding:0 24px;
  pointer-events:none;
  font-family:Manrope,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

.admin-bar .tb-site-header{top:50px;}

.tb-header-shell{
  width:min(1500px,calc(100% - 48px));
  min-height:74px;
  margin:0 auto;
  padding:14px 30px;
  display:grid;
  grid-template-columns:auto 1fr auto auto;
  align-items:center;
  gap:22px;
  border:1px solid rgba(220,228,239,.82);
  border-radius:999px;
  background:rgba(255,255,255,.92);
  box-shadow:0 18px 50px rgba(7,17,31,.08);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  pointer-events:auto;
}

.tb-header-brand{
  display:inline-flex;
  align-items:center;
  gap:12px;
  color:var(--tb-ink);
  text-decoration:none;
  min-width:max-content;
}

.tb-header-brand-mark{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:linear-gradient(135deg,var(--tb-blue),var(--tb-violet));
  color:#fff;
  font-size:15px;
  line-height:1;
  font-weight:900;
  letter-spacing:-.4px;
  box-shadow:0 10px 28px rgba(141,124,246,.32);
}

.tb-header-brand-text{
  display:block;
  color:#101426;
  font-size:14px;
  line-height:.95;
  letter-spacing:-.5px;
  font-weight:900;
}

.tb-header-nav{justify-self:center;}
.tb-header-menu,.tb-mobile-menu{
  list-style:none;
  padding:0;
  margin:0;
}
.tb-header-menu{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
}
.tb-header-menu li{position:relative;margin:0;}
.tb-header-menu > li > a{
  display:inline-flex;
  align-items:center;
  min-height:38px;
  padding:8px 12px;
  border-radius:999px;
  color:#2d3445;
  text-decoration:none;
  font-size:13px;
  line-height:1.15;
  font-weight:800;
  letter-spacing:-.1px;
  transition:background .2s ease,color .2s ease,box-shadow .2s ease;
}
.tb-header-menu > li.menu-item-has-children > a:after{
  content:"";
  width:7px;
  height:7px;
  margin-left:8px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  opacity:.55;
}
.tb-header-menu > li:hover > a,
.tb-header-menu > li.current-menu-item > a,
.tb-header-menu > li.current-menu-ancestor > a{
  background:rgba(141,124,246,.10);
  color:#111426;
}
.tb-header-menu .sub-menu{
  position:absolute;
  top:calc(100% + 14px);
  left:50%;
  transform:translateX(-50%) translateY(8px);
  min-width:270px;
  padding:12px;
  list-style:none;
  border:1px solid rgba(220,228,239,.9);
  border-radius:24px;
  background:rgba(255,255,255,.96);
  box-shadow:0 24px 70px rgba(7,17,31,.12);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .18s ease,visibility .18s ease,transform .18s ease;
}
.tb-header-menu li:hover > .sub-menu,
.tb-header-menu li:focus-within > .sub-menu{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translateX(-50%) translateY(0);
}
.tb-header-menu .sub-menu a{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:11px 13px;
  border-radius:16px;
  color:#2d3445;
  text-decoration:none;
  font-size:13px;
  font-weight:800;
  line-height:1.25;
}
.tb-header-menu .sub-menu a:hover{
  background:linear-gradient(135deg,rgba(20,120,255,.10),rgba(141,124,246,.12));
  color:#0d0a23;
}

.tb-header-cta{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:12px 18px;
  border-radius:999px;
  background:#1478ff;
  color:#fff;
  text-decoration:none;
  font-size:13px;
  font-weight:900;
  letter-spacing:-.1px;
  box-shadow:0 14px 34px rgba(20,120,255,.26);
  white-space:nowrap;
}

.tb-header-toggle{
  width:46px;
  height:46px;
  display:none;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:5px;
  border:1px solid rgba(13,10,35,.12);
  border-radius:16px;
  background:rgba(255,255,255,.72);
  color:#0d0a23;
  cursor:pointer;
}
.tb-header-toggle span{
  width:19px;
  height:2px;
  border-radius:999px;
  background:currentColor;
}

.tb-mobile-backdrop{
  position:fixed;
  inset:0;
  background:rgba(13,10,35,.36);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .2s ease,visibility .2s ease;
}
.tb-mobile-panel{
  position:fixed;
  top:0;
  right:0;
  width:min(420px,calc(100vw - 24px));
  height:100vh;
  padding:24px;
  background:#fff;
  box-shadow:-28px 0 80px rgba(7,17,31,.18);
  transform:translateX(105%);
  transition:transform .24s ease;
  pointer-events:auto;
  overflow:auto;
}
.tb-mobile-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:28px;
}
.tb-mobile-close{
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border:1px solid var(--tb-border);
  border-radius:16px;
  background:#fff;
  color:var(--tb-ink);
  font-size:28px;
  line-height:1;
  cursor:pointer;
}
body.tb-mobile-open{overflow:hidden;}
body.tb-mobile-open .tb-mobile-backdrop{opacity:1;visibility:visible;pointer-events:auto;}
body.tb-mobile-open .tb-mobile-panel{transform:translateX(0);}

.tb-mobile-menu li{border-bottom:1px solid rgba(220,228,239,.75);}
.tb-mobile-menu a{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 0;
  color:#0d0a23;
  text-decoration:none;
  font-size:17px;
  font-weight:850;
  letter-spacing:-.4px;
}
.tb-mobile-menu .menu-item-has-children > a:after{
  content:"+";
  width:28px;
  height:28px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:rgba(141,124,246,.12);
  color:#6f63d9;
}
.tb-mobile-menu .menu-item-has-children.is-open > a:after{content:"–";}
.tb-mobile-menu .sub-menu{
  display:none;
  list-style:none;
  margin:0;
  padding:0 0 12px 14px;
}
.tb-mobile-menu .menu-item-has-children.is-open > .sub-menu{display:block;}
.tb-mobile-menu .sub-menu li{border-bottom:0;}
.tb-mobile-menu .sub-menu a{
  padding:10px 0;
  font-size:14px;
  font-weight:800;
  color:#5d5c6d;
}
.tb-mobile-cta{
  display:flex;
  align-items:center;
  justify-content:center;
  margin-top:26px;
  min-height:52px;
  padding:14px 20px;
  border-radius:999px;
  background:#1478ff;
  color:#fff;
  text-decoration:none;
  font-size:14px;
  font-weight:900;
  box-shadow:0 14px 34px rgba(20,120,255,.24);
}

@media(max-width:1120px){
  .tb-header-shell{grid-template-columns:auto 1fr auto; padding:12px 18px; min-height:68px;}
  .tb-header-nav,.tb-header-cta{display:none;}
  .tb-header-toggle{display:flex; justify-self:end;}
}
@media(max-width:600px){
  .tb-site-header{top:10px; padding:0 12px;}
  .admin-bar .tb-site-header{top:56px;}
  .tb-header-shell{border-radius:24px;}
  .tb-header-brand-mark{width:40px;height:40px;}
  .tb-header-brand-text{font-size:13px;}
}

/* Fix logo reale sito */
.tb-header-logo-img,
.tb-header-logo-img .custom-logo-link{
  display:inline-flex;
  align-items:center;
  line-height:0;
}
.tb-header-logo-img img,
.tb-header-brand .custom-logo{
  display:block;
  width:auto;
  max-width:170px;
  max-height:48px;
  object-fit:contain;
}
.tb-mobile-panel .tb-header-logo-img img,
.tb-mobile-panel .tb-header-brand .custom-logo{
  max-width:160px;
  max-height:46px;
}

/* Fix dropdown stabile: nessun vuoto tra voce e tendina */
.tb-header-menu > li.menu-item-has-children{
  padding-bottom:12px;
  margin-bottom:-12px;
}
.tb-header-menu > li.menu-item-has-children::after{
  content:"";
  position:absolute;
  left:-18px;
  right:-18px;
  top:100%;
  height:18px;
}
.tb-header-menu .sub-menu{
  top:calc(100% + 2px);
}
.tb-header-menu li.tb-submenu-open > .sub-menu,
.tb-header-menu li:hover > .sub-menu,
.tb-header-menu li:focus-within > .sub-menu{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translateX(-50%) translateY(0);
}
.tb-header-menu li.tb-submenu-open > a{
  background:rgba(141,124,246,.10);
  color:#111426;
}


/* Revisione v3: header più largo e logo del sito controllato */
.tb-header-shell{
  width:min(1500px,calc(100% - 48px))!important;
  min-height:78px;
}
.tb-header-brand{
  max-width:260px;
  overflow:hidden;
  flex:0 0 auto;
}
.tb-header-logo-img,
.tb-header-logo-img .custom-logo-link{
  display:inline-flex!important;
  align-items:center!important;
  line-height:0!important;
  max-width:250px!important;
  width:auto!important;
  height:auto!important;
  overflow:hidden!important;
}
.tb-header-logo-img img,
.tb-header-logo-img .custom-logo,
.tb-header-brand .custom-logo,
.tb-header-brand img.custom-logo,
.tb-header-brand .custom-logo-link img{
  display:block!important;
  height:auto!important;
  max-height:56px!important;
  width:auto!important;
  max-width:240px!important;
  object-fit:contain!important;
}
.tb-mobile-panel .tb-header-brand{
  max-width:220px;
}
.tb-mobile-panel .tb-header-logo-img,
.tb-mobile-panel .tb-header-logo-img .custom-logo-link{
  max-width:210px!important;
}
.tb-mobile-panel .tb-header-logo-img img,
.tb-mobile-panel .tb-header-logo-img .custom-logo,
.tb-mobile-panel .tb-header-brand .custom-logo,
.tb-mobile-panel .tb-header-brand img.custom-logo,
.tb-mobile-panel .tb-header-brand .custom-logo-link img{
  max-height:48px!important;
  max-width:200px!important;
}

/* Revisione v3: dropdown più stabile su hover */
.tb-header-menu > li.menu-item-has-children{
  padding-bottom:18px!important;
  margin-bottom:-18px!important;
}
.tb-header-menu > li.menu-item-has-children::after{
  content:"";
  position:absolute;
  left:-24px;
  right:-24px;
  top:38px;
  height:32px;
  z-index:1;
}
.tb-header-menu .sub-menu{
  top:calc(100% + 0px)!important;
  z-index:20;
}
.tb-header-menu li:hover > .sub-menu,
.tb-header-menu li:focus-within > .sub-menu,
.tb-header-menu li.tb-submenu-open > .sub-menu{
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
  transform:translateX(-50%) translateY(0)!important;
}

@media(max-width:1120px){
  .tb-header-shell{width:min(1500px,calc(100% - 32px))!important;}
}
@media(max-width:600px){
  .tb-header-shell{width:100%!important;}
  .tb-header-brand{max-width:205px;}
  .tb-header-logo-img img,
  .tb-header-logo-img .custom-logo,
  .tb-header-brand .custom-logo,
  .tb-header-brand img.custom-logo,
  .tb-header-brand .custom-logo-link img{
    max-height:44px!important;
    max-width:190px!important;
  }
}


/* Revisione v4: logo reale sempre controllato, senza markup custom-logo di WordPress */
.tb-site-header .tb-header-shell{
  width:min(1620px,calc(100% - 36px))!important;
  min-height:72px!important;
  max-height:92px!important;
  padding:14px 26px!important;
  overflow:visible!important;
  grid-template-columns:auto 1fr auto auto!important;
}
.tb-site-header .tb-header-brand{
  width:auto!important;
  max-width:245px!important;
  min-width:0!important;
  overflow:hidden!important;
  flex:0 1 245px!important;
}
.tb-site-header .tb-header-logo-img{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  width:auto!important;
  max-width:235px!important;
  height:54px!important;
  max-height:54px!important;
  overflow:hidden!important;
  line-height:0!important;
}
.tb-site-header .tb-header-logo-img img.tb-header-site-logo,
.tb-site-header .tb-header-brand img.tb-header-site-logo{
  display:block!important;
  width:auto!important;
  height:auto!important;
  max-width:235px!important;
  max-height:54px!important;
  object-fit:contain!important;
  object-position:left center!important;
  margin:0!important;
  padding:0!important;
  transform:none!important;
}
.tb-site-header .tb-header-nav{min-width:0!important;}
.tb-site-header .tb-header-cta{justify-self:end!important;}
@media(max-width:1120px){
  .tb-site-header .tb-header-shell{width:min(1620px,calc(100% - 28px))!important;grid-template-columns:auto 1fr auto!important;}
  .tb-site-header .tb-header-brand{max-width:220px!important;flex-basis:220px!important;}
  .tb-site-header .tb-header-logo-img{max-width:210px!important;height:50px!important;max-height:50px!important;}
  .tb-site-header .tb-header-logo-img img.tb-header-site-logo{max-width:210px!important;max-height:50px!important;}
}
@media(max-width:600px){
  .tb-site-header .tb-header-shell{width:100%!important;min-height:66px!important;max-height:78px!important;}
  .tb-site-header .tb-header-brand{max-width:185px!important;flex-basis:185px!important;}
  .tb-site-header .tb-header-logo-img{max-width:175px!important;height:44px!important;max-height:44px!important;}
  .tb-site-header .tb-header-logo-img img.tb-header-site-logo{max-width:175px!important;max-height:44px!important;}
}


/* Revisione v5: il contenuto non deve andare sotto l'header fisso */
.tb-site-main{
  padding-top:124px;
}
.admin-bar .tb-site-main{
  padding-top:132px;
}

/* Revisione v5: logo sempre contenuto anche se l'immagine caricata è molto grande */
.tb-site-header .tb-header-brand,
.tb-site-header .tb-header-logo-img{
  min-height:0!important;
}
.tb-site-header .tb-header-logo-img{
  height:46px!important;
  max-height:46px!important;
  max-width:215px!important;
}
.tb-site-header .tb-header-logo-img img.tb-header-site-logo{
  width:auto!important;
  height:auto!important;
  max-height:46px!important;
  max-width:215px!important;
  display:block!important;
  object-fit:contain!important;
}
.tb-site-header .tb-header-shell{
  min-height:72px!important;
}
@media(max-width:1120px){
  .tb-site-main{padding-top:110px;}
  .admin-bar .tb-site-main{padding-top:118px;}
  .tb-site-header .tb-header-logo-img{height:42px!important;max-height:42px!important;max-width:195px!important;}
  .tb-site-header .tb-header-logo-img img.tb-header-site-logo{max-height:42px!important;max-width:195px!important;}
}
@media(max-width:600px){
  .tb-site-main{padding-top:96px;}
  .admin-bar .tb-site-main{padding-top:112px;}
  .tb-site-header .tb-header-logo-img{height:36px!important;max-height:36px!important;max-width:170px!important;}
  .tb-site-header .tb-header-logo-img img.tb-header-site-logo{max-height:36px!important;max-width:170px!important;}
}


/* V7: header responsive, menu mobile padding e CTA flottanti */
html, body{max-width:100%;overflow-x:hidden;}
.tb-site-header{padding-left:clamp(10px,2.2vw,24px)!important;padding-right:clamp(10px,2.2vw,24px)!important;}
.tb-site-header .tb-header-shell{width:min(1620px,calc(100vw - clamp(20px,4.4vw,48px)))!important;max-width:calc(100vw - clamp(20px,4.4vw,48px))!important;box-sizing:border-box!important;}
.tb-site-header .tb-header-cta{max-width:220px;white-space:nowrap;}
.tb-mobile-panel{box-sizing:border-box;padding:26px clamp(22px,6vw,34px) 120px!important;width:min(430px,calc(100vw - 18px))!important;}
.tb-mobile-menu a{padding-left:0!important;padding-right:0!important;}
.tb-mobile-cta{margin-left:0!important;margin-right:0!important;width:100%;box-sizing:border-box;}
.tb-mobile-panel-head{padding-right:2px;}
.tb-floating-cta{position:fixed;right:24px;bottom:24px;z-index:9998;font-family:Manrope,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;pointer-events:none;}
.tb-floating-demo{display:inline-flex;align-items:center;justify-content:center;min-height:54px;padding:15px 24px;border-radius:999px;background:#1478ff;color:#fff!important;text-decoration:none!important;font-size:14px;font-weight:900;box-shadow:0 18px 46px rgba(20,120,255,.34);pointer-events:auto;transition:transform .2s ease,box-shadow .2s ease;}
.tb-floating-demo:hover{transform:translateY(-3px);box-shadow:0 24px 58px rgba(20,120,255,.42);}
.tb-floating-mobile-actions{display:none;}
@media(max-width:1120px){
  .tb-floating-cta{left:0;right:0;bottom:0;padding:10px 12px calc(10px + env(safe-area-inset-bottom));background:rgba(255,255,255,.94);border-top:1px solid rgba(220,228,239,.9);box-shadow:0 -16px 44px rgba(7,17,31,.10);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);}
  .tb-floating-demo{display:none;}
  .tb-floating-mobile-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;pointer-events:auto;}
  .tb-floating-mobile-actions a{display:flex;align-items:center;justify-content:center;min-height:48px;padding:12px 10px;border-radius:999px;text-decoration:none!important;font-size:13px;font-weight:900;line-height:1.1;text-align:center;}
  .tb-floating-mobile-actions a:first-child{background:#1478ff;color:#fff!important;box-shadow:0 12px 28px rgba(20,120,255,.24);}
  .tb-floating-mobile-actions a:last-child{background:#0d0a23;color:#fff!important;}
  body{padding-bottom:74px;}
}
@media(max-width:600px){
  .tb-site-header{padding-left:10px!important;padding-right:10px!important;}
  .tb-site-header .tb-header-shell{width:calc(100vw - 20px)!important;max-width:calc(100vw - 20px)!important;padding:12px 14px!important;grid-template-columns:minmax(0,1fr) auto!important;}
  .tb-site-header .tb-header-brand{max-width:calc(100vw - 98px)!important;flex-basis:auto!important;}
  .tb-site-header .tb-header-logo-img{max-width:calc(100vw - 112px)!important;}
  .tb-site-header .tb-header-logo-img img.tb-header-site-logo{max-width:calc(100vw - 112px)!important;}
  .tb-header-toggle{width:44px;height:44px;flex:0 0 44px;}
  .tb-mobile-panel{width:calc(100vw - 12px)!important;padding-left:22px!important;padding-right:22px!important;}
}


/* V7: niente fascia bianca tecnica sotto header */
.tb-site-main{padding-top:0!important;}
.admin-bar .tb-site-main{padding-top:0!important;}


/* V8: CTA flottanti più discreti e sicuri su mobile */
.tb-floating-cta{box-sizing:border-box!important;}
.tb-floating-demo{
  min-height:44px!important;
  padding:11px 20px!important;
  font-size:13px!important;
  box-shadow:0 12px 32px rgba(20,120,255,.24)!important;
}
@media(max-width:1024px){
  .tb-floating-cta{
    padding:7px 10px calc(7px + env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;
  }
  .tb-floating-mobile-actions{gap:8px!important;}
  .tb-floating-mobile-actions a{
    min-height:40px!important;
    padding:9px 8px!important;
    font-size:12px!important;
    line-height:1.05!important;
    box-shadow:none!important;
  }
  body{padding-bottom:58px!important;}
}
@media(max-width:420px){
  .tb-floating-cta{padding-left:8px!important;padding-right:8px!important;}
  .tb-floating-mobile-actions{gap:7px!important;}
  .tb-floating-mobile-actions a{font-size:11.5px!important;min-height:38px!important;padding:8px 6px!important;}
}
