@import '../helpers/helpers';

.products-list-page {
  .page-header {
    &__title {
      text-transform: none;
    }
  }

  .searched-item {
    display: block;
    font-weight: 700;
  }

  .left-aside {
    position: static;
  }
}

.sort-products-list {
  @include make-row;
  align-items: center;

  .open-filters-btn {
    @include button-full;
    margin-bottom: 30px;

    .icon {
      margin-right: 6px;
    }
  }

  &__section {
    @include make-col-ready;
    @include make-col(12);
  }

  &__sort-by {
    text-align: right;
  }
}

.products-list {
  margin-top: 30px;

  .card__inner {
    .card__descr {
      margin-bottom: 10px;
    }
  }

  .product-card__price {
    position: relative;

    .product-card__price-value {
      bottom: 0;
    }

    &.product-card__price_sale {
      .product-card__price-value {
        bottom: 1px;
      }
    }
  }
}

//sass-lint:disable no-mergeable-selectors
.products-list {
  .product-card {
    .product-card__title {
      font-size: 1rem;
    }

    .card__inner {
      padding-top: 0;
      padding-bottom: 10px;
      border: 1px solid $gray;

      .card__img {
        border-bottom: 1px solid $gray;
      }
    }

    .product-card__extra-info {
      margin: 0;
      width: 100%;
    }

    .out-of-stock-container {
      padding: 10px 0;
      padding-left: 30px;
    }

    .notify-container {
      padding: 10px 0;
      padding-right: 30px;
    }

    .card__offers {
      top: 0;
    }

    .click-collect-container {
      padding: 10px 30px 0;
    }

    &__price {
      display: flex;
      align-items: center;
      text-align: center;
      width: 100%;
      margin: 0;
      flex-direction: column;
      min-height: auto;

      .product-card__price__old-price {
        text-align: left;
        width: 100%;
        margin-right: 0;
        padding-left: 15px;
        padding-bottom: 5px;
      }

      .product-card__price-value {
        width: 100%;
        text-align: left;
        padding-left: 15px;
        padding-bottom: 5px;
      }

      .uom-price {
        margin: 0;
      }

      .product-card__price__out-of-stock {
        margin-right: 0;
        width: 100%;
        text-align: left;
        padding-left: 15px;
      }
    }
  }

  .product-card__description {
    float: left;
    padding: 15px 0 0 15px;
    width: 100%;
    font-weight: 500;
  }

  .card__inner {
    .card__descr {
      line-height: 1.5;
    }
  }
}

.product-card__price {
  .product-card__price_sale {
    padding: 0 10px;
  }
}

.product-list {
  .card__descr {
    .card_offer_text:empty {
      display: none;
    }
  }
}

.products-list-v2 {
  &__badges {
    @include badges;
    @include price-block-badge;
    font-size: 1rem;
  }

  &__badges.products-list-v2__badges.products-list-v2__badges {
    width: auto;
    min-width: 120px;
  }

  &__badge {
    padding: 3px 5px;
  }
}

@include media-breakpoint-up(md) {
  .sort-products-list {
    .open-filters-btn {
      display: none;
    }
  }

  .products-list {
    @include make-row;

    .product-card__price {
      .product-card__price-value {
        .product-card__price-from {
          float: left;
        }
      }
    }

    .card {
      @include make-col-ready;
    }
  }
}

@include media-breakpoint-up(lg) {
  .sort-products-list {
    &__section {
      @include make-col(4);
    }

    &__pagination {
      .pagination_tablet {
        display: none;
      }
    }

    .form-row {
      margin-bottom: 0;
    }

    .ddn {
      display: inline-block;
      width: 200px;
    }
  }

  .products-list {
    .card {
      @include make-col(4);
    }
  }
}

@include media-breakpoint-down(md) {
  .sort-products-list {
    &__pagination {
      @include make-col(12);
      order: 2;
    }
  }

  .products-list {
    @include make-row;
  }

  .is-hidden {
    display: none;
  }

  .products-list-v2 {
    @include make-row;
  }
}

@include media-breakpoint-down(sm) {
  .products-list-page {
    .page-header {
      border: 0;
      padding: 0;
    }
  }

  .sort-products-list {
    &__pagination {
      .pagination_tablet {
        display: none;
      }
    }

    &__items-per-page {
      .form-row {
        display: none;
      }
    }
  }

  .products-list {
    margin-right: -5px;
    margin-left: -5px;
    margin-top: 0;
    padding-top: 40px;
    overflow-x: hidden;
  }

  .filter-results {
    &__actions.filter-results__actions {
      padding: 5px 0;
    }
  }

  .products-list-v2 {
    margin-right: -5px;
    margin-left: -5px;
    margin-top: 0;
    padding-top: 40px;
    overflow-x: hidden;

    &__badges {
      font-size: 0.875rem;
    }

    .card {
      max-width: 50%;
      padding-left: 5px;
      padding-right: 5px;
      position: relative;

      &:nth-of-type(1)::before,
      &:nth-of-type(2)::before {
        content: '';
        position: absolute;
        top: -20px;
        left: 5px;
        width: calc(100% - 10px);
        border-bottom: 1px solid $gray;
      }
    }
  }
}

@include media-breakpoint-only(md) {
  .products-list-page {
    .left-aside {
      @include make-col(4);
    }

    .content {
      @include make-col(8);
    }

    .banner {
      min-height: 310px;
    }
  }

  .sort-products-list {
    &__section {
      @include make-col(6);
      color: black;
      border: none;

      > .form-row {
        margin-bottom: 0;
      }
    }

    &__pagination {
      margin-top: 20px;

      .pagination {
        &:not(.pagination_tablet) {
          display: none;
        }
      }
    }
  }

  .products-list {
    .card {
      @include make-col(6);
    }
  }
}
