.filter-modal {
  border-radius: 0;

  &__title {
    font-size: 1.125rem;
    font-style: normal;
    font-weight: 700;
    line-height: 1.5rem;
    margin-bottom: 0;
  }

  .modal-header,
  .modal-footer {
    position: sticky;
    background-color: $white;
    z-index: 10;
    box-shadow: none;
    border-bottom: 0;
    transition: box-shadow 0.3s ease;
    padding: 0;
  }

  .modal-box__row,
  .modal-box__columns,
  .modal-dialog,
  .modal-box__content {
    height: 100%;
  }

  .modal-dialog {
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0;
  }

  .modal-content {
    width: 100%;
    border-radius: 0;
  }

  .modal-box__content {
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    width: 100vw;
  }

  .modal-box__header::after {
    border: 0;
  }

  .modal-header {
    top: 0;

    .modal-box__inner-row {
      .modal-box__inner-columns {
        padding: 20px 16px 16px;
      }
    }
  }

  .filter-modal__heading {
    margin-bottom: 8px;
  }

  .modal-box__footer-row {
    width: 100%;
  }

  .modal-footer {
    justify-content: center;
    bottom: 0;
    border-top: 0;

    .modal-box__inner-columns {
      display: flex;
      gap: 16px;
      margin: 0;
    }

    .modal-box__inner-row {
      .modal-box__inner-columns {
        padding: 12px 16px;
      }
    }
  }

  .modal-box__container {
    padding: 0;
  }

  .modal-box__inner-columns {
    padding: 16px;
    margin: 0 16px;
  }

  .modal-box__header .close {
    right: 16px;
    top: 20px;
    opacity: 1;
    font-weight: 700;
    line-height: 1;
    font-size: 1rem;
    color: $warm-grey;
    background-color: transparent;
    border: 0;
    -webkit-appearance: none;
    position: absolute;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }

  .modal-footer {
    .modal-box__inner-columns .btn {
      width: 100%;
    }
  }

  .modal-body {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;

    .modal-box__inner-columns {
      padding: 0 16px;

      .accordion {
        position: relative;
        padding-top: 16px;
        padding-bottom: 16px;
        border: 0;

        &:before {
          content: '';
          display: block;
          position: absolute;
          top: 0;
          width: 100%;
          border-top: 1px solid $gray;
        }

        &:last-of-type {
          border-bottom: 1px solid $gray;
        }

        &__content {
          padding: 16px 0 0;
        }
      }
    }
  }

  .modal-content {
    &[data-scroll-state='middle'],
    &[data-scroll-state='bottom'] {
      .modal-header {
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
        border-bottom: 0;
      }
    }

    &[data-scroll-state='middle'],
    &[data-scroll-state='top'] {
      .modal-footer {
        box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
      }
    }
  }
}

.products-list-page {
  .filter-modal {
    .modal-header {
      .modal-box__inner-row {
        .modal-box__inner-columns {
          padding: 20px 16px 14px;
        }
      }
    }
  }

  .filter-modal {
    .modal-box__inner-columns {
      margin: 0;

      .accordion {
        position: relative;
        padding-top: 20px;
        padding-bottom: 20px;

        &:first-of-type {
          &:before {
            border-top: 0;
          }
        }
      }
    }
  }
}

@include media-breakpoint-up(md) {
  .filter-modal {
    display: none;
  }
}
