@charset "UTF-8";

//
// @copyright        2017 opencart.cn - All Rights Reserved
// @link             http://www.guangdawangluo.com
// @author           Pu shuo <pushuo@opencart.cn>
// @created          2017-11-14 17:16:21
// @modified         2017-11-15 09:45:48
//

$star_width: 24px;

.star-box {
  width: $star_width * 5; height: $star_width;
  background: url(../image/rating.png) repeat-x;
  position: relative;
  overflow: hidden;

  &:hover .star {
    background-image: none !important;
  }

  .score {
    position: absolute; clip: rect(0 0 0 0);

    @for $i from 1 through 5 {
      &.score-#{$i}:checked ~ .star-#{$i} {
        width: $i * $star_width !important;
      }
    }

    &:checked + .star {
      background: url(../image/rating.png) repeat-x 0 -48px;
      left: 0; z-index: 1;
    }
  }

  .star {
    position: absolute;
    height: 100%;
    width: $star_width !important;
    z-index: 3;
    display: block;
    cursor: pointer;

    @for $i from 0 through 4 {
      &.star-#{$i + 1} {
        left: $i * $star_width;
      }
    }

    @for $i from 1 through 5 {
      &.star-#{$i}:hover {
        width: $i * $star_width !important;
      }
    }

    &:hover {
      background: url(../image/rating.png) repeat-x 0 -48px !important;
      left: 0; z-index: 2;
    }
  }
}

.rating-star-box {
  .control-label {
    float: left;
    margin-right: 5px;
    padding-top: 3px;
  }
}