@media screen and (max-width: 768px) {
  .cc-collection-products {
    margin-top: 0.5rem !important;
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.grid,
.grid > li {
  border: none !important;
}

.main-products-grid {
  align-items: stretch;

  .main-products-grid__results {
    @media screen and (max-width: 768px) {
      > ul.grid {
        padding-inline: 2rem;
        gap: 1rem;
      }
    }

    > nav {
      ul {
        gap: 2rem;

        .pagination__item--arrow {
          flex: unset;

          > a {
            padding: 0;
            margin: 0 1rem;
            width: fit-content;
            display: flex;
            gap: 1rem;

            > * {
              opacity: 1;
            }

            > span {
              @media screen and (max-width: 768px) {
                display: none;
              }
            }

            .pagination__arrow-icon {
              display: flex;

              svg {
                width: 26px;
              }
            }
          }
        }

        li:hover,
        li > a:hover {
          text-decoration: none;
          border: none;
        }

        li:not(:first-child):not(:last-child):has(> a),
        li:not(:first-child):not(:last-child):has(.pagination__page-current) {
          border: 0.5px solid #c1babd;

          a {
            padding: 0.8rem 1rem;
          }

          span {
            background: none;
            padding: 0.8rem 1rem;
          }
        }
      }
    }
  }
}

.main-products-grid__filters {
  align-self: stretch;
  border-inline-end: none !important;

  .facets.drawer {
    height: 100%;
  }

  .promo__content {
    align-self: stretch;
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }

  .promo::after {
    background: linear-gradient(0deg, black, black), linear-gradient(0deg, black 49.36%, black 79.76%);
    opacity: 0.2;
  }

  @media (min-width: 1024px) {
    flex: 0 0 calc(260px + 12 * var(--space-unit));
    margin-inline-end: calc(12 * var(--space-unit));
    padding-bottom: calc(14 * var(--space-unit));
    padding-inline-end: calc(12 * var(--space-unit));
  }
}

#products-toolbar {
  border: none;

  @media screen and (max-width: 768px) {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 24px;
    padding-bottom: 1.5rem;
  }
}

.products-toolbar--custom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0;
  padding-bottom: 0;
  padding-top: 0;
  border-top: 0;

  .products-toolbar__title-wrap {
    flex: 1;
    min-width: 0;
    padding-bottom: 1rem !important;
  }

  .products-toolbar__title {
    margin: 0;
    font-weight: 600;
  }

  .products-toolbar__mobile-search {
    display: none;
  }

  .products-toolbar__mobile-actions {
    display: none;
    padding-top: 2rem;

    .products-toolbar__filter-btn {
      display: none;
      align-items: center;
      gap: 1rem;
      font-weight: 400;
      text-align: start;
      padding-left: 0;
      border: none;

      .icon {
        width: 16px;
        height: 16px;
      }
    }

    .products-toolbar__mobile-count {
      text-align: end;
      white-space: nowrap;
      font-size: 14px;
    }

    @media screen and (max-width: 768px) {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.75rem;

      .products-toolbar__filter-btn {
        display: inline-flex;
        width: fit-content;
      }
    }
  }

  .products-toolbar__sort {
    margin-inline-start: auto;
    position: relative;

    @media screen and (max-width: 768px) {
      display: none;
    }

    .custom-sort-popup .custom-select {
      border: 1px solid rgba(228, 231, 233, 1);
      padding: 0.5rem 1rem 0.5rem 2rem;
      background: #fff;
    }

    .custom-sort-popup .custom-select__btn {
      margin-inline-end: 0;
    }
  }

  .products-toolbar__filter-btn {
    display: none;
  }

  @media screen and (max-width: 768px) {
    .products-toolbar__title-wrap {
      order: 1;
      padding-bottom: 0;
    }

    .products-toolbar__mobile-search {
      order: 2;
      display: block;
      width: 100%;
      --display: block;
    }

    .products-toolbar__mobile-actions {
      order: 3;
      padding-top: 0;
    }
  }
}

.custom-sort-popup {
  position: relative;
  display: flex;
  flex-direction: row;
  gap: 1rem;
  align-items: center;
}

.custom-sort-popup__panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  width: min(320px, 92vw);
  border: 1px solid rgba(228, 231, 233, 1);
  background: #fff;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.12);
  z-index: 30;
}

.custom-sort-popup__panel-top {
  display: flex;
  align-items: center;
  min-height: 3rem;
  padding: 1.5rem 1rem;
  justify-content: end;

  button {
    text-decoration: underline;
    font-size: 14px;
  }
}

.custom-sort-popup__reset {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
}

.custom-sort-popup__divider {
  border-top: 1px solid rgba(228, 231, 233, 1);
}

.custom-sort-popup__panel-main {
  padding: 0.9rem 1rem 1rem;
}

.custom-sort-popup__heading {
  margin: 1rem 0;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
}

.custom-sort-popup__options {
  list-style: none;
  margin: 0;
  padding: 0;
}

.custom-sort-popup__option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.35rem 0;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
}

.custom-sort-popup__option input[type="radio"] {
  appearance: none;
  width: 14px;
  height: 14px;
  margin: 0;
  border: 1px solid #808080;
  border-radius: 50%;
  position: relative;
  flex: 0 0 14px;
}

.custom-sort-popup__option input[type="radio"]::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #111;
  transform: scale(0);
  transition: transform 0.12s ease;
}

.custom-sort-popup__option input[type="radio"]:checked::after {
  transform: scale(1);
}

.custom-active-filters {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0;
  padding: 20px;
  background: rgba(242, 244, 245, 1);

  .custom-active-filters__left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    min-width: 0;
  }

  .custom-active-filters__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .custom-active-filters__count {
    text-align: end;
    white-space: nowrap;

    @media (max-width: 767.98px) {
      text-align: start;
    }
  }

  @media screen and (max-width: 768px) {
    display: none;
  }

  @media (max-width: 767.98px) {
    grid-template-columns: 1fr;
  }
}

.custom-active-filter-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  color: currentColor;
  text-decoration: none;

  .icon {
    width: 14px;
    height: 14px;
  }
}

.disclosure__show-more {
  display: none;
}

.facets {
  .disclosure {
    margin: 0 6px;
  }
}

.filter {
  > .filter__toggle > div > span {
    text-transform: uppercase;
    font-size: clamp(14px, 3vw, 16px);
  }

  li:not(:last-child) {
    margin-bottom: calc(5 * var(--space-unit));
  }
}

.filter__label--product-type {
  cursor: pointer;

  &::before,
  &::after {
    display: none !important;
    content: none !important;
  }

  &.is-active {
    font-weight: 700;
  }
}

.filter__search {
  position: relative;
  margin-bottom: 3rem;

  .filter__search-icon {
    position: absolute;
    inset-inline-start: 0.7rem;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    pointer-events: none;
    color: rgba(var(--text-color) / 0.65);
    display: flex;

    .icon {
      width: 14px;
      height: 14px;
    }
  }

  .filter__search-input {
    width: 100%;
    padding: 0.55rem 0.7rem 0.55rem 3rem;
    border: 1px solid rgba(var(--text-color) / 0.2);
    border-radius: 0;
    background: rgba(var(--bg-color));
    color: rgba(61, 61, 61, 1);
  }

  .filter__search-empty {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    color: rgba(var(--text-color) / 0.7);
  }
}

.filter__vendor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.5rem;

  > .filter__all-option {
    grid-column: 1 / -1;
  }
}

.promo__button {
  padding: 2rem;
}

custom-pagination {
  #filter-results {
    > nav > ul {
      justify-content: center !important;
    }
  }
}
