.hidden {
  display: none !important;
  visibility: hidden !important;
}

.woocommerce div.product,
.woocommerce.archive,
.woocommerce.single-product {
  form.cart.variations_form {
    .variable:not(.type-select) {
      .arrow {
        display: none !important;
      }

      .line-hover:after {
        content: none;
      }
    }

    .tawcvs-swatches {
      padding: 5px;
      display: inline-flex !important;
      flex-wrap: wrap;

      .swatch,
      .swatch-show-more {
        -webkit-transition: all 0.3s;
        -moz-transition: all 0.3s;
        -o-transition: all 0.3s;
        transition: all 0.3s;
        width: 30px;
        height: 30px;
        line-height: 28px;
        text-align: center;
        cursor: pointer;
        position: relative;
        white-space: nowrap;
        margin: 0 10px;
        padding: 2px 5px;
        display: inline-flex;
        align-items: center;
        justify-content: center;

        &:after,
        &:before {
          display: block !important;
        }

        &.swatch-color {
          text-indent: -9999em;

          &.selected {

            &:after {
              -webkit-transform: translate(-50%, -50%) rotate(45deg);
              -moz-transform: translate(-50%, -50%) rotate(45deg);
              transform: translate(-50%, -50%) rotate(45deg);
              content: "";
              width: 6px;
              height: 10px;
              display: block;
              border: solid #eee;
              border-width: 0 2px 2px 0;
              border-radius: 0;
              position: absolute;
              top: 50%;
              left: 50%;
              margin: -2px -2px 0 0;
            }
          }
        }

        &:not(.swatch-color) {
          background-color: #f1f1f1;
        }

        &.swatch-label {
          font-size: 14px;
          min-width: max-content;
        }

        &.swatch-image {
          font-size: 0;

          .swatch__tooltip {
            font-size: 14px;
          }
        }

        &.swatch-shape-circle {
          -webkit-border-radius: 50% !important;
          -moz-border-radius: 50% !important;
          border-radius: 50% !important;

          img {
            -webkit-border-radius: 50%;
            -moz-border-radius: 50%;
            border-radius: 50%;
          }

          &:before {
            border-radius: 50%;
          }
        }

        &.swatch-shape-rounded {
          -webkit-border-radius: 8px;
          -moz-border-radius: 8px;
          border-radius: 8px;

          img {
            -webkit-border-radius: 8px;
            -moz-border-radius: 8px;
            border-radius: 8px;
          }

          &:before {
            border-radius: 8px;
          }
        }

        &.swatch-shape-edge {
          -webkit-border-radius: 0;
          -moz-border-radius: 0;
          border-radius: 0;

          img {
            -webkit-border-radius: 0;
            -moz-border-radius: 0;
            border-radius: 0;
          }

          &:before {
            border-radius: 0;
          }
        }

        &.disabled {
          cursor: default;
          opacity: 0.4 !important;

          .swatch__tooltip {
            display: none;
          }
        }

        &:first-child {
          margin-left: 0;
        }

        &:last-child {
          margin-right: 0;
        }

        &:before {
          content: '';
          position: absolute;
          left: -4px;
          top: -4px;
          right: -4px;
          bottom: -4px;
          border: 1px solid #ddd;
        }

        &.selected {
          border-color: transparent;

          &:before {
            border-color: #674399;
          }

          &:after {
            content: none;
          }

          &.swatch-label {
            border-bottom: none !important;
          }
        }
      }

      .swatch__tooltip {
        -webkit-transform: translate(-50%, -100%);
        -moz-transform: translate(-50%, -100%);
        transform: translate(-50%, -100%);
        -webkit-transition: all 0.3s;
        -moz-transition: all 0.3s;
        -o-transition: all 0.3s;
        transition: all 0.3s;
        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
        border-radius: 3px;
        position: absolute;
        left: 50%;
        top: 0;
        background: #333;
        z-index: 2;
        color: #fff;
        margin: -15px 0 0 0;
        padding: 5px 10px;
        text-indent: initial;
        font-size: 14px;
        font-weight: 500;
        opacity: 0;
        visibility: hidden;
        user-select: none;
        display: inline-block;
        word-break: break-all;
        white-space: normal;
        min-width: max-content;

        &:after {
          -webkit-transform: rotate(45deg);
          -moz-transform: rotate(45deg);
          transform: rotate(45deg);
          content: "";
          position: absolute;
          width: 12px;
          height: 12px;
          background: #333;
          bottom: -4px;
          left: 50%;
          margin-left: -6px;
        }
      }

      .swatch-item-wrapper {
        position: relative;
      }

      .swatch:hover + .swatch__tooltip {
        opacity: 1;
        visibility: visible;
        user-select: auto;
      }

      &.oss-blur-with-cross {
        .swatch.disabled {
          position: relative;
          background: #33333357;

          img {
            opacity: 0.5;
          }

          &:after {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border: none;
            border-radius: 0;
            background: linear-gradient(to top left,
                    rgba(0, 0, 0, 0) 0%,
                    rgba(0, 0, 0, 0) calc(50% - 0.8px),
                    rgba(0, 0, 0, 1) 50%,
                    rgba(0, 0, 0, 0) calc(50% + 0.8px),
                    rgba(0, 0, 0, 0) 100%),
            linear-gradient(to top right,
                            rgba(0, 0, 0, 0) 0%,
                            rgba(0, 0, 0, 0) calc(50% - 0.8px),
                            rgba(0, 0, 0, 1) 50%,
                            rgba(0, 0, 0, 0) calc(50% + 0.8px),
                            rgba(0, 0, 0, 0) 100%);
          }

          &.swatch-shape-rounded {
            &:after {
              border-radius: 8px;
            }
          }

          &.swatch-shape-circle {
            &:after {
              border-radius: 50%;
            }
          }
        }
      }

      &.oss-hide {
        .swatch.disabled {
          display: none !important;
        }
      }
    }
  }
}

.swatch-align-left .variations {
  text-align: left;

  img, select, .value {
    text-align: left;
  }
}

.swatch-align-center .variations {
  text-align: center;

  img, select, .value {
    text-align: center;
  }
}

.related.products {
  .swatch-align-center .variations .label {
    display: none;
  }
}

.swatch-align-right .variations {
  text-align: right;

  img, select, .value {
    text-align: right;
  }
}

.variations .reset_variations {
  display: none;
}

/**
 * Custom CSS for the Sober theme
 */
.woocommerce.theme-sober div.product form.cart.variations_form {
  .variations .variable {
    width: 90%;
  }

  @media (max-width: 768px) {
    .variations .variable {
      width: 100%;
    }
  }

  .line-hover {
    cursor: default;
  }

  .tawcvs-swatches .swatch-item-wrapper {

    .swatch-image {
      img {
        width: 100%;
        height: auto;
      }

      text-align: center;
    }
  }
}