// =============================================================================
// _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 {
  .entry-header.shop {
    margin-bottom: 50px;
    @include break(cubs) {
      margin-bottom: 32px;
    }
    @include break(baby-bear) {
      margin-bottom: 24px;
    }
  }

  ul.products {
    clear: both;
    margin: 0 0 -55px;
    list-style: none;
    @include cf();
  }

  li.product {
    float: left;
    overflow: hidden;
    position: relative;
    margin: 0 4% 55px 0;
    border: 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 {
      border: 0;
      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;
    padding: 0;
    @include cf();
  }

  div.product {
    border: 0;
    padding: 0;
    @include cf();

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

      .x-img-thumbnail:hover {
        border-color: $baseBorderSolid;
        border-color: $baseBorderRgba;
      }
    }

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

      .product_title {
        margin: 0 0 0.25em;
        padding: 0;
        font-size: 228%;
        text-align: left;
        @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 -55px;

    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();
      font-size: 78.5%;

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

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

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

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


//
// Cart.
//

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

  ul {
    margin-bottom: -1px;

    li {
      position: relative;

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

      &:hover {
        .remove {
          opacity: 0.35;

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

  .total {
    margin: 0 -21px;
    border: 1px solid $baseBorderSolid;
    border: 1px solid $baseBorderRgba;
    border-top: 0;
    border-bottom: 0;
    padding: 7px;
    font-size: 11px;
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
    background-color: $baseModBackground;
  }

  .buttons {
    margin: 0 -21px;
    border: 1px solid $baseBorderSolid;
    border: 1px solid $baseBorderRgba;
    background-color: $baseModBackground;
    @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 $baseBorderSolid;
        border-right: 1px solid $baseBorderRgba;
      }
    }
  }
}


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

.widget_layered_nav {
  li {
    position: relative;

    .count {
      position: absolute;
      top: 50%;
      right: 20px;
      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 {
    width: 5.8em;
    margin-bottom: 2px;
  }
}



// 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: -29px;
    left: -63px;
    display: block;
    width: 150px;
    height: 80px;
    border: 1px solid $baseBorderSolid;
    border: 1px solid $baseBorderRgba;
    font-size: 18px;
    line-height: 120px;
    text-align: center;
    text-transform: uppercase;
    color: $linkColor;
    background-color: $baseModBackground;
    @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;
            border: 1px solid $baseBorderSolid;
            border: 1px solid $baseBorderRgba;
            padding: 0 0.5em;
            position: absolute;
            top: -1px;
            right: -8.25em;
            font-size: 0.5em;
            text-align: center;
            color: $textColor;
            background-color: $baseModBackground;
            @include font-awesome();
          }
        }
      }
    }
  }
}



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

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

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

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

    article.comment {
      margin-left: 90px;
      border: 0;
      padding: 0;
      @include cf();

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

    .x-comment-header {
      position: relative;
      float: left;
      width: 165px;
      margin: 7px 19px 5px 0;
      border: 1px solid $baseBorderSolid;
      border: 1px solid $baseBorderRgba;
      padding: 12px 13px;
      background-color: #fafafa;
      @include text-overflow();
      z-index: 5;
      @include break(baby-bear) {
        width: 100%;
        margin-bottom: 10px;
      }

      .x-comment-author {
        font-size: 21px;
      }

      .star-rating-container {
        display: block;
        margin: 5px 0 4px;

        .star-rating {
          font-size: 10px;
        }
      }

      .x-comment-time {
        font-size: 12px;
      }

      .comment-edit-link {
        display: none;
      }
    }

    .x-comment-content {
      font-size: 14px;
    }

    .x-comment-img {
      @include break(middle-bear) {
        display: none;
      }

      .avatar-wrap {
        margin-top: 16px;

        .avatar {
          width: 70px;
        }
      }

      .bypostauthor {
        display: none;
      }
    }
  }
}



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

.woocommerce-result-count {
  float: right;
  height: 2.65em;
  padding: 0 7px;
  border: 1px solid $baseBorderSolid;
  border: 1px solid $baseBorderRgba;
  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%);
  }
}