/* GreenPulse 5.4.8 - Mobile touch + Iubenda layer fix
 * Fix chirurgico: su smartphone reale i link del menu hamburger risultavano oscurati/non cliccabili
 * e il banner Iubenda non appariva. Non modifica layout desktop, workflow o contenuti.
 */
@media (max-width: 900px) {
  html, body { overflow-x: hidden !important; }

  .gp-site-header,
  .gp-site-header.gp-header-pro {
    z-index: 2147483000 !important;
    isolation: isolate !important;
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
  }

  .gp-header-inner {
    position: relative !important;
    z-index: 2147483001 !important;
    overflow: visible !important;
  }

  .gp-mobile-menu-toggle {
    z-index: 2147483003 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    opacity: 1 !important;
    -webkit-tap-highlight-color: rgba(0,63,255,.16) !important;
  }

  body.gp-mobile-menu-open #gp-primary-menu,
  body.gp-mobile-menu-open #gp-primary-menu.gp-nav,
  body.gp-mobile-menu-open .gp-header-pro #gp-primary-menu,
  body.gp-mobile-menu-open .gp-header-pro .gp-nav {
    position: relative !important;
    z-index: 2147483002 !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
  }

  #gp-primary-menu,
  #gp-primary-menu *,
  .gp-nav,
  .gp-nav * {
    pointer-events: auto !important;
  }

  #gp-primary-menu a,
  .gp-nav a,
  .gp-nav li a,
  .gp-nav .menu-item > a {
    position: relative !important;
    z-index: 2147483004 !important;
    cursor: pointer !important;
    opacity: 1 !important;
    color: #0f172a !important;
    text-decoration: none !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: rgba(0,63,255,.16) !important;
  }

  /* Qualsiasi overlay decorativo della Hero non deve catturare il touch quando il menu è aperto. */
  body.gp-mobile-menu-open .gp-hero-original::before,
  body.gp-mobile-menu-open .gp-hero-original::after,
  body.gp-mobile-menu-open .gp-hero::before,
  body.gp-mobile-menu-open .gp-hero::after,
  body.gp-mobile-menu-open .gp-hero-bg,
  body.gp-mobile-menu-open .gp-hero-overlay,
  body.gp-mobile-menu-open .gp-hero-visual,
  body.gp-mobile-menu-open .gp-visual-card,
  body.gp-mobile-menu-open main::before,
  body.gp-mobile-menu-open main::after,
  body.gp-mobile-menu-open #content::before,
  body.gp-mobile-menu-open #content::after {
    pointer-events: none !important;
  }

  .gp-mobile-menu-backdrop {
    display: none !important;
    pointer-events: none !important;
    z-index: -1 !important;
  }
}

/* Iubenda / Cookie Solution: deve stare sopra menu, hero, overlay e pulsanti flottanti. */
#iubenda-cs-banner,
.iubenda-cs-banner,
.iubenda-cs-container,
.iubenda-cs-content,
.iubenda-cs-rationale,
.iubenda-cs-opt-group,
.iubenda-cs-preferences-link,
.iubenda-tp-alert-btn,
.iubenda-tp-btn,
.iubenda-tp-btn[data-tp-float],
.iubenda-tp-btn[data-tp-float='bottom-right'],
.iubenda-tp-btn[data-tp-float='bottom-left'] {
  z-index: 2147483647 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}

@media (max-width: 900px) {
  #iubenda-cs-banner,
  .iubenda-cs-banner,
  .iubenda-cs-container,
  .iubenda-cs-content,
  .iubenda-cs-rationale,
  .iubenda-tp-alert-btn,
  .iubenda-tp-btn {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    max-width: calc(100vw - 20px) !important;
  }
}
