/* =========================================
   MEGA MENU (Desktop Hover Panels)
   ========================================= */

/* Trigger-Element (LI mit Dropdown) */
.nav-has-mega {
  position: relative;
}

.nav-has-mega::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -2rem;
  right: -2rem;
  height: 40px;
  background: transparent;
}

/* Die schwebende Fläche unter dem Menüpunkt */
.mega-surface {
  position: absolute;
  top: 100%;
  left: 50%;
  width: calc(100vw - 80px);
  max-width: 1690px;
  padding-top: 25px;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translateX(-50%) translateY(24px) scale(.98);
  transition:
    opacity .45s ease,
    visibility .45s ease,
    transform .45s cubic-bezier(.25,1,.5,1),
    filter .45s ease;

  z-index: 99999;
  filter: drop-shadow(0 30px 80px rgba(15,23,42,.4));
}

/* sichtbar bei Hover */
.nav-has-mega:hover .mega-surface,
.nav-has-mega:focus-within .mega-surface {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
  filter: drop-shadow(0 40px 90px rgba(15,23,42,.55));
}

/* Inhalt der Mega-Fläche (Glass Panel / Card Grid) */
.mega-inner {
  position: relative;
  max-width: var(--header-max-width);
  margin: 0 auto;
  padding: 1.5rem 2rem 2rem;

  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1rem;
  align-items: flex-start;

  border-radius: 1rem;
  overflow: hidden;

  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(255,255,255,0.45);
  box-shadow:
    0 20px 60px rgba(15,23,42,.25),
    0 0 120px rgba(30,97,255,.35);
}

/* Glow Overlay oben */
.mega-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(30,97,255,0.22) 0%, rgba(169,225,254,0) 60%),
    radial-gradient(circle at 80% 0%, rgba(169,225,254,0.2) 0%, rgba(30,97,255,0) 60%);
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Einzelne Spalten in der Mega-Navigation */
.mega-col {
  background: rgba(255,255,255,0.9);
  border-radius: .75rem;
  border: 1px solid rgba(15,23,42,0.06);
  box-shadow:
    0 8px 20px rgba(0,0,0,0.07),
    0 0 40px rgba(169,225,254,0.35);
  padding: .9rem 1rem 1.1rem;
  min-width: 0;
  transition: all .18s ease;
}

.mega-col:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 32px rgba(0,0,0,0.12),
    0 0 60px rgba(30,97,255,0.4);
  background: rgba(255,255,255,0.96);
}

/* Überschrift jeder Spalte */
.mega-heading {
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #0f172a;
  margin-bottom: .5rem;
  line-height: 1.4;

  display: flex;
  align-items: center;
  gap: .4rem;
}

.mega-heading::before {
  content: "";
  display: inline-block;
  width: .5rem;
  height: .5rem;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #a9e1fe 0%, #1e61ff 80%);
  box-shadow: 0 0 10px rgba(30,97,255,0.7);
}

/* Linkliste in der Spalte */
.mega-linklist a {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;

  color: #0f172a;
  text-decoration: none;
  font-size: .9rem;
  line-height: 1.4;
  padding: .4rem 0;
  transition: color .18s ease;
}

.mega-linklist a:hover {
  color: var(--brand-blue);
}

.mega-linklist a::after {
  content: "→";
  font-size: .8rem;
  line-height: 1;
  color: rgba(15,23,42,0.2);
  transition: color .18s ease, transform .18s ease;
}

.mega-linklist a:hover::after {
  color: var(--brand-blue);
  transform: translateX(2px);
}

/* CTA Spalte (rechts) */
.mega-col-cta {
  text-align: center;
  background: radial-gradient(
    circle at 30% 20%,
    rgba(169,225,254,0.9) 0%,
    rgba(255,255,255,0.9) 60%
  );
  border: 1px solid rgba(30,97,255,0.2);
  box-shadow:
    0 8px 24px rgba(0,0,0,0.08),
    0 0 80px rgba(30,97,255,0.45),
    0 0 140px rgba(169,225,254,0.3);
}

.mega-col-cta .subtext {
  font-size: .75rem;
  line-height: 1.4;
  color: #0f172a;
  margin: 0 0 .75rem;
  opacity: .8;
}

.mega-col-cta .btn-primary {
  display: inline-block;
  background-image: linear-gradient(to right,#1e61ff 0%,#a9e1fe 100%);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  font-size: .95rem;
  line-height: 1.2;
  padding: .9rem 1.2rem;
  text-decoration: none;
  box-shadow:
    0 10px 30px rgba(0,0,0,0.22),
    0 0 50px rgba(30,97,255,0.6),
    0 0 90px rgba(169,225,254,0.5);
  transition: all .22s ease;
}

.mega-col-cta .btn-primary:hover {
  background-image: linear-gradient(to right,#0f172a 0%,#1e61ff 100%);
  box-shadow:
    0 16px 36px rgba(0,0,0,0.3),
    0 0 60px rgba(30,97,255,0.75),
    0 0 110px rgba(169,225,254,0.6);
  color: #fff;
}

/* Feine Positionsanpassung je Menüpunkt */
.nav-bauleistungen .mega-surface {
  left: calc(50% + 225px);
}
.nav-facility .mega-surface {
  left: calc(50% + 400px);
}

/* Responsive: bei schmaleren Screens nur 2 Spalten */
@media (max-width:1100px) {
  .mega-inner {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}
