.ss-collection {
  padding: calc(var(--PT) + var(--header-height, 0)) 0px var(--PB);
  display: block;

  .ss-collection__filters-drawer {
    background: #fff;
    box-shadow: none;
    display: flex;
    filter: blur(.5rem);
    flex-direction: column;
    height: 100%;
    left: 0;
    max-width: 44rem;
    opacity: 0;
    overflow: auto;
    pointer-events: none;
    position: fixed;
    top: 0;
    transition: all .3s;
    transition-behavior: allow-discrete;
    transform: translate(-50%);
    width: 80%;
    z-index: 99999;

    &.active {
      filter: blur(0);
      opacity: 1;
      pointer-events: all;
      transform: translate(0%);
    }

    .ss-collection__filters-header {
      position: sticky;
      top: 0;
      padding: 2.4rem;
      display: flex;
      justify-content: space-between;
      z-index: 1;
      border-bottom: 1px solid rgb(17 17 17 / 0.1);
      background-color: #fff;

      .ss-collection__filters-heading {
        font-size: 2rem;
        font-weight: 500;
        line-height: 1.2;
        text-transform: uppercase;
      }

      .ss-collection__filters-close {
        background: transparent;
        border: none;
        cursor: pointer;
        opacity: 0.2;
        padding: 0;
        width: 1.6rem;

        .ss-collection__filters-close svg {
          fill: currentColor;
          height: auto;
          width: 100%;
        }
      }
    }

    .ss-collection__filters-wrapper {
      padding: 2rem;

      .ss-collection__filter-details {
        display: flex;
        flex-direction: column;
        gap: 0px;
        padding-block: 1rem;
        transition: all .15s cubic-bezier(.4, 0, .2, 1);
        width: 100%;

        .ss-collection__filters-title {
          align-items: center;
          cursor: pointer;
          display: flex;
          font-size: 1.6rem;
          justify-content: space-between;
          list-style: none;
          margin-bottom: 1.8rem;
          text-transform: uppercase;
          transition: all .15s cubic-bezier(.4, 0, .2, 1);

          &::-webkit-details-marker {
            display: none;
          }

          .ss-collection__filters-title-icon {
            color: #d6d2c4;
            opacity: 0.6;
            position: relative;
            width: 1.6rem;
            transition: all .3s cubic-bezier(.4, 0, .2, 1);
          }
        }

        .ss-collection__filters {
          display: flex;
          flex-direction: column;

          .ss-collection__filter-value {
            align-items: center;
            cursor: pointer;
            display: flex;
            font-size: 2.2rem;
            font-style: normal;
            gap: 18px;
            line-height: 1.3;
            padding: 8px;
            position: relative;

            &[disabled] {
              opacity: 0.5;
              pointer-events: none;
            }

            .ss-collection__filter-checkbox {
              align-items: center;
              border: 1px solid #ccc;
              display: flex;
              height: 24px;
              justify-content: center;
              min-width: 24px;
              width: 24px;
            }
          }

          input {
            display: none;

            &:checked~.ss-collection__filter-checkbox {
              clip-path: none;
              opacity: 1;
              background: #3a3a3a;
            }
          }

          @media (width < 1024px) {
            .ss-collection__filter-value {
              font-size: 2rem;
            }
          }
        }


        &[open] .ss-collection__filters-title-icon {
          rotate: 180deg;
        }
      }
    }

    .ss-collection__apply-filters {
      align-items: center;
      background: linear-gradient(0deg, white 75%, transparent);
      bottom: 0;
      display: flex;
      flex-direction: column;
      gap: 1.2rem;
      padding: 2, 4rem;
      position: sticky;
      text-align: center;

      .ss-collection__filters-cta {
        background: #000;
        color: #fff;
        display: flex;
        font-weight: 400;
        padding: 1.2rem 2.4rem;
        transition: all;
        text-transform: uppercase;
        text-decoration: none;
        width: fit-content;

        &:hover {
          color: #606060;
        }
      }
    }
  }

  .ss-collection__container {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;

    .ss-collection__header {
      align-items: center;
      display: flex;
      justify-content: space-between;

      button {
        background: transparent;
        border: none;
        border-radius: 3.2rem;
        color: inherit;
        cursor: pointer;
        font-size: 2.2rem;
        font-style: normal;
        line-height: 1.3;
        outline: none;
        padding: 0.6rem 1.2rem;
        transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);

        &:hover {
          background: rgb(17 17 17 / 0.05);
        }
      }

      .ss-collection__heading {
        font-size: 3.2rem;
        font-weight: 700;
        line-height: 1.3;
        text-wrap: pretty;
      }
    }

    .ss-collection__sortby-wrapper {
      color: inherit;
      display: flex;
      gap: 5.5rem;
      filter: blur(0);
      line-height: 1.3;
      opacity: 1;
      transform: translateY(0);
      transition: all .3s;
      transition-behavior: allow-discrete;

      &:not(.active) {
        filter: blur(.5rem);
        height: 0;
        opacity: 0;
        overflow: hidden;
        transform: translateY(100%);
      }

      .ss-collection__sortby-heading,
      .ss-collection__sortby-value {
        border-radius: 3.2rem;
        font-size: 2.2rem;
        font-weight: 300;
        padding: 0.6rem 1.2rem;
        transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
      }

      .ss-collection__sortby-title {
        font-size: 2.2rem;
        font-weight: 300;
        opacity: 0.5;
      }

      .ss-collection__sortby-value {
        cursor: pointer;
      }

      .ss-collection__sortby-list {
        display: flex;
        flex-wrap: wrap;
        gap: 1.2rem;

        input {
          display: none;
        }

        .ss-collection__sortby-value:has(input:checked) {
          background: rgb(17 17 17 / 0.05);
          font-weight: 700;
        }
      }
    }

    .ss-collection__grid {
      display: grid;
      gap: 3.6rem 2.4rem;
      grid-template-columns: repeat(4, 1fr);

      .ss-collection__product {
        color: inherit;
        display: flex;
        flex-direction: column;
        font-size: 1.8rem;
        font-weight: 300;
        gap: 1.25rem;
        line-height: 1.2;
        text-decoration: none;

        &:first-child {
          grid-column: span 2;
          grid-row: span 2;
        }

        .ss-collection__product-meida {
          flex: 1;

          .ss-collection__product-image {
            border-radius: 2rem;
            min-height: 100%;
            overflow: hidden;
            padding-bottom: 137.75%;
            position: relative;

            .ss-collection__product-image-tag {
              height: 100%;
              object-fit: cover;
              position: absolute;
              width: 100%;
            }
          }
        }

        .ss-collection__product-title {
          font-size: 2rem;
          font-weight: 500;
        }
      }
    }

    .pagination-wrapper {
      margin-top: 3rem;
    }

    @media (width < 1024px) {
      .ss-collection__sortby-wrapper {
        background: #fff;
        bottom: 0;
        filter: blur(.5rem);
        flex-direction: column;
        gap: 0;
        left: 0;
        opacity: 0;
        position: fixed;
        right: 0;
        transition: all .3s;
        transition-behavior: allow-discrete;
        translate: 0 100%;
        z-index: 99;

        &.active {
          filter: blur(0);
          opacity: 1;
          translate: 0 0;
        }

        .ss-collection__sortby-heading {
          border-bottom: 1px solid rgb(17 17 17 / .1);
          border-radius: 0;
          display: grid;
          padding: 2rem 0;
          position: relative;
          text-align: center;

          .ss-collection__sortby-title {
            font-size: 2.2rem;
            font-weight: 400;
            line-height: 1;
            opacity: 1;
          }

          .ss-collection__sortby-close {
            all: unset;
            display: block;
            height: 1.6rem;
            opacity: .2;
            position: absolute;
            right: 1.6rem;
            top: 50%;
            translate: 0 -50%;
            width: 1.6rem;
          }
        }

        .ss-collection__sortby-list {
          flex-direction: column;
          gap: 0;
          padding: 1rem 0;
          text-align: center;
        }

        .ss-collection__sortby-value {
          font-size: 1.8rem;
          padding: 1rem 0;
        }
      }

      .ss-collection__grid {
        gap: 2rem 1.2rem;
        grid-template-columns: repeat(2, 1fr);

        .ss-collection__product {
          &:nth-child(5n + 1) {
            grid-column: span 2;
            grid-row: span 1;
          }

          .ss-collection__product-meida {
            flex: 0;
          }
        }
      }

      .pagination-wrapper {
        margin-top: 2.5rem;
      }
    }
  }
}