/* Header Elementor (template "Header") — integrazioni del tema.
   - sotto i 1200px: barra compatta con hamburger (js/header-mobile.js) al posto dei link su più righe
   - pagine interne: titolo e briciole sotto la barra del menu, non allineati ai link
   Le regole usano la struttura del template (barra normale, .sticmenu), non gli ID degli elementi,
   così valgono anche per la versione inglese. */

:root {
  --gl-bar-h: 72px;       /* altezza della barra del menu su desktop */
  --gl-bar-h-m: 64px;     /* altezza della barra compatta */
}

/* Hamburger e pannello: nascosti su desktop */
.gl-burger { display: none; }
.gl-mpanel[hidden] { display: none !important; }

/* Icona di ricerca leggibile sulla fascia grigia delle pagine interne */
.is-inner-page header[data-elementor-type="header"] > .e-parent:not(.sticmenu) a[href*="elementor-action"],
.is-inner-page header[data-elementor-type="header"] > .e-parent:not(.sticmenu) a[href*="elementor-action"] svg,
.is-inner-page header[data-elementor-type="header"] > .e-parent:not(.sticmenu) a[href*="elementor-action"] svg * {
  color: #000 !important;
  fill: #000 !important;
}

/* Desktop: i due gruppi di link restano su una riga. I blocchi laterali si dividono lo spazio
   rimasto (il blocco centrale col logo resta al centro); tra 1200 e 1440px testo a 14px. */
@media (min-width: 1200px) {
  header[data-elementor-type="header"] > .e-parent > .e-con {
    width: auto !important;
    min-width: 0;
  }
  header[data-elementor-type="header"] > .e-parent > .e-con:first-child,
  header[data-elementor-type="header"] > .e-parent > .e-con:last-child {
    flex: 1 1 0 !important;
  }
  header[data-elementor-type="header"] > .e-parent > .e-con:not(:first-child):not(:last-child) {
    flex: 0 0 auto !important;
  }
  header[data-elementor-type="header"] .elementor-icon-list-items { flex-wrap: nowrap !important; }
  header[data-elementor-type="header"] .elementor-icon-list-item { white-space: nowrap; }
}
@media (min-width: 1200px) and (max-width: 1439px) {
  header[data-elementor-type="header"] .elementor-icon-list-text { font-size: 14px !important; }
}

/* Titoli delle pagine interne sotto la barra del menu */
.is-inner-page .intro:not(.intro__product) {
  padding-top: calc(var(--gl-bar-h) + 40px);
  padding-bottom: 40px;
}
.is-inner-page .intro:not(.intro__product) .intro__bc {
  top: calc(var(--gl-bar-h) + 8px);
}

@media (max-width: 1199px) {
  /* Barra normale: logo a sinistra, ricerca + hamburger a destra, un'unica riga */
  header[data-elementor-type="header"] > .e-parent:not(.sticmenu) {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    min-height: var(--gl-bar-h-m);
    padding: 8px 16px !important;
    margin-top: 0 !important;
  }
  header[data-elementor-type="header"] > .e-parent:not(.sticmenu) > .e-con {
    width: auto !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    margin: 0 !important;
  }
  header[data-elementor-type="header"] > .e-parent:not(.sticmenu) > .e-con:last-child {
    margin-left: auto !important;
    gap: 8px;
    align-items: center;
  }
  header[data-elementor-type="header"] .elementor-widget-icon-list { display: none !important; }
  header[data-elementor-type="header"] .elementor-widget-icon .elementor-icon svg {
    height: 28px;
    width: auto;
  }
  header[data-elementor-type="header"] a[href*="elementor-action"] svg { height: 22px !important; }

  /* Barra sticky compatta: logo + hamburger */
  header[data-elementor-type="header"] > .sticmenu {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    min-height: 56px;
    padding: 8px 16px !important;
  }
  header[data-elementor-type="header"] > .sticmenu .elementor-widget-icon { margin: 0 !important; }
  /* sticky con blocchi interni: i blocchi con soli link spariscono, gli altri si stringono */
  header[data-elementor-type="header"] > .sticmenu > .e-con {
    width: auto !important;
    flex: 0 0 auto !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  header[data-elementor-type="header"] > .sticmenu > .e-con:not(:has(.elementor-widget-icon, .gl-burger)) {
    display: none !important;
  }

  .gl-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
  }
  .gl-burger svg { width: 26px; height: 26px; }
  .gl-burger:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

  /* Pagine interne: titolo e briciole sotto la barra compatta */
  .is-inner-page .intro:not(.intro__product) {
    padding-top: calc(var(--gl-bar-h-m) + 36px);
    padding-bottom: 28px;
  }
  .is-inner-page .intro:not(.intro__product) .intro__bc {
    top: calc(var(--gl-bar-h-m) + 4px);
  }
}

/* sotto i 992px il tema mette le briciole nel flusso della pagina (non più sovrapposte):
   basta lasciare lo spazio della barra compatta */
@media (max-width: 992px) {
  .is-inner-page .intro:not(.intro__product) {
    padding-top: calc(var(--gl-bar-h-m) - 24px);
  }
}

/* Pulizia e manutenzione: nella fascia ci sono solo le briciole (il titolo è nella sezione sotto).
   Il tema "apre" la fascia grigia (.intro:before) solo quando c'è il titolo: qui la mostro sempre. */
.is-inner-page .template__pm .intro:before { transform: scaleY(1); }
@media (min-width: 993px) {
  .is-inner-page .template__pm .intro {
    padding-top: 0;
    padding-bottom: 0;
    min-height: calc(var(--gl-bar-h) + 100px);
  }
  .is-inner-page .template__pm .intro .intro__bc {
    top: var(--gl-bar-h);
  }
}

/* Pannello a tutto schermo */
html.gl-mpanel-open { overflow: hidden; }
.gl-mpanel {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #000;
  overflow-y: auto;
  animation: gl-mpanel-in 220ms ease;
}
@keyframes gl-mpanel-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}
.gl-mpanel__head {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: var(--gl-bar-h-m);
  padding: 8px 16px;
}
.gl-mpanel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  color: #000;
  cursor: pointer;
}
.gl-mpanel__close svg { width: 26px; height: 26px; }
.gl-mpanel__close:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.gl-mpanel__nav { padding: 8px 24px 40px; }
.gl-mpanel__group {
  list-style: none;
  margin: 0;
  padding: 0 0 20px;
}
.gl-mpanel__group + .gl-mpanel__group {
  padding-top: 20px;
  border-top: 1px solid #e9e9e9;
}
.gl-mpanel__link {
  display: block;
  padding: 10px 0;
  color: #000;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.3px;
  text-decoration: none;
}
.gl-mpanel__group + .gl-mpanel__group .gl-mpanel__link {
  font-size: 19px;
  color: #3b3b3b;
}
.gl-mpanel__link[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.gl-mpanel__link:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.gl-mpanel__link::after { display: none; }

@media (prefers-reduced-motion: reduce) {
  .gl-mpanel { animation: none; }
}
