/* K-Star mega menus (Products / Courses) — brand A–Z panel style */
#ec-main-menu-desk,
#ec-main-menu-desk.sticky-nav,
#ec-main-menu-desk.sticky-nav.menu_fixed,
#ec-main-menu-desk .container,
#ec-main-menu-desk .ec-main-menu,
#ec-main-menu-desk .ec-main-menu > ul {
  overflow: visible !important;
}

#ec-main-menu-desk .ec-main-menu > ul > li.ks-mega {
  position: static;
}

#ec-main-menu-desk .ks-mega-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 40;
  margin-top: 0;
  padding: 22px 28px 28px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

#ec-main-menu-desk .ks-mega:hover > .ks-mega-panel,
#ec-main-menu-desk .ks-mega:focus-within > .ks-mega-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.ks-mega-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee;
}

.ks-mega-title {
  margin: 0;
  color: #111;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
}

.ks-mega-sub {
  margin-top: 4px;
  color: #888;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.3;
}

.ks-mega-all {
  flex-shrink: 0;
  color: #0406ee !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none !important;
  white-space: nowrap;
  height: auto !important;
  padding: 0 !important;
  border: 0 !important;
}

.ks-mega-all:hover {
  color: #0203a8 !important;
  text-decoration: underline !important;
}

.ks-mega-columns {
  column-count: 5;
  column-gap: 28px;
}

.ks-mega-columns--products {
  column-count: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 32px;
}

.ks-mega-col {
  min-width: 0;
}

.ks-mega-letter-group {
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 16px;
}

.ks-mega-letter {
  margin: 0 0 8px;
  color: #0406ee;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.ks-mega-item {
  display: flex !important;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0 0 8px;
  padding: 4px 0 !important;
  color: #222 !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.25 !important;
  text-transform: none !important;
  text-decoration: none !important;
  height: auto !important;
  border: 0 !important;
  justify-content: flex-start !important;
}

.ks-mega-item:hover {
  color: #0406ee !important;
}

.ks-mega-thumb {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f4f4f4;
  border: 1px solid #ececec;
  border-radius: 4px;
}

.ks-mega-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ks-mega-initial {
  color: #0406ee;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.ks-mega-name {
  flex: 1 1 auto;
  min-width: 0;
}

@media (max-width: 1199.98px) {
  .ks-mega-columns {
    column-count: 4;
  }

  .ks-mega-columns--products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991.98px) {
  /* Desktop mega panel is hidden with the desk menu; mobile keeps accordion lists */
  #ec-main-menu-desk .ks-mega-panel {
    display: none;
  }
}
