/* Only database categories become mega-menu columns; ordinary menus stay unchanged. */
@media (min-width: 992px) {
  .th-header .main-menu {
    position: relative;
  }

  .th-header .main-menu > ul > li.ayu-category-mega-item {
    position: static;
  }

  .th-header .main-menu > ul > li.ayu-category-mega-item > .ayu-category-mega {
    display: grid;
    grid-template-columns: repeat(var(--ayu-mega-columns, 2), minmax(220px, 1fr));
    gap: 0;
    top: 100%;
    left: 50%;
    width: min(calc(var(--ayu-mega-columns, 2) * 300px + 48px), calc(100vw - 48px));
    max-height: min(68vh, 680px);
    margin: 0;
    padding: 22px 24px;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(18, 41, 74, 0.1);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 20px 44px rgba(18, 41, 74, 0.16);
    pointer-events: none;
    transform: translate(-50%, 12px);
    transform-origin: top center;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  }

  .th-header .main-menu > ul > li.ayu-category-mega-item:hover > .ayu-category-mega {
    visibility: visible;
    opacity: 1;
    z-index: 99;
    pointer-events: auto;
    transform: translate(-50%, 0);
  }

  .th-header .ayu-category-mega > .ayu-category-column {
    display: block;
    min-width: 0;
    margin: 0;
    padding: 0 22px;
  }

  .th-header .ayu-category-mega > .ayu-category-column + .ayu-category-column {
    border-left: 1px solid rgba(18, 41, 74, 0.1);
  }

  .th-header .ayu-category-title,
  .th-header .ayu-category-subtitle {
    display: block;
    color: var(--theme-color);
    font-weight: 800;
    line-height: 1.35;
  }

  .th-header .ayu-category-title {
    padding: 2px 0 8px;
    margin-bottom: 3px;
    font-size: 17px;
  }

  .th-header .ayu-category-subtitle {
    padding: 8px 0 4px;
    font-size: 15px;
  }

  .th-header .ayu-category-mega .ayu-category-links,
  .th-header .ayu-category-mega .ayu-category-links .ayu-category-links {
    position: static;
    display: block;
    visibility: visible;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    opacity: 1;
    z-index: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    transform: none;
  }

  .th-header .ayu-category-mega .ayu-category-links li {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  .th-header .ayu-category-mega .ayu-category-links li + li {
    margin-top: 2px;
  }

  .th-header .ayu-category-mega .ayu-category-links a {
    display: block;
    padding: 6px 0;
    color: var(--title-color);
    font-size: 15px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .th-header .ayu-category-mega .ayu-category-links a::before,
  .th-header .ayu-category-mega .ayu-category-links a::after {
    display: none;
  }

  .th-header .ayu-category-mega .ayu-category-links a:hover {
    color: var(--theme-color);
    padding-left: 5px;
  }

  .th-header .main-menu ul.sub-menu:not(.ayu-category-mega) li a {
    padding-left: 0;
    transition: color 0.2s ease, padding-left 0.2s ease;
  }

  .th-header .main-menu ul.sub-menu:not(.ayu-category-mega) li a::before {
    display: none;
  }

  .th-header .main-menu ul.sub-menu:not(.ayu-category-mega) li a:hover {
    color: var(--theme-color);
    padding-left: 5px;
  }

  .th-header .ayu-category-pages {
    padding-top: 1px;
  }

  .th-header .ayu-category-mega::-webkit-scrollbar {
    width: 8px;
  }

  .th-header .ayu-category-mega::-webkit-scrollbar-thumb {
    border: 2px solid #fff;
    border-radius: 8px;
    background: rgba(18, 41, 74, 0.28);
  }
}
