/**
 * ASOR — fix icone IcoFont / telefono / card Serietà (mobile + desktop)
 * Allineato a Joomla: icofont-newspaper, icofont-ui-dial-phone
 */

/* Card "Perché affidarsi a noi" — tutte e 3 le icone IcoFont visibili */
#acm-features-95 .features-icon.icofont,
.itemid-101 #acm-features-95 .features-icon.icofont {
  font-family: "IcoFont" !important;
  font-style: normal !important;
  font-weight: normal !important;
  speak: none;
  -webkit-font-smoothing: antialiased;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#acm-features-95 .features-icon.icofont-newspaper::before {
  content: "\f085" !important;
  font-family: "IcoFont" !important;
}

/* Cornetta "Chiamaci Subito" — navhelper e sidebar hero */
nav.wrap.t3-navhelper .acm-hero .hero-icon .icofont,
nav.wrap.t3-navhelper .acm-hero .hero-icon .icofont-ui-dial-phone,
.acm-hero .hero-icon .icofont-ui-dial-phone {
  font-family: "IcoFont" !important;
  font-style: normal !important;
  font-weight: normal !important;
  color: #fff !important;
}

nav.wrap.t3-navhelper .acm-hero .hero-icon .icofont-ui-dial-phone::before,
.acm-hero .hero-icon .icofont-ui-dial-phone::before {
  content: "\ed30" !important;
  font-family: "IcoFont" !important;
}

/* Fallback FA4 cornetta se IcoFont non caricato */
@supports not (font-family: "IcoFont") {
  nav.wrap.t3-navhelper .acm-hero .hero-icon .icofont-ui-dial-phone::before {
    content: "\f095" !important;
    font-family: FontAwesome !important;
  }
}

/* Menu hamburger mobile — 3 linee bianche (CSS puro, come previsto da custom.css) */
.off-canvas-toggle .asor-hamburger-lines,
.ja-topbar .asor-mobile-hamburger-slot .off-canvas-toggle .asor-hamburger-lines,
#t3-header .off-canvas-toggle .asor-hamburger-lines {
  display: inline-flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 5px !important;
  width: 30px !important;
  height: 18px !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.off-canvas-toggle .asor-hamburger-lines > span,
.ja-topbar .asor-mobile-hamburger-slot .off-canvas-toggle .asor-hamburger-lines > span {
  display: block !important;
  width: 24px !important;
  height: 2.5px !important;
  min-height: 2.5px !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-radius: 3px !important;
  opacity: 1 !important;
  visibility: visible !important;
  margin: 0 auto !important;
}

/* Legacy: nasconde fa-bars se ancora presente in qualche pagina */
.off-canvas-toggle > .fa.fa-bars {
  display: none !important;
}

/* Fallback FA4 icona bars (se resta solo .fa-bars senza linee) */
.off-canvas-toggle .fa-bars::before {
  content: "\f0c9" !important;
  font-family: FontAwesome !important;
  font-weight: normal !important;
  color: #fff !important;
  font-size: 20px !important;
}

