// -----------------------------------------------------------------------------
// This file contains styles that are specific to the shop pages.
// -----------------------------------------------------------------------------
/*--------------------------------------------------------------
#{$s}
--------------------------------------------------------------*/

// Widget Master
.shop-w-master {


  &__heading {
    font-size: 18px;
    color: $g-brand-secondary-color;
    font-weight: 700;
    line-height: 20px;
  }



}


.sidebar--bg-snow {
  background-color: #f9f9f9;
}



.shop-w {
  &--style {
    border: 1px solid #f1f1f1;
    background-color: $g-white;
    box-shadow: 0 6px 15px 0 rgba(36, 37, 38, 0.08);
  }

  &__intro-wrap {
    position: relative;
  }

  &__h {
    font-size: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid #efefef;
    color: $g-brand-secondary-color;
    font-weight: 700;
    line-height: 20px;
  }

  &__wrap {
    padding: 14px;
  }
}

.shop-w__toggle.collapsed {
  &:before {
    content: "\F067";
  }
}


.shop-w__toggle {
  position: absolute;
  top: 50%;
  padding: 8px 12px;
  background-color: transparent;
  transform: translateY(-50%);
  right: 10px;
  font-size: 12px;
  cursor: pointer;
  color: #444;
}








// Shop widget Global Recursive List
.shop-w {
  ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
  }
}

// Shop widget Official List
.shop-w__list {
  overflow: auto;
  max-height: 290px;
  > li {
    position: relative;// Important property because of span (.shop-w__total-text)
    padding: 8px 16px;
  }
}


// Shop widget Official List with Hidden checkboxes
.shop-w__list-2 {
  overflow: auto;
  max-height: 290px;
  > li {
    padding: rem(4) 0;
    position: relative;// Important property because of span (.shop-w__total-text)
  }
}

.list__content {
  position: relative;
  [type="checkbox"] {
    position: absolute;
    left: 0;
    top: 0;
    min-width: 16px;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0;
    cursor: pointer;
  }

  span {
    padding: 8px 16px;
    display: block;
    font-size: 14px;
    transition: background-color 110ms ease-in-out,color 110ms ease-in-out;
    color: $g-text-color;
  }
}

.list__content:hover {
  span {
    color: $g-brand-secondary-color;
    background-color: #ececec;
    border-radius: .5rem;
  }
}

.list__content input:checked + span {
  background-color: #ececec;
  color: $g-brand-secondary-color;
  border-radius: .5rem;
}



.shop-w__total-text {
  font-size: 11px;
  position: absolute;
  cursor: pointer;
  top: 50%;
  transform: translateY(-50%);
  color: $g-brand-secondary-color;
  right: 13px;
}

// Category list
.shop-w__category-list {
  overflow: auto;
  max-height: 290px;
  > li {
    padding: 4px 14px;
    > a {
      font-size: 14px;
      color: $g-brand-secondary-color;
      transition: color 110ms ease-in-out;
      &:hover {
        color: $g-brand-color;
      }
    }
    // Recursive only : Apply to only list item that has '.has-list' class
    ul {
      .has-list {
        > a {
          font-size: 13px;
          font-weight: 700;
          color: $g-brand-secondary-color;
        }
      }
    }

    ul {
      display: none;
      padding-left: 8px;
      li {
       // padding: 4px 0;
        a {
          font-size: 13px;
          color: $g-text-color;
          transition: color 110ms ease-in-out;
          &:hover {
            color: $g-brand-color;
          }
        }
      }
    }

  }
}

.has-list {
  position: relative;
}

.category-list__text {
  font-size: 10px;
  color: #a0a0a0;
}

.js-shop-category-span {
  cursor: pointer;
  font-size: 13px;
  color: #444;
  transition: color 110ms ease-in-out;
  &:hover {
    color: $g-black;
  }
}

.js-shop-category-span.is-expanded {
  &:before {
    content: '\f068';
  }
}



