/* ==========================================================================
   Mega menus — Services + Hire with Us
   (partials/nav-menu.php → render_mega_nav_item())
   Subcategory tabs on the left, the active tab's pages on the right.
   Built only from the theme's existing tokens (style.css :root) so it matches
   the regular dropdowns: black panel, white GT Walsheim links, teal accent.
   Tabs are driven by js/mega-menu.js (which also centres the panel in the
   viewport — without JS it simply opens left-aligned under "Services").
   ========================================================================== */

/* The mobile/sticky menus are clones of the desktop markup (script.js):
   the mobile drawer uses the plain <ul class="qt-mega-mobile"> instead. */
.mobile-menu .qt-mega {
  display: none !important;
}

/* Desktop: the plain list is replaced by the panel. */
.main-menu .navigation > li.has-mega > ul.qt-mega-mobile {
  display: none !important;
}

.main-menu .navigation > li.has-mega > .qt-mega {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  width: min(1140px, calc(100vw - 40px));
  margin-top: 30px;
  background-color: var(--body-bg);
  border: 1px solid #1d2022;
  border-radius: 6px;
  box-shadow:
    2px 2px 5px 1px rgba(0, 0, 0, 0.05),
    -2px 0px 5px 1px rgba(0, 0, 0, 0.05),
    0 24px 48px rgba(0, 0, 0, 0.45);
  font-family: var(--body-font-family);
  text-align: left;
  opacity: 0;
  visibility: hidden;
  -webkit-transition: opacity 300ms ease, visibility 300ms ease, margin-top 300ms ease;
  transition: opacity 300ms ease, visibility 300ms ease, margin-top 300ms ease;
}

/* Same open behaviour as the theme's `li.dropdown:hover > ul`. */
.main-menu .navigation > li.has-mega:hover > .qt-mega,
.main-menu .navigation > li.has-mega:focus-within > .qt-mega {
  margin-top: 0;
  opacity: 1;
  visibility: visible;
}

/* ---- Left: subcategory tabs ---- */
.qt-mega__tabs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 0;
  border-right: 1px solid #1d2022;
}

.main-menu .qt-mega__tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 24px 12px 28px;
  background: transparent;
  border: 0;
  color: var(--theme-color-white);
  font-family: var(--body-font-family);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  text-align: left;
  text-transform: capitalize;
  cursor: pointer;
  -webkit-transition: all 200ms ease;
  transition: all 200ms ease;
}

.main-menu .qt-mega__tab i {
  font-size: 14px;
  opacity: 0;
  -webkit-transition: all 200ms ease;
  transition: all 200ms ease;
}

.main-menu .qt-mega__tab:before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--theme-color1);
  opacity: 0;
  -webkit-transition: opacity 200ms ease;
  transition: opacity 200ms ease;
}

.main-menu .qt-mega__tab:hover,
.main-menu .qt-mega__tab:focus-visible,
.main-menu .qt-mega__tab.is-active {
  color: var(--theme-color1);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.main-menu .qt-mega__tab.is-active {
  font-weight: 700;
}

.main-menu .qt-mega__tab.is-active:before,
.main-menu .qt-mega__tab.is-active i {
  opacity: 1;
}

/* ---- Right: services of the active tab ---- */
.qt-mega__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 22px 0;
}

.qt-mega__panel {
  display: none;
}

.qt-mega__panel.is-active {
  display: block;
  -webkit-animation: qtMegaFade 250ms ease;
  animation: qtMegaFade 250ms ease;
}

@-webkit-keyframes qtMegaFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes qtMegaFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.qt-mega__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 10px;
}

.main-menu .qt-mega__item {
  display: block;
  padding: 12px 14px;
  border-radius: 6px;
  text-decoration: none;
  -webkit-transition: background 200ms ease;
  transition: background 200ms ease;
}

.main-menu .qt-mega__title {
  display: block;
  color: var(--theme-color-white);
  font-family: var(--body-font-family);
  font-size: 16px;
  font-weight: 500;
  line-height: 24px;
  -webkit-transition: color 200ms ease;
  transition: color 200ms ease;
}

.main-menu .qt-mega__desc {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text-color);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.main-menu .qt-mega__item:hover,
.main-menu .qt-mega__item:focus-visible {
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.main-menu .qt-mega__item:hover .qt-mega__title,
.main-menu .qt-mega__item:focus-visible .qt-mega__title {
  color: var(--theme-color1);
}

/* ---- Footer: View All Services ---- */
.qt-mega__footer {
  margin-top: auto;
  padding: 14px 14px 16px;
  border-top: 1px solid #1d2022;
}

.qt-mega__grid {
  margin-bottom: 14px;
}

.main-menu .qt-mega__footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--theme-color1);
  font-family: var(--body-font-family);
  font-size: 15px;
  font-weight: 500;
  line-height: 24px;
}

.main-menu .qt-mega__footer a i {
  font-size: 13px;
  -webkit-transition: transform 200ms ease;
  transition: transform 200ms ease;
}

.main-menu .qt-mega__footer a:hover {
  color: var(--theme-color-white);
}

.main-menu .qt-mega__footer a:hover i {
  -webkit-transform: translateX(4px);
  transform: translateX(4px);
}

/* Narrower desktops: two service columns. */
@media only screen and (max-width: 1199px) {
  .main-menu .navigation > li.has-mega > .qt-mega {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .qt-mega__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
