/* Services dropdown — desktop mega panel + mobile accordion */

.NMP_has_dropdown {
  position: relative;
}

/* Desktop panel */
.NMP_submenu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(16px) scale(0.98);
  min-width: 280px;
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
  margin: 0;
  padding: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(52, 66, 118, 0.12);
  box-shadow:
    0 4px 6px rgba(52, 66, 118, 0.04),
    0 22px 50px rgba(52, 66, 118, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  z-index: 1000;
  transition:
    opacity 0.32s ease,
    visibility 0.32s ease,
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.NMP_submenu::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #5ca8ff, #344276 55%, #5ca8ff);
  background-size: 200% 100%;
  z-index: 2;
}

.NMP_submenu::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #fff;
  border-left: 1px solid rgba(52, 66, 118, 0.1);
  border-top: 1px solid rgba(52, 66, 118, 0.1);
  transform: translateX(-50%) rotate(45deg);
  z-index: 1;
}

/* Header strip — centered title bar (mega-menu pattern) */
.NMP_submenu_header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 28px 14px;
  text-align: center;
  background: linear-gradient(135deg, #344276 0%, #283152 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.NMP_submenu_label {
  display: block;
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
}

.NMP_submenu_tagline {
  display: block;
  margin: 0;
  max-width: 28em;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.45;
}

.NMP_submenu_item {
  width: 100%;
  padding: 0 10px;
  opacity: 0;
  transform: translateY(6px);
  background: linear-gradient(180deg, #fafbfd 0%, #fff 100%);
}

.NMP_submenu_header + .NMP_submenu_item {
  padding-top: 10px;
}

.NMP_submenu_item a {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin-bottom: 0;
  border-radius: 12px;
  text-decoration: none;
  color: #3a3f4d;
  border: 1px solid transparent;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1),
    box-shadow 0.25s ease;
}

.NMP_submenu_icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  color: #344276;
  background: linear-gradient(145deg, rgba(92, 168, 255, 0.2), rgba(52, 66, 118, 0.08));
  border: 1px solid rgba(52, 66, 118, 0.08);
  transition: transform 0.28s ease, background 0.28s ease, color 0.28s ease;
}

.NMP_submenu_text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: left;
}

.NMP_submenu_title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #344276;
  line-height: 1.25;
}

.NMP_submenu_desc {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #6b7280;
  line-height: 1.35;
}

.NMP_submenu_arrow {
  font-size: 11px;
  color: #5ca8ff;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.NMP_submenu_item a:hover {
  background: #fff;
  border-color: rgba(92, 168, 255, 0.35);
  box-shadow: 0 8px 20px rgba(52, 66, 118, 0.1);
  transform: translateX(4px);
}

.NMP_submenu_item a:hover .NMP_submenu_icon {
  background: linear-gradient(145deg, #344276, #4a5d94);
  color: #fff;
  transform: scale(1.06);
}

.NMP_submenu_item a:hover .NMP_submenu_arrow {
  opacity: 1;
  transform: translateX(0);
}

.NMP_submenu_item a.is-active {
  background: rgba(52, 66, 118, 0.06);
  border-color: rgba(52, 66, 118, 0.15);
}

.NMP_submenu_item a.is-active .NMP_submenu_icon {
  background: linear-gradient(145deg, #344276, #4a5d94);
  color: #fff;
}

.NMP_submenu_item a.is-active .NMP_submenu_title {
  color: #344276;
  font-weight: 700;
}

@keyframes NMP_submenuItemIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .NMP_submenu {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 8px;
    min-width: 540px;
    width: 540px;
    max-width: min(560px, calc(100vw - 24px));
    padding: 0 10px 10px;
    box-sizing: border-box;
  }

  .NMP_submenu_header {
    grid-column: 1 / -1;
  }

  .NMP_submenu_header {
    margin: 0 -10px;
    width: calc(100% + 20px);
  }

  .NMP_submenu_item {
    width: 100%;
    padding: 0;
    min-width: 0;
  }

  .NMP_submenu_header + .NMP_submenu_item {
    padding-top: 12px;
  }

  .NMP_submenu_item a {
    grid-template-columns: 36px minmax(0, 1fr);
    padding: 10px;
    gap: 8px;
  }

  .NMP_submenu_arrow {
    display: none;
  }

  .NMP_submenu_item a:hover {
    transform: translateY(-2px);
  }

  .NMP_submenu_title {
    font-size: 12px;
  }

  .NMP_submenu_desc {
    font-size: 11px;
    line-height: 1.3;
  }

  .NMP_has_dropdown:hover .NMP_submenu,
  .NMP_has_dropdown.is-open .NMP_submenu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
  }

  .NMP_has_dropdown:hover .NMP_submenu::before {
    animation: NMP_submenuShine 2.5s ease-in-out infinite;
  }

  .NMP_has_dropdown:hover .NMP_submenu_item,
  .NMP_has_dropdown.is-open .NMP_submenu_item {
    animation: NMP_submenuItemIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }

  .NMP_submenu > .NMP_submenu_item:nth-child(2) { animation-delay: 0.04s; }
  .NMP_submenu > .NMP_submenu_item:nth-child(3) { animation-delay: 0.08s; }
  .NMP_submenu > .NMP_submenu_item:nth-child(4) { animation-delay: 0.12s; }
  .NMP_submenu > .NMP_submenu_item:nth-child(5) { animation-delay: 0.16s; }
  .NMP_submenu > .NMP_submenu_item:nth-child(6) { animation-delay: 0.2s; }
  .NMP_submenu > .NMP_submenu_item:nth-child(7) { animation-delay: 0.24s; }

  /* Bridge gap so hover doesn't close */
  .NMP_has_dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 14px;
  }
}

@keyframes NMP_submenuShine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Mobile accordion */
@media (max-width: 767.98px) {
  .NMP_submenu {
    display: block;
    position: static;
    left: auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    transform: none;
    padding: 0;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    max-height: 0;
    overflow: hidden;
    border: none;
    border-radius: 0;
    box-shadow: none;
    transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .NMP_submenu::before,
  .NMP_submenu::after {
    display: none;
  }

  .NMP_has_dropdown.active .NMP_submenu {
    max-height: 720px;
    margin-top: 4px;
  }

  .NMP_submenu_header {
    padding: 14px 20px 12px;
    margin: 0;
    width: 100%;
    gap: 6px;
  }

  .NMP_submenu_item {
    opacity: 1;
    transform: none;
    animation: none !important;
  }

  .NMP_submenu_item {
    padding: 0 10px;
  }

  .NMP_submenu_item a {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    margin-bottom: 6px;
    transform: none !important;
  }

  .NMP_submenu_arrow {
    display: inline-block;
  }

  .NMP_submenu_item a:hover {
    transform: none;
  }

  .NMP_submenu_arrow {
    opacity: 0.5;
    transform: none;
  }

  .NMP_has_dropdown::after {
    display: none;
  }
}