// Price
.shop-w__form-p-wrap {
    display: flex;
    flex-wrap: wrap;
    padding: 8px 0;

  div {
    margin-right: 8px;
    margin-bottom: 12px;
    &:last-child {
      margin-right: 0;
    }
  }

  .input-text,.btn  {
    height: 40px;
    padding: 8px;
    border-radius: 2px;
  }

  .input-text {
    width: 80px;
  }

  .btn {
      width: 40px;
  }

  }

// Color Checkbox
// div
.color__check {
  position: relative;
  line-height: 1.89;
  margin-right: 36px;// Same as before and after width
  display: inline-block;// Very Very Important property
}

.color__check {
  [type="checkbox"] {
    position: absolute;
    left: 0;
    top: 0;
    min-width: 30px;// Width of the default hidden radio
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0;
    cursor: pointer;
  }
}
// label
.color__check-label {
  position: initial;// Which is by default static
  display: inline-block;// Very Very Important property
}

.color__check-label:before,.color__check-label:after {
  content: '';
  width: 30px;
  height: 30px;
  display: block;
  border: 2px solid transparent;
  z-index: 0;
  position: absolute;
  left: 0;
  top: 0;
}

.color__check-label:after {
  transform: scale(0.6);
  background-color: inherit;// Important property
}

.color__check input:checked + label:before {
  border-color: #d2d2d2;
}
// Color End


// Div Rating Radio
.rating__check {
  position: relative;
  cursor: pointer;
  [type="checkbox"] {
    position: absolute;
    left: 0;
    top: 0;
    min-width: 16px;// Width of the default hidden radio
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0;
    cursor: pointer;
  }
}

// div with 'i' icons
.rating__check-star-wrap {
  > i {
    margin-left: 2px;
    color: #ff4500;
    transition: color .4s ease-in-out;
    &:first-child {
      margin-left: 0;
    }
  }

  span {
    font-size: 12px;
    color: $g-brand-secondary-color;
    margin-right: 2px;
  }
}

.rating__check:hover {
  .rating__check-star-wrap {
    > i {
      color: #ff9600;
    }
  }
}

// Checked
.rating__check input:checked {
  + .rating__check-star-wrap {
    > i {
      color: #ff9600;
    }
  }
}



// Shop Option

.shop-p__meta-wrap {
 box-shadow: 0 8px 16px rgba(0,0,0,.15);
 padding: 20px;
 border-radius: rem(10);
}


.shop-p__meta-text-1 {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    font-weight: 700;
    color: $g-brand-secondary-color;
}
//div
.shop-p__meta-text-2 {
  font-size: 14px;
  font-weight: 700;
  color: $g-text-color;
}



.shop-p__tool-style {
  display: flex;
  align-items: center;
  justify-content: space-between;
}



.tool-style__group {
  display: flex;
  flex-wrap: wrap;// Multi-line
  span {
    position: relative;
    display: inline-block;
    height: 40px;
    cursor: pointer;
    border: 2px solid #e5e5e5;
    font-size: 13px;
    padding: 8px 18px;
    font-weight: 700;
    color: $g-brand-secondary-color;
    &:hover {
      background-color: rgba($g-brand-color,.12);
      color: $g-brand-color;
      border-color: $g-brand-color;
      z-index: 2;
    }
  }

 // Apply only on those spans which are not last-child
  span:not(:last-child) {
    margin-right: -2px;
  }

  span.is-active {
    background-color: rgba($g-brand-color,.12);
    color: $g-brand-color;
    border-color: $g-brand-color;
    z-index: 2;
  }
}


.tool-style__form-wrap {
  display: flex;
  align-items: center;

  div + div {
    margin-left: 15px;
  }

  select {
    border-radius: .25rem;
  }
}



