$selectableCheckboxSize: 20px;

.ui-product-tile {
  border-color: transparent;
  border-style: solid;
  border-width: 1px;

  &__name {
    height: map-get($ui-body, base-line-height) * 3;
    min-height: 100px;
    margin-bottom: 6px;
    padding: 0 3px;
  }

  &__img-wrapper {
    padding: 0 $ui-spacer * 0.5;
  }

  &__children-wrapper {
    height: 25px;
  }

  &__price-wrapper {
    height: 70px;
  }

  &__recommendation-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 65px;
    padding: 0 15px;
    overflow: hidden;

    color: ui-color(natural);

    background-color: ui-color(blue);
  }

  &__overlay {
    z-index: 99999;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;

    color: ui-color(blue);

    background-color: ui-color(natural);

    @include ui-to($ui-bp-tablet) {
      width: 55%;
      padding: 20px 0;

      text-align: center;

      border-top: none;
    }

    &-main-text {
      margin-bottom: 15px;

      @include ui-to($ui-bp-tablet) {
        margin: 5px 0 20px 0 !important;
      }
    }

    &-no-thanks {
      margin: 15px 0 !important;

      @include ui-to($ui-bp-tablet) {
        margin: 10px 0 25px 0 !important;
      }
    }
  }

  &__review-stars {
    margin-bottom: 8px;
  }

  /* Plain product tile */
  &--plain {
    width: 100%;
    height: 100%;

    .ui-product-tile__expand-height {
      padding: 95% 0;
    }
    .ui-product-tile__expand-width {
      padding: 0 100%;
    }
    .ui-product-tile__full-width {
      width: 100%;
    }
  }

  /* Inline product tile */
  &--inline {
    margin: 0 !important; // ui-grid:last-child bottom margin override
    overflow: hidden;

    border-color: transparent;
    border-style: solid;
    border-width: 1px;

    img {
      margin: auto;
    }

    .ui-product-tile__lockup {
      position: relative;

      display: block;

      @include ui-from($ui-bp-tablet) {
        display: flex;
        align-items: center;
        justify-content: space-evenly;
      }
    }

    .ui-product-tile__text-wrapper,
    .ui-product-tile__button-wrapper {
      display: block;
      width: 100%;

      @include ui-from($ui-bp-tablet) {
        flex-grow: 1;
      }
    }

    .ui-price-btn--mb {
      margin-bottom: 8px;
    }

    .ui-product-tile__new-badge {
      margin-right: 80px;
      @include ui-font-specter-bold;
      font-size: 12px;
      text-transform: uppercase;
    }

    &--recommended {
      border-color: ui-color(blue);
    }

    &__recommendation-wrapper {
      padding: 8px 60px;

      color: ui-color(natural);
      font-size: 14px;
      line-height: 22px;

      background-color: ui-color(blue);
    }

    &__detail-container {
      margin-bottom: 6px;
    }

    &__product-name {
      @include ui-font-specter-medium;
      font-size: 16px;
      line-height: 24px;
    }

    &__product-detail {
      font-size: 12px;
      line-height: 18px;
    }
  }

  /* Selectable product tile - Default */
  &--selectable {
    position: relative;

    width: 140px;
    padding: 10px $ui-spacer $ui-spacer;

    cursor: pointer;

    &:focus {
      outline: #5d9dd5 solid 1px;
      box-shadow: 0 0px 8px #5e9ed6;
    }

    &__checkbox {
      width: $selectableCheckboxSize;
      height: $selectableCheckboxSize;
      margin: 0 auto;

      &--corner {
        position: absolute;
        top: 4px;
        left: 4px;
      }

      &--selected {
        display: flex;
        align-items: center;
        justify-content: center;

        &::after {
          @include ui-icon--checkmark;

          color: ui-color(orange-darkest);
          font-weight: bold;
          font-size: 14px;
          text-align: center;
        }
      }
    }

    &-disabled {
      cursor: default;
    }

    &-empty {
      height: 180px;
    }
  }

  /* Selectable product tile - Large */
  &--selectable-large {
    position: relative;

    &:focus {
      outline: #5d9dd5 solid 1px;
      box-shadow: 0 0px 8px #5e9ed6;
    }

    width: 100%;
    height: 130px;
    padding: 15px;

    text-align: left;

    cursor: pointer;

    @include ui-from($ui-bp-desktop) {
      padding: 30px;
    }

    > .ui-grid {
      align-items: center;
      height: 100%;
    }

    @include ui-from($ui-bp-desktop) {
      max-width: 194px;
      height: 295px;

      text-align: center;
    }

    &__text {
      padding-left: 5px;

      @include ui-from($ui-bp-desktop) {
        padding-left: 0;
      }
    }

    &__image {
      position: absolute;
      top: 50%;

      max-width: 112px;
      height: auto;

      transform: translate(-10%, -50%);

      @include ui-from($ui-bp-desktop) {
        top: auto;
        left: 50%;

        max-width: 212px;

        transform: translate(-50%, 0);
      }
    }

    &__image-container {
      height: 98px;

      @include ui-from($ui-bp-desktop) {
        position: relative;

        display: flex;
        align-items: flex-end;
        height: 160px;
      }
    }

    &__checkbox {
      width: $selectableCheckboxSize;
      height: $selectableCheckboxSize;
      margin: 0 auto;

      &--corner {
        position: absolute;
        top: 4px;
        left: 4px;
      }

      &--selected {
        display: flex;
        align-items: center;
        justify-content: center;

        &::after {
          @include ui-icon--checkmark;

          font-weight: bold;
          font-size: 14px;
          text-align: center;
        }
      }
    }

    &-disabled {
      cursor: default;
    }

    &-empty {
      height: 130px;

      @include ui-from($ui-bp-desktop) {
        height: 295px;
      }
    }
  }

  &--recommended {
    border-color: ui-color(blue);
  }

  &__new-badge {
    display: inline;
    padding: 2px 4px;

    text-transform: uppercase;

    background-color: ui-color(natural);

    @include ui-font-specter-bold;
  }

  &__empty-badge {
    display: block;

    width: 15px;
    height: 22px;
    padding: 2px 4px;
  }

  &__product-name {
    @include ui-font-specter-medium;
    font-size: 20px;
    line-height: 26px;
  }

  &__product-detail {
    font-size: 14px;
    line-height: 22px;
  }

  .ui-price-btn--mb {
    margin-bottom: 8px;
  }
}
