.rating {
  $self: &;
  display: flex;
  position: relative;
  &__container {
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
    &:not(:checked) {
      > input {
        height: 0;
        position: absolute;
        top: 0;
        transform: scale(0);
        width: 0;
      }
      > label {
        float: right;
        width: 13px;
        height: 14px;
        overflow: hidden;
        white-space: nowrap;
        line-height: 1;
        cursor: pointer;
        font-size: 14px;
        color: #ddd;
        margin-bottom: 0;
        overflow: hidden;
        &:before {
          content: "\2605";
          // content: '★ ';
          line-height: 0;
          letter-spacing: 0;
          font-size: 13px;

          @include media-breakpoint-up(sm) {
            font-size: 14px;
          }
        }
      }
      > label:hover,
      > label:hover ~ label {
        color: #00abed;
      }
    }
    & > input:checked ~ label {
      color: #00abed;
    }
    & > input:checked {
      & + label:hover,
      & ~ label:hover {
        color: #00abed;
        & ~ label {
          color: #00abed;
        }
      }
    }
    & > label {
      &:hover ~ input:checked ~ label {
        color: #00abed;
      }
      &:active {
        position: relative;
        // top: 2px;
        // left: 2px;
      }
    }
  }

  &__label {
    margin-left: 5px;
    font-size: 12px;
    line-height: 1.2;
    color: #666;

    @include media-breakpoint-up(sm) {
      line-height: 1.5;
    }
  }

  // modifier
  &--disabled {
    label {
      pointer-events: none;
    }
  }

  &--md {
    #{$self}__container {
      &:not(:checked) {
        > label {
          font-size: 16px;
          line-height: 1;
        }
      }
    }

    #{$self}__rounded {
      &:not(:checked) {
        .rating__star > label {
          width: 1.7em;
          height: 1.7em;
        }
      }
    }

    #{$self}__label {
      font-size: 16px;
    }
  }

  &--lg {
    #{$self}__container {
      &:not(:checked) {
        > label {
          font-size: 20px;
          line-height: 1.5;
        }
      }
    }

    #{$self}__rounded {
      &:not(:checked) {
        .rating__star > label {
          width: 2em;
          height: 2em;
        }
      }
    }

    #{$self}__label {
      font-size: 20px;
    }
  }

  &__rounded {
    &:not(:checked) {
      .rating__star {
        & > input {
          height: 0;
          position: absolute;
          top: 0;
          transform: scale(0);
          width: 0;
        }

        & > label {
          position: relative;
          display: block;
          float: right;
          width: 22px;
          height: 22px;
          overflow: hidden;
          white-space: nowrap;
          cursor: pointer;
          font-size: 12px;
          color: #707070;
          margin-bottom: 0;
          border: 0.5px solid #666666;
          border-radius: 50px;
          display: flex;
          align-content: center;
          justify-content: center;
          background-color: #fff;
          margin: 0 5px;

          &:hover,
          &:hover ~ label {
            background-color: #00abed;
            border-color: #00abed;

            .icon-star {
              background-image: url("#{$pathImgIcons}/star-white.png");
            }
          }
        }

        .icon-star {
          position: absolute;
          top: calc(47% - 7px);
          left: calc(50% - 7px);
          z-index: 2;
          height: 14px;
          width: 14px;
          background-position: center;
          background-size: cover;
          background-repeat: no-repeat;
          background-image: url("#{$pathImgIcons}/star-outline.svg");

          @include media-breakpoint-up(sm) {
            top: calc(46% - 7px);
            left: calc(48% - 7px);
          }
        }
      }
    }
    & > .rating__star {
      input:checked ~ label {
        background-color: #00abed;
        border-color: #00abed;

        .icon-star {
          background-image: url("#{$pathImgIcons}/star-white.png");
          top: calc(48% - 7px);
        }
      }
    }
  }

  &-stars {
    $self: &;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;

    &__container {
      height: 15px;
      width: 90px;
      background-image: url("#{$pathImgIcons}/icon_star-gray.svg");
      background-size: contain;
      background-position: top 0 left 0;
      background-repeat: repeat-x;
      color: #00abed;
      position: relative;
      overflow: hidden;

      @include media-breakpoint-up(sm) {
        height: 17px;
        width: 83px;
      }
    }
    &__percentage {
      position: absolute;
      height: 100%;
      top: 0;
      left: 0;
      background-image: url("#{$pathImgIcons}/icon_star.svg");
      background-size: contain;
      background-position: top 0 left 0;
      background-repeat: repeat-x;
      color: #00abed;
    }
    &__count {
      padding-left: 3px;
      font-size: 12px;
      line-height: 1em;
    }

    &--sm {
      #{$self}__container {
        height: 11px;
        width: 65px;
      }
    }

    &--lg {
      #{$self}__container {
        height: 20px;
        width: 120px;
      }
    }
  }
}

