/* X-StyleMenu.css */
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

* {
  box-sizing: inherit;
}

/* hamburger */
/* MENU OVERLAY */
/* HAMBURGER DESKTOP */
.hamburger {
  width: 30px;
  height: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.hamburger span {
  height: 4px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Contenitore menu */
#desktop-menu-panel {
  position: absolute;
  /* position: relative; */
  top: 0px;      /* o quanto serve per stare sotto l'header */
  left: 0px;     /* 50px dal bordo sinistro come richiesto */
  right: 0;
  bottom: 0;
  width: 100%; 
  min-width: 220px;
  background-color: #6D0D1B; /* granata */
  padding: 20px 50px;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  display: none; /* nascosto di default */
  z-index: 50;
  color: white;
  font-family: Arial, sans-serif;
}
/* Mostra menu quando attivo */
#desktop-menu-panel.active {
  display: block;
}

/* Lista principale verticale */
/* Menu principale: lista verticale con larghezza fissa */
/* Contenitore del menu (menu + pannello sottomenu) */
.menu-inner-container {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  background-color: #580B16;
  padding: 20px 30px;
  border-radius: 8px;
  margin-top: 100px;
}

.desktop-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.desktop-menu li a {
  display: block;
  padding: 10px 15px;
  font-size: 1.5rem;
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.3s ease;
}

.desktop-menu li a:hover {
  color: yellow;
}

.submenu-container {
  display: none;
  flex-direction: column;
  background-color: #580B16;
  /* border-radius: 8px; */
  padding: 15px;
  min-width: 200px;
  /* box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); */
}


.submenu-container ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.submenu-container li a {
  color: white;
  text-decoration: none;
  font-size: 1.4rem;
  padding: 6px 10px;
  border-radius: 4px;
}

.submenu-container li a:hover {
  color: yellow;
}


/*************************************************************************** HAMBURGER MOBILE (se diverso) */
@media (max-width: 768px) {
    /* Stile hamburger base: 3 linee */
    .mobile-hamburger {
        width: 30px;
        height: 25px;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .mobile-hamburger span {
        display: block;
        height: 4px;
        width: 100%;
        background-color: black;
        border-radius: 2px;
        transition: all 0.3s ease;
        transform-origin: center;
    }

    /* Trasformazione in X */
    .mobile-hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px);
    }
    .mobile-topbar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 60px; /* la tua altezza */
        z-index: 10000; /* superiore all'overlay */
        background: #6D0D1B; /* o altro colore, deve essere visibile */
    }

    /* Overlay granata */
    #mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 50px; /* lascia visibile la mobile-topbar (alta 50px) */
        left: 0;
        width: 100vw;
        height: calc(100vh - 50px);
        background-color: #800000;
        z-index: 9999;
        padding-top: 20px;
    }

    #mobile-menu-overlay.active {
        display: block;
    }
    .mobile-main-menu {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .mobile-main-menu li {
        font-size: 28px;
        line-height: 1.8;
        padding: 15px 0 15px 10px;
        cursor: pointer;
        color: white;
    }
    .mobile-submenu-panel {
        position: absolute;
        top: 25px; /* sotto la topbar */
        right: 10px;
        z-index: 10000;
    }
    .mobile-submenu {
        display: none;
        background-color: #800000;
        list-style: none;
        padding: 0;
        margin: 0;
        text-align: right;
    }
    #mobile-menu-overlay .mobile-submenu li {
        font-size: 18px;       /* stessa dimensione testo menu principale */
        line-height: 1.7;      /* stessa interlinea */
        padding: 15px 0 15px 0; /* padding verticale per distanziare */
        text-align: right;     /* come richiesto prima */
    }
    #mobile-menu-overlay .mobile-submenu a {
        color: white;
        text-decoration: none;
        font-size: 18px;       /* assicurati che il link abbia la stessa dimensione */
        line-height: 1.5;
        display: block;        /* per occupare tutta l’area cliccabile */
    }
    .mobile-submenu.visible {
        display: block;
    }
    .mobile-submenu a:hover {
    text-decoration: underline;
    }
}