// Product Grid Styles
.is-grid-active {
  .product-m {
    position: relative; // For hover div
    margin-bottom: 30px;
    transition: 0.3s;

    //
    &__thumb {
      position: relative; // For Cart Button/ Quick Look
    }

    // Add Cart
    &__add-cart {
      position: absolute;
      bottom: 15px;
      left: 15px;
      right: 15px;
      opacity: 0;
      visibility: hidden;
      transition: 0.3s;
      > a {
        padding: 12px;
        border-radius: rem(2);
        font-size: 13px;
        width: 100%;
        text-align: center;
        display: block;
      }
    }

    &__quick-look {
      position: absolute;
      top: 8px;
      right: 22px;
      opacity: 0;
      visibility: hidden;
      transition: 0.3s;
      > a {
        font-size: 16px;
        color: $g-brand-color;
        transition: color 110ms ease-in-out;
        &:hover {
          color: #a0a0a0;
        }
      }
    }

    &__content {
      padding: 4px 16px 6px;
    }

    &__category {
      margin-bottom: 2px;
      line-height: 1.2;
      > a {
        color: #a0a0a0;
        transition: color 0.5s;
        font-size: 12px;
        &:hover {
          color: $g-brand-color;
        }
      }
    }

    &__name {
      > a {
        color: $g-brand-secondary-color;
        font-size: 14px;
        font-weight: 600;
        transition: color 0.5s;
        &:hover {
          color: $g-brand-color;
        }
      }
    }

    &__price {
      line-height: 1.2;
      color: $g-brand-secondary-color;
      font-size: 14px;
      font-weight: 600;
    }

    &__discount {
      font-weight: 600;
      margin-left: 30px;
      color: $g-brand-color;
      font-size: 14px;
      text-decoration: line-through;
    }

    &__rating {
      margin-bottom: 6px;
      i {
        font-size: 12px;
      }
    }

    &__review {
      margin-left: 4px;
      font-size: 11px;
      color: #a0a0a0;
    }

    &__hover {
      position: absolute;
      top: 96%;
      width: 100%;
      z-index: 9;
      padding: 4px 16px 14px;
      left: 0;
      background: $g-white;
      box-shadow: 0 6px 7px 0 rgba(0, 0, 0, 0.2); // x-offset y-offset blur spread
      transition: all 300ms ease-in-out;
      opacity: 0;
      visibility: hidden;
    }

    // Span inline
    &__wishlist {
      text-align: right;
      a {
        font-size: 16px;
        color: #a0a0a0;
        transition: color 110ms ease-in-out;
        &:hover {
          color: $g-brand-color;
        }
      }
    }

    &__preview-description {
      margin-bottom: 8px;
      font-size: 12px;
      color: $g-text-color;
    }

  }
}

.is-grid-active {
  .product-m:hover {
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
    .product-m__add-cart {
      opacity: 1;
      visibility: visible;
    }

    .product-m__quick-look {
      opacity: 1;
      visibility: visible;
    }

    .product-m__hover {
      top: 99%;
      opacity: 1;
      visibility: visible;
    }
  }
}

// Product List Styles
// default has flex
.is-list-active {
  display: block;
  [class*="col-"] {
    // default has position relative property
    display: block;// default has flex with hard coded max-width
    max-width: 100%;
    width: 100%;
}
}