.review {
  $breakpoint: "sm";
  @include media-breakpoint-up($breakpoint) {
    border: $border;
    padding: 30px;
  }

  .btn {
    width: 100%;
    @include media-breakpoint-up($breakpoint) {
      width: auto;
    }
  }

  .section__title {
    margin-bottom: 13px;
  }

  &__header {
    display: flex;
    flex-flow: row wrap;
    @include media-breakpoint-up($breakpoint) {
      border-bottom: $border;
      margin: 0 -30px 0px -30px;
      padding: 0 30px;
    }
    hr {
      flex-basis: 100%;
    }
    .btn {
      margin-bottom: 30px;
    }
    .rating-stars {
      margin-bottom: 18px;
    }
    &-col {
      flex-basis: 100%;
      @include media-breakpoint-up($breakpoint) {
        flex: 1;
      }
      &:nth-child(3) {
        @include media-breakpoint-up($breakpoint) {
          flex-basis: 100%;
          margin-top: -32px;
        }
      }
    }
  }

  &__list {
    .rating-stars {
      &__container {
        height: 12px;
        width: 70px;
      }
    }

    &-header {
      display: flex;
      align-items: flex-start;
      small {
        font: {
          size: 12px;
        }
        line-height: 16px;
        color: #999999;
        display: block;
        width: auto;
        flex: 2 0 auto;
        margin: {
          top: -2px;
          left: 9px;
        }
      }
      img {
        filter: grayscale(1);
        max-width: 50px;
        opacity: 0.5;
        align-self: flex-start;
      }
      .rating-stars {
        margin-right: auto;
      }
    }

    &-item {
      margin-bottom: 25px;
      @include media-breakpoint-up($breakpoint) {
        margin-top: 30px;
      }
      .title {
        font-size: 20px;
        margin-bottom: 5px;
      }
      & + & {
        padding-top: 30px;
        border-top: $border;
      }
      .desc {
        margin-bottom: 0;
      }
    }
  }

  &__col {
    display: flex;
    align-items: flex-start;
  }

  &-breakdown {
    width: 100%;
    margin-bottom: 17px;

    @include media-breakpoint-up(sm) {
      margin-bottom: 0;
    }
    &__content {
      display: flex;
      justify-content: space-between;
      @include media-breakpoint-up(md) {
        justify-content: flex-start;
      }
    }
    &__title {
      margin-bottom: 0;
      line-height: 1;
      font-size: 20px;
      @include media-breakpoint-up(sm) {
        margin-bottom: 20px;
        font-size: 26px;
      }
    }
    &__details {
      margin-top: 5px;
      flex-basis: calc(100% - 132px);
      @include media-breakpoint-up(sm) {
        width: 65%;
      }
      span {
        display: inline-block;
        transform: translateY(1px);
        line-height: 1em;

        @include media-breakpoint-up(sm) {
          line-height: 21px;
        }
      }
    }
    &__item {
      display: flex;
      align-items: center;
    }
    &__summary {
      text-align: center;
      padding-left: 0;
      padding-right: 12px;

      @include media-breakpoint-up(md) {
        padding-left: 80px;
        padding-right: 0;
      }

      .average {
        font-weight: 600;
        line-height: 1;
        font-size: 28px;

        @include media-breakpoint-up(md) {
          font-size: 50px;
        }
      }

      .total {
        line-height: 1;
        font-size: 18px;

        @include media-breakpoint-up(md) {
          font-size: 28px;
        }
      }

      .rating-stars {
        justify-content: center;
        margin-top: 3px;
      }
    }
    &__label {
      font-size: 14px;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      @include media-breakpoint-up(sm) {
        font-size: 16px;
      }
    }
    &__count {
      font-size: 14px;
      line-height: 1.2em;
      @include media-breakpoint-up(sm) {
        font-size: 16px;
      }
    }
    .icon-star {
      padding-left: 7px;
      height: 12px;
      @include media-breakpoint-up(sm) {
        height: 20px;
      }
    }
    .progressbar {
      width: calc(57% + 30px);
      padding: 0 20px 0 10px;
      height: 6px;
      overflow: hidden;
      @include media-breakpoint-up(sm) {
        padding: 0 25px;
        width: calc(71% + 50px);
        height: 7px;
      }
    }
  }

  &-form {
    @extend .bg-gray;
    margin: {
      left: -15px;
      right: -15px;
      bottom: 20px;
    }
    padding: 18px 15px 20px 15px;
    @include media-breakpoint-up($breakpoint) {
      margin: {
        left: -30px;
        right: -30px;
        bottom: 0;
      }
      padding: 30px;
    }
    form {
      @include media-breakpoint-up($breakpoint) {
        display: flex;
        flex-flow: row wrap;
        margin: 0 -15px;
      }
    }
    textarea {
      height: 81px;
      @include media-breakpoint-up($breakpoint) {
        height: 138px;
      }
    }
    .form-group {
      display: flex;
      flex-flow: row wrap;
      @include media-breakpoint-up($breakpoint) {
        flex-basis: 50%;
        width: 100%;
        max-width: 50%;
        padding: 0 15px;
        margin-bottom: 25px;
      }
      input,
      select {
        flex-basis: 100%;
      }
    }
    .captcha {
      margin-bottom: 20px;
      @include media-breakpoint-up($breakpoint) {
        display: block;
        margin-left: auto;
        text-align: right;
      }
      &__con {
        @include media-breakpoint-up($breakpoint) {
          padding-top: 35px;
          display: block;
          margin-bottom: 0;
        }
        input {
          @include media-breakpoint-up($breakpoint) {
            flex-basis: auto;
            margin-left: auto;
          }
        }
      }
    }
    .rating__con {
      @include media-breakpoint-up($breakpoint) {
        transform: translateY(35px);
      }
    }
    &__close {
      text-align: right;
      margin-bottom: 5px;
      img {
        max-width: 20px;
        cursor: pointer;
      }
    }
  }

  &-show-hide {
    &.collapsed {
      content: "test";
    }
    &:not(.collapsed) {
      content: "y";
    }
  }
}
