@import "mixins.scss";

$default-border-size: 1px;
$selected-border-size: 3px;
$border-difference: ($selected-border-size - $default-border-size);
$external-spacing: 10px;
$internal-spacing: 15px;

$border-radius: 3px;

/* $large-width: 375px;
$medium-width: 290px;
$small-width: 175px; */

$large-width: calc(50% - 5 * #{$selected-border-size} - 2 * #{$internal-spacing});
$medium-width: calc(50% - 5 * #{$selected-border-size} - 2 * #{$internal-spacing});
$small-width: calc(50% - 5 * #{$selected-border-size} - 2 * #{$internal-spacing});

.rich-radio {
  @include transition(border-color 300ms ease-out);
  display: flex;
  box-sizing: content-box;
  padding: $internal-spacing;
  border: $default-border-size solid $gray5;
  border-radius: $border-radius;
  margin-top: $border-difference;
  margin-left: $border-difference;
  // margin-right: ($external-spacing + $border-difference);
  margin-bottom: ($external-spacing + $border-difference);
  min-height: 44px;
  font-weight: normal;
  cursor: pointer;

  &:hover {
    border-color: $gray2;
    @include transition(border-color 300ms ease-out);

    .rich-radio-illustration-is-image {
      filter: none;
    }

    & .rich-radio-illustration-item {
      fill: $gray2;

      g {
        fill: $gray2;
      }
    }
  }

  &:nth-child(even) {
    margin-right: 0;
  }

  &-is-disabled {
    border: 1px solid $gray6;
    color: $gray5;
    box-shadow: none;
    cursor: default;

    &:hover {
      border: 1px solid $gray6;
    }
  }

  &-is-checked {
    border: $selected-border-size solid $green2;
    margin-top: 0;
    margin-left: 0;
    // margin-right: $external-spacing;
    margin-bottom: $external-spacing;
    box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.15);

    & .rich-radio-illustration-item {
      fill: $green2;

      g {
        fill: $green2;
      }
    }

    &:hover {
      border-color: $green2;

      & .rich-radio-illustration-item {
        fill: $green2;

        g {
          fill: $green2;
        }
      }
    }
  }

  &-is-large {
    width: $large-width;
    // width: calc(50% - #{$large-width});
    min-height: 120px;
  }

  &-is-medium {
    width: $medium-width;
    // width: calc(50% - #{$medium-width});
  }

  &-is-new {
    font-size:20px;
    display:flex;
    align-items: center;
    background-color: $gray7;
    font-weight:bold;
  }

  &-is-small {
    width: $small-width;
    padding: $internal-spacing - 5 $internal-spacing;
    // width: calc(100% - #{$small-width});
  }

  // Specificity override for margins from thirdparty css on input[type="radio"]
  &-radio-button {
    margin-right: $internal-spacing;

    &-is-hidden {
      display: none;
    }
  }

  &-main-text {
    font-size: 14px;
    font-weight: bold;
    text-align: center;
  }

  &-label {
    display: inline-block;
    vertical-align: top;
    margin-right: 5px;
  }

  &-link {
    &-title {
      font-weight: 600;
    }
    &-description {
      font-size: 12px;
    }
    &:hover,
    &:focus {
      text-decoration: none;
    }
  }

  &-illustration-container {
    display: flex;
    align-items: center;
  }

  &-illustration {
    width: 45px;
    height: 40px;
    margin-right: $internal-spacing;

    &-is-image {
      width: 35px;
      height: auto;
      margin-right: 8px;
      filter: $gray6;
      filter: grayscale(100%);
    }
  }

  &-illustration-item {
    fill: $gray6;
    stroke-width: 1px;
    stroke: $pw;

    g {
      fill: $gray6;
      @include transition(fill 300ms ease-out);
    }
  }

  &-illustration-item-is-active {
    fill: $gray2;

    g {
      fill: $gray2;
    }
  }

  &-illustration-title {
    font-size: 14px;
    font-weight: bold;
  }

  &-illustration-description {
    font-weight: normal;
    font-size: 12px;
    color: $gray4;
  }
}
