/**
 * Header personalizzato con effetto glass e submenu
 * 
 * INDICE:
 * 1. Header base e positioning
 * 2. Effetto glass (backdrop-filter)
 * 3. Layout sezione header
 * 4. Logo e title
 * 5. Colonna destra e menu
 * 6. Bottoni base
 * 7. Toggle hamburger mobile
 * 8. Menu mobile fullscreen
 * 9. Submenu base (mobile accordion)
 * 10. Media query desktop (≥1024px)
 * 
 * @package AlexWeb_ChildTheme
 * @since 1.0.0
 */

/* header,
header * {
  border: 2px dotted orange;
} */

/* ========== 1. HEADER BASE E POSITIONING ========== */
#hc {
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 1000;
  color: white;
  padding-top: 16px;
}

/* ========== 2. EFFETTO GLASS (BACKDROP-FILTER) ========== */
.header-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 9999px;
  box-shadow: inset 1px 1px 0 -0.5px #ffffff20,
    inset -1px -1px 0 -0.5px #ffffff10, 
    0 4px 8px rgba(0, 0, 0, 0.15),
    0 0 2px rgba(255, 255, 255, 0.1);
  padding: 12px 25px;
  min-height: 57px;
}

/* ========== 3. LAYOUT SEZIONE HEADER ========== */
#hc > section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  width: 1250px;
  max-width: 92%;
  margin: 0 auto;
  position: relative;
}

/* ========== 4. LOGO E TITLE ========== */
.header-title {
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 1px;
}

/* ========== 5. COLONNA DESTRA E MENU ========== */
.right-col {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.header-menu {
  display: flex;
  flex-wrap: nowrap;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ========== 6. BOTTONI BASE ========== */
/* --- Layout, tipografia, hover/transition, width */
.btn-base {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  gap: 10px;
  width: 100%;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--black-text);
  text-align: center;
  text-decoration: none;
  border: 0 solid;
  border-radius: 9999px;
  transition: transform 0.6s ease-out;
}

.btn-base:hover {
  transform: scale(1.03);
}

/* ========== 7. TOGGLE HAMBURGER MOBILE ========== */
#menu-toggle {
  display: block;
  padding: 12px 16px;
}

/* --- Nascondi nav e CTA desktop di default su mobile */
#nav-container:not(.open),
.btn-preventivo {
  display: none;
}

/* ========== 8. MENU MOBILE FULLSCREEN ========== */
/* --- Menu aperto: overlay fullscreen con sfondo glass */
#nav-container.open {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  margin: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  background-color: rgba(255, 255, 255, 0.8);
  color: var(--black-text);
}

/* --- Layout verticale voci menu mobile */
#nav-container.open .header-menu {
  flex-direction: column;
  gap: 24px;
  text-align: center;
  font-size: clamp(20px, 2.5vw, 24px);
  font-weight: 500;
}

/* --- Blocco scroll body quando menu aperto */
body.no-scroll {
  overflow: hidden;
}

/* --- Pulsante chiusura in alto a destra */
#menu-close {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 12px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: clamp(20px, 2.5vw, 24px);
}

/* --- CTA visibile solo su mobile */
.sm-btn {
  display: inline-flex;
}

/* ========== 9. SUBMENU BASE (MOBILE ACCORDION) ========== */
/* --- Contenitore voce con submenu */
.has-submenu {
  position: relative;
}

/* --- Trigger con freccia */
.submenu-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

/* --- Freccia animata */
.submenu-arrow {
  transition: transform 0.3s ease;
}

/* --- Lista submenu base */
.submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* --- Mobile: accordion chiuso di default */
.submenu {
  max-height: 0;
  opacity: 0;
  padding-left: 20px;
}

.submenu li {
  margin: 8px 0;
  text-align: left;
}

.submenu a {
  font-size: clamp(16px, 2vw, 18px);
  font-weight: 400;
  opacity: 0.85;
}
.submenu a svg {
  height: 1em;
  margin-right: 2px;
}

/* --- Rotazione freccia quando aperto */
.has-submenu.open .submenu-arrow {
  transform: rotate(180deg);
}

.submenu a svg{
  display: inline;
}

/* ========== 10. MEDIA QUERY DESKTOP (≥1024px) ========== */
@media (min-width: 1024px) {
  /* --- Nascondi hamburger e CTA mobile */
  #menu-toggle, 
  .sm-btn {
    display: none!important;
  }
  
  /* --- Mostra nav e CTA desktop */
  #nav-container:not(.open),
  .btn-preventivo {
    display: flex;
  }
  
  /* --- centro il menu senza flex che non lo centrava correttamente */
  #nav-container{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
  
  /* --- Nascondi pulsante close */
  #menu-close {
    display: none;
  }
  
  /* --- Margine negativo per allineamento ottico */
  .header-menu {
    margin-right: -18px;
  }

  /* --- Desktop: dropdown assoluto con effetto glass */
  /* .submenu {
    position: absolute;
    top: calc(100% + 1px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 220px;
    padding: 16px;
    
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    box-shadow: inset 1px 1px 0 -0.5px #ffffff20,
      inset -1px -1px 0 -0.5px #ffffff10,
      0 8px 16px rgba(0, 0, 0, 0.2);
    
    max-height: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    margin-top: 0;
    padding-left: 0;
  } */

  .submenu {
        position: absolute;
        top: calc(100% + 1px);
        left: 50%;
        transform: translateX(-50%);
        padding: 8px;
        background: rgba(50, 49, 50, 1);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-radius: 16px;
        box-shadow: inset 1px 1px 0 -0.5px #ffffff20, inset -1px -1px 0 -0.5px #ffffff10, 0 8px 16px rgba(0, 0, 0, 0.2);
        max-height: none;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        margin-top: 0;
    }

  /* --- Hover su voce padre mostra dropdown */
  .has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
  }

  /* --- Stile voci submenu desktop */
  .submenu li {
    margin: 0;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
  }

  .submenu li:hover {
    background: rgba(255, 255, 255, 0.1);
  }

  .submenu a {
    font-size: 15px;
    font-weight: 400;
    white-space: nowrap;
  }
}