:root {
  --border: #e5e7eb;
  --muted: #6b7280;
  --dark: #1f2937;
  --panel: #f9fafb;
}
a {
  text-decoration: none;
  color: var(--dark);
}

.menu-wrap {
  position: relative;
  display: inline-block;
  display: flex;
  justify-content: start;
}

.menu-trigger {
  padding: 17px 7px;
  color: var(--dark);
  cursor: pointer;
  font-size: 12px;
  text-decoration: none;
  text-wrap: nowrap;
}

.menu-trigger:hover {
  color: var(--dark) !important;
}

.mega-menu {
  position: absolute;
  top: 98%;
  left: 0;
  width: 948px;
  max-width: calc(100vw - 96px);
  min-height: 540px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  z-index: 20;
  padding: 30px;
}

[dir="rtl"] .mega-menu {
  left: auto;
  right: 0;
}

.menu-trigger:hover + .mega-menu,
.mega-menu:hover,
.menu-wrap.open .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  z-index: 9999;
}

.mega-right-panel {
  width: 34%;
  background: var(--panel);
  border-left: 1px solid var(--border);
  max-height: 500px;
  overflow-y: auto;
}

.right-list {
  list-style: none;
  padding: 8px 0;
  margin: 0;
}

.right-item {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: right;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: #4b5563;
  padding: 16px 24px;
  border-right: 4px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.right-item.is-active {
  background: #fff;
  color: var(--mainColor) !important;
  border-right-color: var(--mainColor);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.right-item.is-active .right-item-text {
  color: var(--mainColor) !important;
}

.right-item-text {
  color: var(--dark);
}

.right-item-arrow {
  color: #9ca3af;
  font-size: 20px;
  display: inline-block;
  line-height: 1;
  transition:
    transform 0.22s ease,
    color 0.22s ease;
}

.right-item:hover .right-item-arrow,
.right-item.is-active .right-item-arrow {
  color: var(--mainColor);
  transform: translateX(-4px) scale(1.08);
}

.mega-left-panel {
  width: 66%;
  padding: 32px;
  max-height: 500px;
  overflow-y: auto;
  text-align: start;
}

.menu-title {
  margin: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #f3f4f6;
  color: var(--dark);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
}

.group-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.group h3 {
  margin: 0 0 12px;
  color: var(--dark);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.group ul {
  list-style: none;
  margin: 0;
  padding-right: 14px;
  border-right: 2px solid rgba(93, 53, 237, 0.12);
}

.group li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 1280px) {
  .mega-menu {
    width: min(948px, calc(100vw - 32px));
    right: auto;
    left: 0;
  }

  .right-item {
    font-size: 14px;
  }

  .menu-title {
    font-size: 20px;
  }

  .group h3 {
    font-size: 16px;
  }

  .group li {
    font-size: 14px;
  }
}
