/* =================================================================
   Service365 – Mega Menu (desktop) + Burger Overlay (mobile)
   ================================================================= */

/* Reset old nav defaults that conflict */
.site-header { position: sticky; top: 0; z-index: 100; }
.mega-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  height: 100%;
}
.mega-item {
  display: flex;
  align-items: center;
}
.mega-trigger,
.mega-link {
  height: 80px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.2s var(--ease);
  white-space: nowrap;
  text-decoration: none;
}
.mega-trigger::after {
  content: '';
  width: 6px; height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -3px;
  margin-left: 4px;
  opacity: 0.7;
  transition: transform 0.25s var(--ease);
}
.mega-item:hover .mega-trigger,
.mega-item:hover .mega-link,
.mega-item.open .mega-trigger,
.mega-trigger:focus-visible,
.mega-link:focus-visible {
  color: var(--ink);
  outline: none;
}
.mega-item.open .mega-trigger::after {
  transform: rotate(225deg);
  margin-top: 2px;
}

.mega-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 24px 48px -24px rgba(15, 26, 43, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
  z-index: 60;
}
.mega-item.open .mega-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s;
}
.mega-panel-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px var(--gutter) 32px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1.1fr;
  gap: 48px;
  align-items: start;
}
.mega-panel-col h4 {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-3);
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.mega-panel-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.mega-panel-col li a {
  display: block;
  padding: 7px 0;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: -0.005em;
  color: var(--ink);
  line-height: 1.3;
  transition: color 0.2s var(--ease), transform 0.2s var(--ease);
}
.mega-panel-col li a small {
  display: block;
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0;
  text-transform: none;
  margin-top: 1px;
}
.mega-panel-col li a:hover {
  color: var(--accent);
  transform: translateX(4px);
}
.mega-panel-feature {
  background: var(--bg-soft);
  padding: 24px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-height: 180px;
  position: relative;
  overflow: hidden;
  margin-top: 0;
}
.mega-panel-feature .eyebrow { margin: 0 0 12px; color: var(--ink-3); }
.mega-panel-feature .eyebrow::before { background: var(--ink-3); }
.mega-panel-feature h5 {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 21px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 10px;
}
.mega-panel-feature p {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
  margin: 0;
}
.mega-panel-feature .arrow {
  align-self: flex-start;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  font-weight: 500;
  transition: gap 0.25s var(--ease);
  display: inline-flex;
  gap: 8px;
}
.mega-panel-feature .arrow:hover { gap: 14px; }

/* Backdrop when any panel open */
.mega-backdrop {
  position: fixed;
  inset: 0;
  top: var(--header-bottom, 80px);
  background: rgba(15, 26, 43, 0.18);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s var(--ease), visibility 0s linear 0.25s;
  z-index: 55;
  pointer-events: none;
}
body.mega-open .mega-backdrop {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s var(--ease), visibility 0s;
}

/* Hide old simple nav-links / mobile-toggle */
.nav-links { display: none !important; }
.mobile-toggle { display: none; }

/* ========== BURGER + MOBILE OVERLAY ========== */
.burger {
  display: none;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
  position: relative;
  width: 44px;
  height: 44px;
}
.burger span {
  display: block;
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), top 0.3s var(--ease), opacity 0.2s;
}
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 22px; }
.burger span:nth-child(3) { top: 28px; }
body.menu-open .burger span:nth-child(1) { top: 22px; transform: rotate(45deg); }
body.menu-open .burger span:nth-child(2) { opacity: 0; }
body.menu-open .burger span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  top: 0;
  z-index: 90;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transform: translateY(-100%);
  transition: transform 0.4s var(--ease);
  overflow-y: auto;
  visibility: hidden;
}
body.menu-open .mobile-menu {
  transform: translateY(0);
  visibility: visible;
}
.mobile-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px var(--gutter);
  border-bottom: 1px solid var(--line);
  min-height: 80px;
}
.mobile-menu-body {
  padding: 16px var(--gutter) 48px;
  flex: 1;
}
.mobile-group {
  border-bottom: 1px solid var(--line);
}
.mobile-group-header {
  width: 100%;
  background: none;
  border: 0;
  text-align: left;
  font: inherit;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 26px;
  letter-spacing: -0.025em;
  color: var(--ink);
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.mobile-group-header .mgh-link {
  flex: 1;
  padding: 20px 0;
  color: var(--ink);
  text-decoration: none;
}
.mobile-group-header .mgh-toggle {
  background: none;
  border: 0;
  padding: 16px 4px 16px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.mobile-group-header.mgh-direct {
  padding: 20px 0;
  text-decoration: none;
}
.mobile-group-header.mgh-direct > span:first-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mobile-group-header.mgh-direct small {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-3);
  letter-spacing: 0;
}
.mobile-group-header.mgh-direct .mgh-arrow {
  font-size: 22px;
  color: var(--ink-3);
  font-family: var(--font-body);
}
.mobile-group-header .icon {
  position: relative;
  width: 18px; height: 18px;
  display: block;
}
.mobile-group-header .icon::before,
.mobile-group-header .icon::after {
  content: '';
  position: absolute;
  background: var(--ink);
  top: 50%; left: 50%;
}
.mobile-group-header .icon::before { width: 14px; height: 1.5px; transform: translate(-50%, -50%); }
.mobile-group-header .icon::after  { width: 1.5px; height: 14px; transform: translate(-50%, -50%); transition: transform 0.25s var(--ease); }
.mobile-group.open .mobile-group-header .icon::after { transform: translate(-50%, -50%) scaleY(0); }
.mobile-group--link { }
.mobile-group-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s var(--ease);
}
.mobile-group.open .mobile-group-body { max-height: 720px; }
.mobile-group-body ul {
  list-style: none;
  padding: 0 0 24px;
  margin: 0;
}
.mobile-group-body li a {
  display: block;
  padding: 12px 0;
  font-size: 16px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.mobile-group-body li:last-child a { border-bottom: 0; }
.mobile-group-body li a small {
  display: block;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}
.mobile-menu-foot {
  padding: 32px var(--gutter);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mobile-menu-foot a.btn { justify-content: center; }
.mobile-menu-foot .channel {
  font-size: 14px;
  color: var(--ink-2);
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}
.mobile-menu-foot .channel strong { color: var(--ink); font-weight: 600; }

body.menu-open { overflow: hidden; }

/* Hide mega on small screens, show burger */
@media (max-width: 1366px) {
  .mega-nav { display: none; }
  .burger { display: block; }
  .mega-panel, .mega-backdrop { display: none; }
  /* Hide the desktop CTA buttons entirely so they never block the burger */
  .site-header .nav-cta { display: none !important; }
  /* Give the burger room on the right edge */
  .site-header .nav { gap: 12px; }
  .burger { margin-right: -10px; }
}
