@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(6);
    }

    .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: 100%;
      }

      &__title {
        line-height: 23px;

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

      &__content {
        flex: 1 0 auto;
        position: relative;
        z-index: 0;
        padding: 0;

        &-wrap {
          padding: 15px;
          background: $white;
          transition: all 300ms;
          z-index: -1;
          transform: translateY(0);
        }
      }

      &__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(md) {
    .change-card {
      // sass-lint:disable no-important
      transform: translateY(-138px) !important;
    }

    .card {
      &__descr {
        font-size: 13px;
        line-height: 23px;
      }
    }
  }

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

      &__inner {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        transition: all .5s;
      }

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

        &-wrap {
          padding: 0;
          height: auto;
          position: inherit;
        }

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

      &__content {
        padding: 12px;

        &-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;
        }
      }
    }
  }
}
