// =============================================================================
// Shop Display Gird
// =============================================================================

body.woocommerce-shop .site-main-content-wrapper .widget_layered_nav_filters {
  margin: 0 0 rem-calc(20);
  text-align: left;
  @include breakpoint(large) {
    margin: 0 0 rem-calc(20);
  }
}

body.woocommerce div:not(.kitify-products__list_wrapper) > ul.products,
body.woocommerce section:not(.kitify-products__list_wrapper) > ul.products,
 {
  .product {
    width: 50%;
    @include breakpoint(medium) {
      width: calc(100% / 3);
    }
    @include breakpoint(xlarge) {
      padding: 0 rem-calc(15) rem-calc(30);
      display: flex;
      flex-direction: column;
      text-align: center;
      width: calc(100% / 4);
    }
    img.attachment-woocommerce_thumbnail.size-woocommerce_thumbnail {
      width: 100%;
    }
    .woocommerce-loop-product__title {
      font-size: rem-calc(16);
      font-weight: 400;
      text-align: left;
      margin-bottom: rem-calc(8);
    }
    .product-item__description--button {
       position: absolute;
       opacity: 0;
       width: 100%;
       left: 50%;
       top: 50%;
       padding: 0 rem-calc(25);
       text-align: center;
       z-index: 12;
       @include global_transition;
       transform: translate(-50%, -50%);
       .button {
         width: auto;
       }
    }

    span.price {
      text-align: left;
      @include product_price(16, 0,500);
      color: v(site-wc-price);
      display: block;
    }
    .star-rating {
      margin: 0 auto;
    }
    &:hover {
      .product-item__description--button {
        opacity: 1;
      }
    }
  }
}

