// =============================================================================
// _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;
    background-color: $baseModBackground;
    border-radius: 4px;
    @include box-shadow(#{$baseBoxShadow});

    &.first {
      clear: both;
    }

    &.last {
      margin-right: 0;
    }

    .onsale {
      top: 6px;
      left: 6px;
    }

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

      a {
        display: block;
      }

      img {
        min-width: 100%;
      }
    }

    .entry-wrap {
      padding: 15px;
    }

    .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 {
          @include font-size(1.8);
        }
      }

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

    .added_to_cart {
      display: none;
    }

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

      .entry-header {
        .button {
          @include opacity(1);
        }
      }
    }
  }
}



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

.woocommerce {
  .entry-wrap {
    padding: 60px;
    @include clearfix();
    @include break(cubs) {
      padding: 36px;
    }
    @include break(baby-bear) {
      padding: 25px;
    }
  }

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

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

      .onsale {
        top: 12px;
        left: 12px;
      }

      .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;
        border: 1px solid $shortcodeBorderColorRgba;
        border-radius: 0 0 4px 4px;
        @include box-shadow(#{$shortcodeTabsContentBoxShadow});

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



// 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 {
      font-size: 81.25%;
      @include clearfix();

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

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

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

      > 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: 0;
        margin: 0;
        width: 25px;
        height: 25px;
        @include font-size(1.8);
        line-height: 25px;
        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: 1px solid $widgetBorderColorRgba;
    border-bottom: 0;
    padding: 7px;
    @include font-size(1.1);
    line-height: 1.1;
    text-align: center;
    text-transform: uppercase;
    border-radius: 6px 6px 0 0;
  }

  .buttons {
    border: 1px solid $widgetBorderColor;
    border: 1px solid $widgetBorderColorRgba;
    border-radius: 0 0 6px 6px;
    @include clearfix();
    @include box-shadow(#{$widgetWooButtonStyledBoxShadow});

    .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;
      color: $textColor;
      background-color: transparent;
      @include box-shadow(#{none});
      @include text-overflow();

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

      &:first-child {
        border-radius: 0 0 0 6px;
        border-right: 1px solid $widgetBorderColor;
        border-right: 1px solid $widgetBorderColorRgba;
      }

      &:last-child {
        border-radius: 0 0 6px 0;
      }
    }
  }
}


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

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

.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: $widgetWooLayeredNavCountBackground;
      border-radius: 100%;
      @include box-shadow(#{$widgetWooLayeredNavCountBoxShadow});
    }
  }
}


//
// 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;
    border-radius: 1em;
    @include box-shadow(#{$widgetWooPriceFilterSliderBoxShadow});

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

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

    .ui-slider-range {
      display: block;
      position: absolute;
      top: 0;
      height: 100%;
      border: 0;
      background-color: $accentColor;
      border-radius: 1em;
      z-index: 1;
      @include box-shadow(#{$widgetWooPriceFilterRangeBoxShadow});
    }
  }

  .price_slider_amount {
    @include clearfix();

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

    .button {
      color: $textColor;
      border-radius: 4px 0 0 4px;

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

    .price_label {
      width: 50%;
      border-left: 0;
      border-radius: 0 4px 4px 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: $textColor;
    }

    > ins {
      text-decoration: none;
    }

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



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

.woocommerce {
  .onsale {
    position: absolute;
    display: block;
    width: 42px;
    height: 42px;
    @include font-size(1.4);
    letter-spacing: 0;
    line-height: 40px;
    text-align: center;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.6);
    color: $white;
    border-radius: 100%;
    background-color: $accentColor;
    z-index: 1;
    @include rotate(-10deg);
    @include box-shadow(#{inset 0 1px 3px rgba(0, 0, 0, 0.45)});
  }
}



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

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

  p.stars {
    span {
      a {
        &[class^="star"] {
          &:after {
            display: none;
            width: 6.25em;
            padding: 0 1em;
            position: absolute;
            top: 0;
            right: -8.5em;
            font-size: 0.5em;
            text-align: center;
            color: $textColor;
            background-color: darken($baseModBackground, 10%);
            border-radius: 100em;
            @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-img {
        .avatar-wrap {
          &:before {
            display: none;
          }

          .avatar {
            width: 60px;
            border-radius: 0;
          }
        }

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

      article.comment {
        border: 1px solid $shortcodeBorderColor;
        border: 1px solid $shortcodeBorderColorRgba;
        border-radius: 2px;
        @include box-shadow(#{$thumbnailBoxShadow});
        @include break(middle-bear) {
          margin-left: 0;
        }
      }

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



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

.woocommerce-result-count {
  float: right;
  height: 2.65em;
  padding: 0 7px;
  border: 1px solid $widgetBorderColor;
  border: 1px solid $widgetBorderColorRgba;
  line-height: 2.5em;
  @include font-size(1.1);
  border-radius: 4px;
  @include box-shadow(#{$widgetWooButtonStyledBoxShadow});
}

.woocommerce-ordering {
  float: left;

  select {
    width: 100%;
    margin-bottom: 0;
    @include font-size(1.1);
    @include box-shadow(#{$widgetWooButtonStyledBoxShadow});
  }
}

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