::-webkit-scrollbar {
  width: 5px;
}
::-webkit-scrollbar-thumb {
  background-color: var(--color);
}

body {
  user-select: none;
}
@media screen and (min-width: 1500px) {
  body {
    display: flex;
    justify-content: center;
  }
}
.wrapper {
  display: flex;
  flex-direction: column;
  margin-top: 62px;
  align-items: center;
  height: calc(100% - 62px);
  overflow-y: scroll;
  width: 100%;
}
.wrapper__search {
  max-width: 1500px;
  width: calc(100% - 2rem);
  position: fixed;
  margin-top: 1rem;
}
.wrapper__search input {
  height: 50px;
  width: 100%;
  margin-left: 0.5rem;
  padding: 0 2rem 0 1.5rem;
  font-size: 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--color);
  outline-color: var(--color-dark);
}
.wrapper div {
  display: flex;
}
@media screen and (max-width: 920px) {
  .wrapper div + div {
    flex-direction: column;
  }
}
.wrapper p {
  text-align: center;
  line-height: 1.65;
}
.wrapper span:not(#clearSearch) {
  font-weight: bold;
  text-align: center;
  width: 100%;
  margin-bottom: 1rem;
}
.wrapper article {
  display: flex;
  align-items: center;
  flex-direction: column;
  position: absolute;
  left: 0;
  margin: 0 1rem;
  width: calc(100% - 2rem);
  margin-top: calc(50px + 2rem) !important;
}
@media screen and (max-width: 1000px) {
  .wrapper__results-mobile + article {
    margin-top: calc(100px + 3rem) !important;
  }
}
.wrapper article a {
  color: var(--color);
  line-height: 1.65;
  width: auto;
}
.wrapper__notfound {
  display: none;
  margin-top: calc(50px + 2rem) !important;
  width: 100%;
}
.wrapper__notfound span {
  font-weight: bold;
}


/* Таблица курсов */
table {
  padding: 0 1rem 1rem;
  margin: auto;
  margin-top: 10px;
}
table tr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 10px;
  padding: 10px;
  gap: 10px;
  line-height: 1.65;
}
table tr:hover {
  background-color: var(--color-hover);
}
table tr td {
  display: flex;
  align-items: center;
  gap: 10px;
}
table tr td:first-child {
  user-select: text;
  overflow-wrap: anywhere;
}
table tr td svg {
  cursor: pointer;
  transition-duration: 0.3s;
}
table tr td svg.active path {
  fill: var(--color-heart);
}
table tr td svg.active:hover path {
  fill: var(--color-heart);
  opacity: .5;
}
table tr td svg:hover path {
  fill: var(--color-dark);
}
table tr td button {
  background-color: var(--color);
  border-radius: 7px;
  border: none;
  padding: 6px 15px;
  color: white;
  font-size: 1rem;
  font-family: "Roboto", sans-serif;
  cursor: pointer;
  transition-duration: 0.3s;
}
table tr td button:hover {
  background-color: var(--color-dark);
}
@media screen and (max-width: 400px) {
  table tr {
    flex-direction: column;
    padding: 10px 0;
  }
  table tr td {
    width: 100%;
  }
  table tr td svg {
    height: 30px;
    min-width: 34px;
  }
  table tr td button {
    height: 40px;
    width: 100%;
    font-size: 18px;
  }
}


