.catalog {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-block: 2rem;
}

.catalog-tabs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  user-select: none;
  border-radius: 0.5rem;
  z-index: 2;
  background-color: #fff;
  padding-block: 0.5rem;

  &::-webkit-scrollbar {
    display: none;
  }

  &:active {
    cursor: grabbing;
  }
}

.catalog-tab {
  padding: 0.75rem 1rem;
  color: #453b27;
  background-color: #f4f1ec;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: all 0.3s;
  white-space: nowrap;

  &.active,
  &:hover {
    background-color: #ffdb9b;
  }
}

.catalog-content {
  display: flex;
  gap: 1.5rem;
}

.catalog-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.catalog-rules {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.catalog-rule {
  position: relative;
  background-color: #8da13a;
  padding: 2rem;
  color: #fff2db;
  display: flex;
  align-items: center;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 1;
}

.catalog-rule::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  bottom: 1rem;
  left: 1rem;
  background-image: url("../img/icons/card-border.svg");
}

.catalog-rule::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  top: 1rem;
  transform: rotate(180deg);
  right: 1rem;
  background-image: url("../img/icons/card-border.svg");
}

.catalog-rule-text {
  line-height: 150%;
  span {
    color: #ffe49a;
  }
}

.catalog-rule.dev {
  background: linear-gradient(180deg, #b0ac6c 7.21%, #718708 100%), #aa8440;
}

.catalog-rule.model {
  background:
    linear-gradient(180deg, rgba(156, 111, 54, 0) 0%, #795628 100%), #9c6f36;
}

.catalog-rule.self {
  background:
    linear-gradient(180deg, rgba(195, 105, 67, 0) 0%, #af491e 100%), #c36943;
}

.catalog-filters {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  background: var(--bg);
  width: 100%;
  padding: 1.5rem 1.5rem 1.5rem 0;
  box-shadow: 3px 0px 8px rgba(96, 74, 47, 0.12);
}

.filters-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filters-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-left: 1rem;
}

.filters-title {
  font-family: var(--font-secondary);
  font-size: 1.5rem;
  background-color: #f4f1ec;
  padding: 0.5rem 2rem;
  width: 100%;
  position: relative;

  &:before {
    content: "";
    position: absolute;
    left: 0px;
    top: 50%;
    transform: translate(0, -50%);
    width: 32px;
    height: 50px;
    background: linear-gradient(
      90deg,
      rgba(255, 175, 64, 0.3) 0%,
      rgba(255, 255, 255, 0.3) 100%
    );
    z-index: 1;
  }
}

.filters-hint {
  color: #998b74;
}

.filters-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-left: 1rem;
  position: relative;
}

.filters-list::after {
  content: "";
  position: absolute;
  left: 0px;
  top: 0px;
  height: 100%;
  width: 4px;
  background: linear-gradient(
    rgba(255, 174, 28, 0.066) 0%,
    rgba(255, 174, 28, 0.33) 100%
  );
  transition: all 0.3s;
}

.filter-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #333;
  gap: 0.5rem;
  transition: 0.3s;
}

