// =============================================================================
// _WOOCOMMERCE.SCSS
// -----------------------------------------------------------------------------
// Site styles.
// =============================================================================

// =============================================================================
// TABLE OF CONTENTS
// -----------------------------------------------------------------------------
//   01. Shop Styles
//   02. Product Styles
//   03. Product Loops
//   04. Widgets
//   05. Price
//   06. Sale Badge
//   07. Star Rating
//   08. Review Form
//   09. Results Count and Ordering
//   10. Form Feedback States
// =============================================================================

// Shop Styles
// =============================================================================

.woocommerce {
  ul.products {
    clear: both;
    margin: 0 0 -4.5%;
    list-style: none;
    @include clearfix();
  }

  li.product {
    float: left;
    overflow: hidden;
    position: relative;
    margin: 0 4% 4.5% 0;
    padding: 0;
    text-align: center;
    background-color: $baseModBackground;

    &.first {
      clear: both;
    }

    &.last {
      margin-right: 0;
    }

    .onsale {
      top: -45px;
      left: -95px;
    }

    .entry-product {
      position: relative;
    }

    .entry-featured {
      overflow: hidden;
      z-index: 0;

      a {
        display: block;
      }

      img {
        min-width: 100%;
      }
    }

    .entry-wrap {
      position: absolute;
      top: calc(100% - 4em);
      left: 0;
      right: 0;
      bottom: auto;
      padding: 0;
      @include font-size(1.4);
      @include transition(#{all 0.615s $easeOutExpo});

      &:before {
        content: "";
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 50em;
        background-color: $entryCoverBackground;
        z-index: 0;
        @include transition(#{all 0.615s $easeOutExpo});
      }
    }

    .entry-header {
      position: relative;

      h3 {
        margin: 0;
        padding: 1.5em;
        @include font-size(1.4);
        line-height: 1;
        text-transform: uppercase;
        @include text-overflow();

        a {
          color: $white;
        }
      }

      .price {
        > del {
          display: none;
        }

        > .amount,
        > ins > .amount {
          @include font-size(2.4);
          color: $white;
        }
      }

      .button {
        margin: 15px;
        padding: 0.45em 0.5em 0.575em;
        display: block;
        @include font-size(1.4);
      }
    }

    .added_to_cart {
      display: none;
    }

    &:hover {
      .entry-wrap {
        top: calc(100% - 10.385em);

        &:before {
          background-color: $entryCoverBackgroundHover;
        }
      }

      .star-rating-container {
        @include opacity(1);
      }
    }
  }
}



// Product Styles
// =============================================================================

.woocommerce {
  .entry-wrap > .entry-content:first-child {
    margin: 0;
    @include clearfix();
  }

  div.product {
    .images {
      overflow: hidden;
      position: relative;
      float: left;
      width: 48%;
      @include break(middle-bear) {
        width: 100%;
      }

      .onsale {
        top: -45px;
        left: -95px;
      }

      .thumbnails {
        > a {
          display: block;
          float: left;
          width: 22%;
          margin: 4% 4% 0 0;

          &:nth-child(4n+4) {
            margin-right: 0;
          }
        }
      }
    }

    .summary {
      float: right;
      clear: right;
      width: 48%;
      @include break(middle-bear) {
        width: 100%;
        margin-top: 50px;
      }

      .product_title {
        margin: 0 0 0.25em;
        font-size: 228%;
        @include break(baby-bear) {
          font-size: 200%;
        }
      }

      .price {
        > del,
        > .from {
          @include font-size(1.8);
        }

        > .amount,
        > ins > .amount {
          @include font-size(2.4);
        }
      }

      .variations {
        margin-bottom: $baseMargin;

        .label,
        .value {
          vertical-align: middle;
          border-top: 0;
          background-color: transparent;
        }

        .label {
          padding-left: 0;
        }

        .value {
          padding-right: 0;
        }

        select {
          width: 100%;
          margin-bottom: 0;
        }

        .reset_variations {
          display: none;
        }
      }

      .single_variation {
        text-align: right;

        .price {
          margin-bottom: $baseMargin;
        }
      }
    }

    .woocommerce-tabs {
      clear: both;
      float: left;
      width: 100%;
      margin-top: 50px;

      .x-tab-content {
        margin-bottom: 0;
      }

      h2 {
        margin-top: 0;
        margin-bottom: 0.5em;
        font-size: 200%;
      }

      table {
        margin-bottom: 0;
      }

      p:last-child {
        margin-bottom: 0;
      }
    }
  }
}



// Product Loops
// =============================================================================

.woocommerce {
  .upsells,
  .related,
  .cross-sells {
    clear: both;
    float: left;
    width: 100%;
    margin: 50px 0 -4%;

    h2 {
      margin: 0 0 0.5em;
      font-size: 200%;
    }

    ul.products {
      li.product {
        border: 1px solid $shortcodeBorderColor;

        .entry-featured {
          border-bottom: 1px solid $shortcodeBorderColor;
        }
      }
    }
  }
}

.page,
.single-post {
  .x-main {
    .woocommerce {
      ul.products {
        li.product {
          .entry-featured {
            margin: 0;
          }
        }
      }
    }
  }
}



// Widgets
// =============================================================================

//
// Sidebar widgets.
//

.x-sidebar {
  .widget_best_sellers,
  .widget_shopping_cart,
  .widget_products,
  .widget_featured_products,
  .widget_onsale,
  .widget_random_products,
  .widget_recently_viewed_products,
  .widget_recent_products,
  .widget_recent_reviews,
  .widget_top_rated_products {
    ul {
      li {
        margin: 0;
        padding-top: 8px;
        padding-bottom: 8px;

        &:first-child {
          margin-top: 0;
        }

        a {
          padding: 0;
        }
      }
    }
  }
}


//
// Widgets with images.
//

.widget_best_sellers,
.widget_shopping_cart,
.widget_products,
.widget_featured_products,
.widget_onsale,
.widget_random_products,
.widget_recently_viewed_products,
.widget_recent_products,
.widget_recent_reviews,
.widget_top_rated_products {
  ul {
    li {
      margin-bottom: 5px;
      font-size: 81.25%;
      @include clearfix();

      &:first-child {
        margin-top: 20px;
      }

      &:last-child {
        margin-bottom: 0;
      }

      a {
        display: block;
        margin-bottom: 2px;
        border-bottom: 0;
        font-size: 135.7%;
        line-height: 1.7;

        img {
          @include img_thumbnail();
          padding: 3px !important;
          float: left;
          width: 65px;
          margin-right: 0.65em;
          @include box-shadow(#{none !important});
        }
      }

      > del,
      > ins {
        text-shadow: none;
      }
    }
  }
}


//
// Cart.
//

.widget_shopping_cart {
  .empty {
    font-size: 100%;
    text-align: center;
  }

  ul {
    li {
      position: relative;

      .remove {
        display: block;
        position: absolute;
        right: 0;
        bottom: 4px;
        margin: 0;
        width: 18px;
        height: 18px;
        @include font-size(1.8);
        line-height: 18px;
        text-align: center;
        text-decoration: none;
        opacity: 0;
        @include transition(#{opacity 0.3s ease});
      }

      &:hover {
        .remove {
          opacity: 0.35;

          &:hover {
            opacity: 1;
          }
        }
      }
    }
  }

  .total {
    margin-bottom: 0;
    border: 1px solid $shortcodeBorderColor;
    border-bottom: 0;
    padding: 7px;
    @include font-size(1.1);
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
  }

  .buttons {
    border: 1px solid $shortcodeBorderColor;
    @include clearfix();

    .button {
      float: left;
      width: 50%;
      margin: 0;
      border: 0;
      padding: 7px;
      @include font-size(1.1);
      line-height: 1.1;
      text-align: center;
      text-shadow: none;
      text-decoration: none;
      color: $navbarBackground;
      background-color: transparent;
      @include text-overflow();
      @include box-shadow(#{none});

      &:hover {
        background-color: $shortcodeBorderColor;
      }

      &:first-child {
        border-right: 1px solid $shortcodeBorderColor;
      }
    }
  }
}


//
// Layered nav and layered nav filters.
//

.widget_layered_nav,
.widget_layered_nav_filters {
  .chosen {
    .count {
      background-color: $baseModBackground;
    }
  }
}

.widget_layered_nav {
  li {
    position: relative;

    .count {
      position: absolute;
      top: 50%;
      right: 10px;
      width: 24px;
      height: 24px;
      margin-top: -12px;
      line-height: 24px;
      text-align: center;
      background-color: $shortcodeBorderColor;
      border-radius: 100%;
    }
  }
}


//
// Price filter.
//

.widget_price_filter {
  form {
    margin-bottom: 0;

    input[type="text"] {
      display: none;
    }
  }

  .price_slider_wrapper {
    @include clearfix();
  }

  .ui-slider {
    position: relative;
    height: 8px;
    margin: 10px 0 24px;
    background-color: $shortcodeBorderColor;

    .ui-slider-handle {
      position: absolute;
      top: 50%;
      width: 21px;
      height: 21px;
      margin-top: -11px;
      cursor: pointer;
      background-color: $baseModBackground;
      border-radius: 100em;
      outline: none;
      @include box-shadow(#{0 1px 2px rgba(0, 0, 0, 0.35)});
      z-index: 2;

      &:last-child {
        margin-left: -19px;
      }
    }

    .ui-slider-range {
      display: block;
      position: absolute;
      top: 0;
      height: 100%;
      border: 0;
      background-color: $shortcodeBorderColor;
      z-index: 1;
    }
  }

  .price_slider_amount {
    @include clearfix();

    .button,
    .price_label {
      float: left;
      width: 50%;
      margin: 0;
      border: 1px solid $shortcodeBorderColor;
      padding: 7px;
      @include font-size(1.1);
      line-height: 1.1;
      text-align: center;
      text-shadow: none;
      background-color: transparent;
      @include text-overflow();
    }

    .button {
      color: $navbarBackground;
      @include box-shadow(#{none});

      &:hover {
        background-color: $shortcodeBorderColor;
      }
    }

    .price_label {
      width: 50%;
      border-left: 0;
    }
  }
}


//
// Product search.
//

.widget_product_search {
  input[type="submit"] {
    display: none;
  }
}


//
// Reviews and top rated products.
//

.widget.widget_recent_reviews,
.widget.widget_top_rated_products {
  .star-rating {
    margin-bottom: 2px;
  }
}



// Price
// =============================================================================

.woocommerce {
  .price {
    display: block;
    line-height: 1;
    @include clearfix();

    > .from,
    > del {
      color: inherit;
    }

    > ins {
      text-decoration: none;
    }

    > .amount,
    > ins > .amount {
      color: inherit;
    }
  }
}



// Sale Badge
// =============================================================================

.woocommerce {
  .onsale {
    position: absolute;
    display: block;
    width: 200px;
    height: 100px;
    @include font-size(1.4);
    letter-spacing: 0;
    line-height: 160px;
    text-align: center;
    text-transform: uppercase;
    color: $white;
    background-color: $accentColor;
    z-index: 1;
    @include rotate(-45deg);
  }
}



// Star Rating
// =============================================================================

.woocommerce {
  li.product {
    .star-rating-container {
      top: 10px;
      right: 10px;
      padding: 7px;
      background-color: rgba(0, 0, 0, 0.5);
    }
  }

  p.stars {
    margin-bottom: 1.5em;

    span {
      a {
        &[class^="star"] {
          &:after {
            display: none;
            width: 7em;
            padding: 0 1em;
            position: absolute;
            top: 0;
            right: -9.5em;
            font-size: 0.5em;
            text-align: center;
            color: $textColor;
            background-color: #e5e5e5;
            @include font-awesome();
          }
        }
      }
    }
  }
}



// Review Form
// =============================================================================

.woocommerce {
  #respond {
    margin-bottom: 0;
  }

  #reply-title {
    margin-top: 0;
  }

  #comments {
    position: relative;
    margin-top: 0;

    .x-comments-list {
      margin-top: $layoutSpacing;

      .x-comment-img {
        .avatar-wrap {
          &:before {
            display: none;
          }

          .avatar {
            width: 60px;
          }
        }

        @include break(middle-bear) {
          display: none;
        }
      }

      article.comment {
        @include break(middle-bear) {
          margin-left: 0;
        }
      }

      .x-comment-header {
        .star-rating-container {
          display: block;
          margin-top: 4px;
        }
      }
    }
  }
}



// Results Count and Ordering
// =============================================================================

.woocommerce-result-count {
  float: right;
  height: 2.95em;
  padding: 0 12px;
  border: 1px solid $shortcodeBorderColor;
  line-height: 2.75em;
  @include font-size(1.1);
  background-color: $shortcodeBorderColor;
}

.woocommerce-ordering {
  float: left;

  select {
    width: 100%;
    margin-bottom: 0;
    @include font-size(1.1);
    border-color: $shortcodeBorderColor;
    background-color: $shortcodeBorderColor;
  }
}

.woocommerce-result-count,
.woocommerce-ordering {
  @include break(baby-bear) {
    float: none;
  }
}



// Form Feedback States
// =============================================================================

.woocommerce-invalid {
  input {
    color: $errorText;
    border-color: $errorBorder;
  }
}

.woocommerce-validated {
  input {
    color: $successText;
    border-color: $successBorder;
  }
}