.edil_megamenu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  flex-direction: unset;
  background: var(--bg-megamenu);
}

.edil_menu-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  height: 60px;
}

.edil_main-nav {
  display: flex;
  gap: 10px;
}

.edil_nav-item a {
  display: block;
  padding: 15px 20px;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.3s;
}

.edil_nav-item a:hover {
  background: #555;
  color: #fff;
}

.edil_menu-content {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #f9f9f9;
  padding: 20px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  gap: 20px;

  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;

  transition: max-height 0.35s ease-in-out, opacity 0.35s ease-in-out;
}

.edil_menu-content.open {
  max-height: 800px;
  opacity: 1;
  pointer-events: auto;
}

/*.edil_column {
  flex: 1;
  min-height: 100px;
}*/
.edil_column {
  flex: 0.3;
  min-height: 200px;
}

.edil_rectangle img {
  max-width: 100%;
  height: auto;
  display: block;
}

.submenu-content {
  padding-left: 15px;

  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

.submenu-content.open {
  max-height: 500px;
  opacity: 1;
}

/* Mobile */
@media screen and (max-width:768px) {
  .edil_main-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 999;
    border-top: 1px solid #ccc;
  }
  .edil_nav-item {
    position: relative;
    border-bottom: 1px solid #eee;
  }
  .submenu-content {
    padding-left: 15px;
  }
  .submenu-toggle {
    float: right;
    cursor: pointer;
    display: block;
  }
  .edil_menu-content {
    display: none !important;
  }
  .edil_hamburger {
    display: flex;
  }
}
#col2 ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
#col2 ul li {
  margin-bottom: 8px;
}
#col2 ul li a {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 300;
}
#col2 ul li a:hover {
  text-decoration: underline;
}

button.mobile-menu-toggle.edilhamburger {
    background-color: transparent;
    border: 0px;
}
.edilhamburger {
  display: none;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  width: 40px;
  height: 40px;
  flex-direction: column;
  gap: 4px;
}

.edilhamburger span {
  display: block;
  width: 30px;
  height: 3px;
  background: var(--color-text);
  border-radius: 2px;
  transition: 0.3s all ease;
}

/* Mobile specific styles */
@media screen and (max-width: 768px) {
  .edil_main-nav {
    display: none;
  }
  .edil_menu-content {
    display: none !important;
  }
  .edilhamburger {
    display: flex;
  }
  .edil_menu-bar{
	  width: 100%;
  }
}
/* Mantieni grafica vecchia: il toggle sembra lo span dentro al link */
.edil_nav-item{
  position: relative; /* serve per posizionare il toggle a destra */
}

/* Il toggle resta “sulla riga” del link, a destra, come prima */
@media screen and (max-width:768px) {

  .submenu-toggle{
    position: absolute;
    top: 0;
    right: 0;

    /* stessi spazi del link (così visivamente è identico) */
    padding: 15px 20px;

    background: transparent;
    border: 0;
    color: var(--color-text);
    cursor: pointer;
    display: block;
    line-height: 1;
  }

  /* evita che il + vada a capo e preserva area tappabile */
  .submenu-toggle:focus{
    outline: none;
  }

  /* per non sovrapporre il + al testo (spazio a destra nel link) */
  .edil_nav-item > a.main-menu-link{
    padding-right: 60px; /* 20+20 padding + un po’ di margine */
  }

  /* MENU MOBILE SCROLLABILE quando è lungo */
  .edil_main-nav{
    position: fixed;               /* invece di absolute */
    top: 60px;
    left: 0;
    right: 0;

    max-height: calc(100vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
/* Submenu scrollabile quando è aperto */
.submenu-content.open{
  overflow-y: auto;                 /* invece di hidden */
  -webkit-overflow-scrolling: touch;
}

/* Consigliato su mobile: non usare un 500px fisso, ma adattalo allo schermo */
@media screen and (max-width:768px){
  .submenu-content.open{
    max-height: calc(100vh - 120px); /* 60px header + margine */
  }
}