.custom-radio {
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.filter-link.active .custom-radio::after {
  content: "";
  width: 10px;
  height: 10px;
  background-color: #e5a34c;
  border-radius: 50%;
}

.filter-link.active .filter-text {
  color: #9b6d36;
}

.filter-link:nth-child(n + 5) {
  display: none;
  opacity: 0;
}

.filters-content.is-expanded .filters-list .filter-link:nth-child(n + 5) {
  display: flex;
  animation: fadeIn 0.3s forwards;
}

.show-more {
  color: #8b6e4b;
  border-bottom: 1px dotted;
  width: fit-content;
  font-size: 0.875rem;
}

.filters-content.is-expanded .show-more {
  font-size: 0;
}
.filters-content.is-expanded .show-more::before {
  content: "Скрыть";
  font-size: 0.875rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.catalog-aside {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
  max-width: 280px;
  flex-shrink: 0;
  position: sticky;
  bottom: 0px;
}

.arrow-down {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #000;
}

.catalog-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid #9b6d36;
  padding: 0.75rem;
  background-color: #f9f0df;
}

.toolbar-label {
  color: #9b6d36;
  border-bottom: 2px dotted #9b6d36;
  white-space: nowrap;
}

.dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.custom-select-wrapper {
  position: relative;
  cursor: pointer;
}

.dropdown-list {
  display: none;
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  min-width: 150px;
  background-color: #f9f0df;
  border: 1px solid #d7c5af;
  z-index: 100;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.dropdown-list.active {
  display: block; /* Показуємо при кліку */
}

.dropdown-item {
  padding: 0.5rem 0.75rem;
  transition: all 0.3s;
}

.dropdown-item:hover {
  background-color: #ffae1c50;
}

.catalog-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.catalog-manager {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 1.5rem;
  padding: 1.5rem;
  padding-top: calc(2rem + 40px);
  min-height: 210px;
  grid-row: 2;
  grid-column: 1 / -1;
  background:
    url("../img/catalog/manager-img.png"),
    linear-gradient(
      129.44deg,
      rgba(0, 0, 0, 0) 26.76%,
      rgba(201, 158, 82, 0.12) 73.24%
    ),
    linear-gradient(to bottom, transparent 40px, #4a4237 40px);
  background-repeat: no-repeat;
  background-position:
    left bottom,
    0 40px,
    0 0;
  background-size:
    361px 199px,
    auto,
    auto;
  color: #ffefdd;
  position: relative;

  &:before {
    content: "";
    position: absolute;
    background: linear-gradient(
      to right,
      rgba(198, 181, 149, 0) 0%,
      #fff5e6 50%,
      rgba(198, 181, 149, 0) 100%
    );

    width: 60%;
    height: 2px;
    right: 1.5rem;
    top: calc(40px + 1.5rem);
  }

  &:after {
    content: "";
    position: absolute;
    background: linear-gradient(
      to right,
      rgba(198, 181, 149, 0) 0%,
      #fff5e6 50%,
      rgba(198, 181, 149, 0) 100%
    );

    width: 60%;
    height: 2px;
    right: 3.5rem;
    bottom: 1.5rem;
  }
}

.catalog-manager-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.catalog-manager-title {
  font-family: var(--font-secondary);
  font-size: 2rem;

  span {
    color: #d3d073;
  }
}

.catalog-club-card {
  padding: 1.5rem;
  background: #9baa55;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
  color: #fff2db;

  background:
    url("../img/catalog/club-img.png"),
    linear-gradient(180deg, #9baa55 0%, #647129 100%), #aa8440;

  background-position:
    right center,
    0 0,
    0 0;

  background-repeat: no-repeat;

  grid-row: 4;
  grid-column: 4 / 5;
}

.club-card-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;

  &.num {
    align-items: center;
  }
}

.club-card-title {
  font-family: var(--font-secondary);
  font-size: 2rem;

  span {
    color: #ffe49a;
  }
}

.club-card-num {
  font-family: var(--font-secondary);
  font-size: 5rem;

  background:
    linear-gradient(0deg, #d9c581 19.36%, #d99e61 41.07%, #fff1c3 47.13%),
    #ffdab4;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;

  span {
    font-size: 3rem;
  }
}

.club-card-num-text {
  color: #ffe7b3;
  font-size: 1.25rem;
  line-height: 150%;
  text-align: center;
  background-color: #77853875;
}

.catalog-club-button {
  padding: 1rem;
  border-radius: 0.75rem;
  font-weight: 500;
  background: #f7d79d;
  width: 100%;
  text-align: center;
  font-size: 0.875rem;
  transition: all 0.3s;

  &:hover {
    opacity: 0.7;
  }
}

.item-discount,
.item-new {
  width: 120px;
  height: 120px;
  position: absolute;
  left: -4px;
  top: -4px;
  background-image: url("../img/catalog/discount.svg");
  background-size: 120px 120px;
  z-index: 5;
  pointer-events: none;

  span {
    display: block;
    font-size: 1.5rem;
    color: #ffdaa2;
    font-weight: 700;
    transform: rotate(-45deg) translate(0px, 15px);
  }
}

.item-discount {
  background-image: url("../img/catalog/discount.svg");
}

.item-new {
  background-image: url("../img/catalog/news.svg");
  span {
    font-size: 1.25rem;
    transform: rotate(-45deg) translate(-15px, 15px);
  }
}

.catalog-pre-text {
  width: 100%;

  strong {
    font-weight: 700;
  }

  span {
    color: #ca9232;
  }

  ul {
    padding-block: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  li {
    display: flex;
    align-items: center;
    gap: 0.5rem;

    &::before {
      content: "";
      width: 10px;
      height: 10px;
      background-color: #e5ac48;
      border-radius: 50%;
      flex-shrink: 0;
    }
  }

  h3 {
    color: #e5ac48;
    font-size: 1.5rem;
  }
}

@media all and (max-width: 1529px) {
  .catalog-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .catalog-club-card {
    grid-column: 3 / 4;
  }
}

@media all and (max-width: 1459px) {
  .catalog-rule {
    flex-direction: column;
  }
}

@media all and (max-width: 1279px) {
  .catalog-aside {
    position: fixed;
    top: 60px;
    left: 0;
    z-index: 100;
    width: 100%;
    background: #fff;
    overflow: auto;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.3s;
  }

  .call-button {
    font-size: 0.875rem;
    justify-content: center;
  }

  .catalog-aside.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .catalog-filters-btn-mob {
    display: flex;
  }

  .catalog-call {
    max-width: 90%;
    margin: 0 auto;
  }
}

@media all and (max-width: 1023px) {
  .catalog-rule-text {
    font-size: 0.875rem;
  }

  .catalog-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .catalog-club-card {
    grid-column: 2 / 3;
  }

  .catalog-manager {
    flex-direction: column;
    min-height: 570px;
    padding-bottom: 2.5rem;
    background-position:
      left top,
      0 40px,
      0 0;
    background-size:
      600px 331px,
      auto,
      auto;

    &:before {
      right: 50%;
      top: unset;
      bottom: 13rem;
      transform: translate(50%);
    }

    &:after {
      right: 50%;
      transform: translate(50%);
      bottom: 1rem;
    }
  }
}

@media all and (max-width: 767px) {
  .catalog-rules {
    display: none;
  }

  .catalog-toolbar {
    flex-direction: column;
    gap: 0.5rem;
  }

  .toolbar-group {
    justify-content: space-between;
    width: 100%;
    padding: 0.5rem;
    font-size: 0.875rem;
  }

  .catalog {
    gap: 1rem;
    padding-block: 1rem;
  }

  .catalog-tabs {
    gap: 0.5rem;
  }

  .catalog-tab {
    font-size: 0.875rem;
    padding: 0.75rem;
  }

  .catalog-list {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
  }

  .catalog-club-card {
    grid-column: unset;
    grid-row: 10;
  }

  .catalog-manager {
    grid-row: 5;
    min-height: 450px;
    background-size:
      350px 193px,
      auto,
      auto;

    &:before {
      bottom: 15rem;
      width: 80%;
    }

    &:after {
      width: 80%;
    }
  }

  .catalog-manager-title {
    font-size: 1.5rem;
  }

  .catalog-aside {
    max-width: unset;
  }

  .close-filters {
    display: block;
  }
}