.is-list-active {
  .product-m {
    padding: 15px 0;
    transition: 0.3s;
    display: flex;
    flex-wrap: wrap;

    &__thumb {
      position: relative; // For Cart /Quick Look Button
      flex: 0 0 33.33333%;// col-4
      max-width: 33.33333%;// col-4
      padding-right: 15px;
      padding-left: 15px;
    }

    // Add Cart
    &__add-cart {
      position: absolute;
      bottom: 15px;
      left: 15px;
      right: 15px;
      opacity: 0;
      visibility: hidden;
      transition: 0.3s;
      > a {
        padding: 12px;
        border-radius: rem(2);
        font-size: 13px;
        width: 100%;
        text-align: center;
        display: block;
      }
    }

    &__quick-look {
      position: absolute;
      top: 8px;
      right: 22px;
     opacity: 0;
     visibility: hidden;
      transition: 0.3s;
      > a {
        font-size: 16px;
        color: $g-brand-color;
        transition: color 110ms ease-in-out;
        &:hover {
        color:darken($g-brand-color,1%);
        }
      }
    }


    &__content {
      position: relative;// For add to wishlist
      flex: 0 0 66.66667%;// col-8
      max-width: 66.66667%;// col-8
      padding-right: 15px;
      padding-left: 15px;
    }



    &__category {
      margin-bottom: 2px;
      line-height: 1.2;
      > a {
        color: #a0a0a0;
        transition: color 0.5s;
        font-size: 12px;
        &:hover {
          color: $g-brand-color;
        }
      }
    }

    &__name {
      > a {
        color: $g-brand-secondary-color;
        font-size: 14px;
        font-weight: 600;
        transition: color 0.5s;
        &:hover {
          color: $g-brand-color;
        }
      }
    }

    &__price {
      margin-bottom: 8px;
      line-height: 1.2;
      color: $g-brand-secondary-color;
      font-size: 14px;
      font-weight: 600;
    }

    &__discount {
      font-weight: 600;
      margin-left: 30px;
      color: $g-brand-color;
      font-size: 14px;
      text-decoration: line-through;
    }

    &__rating {
      margin-bottom: 6px;
      i {
        font-size: 12px;
      }
    }

    &__review {
      margin-left: 4px;
      font-size: 11px;
      color: #a0a0a0;
    }


    &__preview-description {
      font-size: 12px;
      color: $g-text-color;
    }

    // Span inline
    &__wishlist {
      position: absolute;
      right: 12px;
      bottom:13px;
      a {
        font-size: 16px;
        color: #a0a0a0;
        transition: color 110ms ease-in-out;
        &:hover {
          color: $g-brand-color;
        }
      }
    }

  }
}

.is-list-active {
  .product-m:hover {
    background: $g-white;
    border-radius: rem(3);
    box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.2);
    .product-m__add-cart {
      opacity: 1;
      visibility: visible;
    }

    .product-m__quick-look {
      opacity: 1;
      visibility: visible;
    }
  }
}


// Shop Pagination
.shop-p__pagination {
  margin: 0;
  padding: 0;
  list-style: none;
  justify-content: center;
  display: flex;
  align-items: center;
  > li {
    margin-right: 14px;
    &:last-child {
      margin-right: 0;
    }
    > a {
      width: 42px;
      text-align: center;
      height: 42px;
      line-height: 42px;
      font-size: 12px;
      display: block;
      //  border: 1px solid #;
      font-weight: 600;
      border-radius: 50%;
      background-color: transparent;
      color: $g-brand-secondary-color;
    }
  }

  > li.is-active {
    > a {
      background-color: #f7f7f7;
    }
  }

  > li:not(.is-active) {
    > a:hover {
     color: $g-brand-color;
     text-decoration: underline;
    }
  }
}


// Shop Side Filters and overlay

.shop-a {
  &__wrap {
    position: fixed;
    top: 0;
    width: 350px;
    min-height: 100vh;
    bottom: 0;
    z-index: 9999;
    right: 0;
    transition: all 400ms ease-out;
    transform: translate(200px, 0);
    box-shadow: 0 0 7px 2px rgba(0, 0, 0, 0.09);
    background-color: $g-white;
    visibility: hidden;
    opacity: 0;
  }

  &__inner {
    overflow: auto;
    height: 100%;
    padding: rem(20) rem(18);
  }
}
.shop-a.is-open {
  .shop-a__wrap {
    transform: translate(0, 0);
    visibility: visible;
    opacity: 1;
  }
}

@media(max-width:575px) {
  .is-list-active {
    .product-m {
      &__thumb {
        margin-bottom: 30px;
        flex: 0 0 100%;
        max-width: 100%;
      }

      &__content {
        flex: 0 0 100%;
        max-width: 100%;
      }

      // Span inline
      &__wishlist {
        position: static;
        text-align: right;
      }
    }

  }

  .shop-p__tool-style {
    display: block;
  }
  .tool-style__form-wrap {
    display: block;
    div + div {
      margin-left: 0;
    }
  }
}
