.collection-product-list {
  &.filter-are-hidden {
    --collection-grid-columns: 4 !important;
  }
}

.collection:has(.facets_hide.is-open) {
  .collection-product-grid {
    flex: unset;
  }
}

.collection-product {
  display: flex;
  flex-wrap: wrap;
  column-gap: 2rem;

  .product_price {
    .price {
      padding-top: 1.5rem;
    }
  }

  .pagination-wrapper {
    flex: 100%;
  }

  .feat_coll_content {
    padding-top: 1rem;
  }

  .collection-product-card {
    .product_image {
      border-image-source: linear-gradient(#f7f7f7, #f7f7f7);
      border-image-slice: fill 1;
      position: relative;

      a {
        position: absolute;
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
      }

      img {
        filter: invert(3%);
        object-position: center;
        background-color: var(--color-background);
      }
    }

    .product_title {
      @media screen and (max-width: 749px) {
        font-size: 12px;
        line-height: 18px;
      }
    }
  }
}

.collection-product-grid {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;

  .pagination-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;

    .button.js-load-more {
      padding: 16px 32px;

      span {
        font-family: var(--font-body-family);
        font-weight: 400;
        font-size: 14px;
        line-height: 1;
        letter-spacing: .02em;
        text-align: center;

        @media screen and (max-width: 749px) {
          font-size: 12px;
        }
      }
    }

    button {
      background-color: #fff !important;
      color: #1d1d1d !important;

      @media screen and (max-width: 749px) {
        font-size: 12px;
      }
    }
  }

  .collection-product-card {
    .product_image img {
      filter: invert(3%);
    }
  }
}

.collection-grid-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;

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

.free_gift_wrap {
  position: absolute;
  top: 2rem;
  left: 1rem;
  display: flex;
  flex-wrap: wrap;

  > * {
    flex: 100%;
  }

  > *:first-child {
    width: 25px;
    height: 25px;
  }

  > *:last-child {
    width: 40px;
    height: 40px;
  }
}

.product-card__swatches {
  padding-top: 1rem;
  display: flex;
  gap: 0.5rem;

  .swatch {
    appearance: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 100%;
    border: 2px solid #c9c9ca;
  }

  .swatch.is-active {
    border: 2px solid #1d1d1d;
  }
}

.collection-info-banner {
  grid-column: 1 / -1;
  /* padding-top: 4rem; */
  margin-bottom: -3rem; /* card elements have padding top, this is to counteract that */
  z-index: 1;

  .collection-info-banner__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 1.5rem;
    text-align: center;
  }

  .collection-info-banner__inner::after {
    content: "";
    position: absolute;
    z-index: -1;
    height: 100%;
    width: calc(100% + 40px);
    left: -20px;
    bottom: 0;
    background-color: inherit;
  }
}

.container #ProductGridContainer[data-products-in-row] .collection-product-list .collection-product-card {
  padding-top: 3rem;
}

.container #ProductGridContainer[data-products-in-row] .collection-product-list {
  row-gap: 1rem;
  column-gap: 1.5rem;
}

.collection-product-card--special__link {
  margin-top: 1.6rem;
  text-align: center;
  color: inherit;
  max-width: 100% !important;
  margin-bottom: 1.2rem !important;
}

#ProductGridContainer[data-products-in-row="medium"] .collection-product-list.collection-product-list--2-mobile .collection-product-card--special:not(.big) .collection-product-card--special__text {
  width: 100%;
  max-width: 100% !important;
  position: absolute;
  top: 0;
}

#ProductGridContainer[data-products-in-row] .collection-product-card--special .collection-product-card--special__overlay {
  aspect-ratio: var(--collection-grid-image-ratio, 3/4) !important;
}

