/* =========================================================
   SERVICES MEGA MENU
   Loads after header-theme.css. Only affects the Services
   dropdown (.nav-dropdown--mega / .nav-mega); the other
   dropdowns keep their existing styles.
   ========================================================= */

/* ---------- Desktop ---------- */
@media (min-width: 992px) {
  /* Anchor the panel to the header container instead of the
     Services toggle, so it can be wide without leaving the viewport. */
  .navbar-container { position: relative; }
  .nav-menu.w-nav-menu { position: static; }
  .nav-dropdown--mega { position: static; }

  .nav-dropdown-menu.nav-mega {
    left: 50%;
    right: auto; /* otherwise RTL resolves the box from `right` and ignores left: 50% */
    top: calc(100% - 4px);
    width: min(1240px, calc(100vw - 48px));
    min-width: 0;
    padding: 0;
    border: 1px solid var(--gc-line, #dde8df);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 28px 60px -12px rgba(15, 46, 31, 0.22), 0 2px 6px rgba(15, 46, 31, 0.05);
    overflow: hidden;
  }

  /* Hover bridge: covers the space between the toggle and the panel */
  .nav-dropdown-menu.nav-mega::before {
    top: -28px;
    height: 28px;
  }

  .nav-mega__body {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.18fr);
    gap: 0;
  }

  .nav-mega__col {
    padding: 26px 20px 22px;
    border-right: 1px solid #eef3ef;
  }
  .nav-mega__col:first-child { padding-left: 26px; }
  .nav-mega__col:last-child  { border-right: 0; }

  .nav-mega__col--feature {
    padding: 26px 26px 22px 22px;
    background:
      radial-gradient(120% 70% at 100% 0%, rgba(22, 163, 74, 0.10), transparent 60%),
      linear-gradient(180deg, #f6faf4 0%, #eef6ee 100%);
  }
}

/* ---------- Shared (desktop) pieces ---------- */
.nav-mega__heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7c72;
}

.nav-mega__new {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gc-green, #16a34a);
  color: #fff;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  line-height: 1.5;
}

/* Webflow's .w-dropdown-link sets nowrap; mega links need to wrap */
.nav-mega .nav-dropdown-item { white-space: normal; margin-left: 0; margin-right: 0; }
.nav-mega__heading { white-space: nowrap; }
.nav-mega__link--compact .nav-mega__title { min-width: 0; }

.nav-dropdown-item.nav-mega__link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--gc-ink, #0f2e1f);
  transition: background-color 0.18s ease, color 0.18s ease;
}

/* Cancel the slide-in hover from header.css for mega links */
.nav-dropdown-item.nav-mega__link:hover {
  padding-left: 10px;
  background: var(--gc-mist, #f4f9f5);
  color: var(--gc-ink, #0f2e1f);
}

.nav-mega__icon {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid #e3ece5;
  background: #fff;
  color: var(--gc-green-deep, #15803d);
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nav-mega__link:hover .nav-mega__icon {
  background: var(--gc-green, #16a34a);
  border-color: var(--gc-green, #16a34a);
  color: #fff;
}

.nav-mega__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-top: 1px;
}

.nav-mega__title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: inherit;
}

.nav-mega__desc {
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.4;
  color: #6b7c72;
}

/* Compact rows in the geology column */
.nav-dropdown-item.nav-mega__link--compact {
  align-items: center;
  padding-top: 6px;
  padding-bottom: 6px;
}
.nav-mega__link--compact .nav-mega__icon {
  flex-basis: 30px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.nav-mega__link--compact .nav-mega__title { font-size: 13.5px; font-weight: 500; }
.nav-mega__col--feature .nav-dropdown-item.nav-mega__link:hover { background: rgba(255, 255, 255, 0.85); }

.nav-mega__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gc-green-deep, #15803d);
  text-decoration: none;
}
.nav-mega__more svg { transition: transform 0.2s ease; }
.nav-mega__more:hover svg { transform: translateX(3px); }
[dir="rtl"] .nav-mega__more svg { transform: scaleX(-1); }
[dir="rtl"] .nav-mega__more:hover svg { transform: scaleX(-1) translateX(3px); }

/* Footer bar */
.nav-mega__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  border-top: 1px solid #eef3ef;
  background: #fbfcfb;
}

.nav-dropdown-item.nav-mega__foot-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gc-ink, #0f2e1f);
}
.nav-dropdown-item.nav-mega__foot-link:hover {
  padding-left: 6px;
  background: var(--gc-mist, #f4f9f5);
  color: var(--gc-ink, #0f2e1f);
}
.nav-mega__foot-link .nav-mega__icon { flex-basis: 30px; width: 30px; height: 30px; border-radius: 8px; }
.nav-mega__foot-link:hover .nav-mega__icon {
  background: var(--gc-green, #16a34a);
  border-color: var(--gc-green, #16a34a);
  color: #fff;
}

.nav-mega__foot-note {
  margin: 0 0 0 auto;
  font-size: 13px;
  color: #6b7c72;
}
.nav-mega__foot-note a {
  margin-left: 6px;
  font-weight: 600;
  color: var(--gc-green-deep, #15803d);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.nav-dropdown-item.nav-mega__link:focus-visible,
.nav-dropdown-item.nav-mega__foot-link:focus-visible,
.nav-mega__more:focus-visible {
  outline: 2px solid var(--gc-green, #16a34a);
  outline-offset: 1px;
}

/* Between 992px and 1180px: tighten the columns */
@media (min-width: 992px) and (max-width: 1180px) {
  .nav-mega__col { padding-left: 14px; padding-right: 14px; }
  .nav-mega__col:first-child { padding-left: 18px; }
  .nav-mega__heading { letter-spacing: 0.07em; font-size: 10.5px; }
  .nav-mega__desc { display: none; }
  .nav-mega__foot-note { display: none; }
}

/* ---------- Mobile slide-in menu (Webflow collapse at 991px) ---------- */
@media (max-width: 991px) {
  .nav-mega__body { display: block; }

  .nav-mega__col,
  .nav-mega__col--feature {
    padding: 6px 0 10px;
    background: none;
    border: 0;
  }

  .nav-mega__heading {
    margin: 10px 0 4px;
    padding: 0 12px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 10.5px;
  }

  .nav-dropdown-item.nav-mega__link,
  .nav-dropdown-item.nav-mega__link--compact {
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.75);
  }
  .nav-dropdown-item.nav-mega__link:hover,
  .nav-mega__col--feature .nav-dropdown-item.nav-mega__link:hover {
    padding-left: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
  }

  .nav-mega__icon,
  .nav-mega__link--compact .nav-mega__icon,
  .nav-mega__foot-link .nav-mega__icon {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #9fd56a;
  }

  .nav-mega__title,
  .nav-mega__link--compact .nav-mega__title { font-size: 15px; font-weight: 500; }
  .nav-mega__desc { display: none; }

  .nav-mega__more { margin: 6px 0 0 12px; color: #9fd56a; }

  .nav-mega__foot {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 0 4px;
    background: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-dropdown-item.nav-mega__foot-link {
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    font-size: 15px;
  }
  .nav-dropdown-item.nav-mega__foot-link:hover {
    padding-left: 12px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
  }
  .nav-mega__foot-note { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-mega__icon,
  .nav-mega__more svg { transition: none; }
}
