@import '../helpers/helpers';

.category-landing {
  @include make-row;

  .card {
    @include make-col-ready;
    @include make-col(4);
    // sass-lint:disable no-important
    flex-direction: column;
    border: 0;

    @include media-breakpoint-down(sm) {
      @include make-col(12);
    }

    .card__inner {
      &:hover {
        border-color: $blue;
      }
    }

    &__promo {
      color: $white;
      text-align: center;
      position: absolute;
      top: 0;
      right: 0;

      &__header {
        font-size: 18px;
        padding: 0 10px;
        background-color: $red;
      }
    }
  }

  .card__img-wrap {
    padding-top: 73%;
    height: 0;
    flex-shrink: 0;
    position: relative;
  }

  .card__img-wrap-inner {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
  }

  .card__img {
    width: 100%;
    height: 100%;
  }
}

.card__title {
  color: $blue;
}

.full-width-offers { //TBD: need to be refactored. Temporary decision
  @include media-breakpoint-down(xl) {
    .change-card {
      // sass-lint:disable no-important
      transform: translateY(-138px) !important;
    }

    .card {
      &__inner {
        overflow: hidden;
        height: 313px;
      }

      &__title {
        line-height: 23px;

        a {
          &:hover {
            color: $blue-dark;
          }
        }
      }

      &__content {
        flex: 1 0 auto;
        position: relative;
        min-height: 121px;
        z-index: 0;
        padding: 0;

        &-wrap {
          position: absolute;
          padding: 15px;
          background: $white;
          transition: all 300ms;
          z-index: -1;
          transform: translateY(0);
          max-height: 255px;
          min-height: 150px;
        }
      }

      &__descr {
        height: auto;
        margin-bottom: 0;
        line-height: 23px;
      }
    }
  }
  @include media-breakpoint-only(xl) {
    .change-card {
      // sass-lint:disable no-important
      transform: translateY(-161px) !important;
    }
  }

  @include media-breakpoint-only(lg) {
    .card {
      &__inner {
        height: 314px;
      }
    }
  }

  @include media-breakpoint-only(md) {
    .change-card {
      // sass-lint:disable no-important
      transform: translateY(-138px) !important;
    }

    .card {
      &__inner {
        height: 300px;
      }

      &__descr {
        margin-bottom: -40px;
        font-size: 13px;
        line-height: 23px;
      }

      &__content {
        &-wrap {
          top: 0;
          min-height: 130px;
        }
      }
    }
  }

  @include media-breakpoint-down(sm) {
    .card {
      &__offers {
        width: calc(50% - 10px);
        left: 0;
      }

      &__inner {
        display: flex;
        flex-direction: row;
        height: 140px;
        overflow: hidden;
        transition: all .5s;
      }

      &__img {
        position: relative;
        z-index: 1;

        &-wrap {
          width: 50%;
          padding: 0 10px 0 0;
          height: auto;
          position: inherit;
        }

        &-wrap-inner {
          bottom: inherit;
          position: relative;
        }
      }

      &__content {
        width: 50%;
        padding-top: 10px;

        &-wrap {
          position: relative;
          top: inherit;
          padding: 0 10px 0 0;
          transition: unset;
          max-height: inherit;
        }
      }
    }

    .full-height {
      display: block;

      .card {
        &__content-wrap {
          padding: 0 10px;
        }

        &__img-wrap {
          float: left;
          display: block;
          padding: 0 10px 15px 0;
        }

        &__content {
          width: 100%;
        }

        &__descr {
          padding-bottom: 10px;
        }
      }
    }
  }
}
