.color-swatch {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
  li {
    width: 34px;
    height: 34px;
    margin: 3px;
    @media (max-width: $screen-xs-max) {
      width: 28px;
      height: 28px;
    }
    & > * {
      display: block;
      overflow: hidden;
      width: 100%;
      height: 100%;
      margin: 1px;
      text-decoration: none;
      cursor: pointer;
      border-radius: 50%;
      box-shadow: inset 0 0 0 1px transparent;
      img {
        display: block;
        position: relative;
        width: 100%;
        height: 100%;
        z-index: -1;
        -webkit-backface-visibility: hidden;
        -webkit-transform: translateZ(0) scale(1.0, 1.0);
        object-fit: cover;
        border-radius: 50%;
      }
    }
  }
  li:hover, li.active {
    & > * {
      box-shadow: inset 0 0 0 1px $text_color_middle;
    }
  }
}
.has-squared-color-swatch {
  .color-swatch, .color-swatch li > *, .color-swatch li > * img, .prd:not(.prd-hor):not(.prd-hor-simple) .colorswatch-label ul img {
    border-radius: 0 !important;
  }
}
@media (max-width: $screen-xs-max) {
  .prd-listview .color-swatch li {
    width: 34px;
    height: 34px;
  }
}
.prd-block {
  ul.color-list {
    display: flex;
    flex-wrap: wrap;
    margin: -4px 0 0;
    padding: 0;
    list-style: none;
    overflow: visible !important;
    li {
      display: inline-flex;
      width: auto;
      position: relative;
      margin: 4px 4px 0;
      top: 0;
      img {
        display: block;
        width: 100%;
        height: 100%;
        border-radius: 50%;
      }
      &.active {
        img {
          min-width: calc(100% + 2px);
          width: calc(100% + 2px);
          height: calc(100% + 2px);
        }
        span.value {
          &:after, &:before {
            border-radius: 50%;
          }
          &:after {
            border-color: #fff;
          }
        }
      }
      &:not(.absent-option):not(.active):hover a {
        img {
          min-width: calc(100% + 2px);
          width: calc(100% + 2px);
          height: calc(100% + 2px);
        }
      }
      &.active a span.value:after,
      &:hover a span.value:after {
        box-shadow: none;
      }
      a {
        display: block;
        text-decoration: none;
        padding: 1px;
        transition: none;
        span.value {
          position: relative;
          display: flex;
          align-items: center;
          justify-content: center;
          width: 30px;
          height: 30px;
          border-radius: 50%;
          &:after {
            border-radius: 50%;
            content: '';
            position: absolute;
            z-index: 0;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            border-width: 2px;
            border-style: solid;
            border-color: transparent;
            box-shadow: none;
          }
        }
      }
    }
    li.absent-option > a {
      overflow: hidden;
      position: relative;
      border-radius: 50%;
    }
    li.absent-option > a:after {
      position: absolute;
      z-index: 1;
      content: '';
      background: url(cross_color.png) rgba(255, 255, 255, .5);
      background-size: 100% 108%;
      display: block;
      left: 1px;
      right: 1px;
      top: 1px;
      bottom: 1px;
    }
  }
}
.sidebar-block ul.color-list {
  margin: -5px 0 0;
  padding: 0;
  list-style: none;
  overflow: visible;
  li {
    width: 100%;
    position: relative;
    img {
      display: inline-block;
      position: relative;
      width: 18px;
      height: 18px;
      vertical-align: top;
    }
    a {
      display: block;
      width: 100%;
      min-height: 25px;
      position: relative;
      padding: 5px 0 2px;
      overflow: hidden;
      text-decoration: none;
      color: $sidebar-option-color-name_color;
      transition: none;
      span.value {
        display: block;
        float: left;
        position: relative;
        border: 0;
        @include flexWidth(25px);
        height: 18px;
        min-width: inherit;
        box-shadow: inset 0 0 10px 5px transparent;
        &:after {
          content: '';
          position: absolute;
          z-index: 2;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          box-shadow: inset 0 0 0 2px transparent;
        }
        &:before {
          content: '';
          position: absolute;
          z-index: 1;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          box-shadow: inset 0 0 0 4px transparent;
        }
      }
      span.colorname {
        display: block;
        position: relative;
        padding: 1px 0 0 9px;
        font-size: 13px;
        line-height: 16px;
        overflow: hidden;
      }
    }
    &.active, &:hover {
      a span.value:after {
        box-shadow: inset 0 0 0 2px $sidebar-option-color-active_border-color;
      }
      a span.value:before {
        box-shadow: inset 0 0 0 4px #fff;
      }
    }
  }
  li:not(.active):hover {
    a {
      color: $sidebar-option-color-name-hover_color;
    }
  }
  li.active {
    a {
      color: $sidebar-option-color-name-active_color;
    }
  }
}

img.color-bordered {
  border: 1px solid #ddd;
}