/* Выбор категории и сортировки */
main {
  display: flex;
  align-items: flex-start;
  width: calc(100% - 2rem);
  max-width: 1500px;
}
.wrapper nav {
  display: none;
  flex-direction: column;
  align-items: center;
  margin: 1rem 0;
  background-color: white;
  min-width: 300px;
  max-width: 300px;
  position: fixed;
  margin-top: calc(50px + 2rem);
  gap: 1rem;
}
.wrapper nav details {
  display: none;
}
.list {
  border: solid 1px black;
  border-radius: 20px;
  width: 100%;
  flex-direction: column;
  justify-content: center;
  height: calc(100vh - 64px - 100px - 123px - 1rem - 38px);
}
.sort {
  border: solid 1px black;
  border-radius: 20px;
  width: 100%;
  flex-direction: column;
  justify-content: center;
}
.sort__container {
  padding: 7px 1rem;
  align-items: center;
  justify-content: space-between;
}
.sort__container-items {
  display: flex;
  gap: 4px;
}
.sort__container-items button {
  font-size: 13px;
  background-color: var(--color);
  border: none;
  border-radius: 10px;
  color: white;
  line-height: normal;
  padding: 0 9px;
  height: 21px;
  cursor: pointer;
}
.sort__container button.active {
  background-color: var(--color-dark);
}
.list p,
.sort p:not(.sort__container p) {
  display: flex;
  justify-content: center;
  border-bottom: solid 1px black;
  padding: 9px 0;
  margin: 0;
  line-height: 1.5;
  text-align: center;
  font-weight: bold;
  width: 100%;
}
.list > div,
nav details summary + div {
  flex-direction: column;
  overflow-y: auto;
  clip-path: inset(0 round 0 0 20px 20px)
}
.list > div > div,
nav details summary + div > div {
  padding: 10px 1rem;
  cursor: pointer;
  line-height: 1.5;
}
.list > div > div:hover,
nav details summary + div > div:hover {
  background-color: var(--color-hover);
}
.list > div > div.active,
nav details summary + div > div.active {
  background-color: var(--color);
  color: white;
}
@media screen and (max-width: 1000px) {
  main {
    flex-direction: column;
  }
  .wrapper nav {
    max-width: calc(100% - 2rem);
    min-width: calc(100% - 2rem);
    margin-top: calc(50px + 2rem);
    border: none;
    flex-direction: row;
    align-items: flex-start;
  }
  .wrapper nav details {
    display: block;
  }
  .list, .sort {
    display: none !important;
  }
  #results {
    padding: 0;
  }
  .wrapper__results,
  .wrapper__notfound {
    margin-left: 0 !important;
  }
  .wrapper__results-mobile {
    margin-top: calc(100px + 2rem) !important;
  }
  .wrapper__notfound.wrapper__results-mobile {
    margin-top: calc(100px + 3rem) !important;
  }
  .wrapper__search input {
    font-size: 1rem;
  }
}
/* Выбор категории - мобильная версия */
nav details {
  width: 100%;
}
nav details summary {
  display: flex;
  justify-content: space-between;
  flex-direction: row-reverse;
  padding: 14px 19px;
  color: #00000050;
  list-style: none;
}
nav details summary,
nav details summary + div {
  border-radius: 15px;
  border: solid 1px black;
  clip-path: inset(-2px round 20px);
}
nav details summary + div {
  max-height: calc(100vh - 64px - 155px - 4rem);
  margin-top: 8px;
}
nav details summary::before {
  content: '▼';
  transition: transform 0.2s ease;
  color: black;
}
#mobileSort + div > .sort__container {
  flex-direction: row;
}
nav .mobile-categories[open] + .mobile-sort {
  display: none;
}
nav:has(.mobile-sort[open]) .mobile-categories {
  display: none;
}
nav details[open] > summary::before {
  transform: rotate(180deg);
}
@media screen and (max-width: 330px) {
  nav details summary,
  nav details summary + div {
    font-size: 14px;
  }
}

.wrapper__results {
  flex-direction: column;
  width: 100%;
  margin-top: calc(50px + 1rem);
}
.wrapper__results p {
  display: none;
  font-weight: bold;
  margin-top: 1rem;
}

/* Недавно добавленные курсы и Понравившиеся курсы */
.new {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  background-color: white;
}
.new p {
  text-align: center;
  font-size: 24px;
  margin-top: 1rem;
}
.new span {
  font-weight: normal !important;
  margin: 10px 1rem;
  width: calc(100% - 2rem) !important;
  line-height: 1.65;
}
@media screen and (max-width: 400px) {
  .new p {
    font-size: 20px;
  }
}



.active-tab,
.active-tab:hover {
  color: var(--color) !important;
}
#menuTab {
  height: 50px;
  width: 50px;
  cursor: pointer;
  border-radius: 16px;
  border: 1px solid var(--color);
  padding: 0.5rem;
  transition: opacity 0.2s ease;
  background-color: white;
}
#menuTab:hover {
  border: 1px solid var(--color-dark) !important;
}
.tg,
.top {
  height: 50px;
  width: 50px;
  margin: 1rem;
  cursor: pointer;
  position: fixed;
  bottom: 0;
  background-color: white;
  border-radius: 50px;
}
.tg img {
  height: 50px;
  width: 50px;
}
.tg {
  right: 0;
}
.top {
  display: none;
  right: 0;
  bottom: 58px;
}
@media screen and (max-width: 1000px) {
  .top {
    left: 0;
    right: auto;
    bottom: 0;
  }
}

.search-wrapper {
  position: relative;
  width: 100%;
  margin: 0 !important;
}
#clearSearch {
  position: absolute;
  right: 1rem;
  cursor: pointer;
  font-size: 2.5rem;
  color: var(--color);
  height: 50px;
  display: none;
}
#clearSearch:hover {
  color: var(--color-dark);
}

/* Объединение в категорию */
#new {
  padding: 0 10px;
}
.category-row {
  padding: 1rem 10px;
  margin: 1rem 0;
  justify-content: center;
  text-align: center;
  font-size: 20px;
  line-height: 1.25;
  color: var(--color);
  border: solid 1px black;
  cursor: pointer;
  width: calc(100vw - 2rem);
  max-width: 1350px;
  position: relative;
}
.category-row td {
  justify-content: center;
  width: calc(100% - 50px);
}
.category-row::before {
  content: "▼";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform 0.3s ease;
  font-size: 20px;
  color: #555;
}
.category-row.collapsed::before {
  transform: translateY(-50%) rotate(-180deg);
}
@media screen and (max-width: 600px) {
  .category-row {
    font-size: 18px;
  }
}
.category-row:hover {
  background-color: inherit;
}

/* Счетчик просмотров */
.course-views {
  text-wrap: nowrap;
}

#new tr {
  max-width: 1350px;
}