#ProductGridContainer {
  .collection-product-list--multislide .multislide_slide {
    width: 100%;
    max-width: 100%;
  }

  .collection-product-card--special {
    grid-column: auto !important;
    grid-row: auto !important;

    .card-wrapper {
      aspect-ratio: 3 / 4;
      width: 100%;
      height: max-content;
    }

    .collection-product-card--special__heading {
      p {
        letter-spacing: -.02em;
      }
    }

    .collection-product-card--special__link {
      letter-spacing: .02em;
      font-size: 14px;
      font-family: var(--font-body-family);
      font-weight: 400;
      line-height: 24px;
      text-align: center;

      @media screen and (max-width: 749px) {
        font-size: 12px;
      }
    }
  }

  .collection-product-card--special > .card-wrapper > .card {
    aspect-ratio: var(--collection-grid-image-ratio, 3/4);
  }

  .card-wrapper {
    height: 81%;
  }

  .collection-product-card--special__text {
    position: relative;
    z-index: 1;
    height: 100%;
    box-sizing: border-box;
    padding: 2.4rem;
    display: flex;
    flex-direction: column;
  }

  .collection-product-card--special__heading {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 100% !important;

    * {
      color: inherit;
    }

    > .section-heading__heading {
      font-size: 42px;
      line-height: 1;
      margin: 0;

      @media screen and (max-width: 749px) {
        font-size: 26px
      }

      p {
        margin-top: 2rem;
      }
    }
  }

  .collection-product-card--special__heading--top {
    align-items: flex-start;
  }

  .collection-product-card--special__heading--bottom {
    align-items: flex-end;
  }

  .collection-product-list--multislide .product_image {
    position: relative;
    width: 100%;
    --overflow: hidden;
    aspect-ratio: var(--collection-grid-image-ratio, 3/4);

    > img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: var(--collection-grid-image-fit, cover);
    }

    > a {
      position: absolute;
      inset: 0;
      display: block;
    }
  }
}

.collection-info-banner--mobile {
  display: none;
}

@media only screen and (min-width: 750px) {
  #ProductGridContainer .collection-product-list {
    grid-template-columns: repeat(var(--collection-grid-columns, 4), 1fr) !important;
  }

  .collection-info-banner__inner::after {
    display: none;
  }

  .collection-info-banner--desktop {
    display: block;
  }
}

@media only screen and (max-width: 768px) {
  #ProductGridContainer[data-products-in-row="medium"] .collection-product-list.collection-product-list--2-mobile .collection-product-card--special:not(.big) .collection-product-card--special__text {
    padding: 0 !important;
  }

  .container #ProductGridContainer[data-products-in-row] .collection-product-list {
    column-gap: 0.5rem;
  }

  .free_gift_wrap {
    > *:first-child {
      width: 20px;
      height: 20px;
    }

    > *:last-child {
      width: 35px;
      height: 35px;
    }
  }

  .collection-info-banner--desktop {
    display: none;
  }

  .collection-info-banner--mobile {
    display: block;
  }
}

.collection-info-banner__text {
  display: inline-block;
  font-family: var(--font-body-family);
  font-weight: 400;
  font-size: 12px;
  line-height: 20px;
  letter-spacing: 0.02em;
}

/* CSS Fixes */
.collection-wrapper > .container > #ProductGridContainer {
  #product-grid {
    flex: 1;
  }
  .collection-product-list {
    padding-top: 0;

    .product_price {
      .price {
        letter-spacing: .02em;
      }
    }
  }
  .collection-product-list .collection-product-card {
    padding-top: 0;
  }
  .collection-product-card--special__text {
    position: absolute;
    top: 0;
    width: 100%;
  }

  @media only screen and (max-width: 749px) {
    .collection-info-banner {
      padding-bottom: 2.4rem;
      padding-top: 2.4rem;
    }
  }

  .collection-product-list {
    row-gap: 4rem;
  }

  .collection-product-card--special__heading > .section-heading__heading {
    font-size: 42px;
    line-height: 1;
    font-family: "Instrument Serif", serif;

    @media screen and (max-width: 749px) {
      font-size: 26px;
    }
  }
}

.subcollection_title {
  font-family: var(--font-body-family);
}

.collection-wrapper > .container > #ProductGridContainer:has(.facets-container.is-hidden) {
  #product-grid {
    flex: 100%;
  }
}



.products-grid {
  .collection-product-card {
    .abrwl-button {
      width: 32px;
      height: 32px;

      @media screen and (max-width: 749px) {
        width: 26px;
        height: 26px;
        top: 4px;
        right: 4px;
        padding: 3px;
      }
      
      &.abrwl-is-added {
        .icon.icon-heart {
          display: block !important;

          svg {
            path {
              &.heart-outline {
                display: none;
              }
              &.heart-solid {
                display: block !important;
              }
            }
          }
        }
      }
    }
  }
}
