/* Menu della homepage */
html:has(.lp-header-ready) {
  scroll-padding-top: 69px;
}

.lp-header-slot {
  min-height: 69px;
}

#masthead.lp-header-ready {
  position: relative;
  z-index: 200;
  width: 100%;
  padding: 0;
  background: #fff;
  border-bottom: 1px solid #ebedff;
}

#masthead.lp-header-ready.fixed {
  position: fixed;
  top: 0;
  inset-inline: 0;
}

.admin-bar #masthead.lp-header-ready.fixed {
  top: 32px;
}

#masthead .lp-header-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
  width: var(--lp-home-width, calc(100% - 32px));
  min-height: 68px;
  margin-inline: auto;
}

#masthead .lp-header-bar .site-branding,
#masthead.fixed .lp-header-bar .site-branding {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

#masthead .lp-header-bar .custom-logo {
  display: block;
  width: clamp(120px, 11vw, 148px);
  height: auto;
  max-width: 100%;
}

#masthead .lp-header-panel {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 32px);
}

#masthead .lp-header-panel[hidden],
#masthead .lp-menu-toggle[hidden] {
  display: none;
}

#masthead .lp-header-panel .main-navigation {
  flex: 1;
  width: auto;
  min-width: 0;
}

#masthead .lp-header-panel .language-switcher-container {
  position: static;
  width: auto;
  margin: 0;
}

#masthead .lp-header-panel #primary-menu,
#masthead .lp-header-panel .language-switcher {
  display: flex;
  align-items: center;
  height: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

#masthead .lp-header-panel #primary-menu {
  justify-content: center;
  gap: clamp(18px, 2vw, 24px);
}

#masthead .lp-header-panel .language-switcher {
  gap: 8px;
}

#masthead .lp-header-panel :is(#primary-menu, .language-switcher) > li {
  float: none;
  flex: 0 0 auto;
  width: auto;
  margin: 0;
  padding: 0;
}

#masthead .lp-header-panel :is(#primary-menu, .language-switcher) > li > a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 0;
  color: var(--text-color1, #6a71ce);
  font-family: var(--font1, "Comfortaa", sans-serif);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
}

#masthead .lp-header-panel .language-switcher > li > a {
  padding-inline: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

#masthead .lp-header-panel :is(#primary-menu, .language-switcher) > li > a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

#masthead .lp-header-purchase {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: #575fba;
  color: #fff;
  font-family: var(--font1, "Comfortaa", sans-serif);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

#masthead .lp-header-purchase:hover {
  background: #454da4;
}

#masthead .lp-header-bar :is(a, button, summary):focus-visible {
  outline: 2px solid #454da4;
  outline-offset: 3px;
}

#masthead .lp-menu-toggle {
  display: grid;
  flex: 0 0 42px;
  height: 42px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 1px solid #daddff;
  border-radius: 10px;
  background: #fff;
  color: #575fba;
  cursor: pointer;
}

#masthead .lp-menu-toggle::before {
  width: 18px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px currentColor, 0 5px currentColor;
  content: "";
}

#masthead .lp-menu-toggle[aria-expanded="true"] {
  background: #ebedff;
}

@media (max-width: 991.98px) {
  #masthead .lp-header-bar {
    gap: clamp(8px, 2vw, 14px);
  }

  #masthead .lp-header-bar .site-branding {
    margin-inline-end: auto;
  }

  #masthead .lp-header-bar .custom-logo {
    width: clamp(104px, 26vw, 132px);
  }

  #masthead .lp-header-purchase {
    padding-inline: clamp(10px, 3vw, 16px);
    font-size: 0.8125rem;
  }

  #masthead .lp-header-panel {
    position: absolute;
    inset: 100% 0 auto;
    display: block;
    max-height: calc(100vh - 72px);
    max-height: calc(100dvh - 72px);
    padding: 12px 16px;
    overflow: auto;
    border: 1px solid #ebedff;
    border-radius: 0 0 14px 14px;
    background: #fff;
    box-shadow: 0 14px 28px rgb(48 52 120 / 12%);
  }

  #masthead .lp-header-panel #primary-menu {
    display: grid;
    justify-content: stretch;
    gap: 0;
  }

  #masthead .lp-header-panel #primary-menu > li > a {
    display: flex;
    min-height: 44px;
  }

  #masthead .lp-header-panel .language-switcher {
    justify-content: flex-start;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #ebedff;
  }
}