ul.products {
  list-style: none;
  margin: 0 rem-calc(-$grid-column-gutter/2) rem-calc(40);
  display: flex;
  flex-wrap: wrap;
  @include breakpoint(large) {
    margin: 0 rem-calc(-$grid-column-gutter/2) rem-calc(24);
  }

  .grid-new-row {
    width: 100%;
  }

  .product {
    position: relative;
    padding: 0 rem-calc($grid-column-gutter/2);
    &:hover {
      .product-item__description--button {
        opacity: 1;
      }
    }
    &.outofstock,
    &.product-type-variable {
      .product-item__description--actions {
        .button {
          &:after {
            font-size: 14px;
          }
        }
      }
    }
    // Include Tooltips
    @include tooltip('product-item__description--actions', nova_product_quick_view_btn, 11, 16);
    @include tooltip('product-item__description--actions', nova_product_wishlist_btn, 11, 16);
    @include trikon_addtocart_button('product-item__description--actions', button, 11, 16);
    @include trikon_addtocart_button('product-item__description--actions', product_type_variable, 11,16);

    &.outofstock {
      @include trikon_addtocart_button('product-item__description--actions', button, 11, 16);
    }
    // Include Badges
    @include shop_product_badges(15px, 15px);

    .product-item {
      transition: opacity 1s ease, transform 1.5s ease;
      position: relative;
      min-height: 100%;
      overflow: hidden;
      body.shop-products-per-row-6 .shop-has-sidebar & {
        overflow: visible;
      }

      .product-item-link {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10;
      }

      .category {
        .content-product-cat {
          font-size: rem-calc(10);
          font-weight: 400;
          color: #919296;
          text-transform: uppercase;
        }
      }

      .product-item__thumbnail {
        position: relative;
        overflow: hidden;
        .product-item__thumbnail_overlay {
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          opacity: 0;
          z-index: 9;
          @include global_transition;
        }
        .product-item__description--button {
           position: absolute;
           opacity: 0;
           width: 100%;
           left: 50%;
           bottom: rem-calc(0);
           text-align: center;
           z-index: 12;
           @include global_transition;
           transform: translate(-50%, 0%);
        }

      }
      .nova_product_quick_view_btn,
      .nova_product_wishlist_btn,
      .product-item__description--actions .button {
        opacity: 0 !important;
        transform: translate3d(0, 15px, 0);
        .trikon-addtocart {
          width: 18px;
          height: 18px;
        }
        &:hover {
          background-color: v(site-accent-color);
          color: #fff;
        }
      }

      .nova_product_wishlist_btn {
        transition: all 0.3s ease-in-out;
      }

      .product-item__description--actions .button {
        transition: all 0.45s ease-in-out;
        width: auto !important;
        min-width: 145px;
        padding: 0 rem-calc(15);
        .text {
          margin-left: rem-calc(5);
          font-size: rem-calc(12);
          font-weight: 500;
        }
      }

      .nova_product_quick_view_btn {
        transition: all 0.6s ease-in-out;
      }

      &:hover {
        .product-item__thumbnail_overlay {
          opacity: 0.2;
        }
        .product-item__thumbnail .product-item__description--button {
          opacity: 1;
        }
        .product-item__thumbnail .product-item__description--button .button {
          transform: translate3d(0, 0, 0);
          opacity: 1;
        }
        .nova_product_quick_view_btn,
        .nova_product_wishlist_btn,
        .product-item__description--actions .button {
          transform: translate3d(0, 0, 0);
          opacity: 1 !important;
        }

        .product-item__thumbnail-placeholder {
          .product_second_image {
            opacity: 1;
            transition: opacity 300ms ease-in-out 0.05s, transform 0.3s ease-in-out;
          }
        }
      }

      .product-item__thumbnail-placeholder {

        .product_second_image {
          opacity: 0;
          transition: opacity 300ms ease-in-out 0.05s, transform 0.3s ease-in-out;
          width: 100%;
        }
      }

      .product-item__thumbnail-placeholder {

        .product_second_image {
          width: 100%;
          height: 100%;
          display: block;
          opacity: 0;
          position: absolute;
          background-size: cover;
          background-repeat: no-repeat;
          transition: opacity 0 ease 0.05s;
        }

        a {
          display: flex;
          align-items: center;
          justify-content: center;
          position: relative;
          color: inherit !important;
          flex-direction: column;
          cursor: pointer;

          img {
            transition: transform 0.3s ease-in-out;
            will-change: transform;
            width: 100%;
          }

          .out-of-stock {
            position: absolute;
            background-color: v(site-heading-color);
            @include product_badge();
            color: v(site-bg-color);
            top: 50%;
            margin-top: -8px;
          }
        }
      }

      .product-item__description--actions {
        display: flex;
        flex-direction: row;
        position: absolute;
        opacity: 1;
        left: 50%;
        bottom: 50%;
        padding: rem-calc(15);
        pointer-events: none;
        z-index: 11;
        @include global_transition;
        transform: translate(-50%, 50%);

        > a {
          position: relative;
          pointer-events: auto;
          margin-bottom: rem-calc(15);
          border-radius: 5px;

          &.clicked {
            &:after {
              animation: shop_tooltip_clicked 0.3s ease-out;
              @include breakpoint(xlarge) {
                animation: shop_tooltip_clicked_desktop 0.3s ease-out;
              }
            }
          }

          &.loading {
            @include loader(45px, 45px);

            &:before {
              display: none;
            }
          }
        }

        > a.button {
          &.loading {
            @include loader(30px, 30px);

            &:before {
              border-top: 1px solid;
              border-color: v(site-secondary-button-color) #FFF #FFF #FFF;
              position: absolute;
              left: auto;
              top: auto;
              z-index: 1;
            }
          }
        }
        @include global-transition();
        .added_to_cart {
          display: none;
        }
      }
      .product-item__description {
        position: relative;
        margin-top: rem-calc(20);

        .product-item__description--info {
          display: flex;
          flex-direction: column;
          position: relative;
          @include global-transition();

          .info-left {
            display: flex;
            width: 100%;
            text-align: left;
            flex-direction: column;
            margin-bottom: rem-calc(0);
          }

          .info-right {
            text-align: left;
          }
          .product-short-description {
            display: none;
            font-size: rem-calc(14);
            ul {
              li {
                padding: 0;
                margin: 0;
              }
            }
          }

          span.price {
            @include product_price(14, 0,600);
            color: v(site-wc-price);
            display: block;
          }

          .star-rating {
            font-size: rem-calc(13);
            margin-top: rem-calc(5);
          }
        }
        .product-item__description--footer {
          display: flex;
          align-items: center;
          margin-top: rem-calc(15);
          .product-item__category {
            margin-left: auto;
          }
        }
      }

      &.adding,
      &:hover {
        .product-item__description {
          .product-item__description--info {
            .star-rating {
              opacity: 1;
              visibility: visible;
            }
          }
        }
      }
      &__category {
        .content-product-cat {
          font-size: rem-calc(11);
          color: inherit;
          text-transform: uppercase;
        }
      }
      .woocommerce-loop-product__title {
        @include product_title(14, 5, v(site-main-font), 400);
        &:hover {
          color: v(site-accent-color);
        }
      }
    }
    .product-item__description--button {

       .button {
         opacity: 1;
         width: 100%;
         padding: rem-calc(12);
         transform: translate3d(0, 15px, 0);
         transition: all 0.3s ease-in-out;
       }
       .added_to_cart {
         display: none;
       }
    }
  }
}
@include breakpoint(large up) {
  @include shop_products_per_row(1);
  @include shop_products_per_row(2);
  @include shop_products_per_row(3);
  @include shop_products_per_row(4);
  @include shop_products_per_row(5);
  @include shop_products_per_row(6);
}
@include woocommerce_columns(1);
@include woocommerce_columns(2);
@include breakpoint(medium up) {
  @include woocommerce_columns(3);
  @include woocommerce_columns(4);
  @include woocommerce_columns(5);
  @include woocommerce_columns(6);
}