@media (max-width: 991px) {
  .ja-topbar .asor-mobile-hamburger-slot,
  .ja-topbar .asor-mobile-hamburger-slot .off-canvas-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .ja-topbar .asor-mobile-hamburger-slot .off-canvas-toggle .asor-hamburger-lines,
  body .ja-topbar .asor-mobile-hamburger-slot .off-canvas-toggle .asor-hamburger-lines {
    display: inline-flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 24px !important;
    height: 18px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    gap: 5px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    transform: none !important;
    align-self: center !important;
    pointer-events: none !important;
  }

  .ja-topbar .asor-mobile-hamburger-slot .off-canvas-toggle .asor-hamburger-lines > span,
  body .ja-topbar .asor-mobile-hamburger-slot .off-canvas-toggle .asor-hamburger-lines > span {
    width: 24px !important;
    min-width: 24px !important;
    height: 2.5px !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 3px !important;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.15) !important;
  }

  #acm-features-94 #features-0 .features-icon.icofont-newspaper::before {
    content: "\f085" !important;
    font-family: "IcoFont" !important;
  }

  nav.wrap.t3-navhelper .acm-hero .hero-icon.hidden-xs,
  html.itemid-101.home nav.wrap.t3-navhelper .acm-hero .hero-icon.hidden-xs {
    display: block !important;
    visibility: visible !important;
  }

  nav.wrap.t3-navhelper .acm-hero .hero-icon .icofont-ui-dial-phone {
    font-size: 68px !important;
    line-height: 1 !important;
    min-height: 72px !important;
  }

  #acm-features-95 .features-icon.icofont {
    font-size: 52px !important;
    min-height: 56px !important;
    color: #c29032 !important;
  }

  /* Numero topbar mobile: +20px su, +20px a destra rispetto al centro */
  html body .ja-topbar .asor-mobile-numero-floating,
  html.itemid-101 .ja-topbar .asor-mobile-numero-floating,
  body.asor-home .ja-topbar .asor-mobile-numero-floating {
    transform: translate(calc(-50% + 35px), calc(-50% + 22px)) !important;
    -webkit-transform: translate(calc(-50% + 35px), calc(-50% + 22px)) !important;
  }

  /* Meta topbar a tutta larghezza: non bloccare click sul menu */
  html body .ja-topbar .asor-mobile-topbar-meta {
    pointer-events: none !important;
  }

  html body .ja-topbar .asor-mobile-topbar-meta a,
  html body .ja-topbar .asor-mobile-topbar-meta .asor-topbar-email-link {
    pointer-events: auto !important;
  }

  html body .ja-topbar .asor-mobile-hamburger-slot {
    position: relative !important;
    z-index: 400 !important;
    pointer-events: auto !important;
  }

  html body .ja-topbar .asor-mobile-hamburger-slot .off-canvas-toggle,
  html body #t3-header .off-canvas-toggle {
    position: relative !important;
    z-index: 401 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
  }

  html body .ja-topbar .asor-mobile-hamburger-slot .off-canvas-toggle .asor-hamburger-lines,
  html body .ja-topbar .asor-mobile-hamburger-slot .off-canvas-toggle .asor-hamburger-lines > span,
  html body #t3-header .off-canvas-toggle .asor-hamburger-lines,
  html body #t3-header .off-canvas-toggle .asor-hamburger-lines > span {
    pointer-events: none !important;
  }

  /* Home mobile: topbar + email + menu come pagine interne (desktop ≥992px invariato) */
  html.itemid-101.home .t3-wrapper:has(> .wrap.t3-slideshow) > .ja-topbar,
  html.itemid-101 .t3-wrapper:has(> .wrap.t3-slideshow) > .ja-topbar,
  body.asor-home .t3-wrapper:has(> .wrap.t3-slideshow) > .ja-topbar {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 30 !important;
    background: transparent !important;
    background-color: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  html.itemid-101.home .ja-topbar .asor-mobile-topbar-stack,
  body.asor-home .ja-topbar .asor-mobile-topbar-stack {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 2px 10px !important;
    box-sizing: border-box !important;
  }

  html.itemid-101.home .ja-topbar .asor-topbar-email-inline a.asor-topbar-email-link,
  body.asor-home .ja-topbar .asor-topbar-email-inline a.asor-topbar-email-link {
    display: inline-flex !important;
    align-items: center !important;
    color: #fff !important;
    font-size: 14px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    pointer-events: auto !important;
  }

  html.itemid-101.home .ja-topbar .asor-mobile-hamburger-slot .off-canvas-toggle,
  body.asor-home .ja-topbar .asor-mobile-hamburger-slot .off-canvas-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    background: rgba(55, 58, 62, 0.95) !important;
    border: 2px solid rgba(255, 255, 255, 0.55) !important;
    border-radius: 4px !important;
  }
}