@media (min-width: 601px) and (max-width: 782px) {
  .admin-bar #masthead.lp-header-ready.fixed {
    top: 46px;
  }
}

@media (max-width: 600px) {
  .admin-bar #masthead.lp-header-ready.fixed {
    top: 0;
  }
}

/* Le dimensioni restano identiche quando si mostra la goccia. */
#masthead .lp-header-panel #primary-menu {
  gap: clamp(6px, 1.2vw, 16px);
}

#masthead .lp-header-panel #primary-menu > li > a {
  position: relative;
  min-height: 44px;
  padding-inline: 25px 9px;
  border-radius: 10px;
  font-size: clamp(18px, 1.4vw, 20px);
}

#masthead .lp-header-panel .language-switcher > li > a {
  position: relative;
  padding-inline: 20px 6px;
  font-size: 0.875rem;
}

#masthead .lp-header-panel :is(#primary-menu, .language-switcher) > li > a:is(:hover, :focus-visible) {
  border-radius: 10px;
  background: #ebedff;
  text-decoration: none;
}

#masthead .lp-header-panel :is(#primary-menu, .language-switcher) > li > a::before {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 7px;
  display: block;
  width: 14px;
  height: 16px;
  margin: 0;
  background: var(--lp-home-drop, url("../img/goccia.png")) center / contain no-repeat;
  content: "";
  opacity: 0;
  transform: translateY(-50%);
  pointer-events: none;
}

#masthead .lp-header-panel :is(#primary-menu, .language-switcher) > li > a:is(:hover, :focus-visible)::before {
  opacity: 1;
}

#masthead .lp-header-panel .language-switcher > li > a::before {
  inset-inline-start: 4px;
  width: 12px;
}

#masthead .lp-language-menu {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
}

#masthead .lp-language-menu > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid #ebedff;
  border-radius: 10px;
  color: var(--text-color1, #6a71ce);
  font-family: var(--font1, "Comfortaa", sans-serif);
  font-size: 0.875rem;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

#masthead .lp-language-menu > summary::-webkit-details-marker {
  display: none;
}

#masthead .lp-language-menu > summary::after {
  width: 0.45rem;
  height: 0.45rem;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: rotate(45deg);
}

#masthead .lp-language-menu > summary:hover,
#masthead .lp-language-menu[open] > summary {
  background: #ebedff;
}

#masthead .lp-language-menu[open] > summary::after {
  margin-top: 3px;
  transform: rotate(225deg);
}

#masthead .lp-header-panel .lp-language-menu > .language-switcher-container {
  position: absolute;
  z-index: 3;
  inset: calc(100% + 6px) 0 auto auto;
  display: block;
  box-sizing: border-box;
  width: max-content;
  min-width: 136px;
  height: auto;
  padding: 5px;
  border: 1px solid #ebedff;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgb(48 52 120 / 12%);
}

#masthead .lp-language-menu:not([open]) > .language-switcher-container {
  display: none;
}

#masthead .lp-header-panel .lp-language-menu .language-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  justify-content: stretch;
  gap: 2px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
}

#masthead .lp-header-panel .lp-language-menu .language-switcher > li {
  width: 100%;
}

#masthead .lp-header-panel .lp-language-menu .language-switcher > li > a {
  display: flex;
  justify-content: flex-start;
  min-height: 40px;
  width: 100%;
  box-sizing: border-box;
  padding-inline: 22px 10px;
  border-radius: 8px;
  text-transform: none;
}

#masthead .lp-language-menu .language-switcher > li > a[aria-current="page"] {
  background: #ebedff;
}

@media (max-width: 991.98px) {
  #masthead .lp-header-panel #primary-menu > li > a {
    font-size: 16px;
  }

  #masthead .lp-language-menu {
    margin-top: 8px;
  }

  #masthead .lp-language-menu > summary {
    width: max-content;
  }

  #masthead .lp-header-panel .lp-language-menu > .language-switcher-container {
    position: static;
    width: 100%;
    margin-top: 6px;
    box-shadow: none;
  }
}
