/* Programs mega-dropdown — categories → program links */

.nav-programs { position: relative; }

.programs-mega {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: min(720px, calc(100vw - 32px));
  background: #fff;
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: 16px;
  box-shadow: 0 2px 4px rgba(26, 26, 26, 0.04), 0 18px 40px -10px rgba(26, 26, 26, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 320;
  overflow: hidden;
  padding: 0;
  list-style: none;
  margin: 0;
}

@media (hover: hover) and (pointer: fine) {
  .nav-programs:hover .programs-mega,
  .nav-programs:focus-within .programs-mega {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
  }
}

.programs-mega-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 280px;
  max-height: min(70vh, 480px);
}

.programs-mega-cats {
  border-right: 1px solid rgba(26, 26, 26, 0.06);
  overflow: auto;
  padding: 10px;
  background: #fcfbfd;
}

.programs-mega-cat {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(26, 26, 26, 0.62);
  cursor: pointer;
}

.programs-mega-cat:hover { background: rgba(122, 60, 255, 0.06); color: #141218; }
.programs-mega-cat.active {
  background: rgba(122, 60, 255, 0.1);
  color: #7a3cff;
}

.programs-mega-panel {
  overflow: auto;
  padding: 14px 16px 16px;
}

.programs-mega-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.programs-mega-panel-head strong {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #141218;
}

.programs-mega-panel-head a {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a3cff;
  text-decoration: none;
}

.programs-mega-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.programs-mega-list a {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(26, 26, 26, 0.78);
  text-decoration: none;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.35;
  white-space: normal;
}

.programs-mega-list a:hover {
  background: rgba(26, 26, 26, 0.05);
  color: #141218;
}

.programs-mega-list a::before { display: none !important; }

.programs-mega-empty {
  color: rgba(26, 26, 26, 0.45);
  font-size: 13px;
  padding: 12px 4px;
}

/* Mobile accordion — hidden on desktop */
.programs-mega-accordion { display: none; }

/* Mobile: expand inside hamburger menu */
@media (max-width: 900px) {
  .nav-programs.nav-dropdown > a::after { display: none; }
  .programs-mega {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: all !important;
    width: 100%;
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
    max-height: none;
    display: none;
    overflow: visible;
  }
  .nav-programs.open-programs .programs-mega { display: block; }

  /* Hide desktop two-column mega on mobile */
  .programs-mega-body { display: none !important; }

  .programs-mega-accordion {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0 4px;
  }

  .programs-acc-item {
    border: 1px solid rgba(26, 26, 26, 0.08);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
  }

  .programs-acc-item[open] {
    border-color: rgba(122, 60, 255, 0.22);
    box-shadow: 0 1px 0 rgba(122, 60, 255, 0.06);
  }

  .programs-acc-item summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: rgba(26, 26, 26, 0.78);
    user-select: none;
  }

  .programs-acc-item summary::-webkit-details-marker { display: none; }

  .programs-acc-item summary::after {
    content: '';
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-right: 1.5px solid rgba(26, 26, 26, 0.4);
    border-bottom: 1.5px solid rgba(26, 26, 26, 0.4);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -3px;
  }

  .programs-acc-item[open] summary {
    color: #7a3cff;
    background: rgba(122, 60, 255, 0.06);
  }

  .programs-acc-item[open] summary::after {
    transform: rotate(-135deg);
    margin-top: 3px;
    border-color: #7a3cff;
  }

  .programs-acc-body {
    padding: 4px 8px 12px;
    border-top: 1px solid rgba(26, 26, 26, 0.06);
  }

  .programs-acc-body .programs-mega-list a {
    color: rgba(26, 26, 26, 0.62) !important;
    -webkit-text-fill-color: rgba(26, 26, 26, 0.62) !important;
    padding: 11px 10px !important;
    font-size: 13px;
  }

  .programs-acc-all {
    display: inline-block;
    margin: 6px 10px 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #7a3cff !important;
    -webkit-text-fill-color: #7a3cff !important;
    text-decoration: none;
  }
}
