/* ===== HEADER + NAV COMUNE ===== */

.gp-header {
  position: relative;        /* NON sticky */
  z-index: 20;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: relative;   /* crea il contesto per il menu mobile */
  z-index: 2000;        /* sta sopra la barra verde e il resto */
}

.gp-header__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

/* NAV DESKTOP */

.gp-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  z-index: 2100;  /* sopra tutto il resto */
  
}

.gp-nav__link {
  text-decoration: none;
  font-size: 0.95rem;
  color: #4b5563;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.gp-nav__link:hover {
  background: #e0f2fe;
  color: #0f172a;
}

.gp-nav__link--active {
  background: #0284c7;
  color: #ffffff;
}

/* Dropdown “Servizi” */

.gp-nav__dropdown {
  position: relative;
  display: flex;
  align-items: center;
}

.gp-nav__link--dropdown {
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.gp-nav__link--dropdown:hover {
  background: #e0f2fe;
  color: #0f172a;
}

.gp-nav__dropdown-menu {
  position: absolute;
  top: 120%;
  left: 0;
  min-width: 220px;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
  padding: 0.5rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
  z-index: 1000;
}

/* Menu servizi visibile SOLO quando il container ha la classe --open */
.gp-nav__dropdown.gp-nav__dropdown--open .gp-nav__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.gp-nav__dropdown-link {
  display: block;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  text-decoration: none;
  color: #4b5563;
  white-space: nowrap;
}

.gp-nav__dropdown-link:hover {
  background: #e0f2fe;
  color: #0f172a;
}

/* Bottone hamburger (desktop nascosto) */

.gp-header__toggle {
  display: none;
  width: 40px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  cursor: pointer;
  padding: 0 8px;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 4px;
}

.gp-header__toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: #111827;
}

/* ===== MOBILE MENU ===== */

@media (max-width: 768px) {
  .gp-header__inner {
    align-items: center;
  }

  /* Mostra hamburger */
  .gp-header__toggle {
    display: flex;
  }

  /* Nav nascosto di default */
  .gp-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    flex-direction: column;
    padding: 0.5rem 1rem 0.75rem;
    gap: 0.25rem;
  }

  /* Nav visibile quando ha la classe open */
  .gp-nav.gp-nav--open {
    display: flex;
  }

  .gp-nav__link,
  .gp-nav__link--dropdown {
    width: 100%;
    justify-content: flex-start;
    border-radius: 0.6rem;
  }

  /* Dropdown container su mobile: colonna */
  .gp-nav__dropdown {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  /* Di base il sottomenu è nascosto anche su mobile */
  .gp-nav__dropdown-menu {
    position: static;
    box-shadow: none;
    border-radius: 0.5rem;
    margin-top: 0.25rem;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transform: none;
  }

  /* Visibile solo quando la classe --open è attiva */
  .gp-nav__dropdown.gp-nav__dropdown--open .gp-nav__dropdown-menu {
    opacity: 1;
    visibility: visible;
  }

  .gp-nav__dropdown-link {
    padding: 0.35rem 0.75rem;
  }
}