/* Мега-меню каталога в шапке */

.mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  z-index: 20;
  background-color: #f6f7f8;
  box-shadow: 0 12px 24px rgba(47, 62, 75, 0.08);
}

.mega-menu[hidden] {
  display: none;
}

.mega-menu__inner {
  max-width: 1202px;
  margin: 0 auto;
  padding: 24px 16px 32px;
}

.mm-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.mm-card {
  position: relative;
  overflow: hidden;
  padding: 20px 22px 22px;
  background-color: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0px 2px 10px 0px rgba(47, 62, 75, 0.05);
}

.mm-card--wide {
  grid-column: span 2;
}

.mm-card__watermark {
  position: absolute;
  right: -12px;
  bottom: -18px;
  width: 120px;
  height: 120px;
  opacity: 0.05;
  pointer-events: none;
}

.mm-card--wide .mm-card__watermark {
  right: -1px;
  bottom: -25px;
  opacity: 1;
}

.mm-card__head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef0f2;
  text-decoration: none;
}

.mm-card__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background-color: #e8f2ff;
}

.mm-card__icon img {
  width: 22px;
  height: 22px;
}

.mm-card__title {
  font-family: "Roboto", sans-serif;
  font-weight: 500;
  font-size: 19px;
  line-height: 22.8px;
  color: #2f3e4b;
}

/* Стрелка нужна только в мобильном аккордеоне */
.mm-card__chevron {
  display: none;
}

.mm-links {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.mm-card--wide .mm-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
}

.mm-links li {
  margin: 0;
}

.mm-links a,
.mm-links__soon {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 8px;
  font-family: "Roboto", sans-serif;
  font-size: 15px;
  line-height: 20.25px;
  color: #374151;
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.mm-links a:hover {
  background-color: #fff3e9;
  text-decoration: none;
}

.mm-links__soon {
  color: #9aa4ae;
  cursor: default;
}

.mm-links img {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

@media screen and (max-width: 1023px) {
  .mega-menu {
    max-height: 80vh;
    overflow-y: auto;
    padding: 0;
    background-color: #fff;
  }

  .mega-menu__inner {
    padding: 16px 12px 24px;
  }

  .mm-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .mm-card,
  .mm-card--wide {
    grid-column: auto;
    padding: 0;
  }

  .mm-card__watermark {
    display: none;
  }

  .mm-card__head {
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 0;
  }

  .mm-card__icon {
    background-color: #f1f3f5;
  }

  .mm-card__title {
    flex: 1 1 auto;
    font-size: 18px;
    line-height: 21.6px;
  }

  .mm-card__chevron {
    display: block;
    flex: none;
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
  }

  .mm-card.is-open .mm-card__chevron {
    transform: rotate(180deg);
  }

  .mm-card .mm-links {
    display: none;
    margin: 0;
    padding: 0 14px 12px;
  }

  .mm-card.is-open .mm-links {
    display: block;
  }

  .mm-card--wide .mm-links {
    grid-template-columns: minmax(0, 1fr);
  }
}
