/* ============================================================
   FinAdvantage — Mega Menu (Auxis-style)
   ============================================================ */

/* ── Override main.css: li needs static so dropdown anchors to #mainNav (position:fixed) ── */
li.has-mega {
  position: static !important;
}

/* ── Chevron on trigger ── */
.mega-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.nav-chevron {
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.has-mega:hover .nav-chevron,
.has-mega.open .nav-chevron {
  transform: rotate(180deg);
}

/* Suppress the underline pseudo-element on mega trigger */
.has-mega > a.mega-trigger::after {
  display: none !important;
}

/* ── Dropdown container ── */
.mega-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
  border-top: 3px solid #6617FF;
  /* no overflow:hidden — it clips the ::before bridge and breaks hover */
  margin: 0 100px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
  z-index: 999;
  pointer-events: none;
}

/* No right panel — hide right side and let left fill the dropdown */
.mega-dropdown--no-right .mega-right {
  display: none;
}

.mega-dropdown--no-right .mega-left {
  width: 100%;
  max-width: 400px;
}

/* JS adds .open — this is the only trigger (no CSS :hover) */
.has-mega.open .mega-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── LEFT PANEL ── */
.mega-left {
  width: 300px;
  flex-shrink: 0;
  background: #FFF;
  /* padding: 8px 0; */
  display: flex;
  flex-direction: column;
  border-radius: 0 0 0 10px;border: 1px solid #EAEAEA;
}

/* Tab button */
.mega-tab {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 22px 24px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.mega-tab:hover,
.mega-tab.active {
  background: var(--midnight);
  border-left-color: #6617FF; color:#FFF;
}

/* Tab icon box */
.mega-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--indigo);
  color: #6617FF;
  flex-shrink: 0;
  transition: background 0.18s ease;
}

.mega-tab.active .mega-tab-icon,
.mega-tab:hover .mega-tab-icon {
  background: #6617FF;
  color: #ffffff;
}

.mega-tab-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-weight: 600;
}

.mega-tab-title {
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #151516;
  display: block;
  line-height: 1.2;
}

.mega-tab-desc {
  font-family: 'Roboto', sans-serif;
  font-size: 0.78rem;
  color: var(--charcoal);
  line-height: 1.45;
  margin: 0; font-weight: 400;
}

.mega-tab-link {
  font-family: 'Roboto', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: #6617FF;
  display: inline-block;
  margin-top: 4px;
  transition: letter-spacing 0.15s ease;
}

.mega-tab:hover .mega-tab-link,
.mega-tab.active .mega-tab-link {
  letter-spacing: 0.02em;
}

/* ── RIGHT PANEL ── */
.mega-right {
  flex: 1;
  background: #ffffff;
  padding: 20px 30px;
  min-height: 172px;
  position: relative;
  border-radius: 0 0 10px 0;
}

/* Panel sections — hidden by default */
.mega-section {
  display: none;
  animation: megaSectionIn 0.18s ease forwards;
}

.mega-section.active {
  display: block;
}

@keyframes megaSectionIn {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Grid of items ── */
.mega-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

/* Each item */
.mega-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid #ececec;
  text-decoration: none;
  color: #151516;
  transition: color 0.18s ease, padding-left 0.18s ease;
  font-family: 'Roboto', sans-serif;
  font-size: 0.9rem !important;
  font-weight: 500;
  line-height: 1.3;
}

/* Right-column items get left padding for the divider */
.mega-item:nth-child(odd) {
  /* border-right: 1px solid #ececec; */
  padding-right: 24px;
}

.mega-item:nth-child(even) {
  padding-left: 24px;
}

/* Remove bottom border from last two items */
/* .mega-item:nth-last-child(1),
.mega-item:nth-last-child(2) {
  border-bottom: none;
} */

.mega-item:hover {
  color: #6617FF;
  /* padding-left: 8px; */
}

.mega-item:nth-child(odd):hover {
  padding-left: 8px;
  padding-right: 16px;
}

/* Item icon */
.mega-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  border: 1px solid #e0e0e0;
  background: var(--indigo);
  color: var(--midnight);
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.mega-item:hover  {
  /* background: #f1e8ff; */
  border-color: #c9a8ff;
  color: #6617FF;
}

/* Brand icon images inside icon boxes */
.mega-item-icon img,
.mega-tab-icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
}

.mega-item-label {
  flex: 1;
  line-height: 1.3;
  color:#151516; font-size: 0.9rem;
}

/* Sub-panels are mobile-only; hidden on desktop */
.mega-sub-panel { display: none; }

/* ── Mobile: two-level inline accordion inside nav drawer ── */
@media (max-width: 900px) {
  li.has-mega {
    position: relative !important;
    flex-direction: column;
    align-items: flex-start;
  }

  /* Level-1 accordion: the whole dropdown */
  .mega-dropdown {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    flex-direction: column;
    border-top: 3px solid #6617FF;
    border-radius: 0;
    box-shadow: none;
    z-index: 1;
    width: 100%;
  }

  /* Large enough to hold tabs + items without scrollbar */
  .has-mega.open .mega-dropdown {
    max-height: 1600px;
  }

  /* Left panel — vertical list of category tabs */
  .mega-left {
    width: 100%;
    flex-direction: column;
    overflow-x: visible;
    padding: 0;
    border-radius: 0;
    flex-shrink: 0;
    background: #FFF; border: 1px solid #EAEAEA;
  }

  /* Individual tab — full-width row with chevron on the right */
  .mega-tab {
    flex: 1 1 auto;
    flex-direction: row;
    align-items: center;
    text-align: left;
    padding: 14px 20px;
    gap: 12px;
    border-left: 3px solid transparent;
    border-bottom: 1px solid rgba(102, 23, 255, 0.12);
    border-right: none;
    min-width: unset;
    width: 100%;
    justify-content: flex-start;
  }

  .mega-tab-body { flex: 1; text-align: left; }

  /* Expand chevron at the far right */
  .mega-tab::after {
    content: '›';
    font-size: 1.4rem;
    line-height: 1;
    color: #6617FF;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.25s ease, color 0.2s;
  }

  .mega-tab.active,
  .mega-tab:hover {
    border-left-color: #6617FF;
    border-bottom-color: rgba(102, 23, 255, 0.2);
    background: var(--midnight);
    color: #fff;
  }

  .mega-tab.active::after {
    transform: rotate(90deg);
    color: #fff;
  }

  .mega-tab-desc { display: none; }

  /* Desktop right-panel is hidden on mobile; sub-panels handle level-2 */
  .mega-right { display: none !important; }

  /* Level-2 accordion: inline sub-panel directly below its tab */
  .mega-sub-panel {
    display: block;
    max-height: 0;
    overflow: hidden;
    width: 100%;
    background: #fff;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .mega-sub-panel.panel-open {
    max-height: 700px;
    padding: 10px 16px 14px;
    border-top: 2px solid #6617FF;
    border-bottom: 1px solid rgba(102, 23, 255, 0.12);
  }

  .mega-grid { grid-template-columns: 1fr; }

  .mega-item:nth-child(odd) {
    border-right: none;
    padding-right: 0;
    padding-left: 0;
  }
  .mega-item:nth-child(odd):hover { padding-left: 8px; }
  .mega-item:nth-child(even) { padding-left: 0; }
  .mega-item:nth-last-child(1) { border-bottom: none; }

  .mega-dropdown--no-right .mega-right { display: none; }
  .mega-dropdown--no-right .mega-left { width: 100%; max-width: 100%; }
}
