/* c-pagination
------------------------------------------------------------------- */

.personal-page .c-pagination {
  background-color: var(--color-bg);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 20px;
}

.catalog__pagination {
  grid-column-start: 1;
  grid-column-end: -1;
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 15px;
}

.a-pagination {
  width: 100%;
}

.mg-pager {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  align-items: center;
  font-size: var(--text-md);
  line-height: 1.2;
  font-weight: 500;
}

.c-pagination .allPages,
.mg-pager .allPages {
  padding: 10px 10px;
  border-radius: 5px;
  background: var(--color-bg-accent);
  text-align: center;
  color: var(--color-text);
}

.c-pagination ul,
.mg-pager ul {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  list-style: none;
  padding: 0;
  /* Разделяем «» и «»» (вперёд / в конец), иначе визуально сливаются в »»» */
  gap: 0.5rem;
  row-gap: 0.35rem;
  align-items: center;
}

.mg-pager ul > li {
  flex-shrink: 0;
}

.c-pagination ul a,
.mg-pager li > a,
.mg-pager li > button.active {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: center;
  align-items: center;
  -ms-flex-pack: center;
  justify-content: center;
  min-width: 4rem;
  height: 4rem;
  text-decoration: none;
  color: var(--color-text);
  transition:
    color 0.25s,
    background 0.25s;
  border-radius: 4px;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  line-height: initial;
}

@media (max-width: 373px) {
  .mg-pager {
    flex-direction: column;
  }
}

@media (max-width: 767px) {
  .c-pagination ul a,
  .mg-pager li > a,
  .mg-pager li > button.active {
    width: 22px;
    height: 22px;
    font-size: var(--text-xxs);
  }

  /* Стрелки навигации (‹ » »») — не фиксировать 22px, иначе символы наезжают друг на друга */
  .mg-pager li > a.navButton,
  .mg-pager li > a.linkPage.navButton {
    width: auto;
    min-width: 2.25rem;
    padding-left: 0.35rem;
    padding-right: 0.35rem;
  }

  .mg-pager ul {
    gap: 0.4rem;
  }
}

.c-pagination ul a:hover,
.c-pagination ul a.active,
.mg-pager li > a:hover {
  color: var(--color-accent);
  opacity: 0.7;
}

.mg-pager li > a.active,
.mg-pager li > button.active {
  background: var(--color-accent);
  color: var(--color-text-inverse);
  pointer-events: none;
  cursor: default;
}

.c-pagination ul a:active,
.mg-pager li > a:active {
  -webkit-transform: translateY(3px);
  -ms-transform: translateY(3px);
  transform: translateY(3px);
}

.mg-pager .linkPage:focus {
  outline: auto;
}




