
@import "theme_variables";
@import "vendor_variables";

$quick-view-btn-size: 31px;
$product-grid-item-hover-bg: #f6f6f6;

//
// Transformation classes
//
.product_list {
  .show-if-product-item-hover {
    display: none;
  }
  .product-container:hover {
    .show-if-product-item-hover {
      display: block;
    }
  }
}

.product_list.list {
  .show-if-product-list-hover,
  .hide-if-product-list {
    display: none;
  }
  .product-container:hover {
    .show-if-product-list-hover {
      display: block;
    }
  }
}

.product_list.grid {
  .show-if-product-grid-hover,
  .hide-if-product-grid {
    display: none;
  }
  .product-container:hover {
    .show-if-product-grid-hover {
      display: block;
    }
  }
}

//
// Component classes
//
.quick-view {
  width: $quick-view-btn-size;
  position: absolute;
  top: 0;
  right: 0;
  text-align: center;
  padding: 5px 8px;
  border: 1px solid #ccc;
  border-right: none;
  border-top: none;
}

.color-list-container {
  margin-bottom: 10px;
  ul {
    padding: 0;
    margin: 0;
    list-style: none;
    line-height: 0;
    li {
      display: inline-block;
      border: 1px solid $ps-border-color;
      a {
        display: block;
        width: 22px;
        height: 22px;
        margin: 1px;
        img {
          display: block;
          width: 22px;
          height: 22px;
        }
      }
    }
  }
}

.product-container {
  text-align: center;
  margin-bottom: 30px;
  border-bottom: 1px solid transparent; // Preserves block heights on hover
}

.hook-reviews {
  margin-bottom: 10px;
}

.content_price {
  text-align: center;
  font-size: 1.4em;
}

.product-image-container {
  position: relative;
  border: 1px solid #ccc;
  background-color: #fff;
  .content_price {
    display: none;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    background: rgba(50, 50, 50, 0.65);
    padding: 3px;
    color: #fff;
  }
}

.product-actions-container {
  position: relative;
  overflow: visible;
  .content_price {
    margin-bottom: 10px;
  }
  .button-container {
    margin-bottom: 10px;
  }
  .availability {
    margin-bottom: 10px;
  }
}

.product_list.grid {
  .product-container {
    margin-bottom: 45px;
    &:hover {
      background-color: $product-grid-item-hover-bg;
      border: 1px solid #ccc;
      .product-image-container {
        border-left: none;
        border-right: none;
        border-top: none;
      }
      .button-container {
        display: block;
      }
      .product-actions-container {
        .content_price {
          @include opacity(0);
        }
      }
    }
  }
  .product-price-button-wrapper {
    position: relative;
    // This needs to have minimum height of the buttons that will be displayed on hover
    // @see bootstrap/_buttons.scss
    min-height: round(2*$padding-base-vertical + 2*1 + $font-size-base*$line-height-base);
    margin-bottom: 10px;
  }

  .product-description-container,
  .product-actions-container{
    padding: 0 5px;
  }
  .button-container {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
  }
  .functional-buttons {
    position: absolute;
    left: 0;
    width: 100%;
    z-index: 1;
    border: 1px solid #ccc;
    background-color: $product-grid-item-hover-bg;
    margin-left: -1px;
    @include box-sizing(content-box);
    > div {
      padding: 3px;
      float: left;
      width: 50%;
    }
  }
}

.add_to_compare.checked .icon:before {
  content: '\f068';
}

.product_list.list {
  .ajax_block_product {
    width: 100%;
  }
  .product-container {
    @include clearfix();
  }
  .product-image-container,
  .product-description-container,
  .product-actions-container {
    float: left;
    width: percentage(1 / 3);
    @media  (max-width: $screen-xs-max) {
      width: 100%;
      .product-name {
        margin-top: 10px;
      }
    }
  }
  .product-name {
    margin-top: 0;
  }
  .product-description-container {
    padding: 0 15px;
  }
}
