/* ==========================================================
   RMG Associates - custom overrides (loaded after style.css)
   Kept separate so a SASS rebuild of style.css won't erase it.
   ========================================================== */

/* ---------- Desktop sub-menu: smooth open, no jump ---------- */

/* Parent "+" icon: fixed width, no flip-back while the sub-menu is open */
.main-menu ul li.menu-item-has-children > a:after {
  width: 14px;
  text-align: center;
  -webkit-transform: none;
      -ms-transform: none;
          transform: none;
  -webkit-transition: none;
  transition: none;
}

.main-menu ul li.menu-item-has-children > a:hover:after {
  content: "\2b";
  -webkit-transform: none;
      -ms-transform: none;
          transform: none;
}

.main-menu ul li.menu-item-has-children:hover > a:after {
  content: "\f068";
}

/* Parent link stays highlighted while its sub-menu is open */
.main-menu > ul > li:hover > a {
  color: var(--theme-color);
}

/* Sub-menu box: fade + small slide instead of the stretch (scaleY) effect */
.main-menu ul.sub-menu {
  min-width: 270px;
  padding: 12px;
  left: -20px;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  -webkit-transform: translateY(12px);
      -ms-transform: translateY(12px);
          transform: translateY(12px);
  -webkit-transition: opacity 0.25s ease, visibility 0s linear 0.25s, -webkit-transform 0.25s ease;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s, transform 0.25s ease;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.main-menu ul li:hover > ul.sub-menu {
  z-index: 99;
  opacity: 1;
  visibility: visible;
  -webkit-transform: translateY(0);
      -ms-transform: translateY(0);
          transform: translateY(0);
  -webkit-transition: opacity 0.25s ease, visibility 0s linear 0s, -webkit-transform 0.25s ease;
  transition: opacity 0.25s ease, visibility 0s linear 0s, transform 0.25s ease;
}

/* Items */
.main-menu ul.sub-menu li {
  display: block;
  margin: 0;
  padding: 0;
}

.main-menu ul.sub-menu li + li {
  margin-top: 2px;
}

.main-menu ul.sub-menu li a {
  display: block;
  padding: 10px 16px 10px 42px;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
  border-radius: 10px;
  white-space: nowrap;
  -webkit-transition: background-color 0.2s ease, color 0.2s ease;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Icon: vertically centred, never moves */
.main-menu ul.sub-menu li a:before {
  top: 50%;
  left: 16px;
  width: 14px;
  height: auto;
  font-size: 13px;
  line-height: 1;
  -webkit-transform: translateY(-50%);
      -ms-transform: translateY(-50%);
          transform: translateY(-50%);
}

/* Hover + current page */
.main-menu ul.sub-menu li a:hover,
.main-menu ul.sub-menu li a.active {
  color: var(--theme-color);
  background-color: rgba(255, 255, 255, 0.07);
}

/* "All Services" separated from the list */
.main-menu ul.sub-menu li:last-child {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
