/* Services mega menu
   Loaded site-wide from inc/header.php

   Markup: one <ul class="services-mega"> containing <li class="mega-col">
   (heading + nested <ul>) and one <li class="mega-promo">.
   Kept as a single <ul> so the theme's mobile slideToggle still works. */

/* ============================================================
   DESKTOP PANEL
   ============================================================ */
@media (min-width: 992px) {

  /* Anchor the panel to the whole nav rather than the Services <li>,
     otherwise a wide panel runs off the right edge on 1280px screens. */
  .main-menu .navigation {
    position: relative;
  }

  .main-menu .navigation > li.dropdown.has-mega {
    position: static;
  }

  .main-menu .navigation > li.dropdown > ul.services-mega {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(160px, 1fr)) 240px;
    gap: 0 26px;
    align-items: start;
    left: 0 !important;
    right: auto !important;
    width: max-content !important;
    max-width: min(1000px, calc(100vw - 48px)) !important;
    padding: 30px 32px !important;
    border-radius: 10px !important;
    box-shadow: 0 18px 50px rgba(11, 27, 58, .16) !important;
    pointer-events: none;
  }

  .main-menu .navigation > li.dropdown.has-mega:hover > ul.services-mega {
    pointer-events: auto;
  }

  .main-menu .navigation > li > ul.services-mega > li {
    border-bottom: none !important;
    padding: 0 !important;
    width: auto !important;
  }

  /* Column heading */
  .main-menu .navigation > li > ul.services-mega > li.mega-col > h5 {
    margin: 0 0 12px;
    padding: 0 0 10px;
    font-family: 'Rubik', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #e8581a;
    border-bottom: 1px solid rgba(23, 27, 39, .1);
  }

  /* Nested list - override the theme's absolute flyout */
  .main-menu .navigation > li > ul.services-mega > li.mega-col > ul {
    position: static !important;
    display: block !important;
    /* inherit, never "visible" - otherwise these stay hoverable
       while the closed panel above them is visibility:hidden */
    visibility: inherit !important;
    opacity: 1 !important;
    transform: none !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    border: none !important;
    left: auto !important;
    top: auto !important;
  }

  .main-menu .navigation > li > ul.services-mega > li.mega-col > ul > li {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    border-bottom: none !important;
  }

  .main-menu .navigation > li > ul.services-mega > li.mega-col > ul > li > a {
    display: block !important;
    padding: 7px 10px 7px 0 !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    font-weight: 400 !important;
    color: #1c2230 !important;
    text-transform: none !important;
    border-radius: 6px;
    transition: color .18s ease, padding-left .18s ease, background .18s ease;
  }

  .main-menu .navigation > li > ul.services-mega > li.mega-col > ul > li > a:hover {
    color: #e8581a !important;
    background: rgba(232, 88, 26, .06);
    padding-left: 10px !important;
  }

  /* Promo card */
  .main-menu .navigation > li > ul.services-mega > li.mega-promo {
    border-left: 1px solid rgba(23, 27, 39, .1);
    padding-left: 28px !important;
    align-self: stretch;
  }

  .main-menu .navigation > li > ul.services-mega > li.mega-promo > a {
    display: block !important;
    height: 100%;
    padding: 24px 22px !important;
    border-radius: 10px;
    background: linear-gradient(150deg, #0b1b3a 0%, #1b3566 100%);
    color: #fff !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    transition: transform .22s ease, box-shadow .22s ease;
  }

  .main-menu .navigation > li > ul.services-mega > li.mega-promo > a:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(11, 27, 58, .28);
  }

  /* Reset anything the theme's badge/menu rules put on these */
  .services-mega .mega-promo .promo-kicker,
  .services-mega .mega-promo .promo-title,
  .services-mega .mega-promo .promo-text,
  .services-mega .mega-promo .promo-cta {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    position: static !important;
    background: none !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    text-align: left !important;
    justify-content: flex-start !important;
    font-style: normal !important;
    top: auto !important;
  }

  .services-mega .mega-promo .promo-kicker {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    letter-spacing: .12em !important;
    text-transform: uppercase !important;
    color: #f5a623 !important;
    margin-bottom: 10px !important;
  }

  .services-mega .mega-promo .promo-title {
    font-family: 'Teko', sans-serif !important;
    font-size: 26px !important;
    font-weight: 600 !important;
    line-height: 1.15 !important;
    color: #fff !important;
    text-transform: none !important;
    margin-bottom: 8px !important;
  }

  .services-mega .mega-promo .promo-text {
    font-size: 13px !important;
    line-height: 1.6 !important;
    font-weight: 400 !important;
    color: rgba(255, 255, 255, .8) !important;
    text-transform: none !important;
    margin-bottom: 16px !important;
  }

  .services-mega .mega-promo .promo-cta {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #f5a623 !important;
    text-transform: none !important;
  }
}

/* ============================================================
   MOBILE / TABLET  (cloned side menu + narrow screens)
   The theme slideToggles the outer <ul>, so everything just stacks.
   ============================================================ */
@media (max-width: 991px) {

  .services-mega > li.mega-col > h5 {
    margin: 0;
    padding: 16px 20px 6px;
    font-family: 'Rubik', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #f5a623;
  }

  .services-mega > li.mega-col > ul {
    display: block !important;
    position: static !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    box-shadow: none !important;
    width: auto !important;
  }

  .services-mega > li.mega-col > ul > li > a {
    padding-left: 32px !important;
  }

  /* Promo card is desktop-only clutter on a phone */
  .services-mega > li.mega-promo {
    display: none !important;
  }
}

/* ============================================================
   LOCATIONS DROPDOWN
   Plain single-column dropdown; the city names are longer than
   the theme's default 220px panel, so widen it and stop the
   uppercase transform from forcing awkward wraps.
   ============================================================ */
@media (min-width: 992px) {

  .main-menu .navigation > li > ul.locations-menu {
    width: 265px !important;
    padding: 14px 0 12px !important;
    border-radius: 10px !important;
    box-shadow: 0 18px 50px rgba(11, 27, 58, .16) !important;
  }

  .main-menu .navigation > li > ul.locations-menu > li {
    padding: 0 18px !important;
    margin-bottom: 0 !important;
    border-bottom: none !important;
  }

  .main-menu .navigation > li > ul.locations-menu > li > a {
    display: block !important;
    padding: 9px 10px !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
    font-weight: 400 !important;
    color: #1c2230 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    border-radius: 6px;
    transition: color .18s ease, background .18s ease;
  }

  .main-menu .navigation > li > ul.locations-menu > li > a:hover {
    color: #e8581a !important;
    background: rgba(232, 88, 26, .06);
  }
}

/* The parent "Locations" link only opens the panel - never navigate */
.main-menu .navigation > li > a[href="#"] {
  cursor: default;
}
