// =============================================================================
// _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 -9.25%;
    list-style: none;
    @include cf();
  }

  li.product {
    float: left;
    overflow: hidden;
    position: relative;
    margin: 0 4% 9.25% 0;
    padding: 0;

    &.first {
      clear: both;
    }

    &.last {
      margin-right: 0;
    }

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

      a {
        display: block;
      }

      img {
        min-width: 100%;
      }
    }

    .entry-wrap {
      padding: 15px 0 0;
    }

    .entry-header {
      position: relative;

      h3 {
        margin: 0;
        padding-bottom: 0.5em;
        font-size: 148%;
        line-height: 1.05;
        @include transition(#{color 0.3s ease});

        a:hover {
          color: $accentColor;
        }
      }

      .price {
        > .amount,
        > ins > .amount {
          font-size: 18px;
        }
      }

      .button {
        position: absolute;
        top: -68px;
        left: 17px;
        right: 17px;
        margin: 0;
        padding: 0.45em 0.5em 0.575em;
        display: block;
        font-size: 14px;
        opacity: 0;
        @include text-overflow();
      }
    }

    .added_to_cart {
      display: none;
    }

    &:hover {
      .star-rating-container {
        opacity: 1;
      }

      .entry-header {
        .button {
          opacity: 1;
        }
      }
    }
  }
}



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

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

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

      .x-img-thumbnail {
        padding: 6px;
      }
    }

    .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 {
          font-size: 18px;
        }

        > .amount,
        > ins > .amount {
          font-size: 24px;
        }
      }

      .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 -9.25%;

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



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

//
// 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 {
      @include cf();

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

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

        img {
          @include img_thumbnail();
          float: left;
          width: 68px;
          margin-right: 0.65em;
        }
      }

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


//
// Best sellers.
//

.widget_best_sellers {
  .h-widget:before {
    // margin-right: 0.3em;
  }
}


//
// Cart.
//

.widget_shopping_cart {
  .empty {
    text-align: center;
  }

  ul {
    margin-bottom: -1px;

    li {
      position: relative;

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

      &:hover {
        .remove {
          opacity: 0.35;

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

  .total {
    margin-bottom: 0;
    border: 1px solid $widgetBorderColor;
    border-bottom: 0;
    padding: 7px;
    font-size: 11px;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
  }

  .buttons {
    border: 1px solid $widgetBorderColor;
    @include cf();

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

      &:hover {
        background-color: #fafafa;
      }

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


//
// Featured products.
//

.widget_featured_products {
  .h-widget:before {
    // margin-right: 0.3em;
  }
}


//
// On sale.
//

.widget_onsale {
  .h-widget:before {
    // margin-right: 0.25em;
  }
}


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

.widget_layered_nav {
  .h-widget:before {
    // margin-right: 0.25em;
  }

  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: $widgetBorderColor;
      border-radius: 100%;
    }
  }
}


//
// Price filter.
//

.widget_price_filter {
  form {
    margin-bottom: 0;

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

  .price_slider_wrapper {
    @include cf();
  }

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

    .ui-slider-handle {
      position: absolute;
      top: 50%;
      width: 21px;
      height: 21px;
      margin-top: -11px;
      cursor: pointer;
      background-color: $headingsColor;
      outline: none;
      border-radius: 100%;
      z-index: 2;

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

    .ui-slider-range {
      display: block;
      position: absolute;
      top: 0;
      height: 100%;
      border: 0;
      background-color: $linkColor;
      border-radius: 1em;
      z-index: 1;
      box-shadow: none;
    }
  }

  .price_slider_amount {
    @include cf();

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

    .button {
      color: $textColor;

      &:hover {
        background-color: #fafafa;
      }
    }

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

.widget.widget_top_rated_products {
  .h-widget:before {
    // margin-right: 0.3em;
  }
}



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

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

    > .from,
    > del {
      color: $textColor;
    }

    > ins {
      text-decoration: none;
    }

    > .amount,
    > ins > .amount {
      color: $linkColor;
    }
  }
}



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

.woocommerce {
  .onsale {
    position: absolute;
    top: -39px;
    left: -73px;
    display: block;
    width: 150px;
    height: 80px;
    font-size: 12px;
    line-height: 130px;
    text-align: center;
    text-transform: uppercase;
    color: $white;
    background-color: $linkColor;
    @include transform(#{rotate(-45deg)});
    z-index: 1;
  }
}



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

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

  p.stars {
    span {
      a {
        &[class^="star"] {
          &:after {
            display: none;
            width: 6em;
            padding: 0 0.575em;
            position: absolute;
            top: 0;
            right: -7.85em;
            font-size: 0.5em;
            text-align: center;
            color: darken($shortcodeBorderColor, 35%);
            background-color: $shortcodeBorderColor;
            @include font-awesome();
          }
        }
      }
    }
  }
}



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

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

  #reply-title {
    font-size: 200%;
  }

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

    .x-comments-list {
      .x-comment-header {
        .star-rating-container {
          position: absolute;
          top: 0;
          right: 0;
          border: 2px solid $shortcodeBorderColor;
          border-top: 0;
          border-right: 0;
          padding: 10px;
          @include break(middle-bear) {
            position: static;
            display: block;
            margin-top: 9px;
            border: 0;
            padding: 0;
          }
        }
      }
    }

    article.comment {
      position: relative;

      &:before {
        content: "";
        display: block;
        position: absolute;
        top: 0;
        left: 170px;
        width: 2px;
        height: 100%;
        background-color: $shortcodeBorderColor;
        @include break(baby-bear) {
          display: none;
        }
      }
    }

    .x-comment-img {
      .avatar-wrap {
        .avatar {
          width: 120px;
          @include break(baby-bear) {
            display: none;
          }
        }
      }
    }

    .x-comment-wrap {
      margin-left: 170px;
      @include break(baby-bear) {
        margin-left: 0;
      }
    }

    .comment-edit-link {
      top: auto;
      bottom: 6px;
    }
  }

  .comment-form-author,
  .comment-form-email,
  .comment-form-url {
    float: none;
    width: 100%;
    padding: 0;
  }
}



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

.woocommerce-result-count {
  float: right;
  height: 2.65em;
  padding: 0 7px;
  border: 2px solid $shortcodeBorderColor;
  line-height: 2.35em;
  font-size: 11px;
}

.woocommerce-ordering {
  float: left;

  select {
    width: 100%;
    margin-bottom: 0;
    line-height: 2.65em;
    font-size: 11px;
  }
}

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



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

.woocommerce-invalid {
  input {
    color: $errorText;
    border-color: $errorBorder;
    background-color: lighten($errorBackground, 5%);
  }
}

.woocommerce-validated {
  input {
    color: $successText;
    border-color: $successBorder;
    background-color: lighten($successBackground, 7.5%);
  }
}