$bsub-color-bg: #f8f9f9;
$bsub-color-bg-hover: rgba(0, 0, 0, 0.03);
$bsub-color-bg-active-green: rgba(125, 186, 99, 0.07);
$bsub-color-widget-border: rgba(0, 0, 0, 0.4);
$bsub-color-group-border: rgba(0, 0, 0, 0.1);
$bsub-color-active-blue: #3B63FF;
$bsub-color-active-green: #7DBA63;

@keyframes bsub-fadeInFromNone {
  0% {
    display: none;
    opacity: 0;
  }

  1% {
    display: block;
    opacity: 0;
  }

  100% {
    display: block;
    opacity: 1;
  }
}

.bsub__hidden {
  display: none;
}

// TODO: Stop BSUB from pushing React widget CSS
.bsub-widget {
  padding: 0 5px !important;
  border: 0 !important;
  margin: 0 !important;

  legend {
    margin-bottom: 5px;
  }
}

.bsub-widget__wrapper {
  padding: 24px;
  border-radius: 8px;
  border: 1px solid $bsub-color-widget-border;
  background-color: $bsub-color-bg;
  font-size: 14px;

  fieldset {
    border: 0;
  	background-color: inherit;
    margin: 0;
    padding: 0;
  }

  legend {
    font-size: 11px;
  	text-transform: uppercase;
    letter-spacing: 3px;
  }
}

.bsub-widget__wrapper--single {
  .bsub-widget__groups-container {
  	display: none;
  }

  .bsub-widget__plans-container,
  .bsub-widget__options-container {
  	margin-top: 0;
  }
}

.bsub-widget__description {
  margin-top: 20px;
  padding-top: 10px;
  color: black;
  border-top: 1px solid $bsub-color-group-border;
}

.bsub-widget__groups-container {
  display: flex;
  align-items: stretch;

  input[type='radio'] {
  	display: none;
  }

  &:only-child {
  	margin-bottom: 0;
  }
}

.bsub-widget__group {
  flex: 1 1 100%;

  & + & {
  	margin-left: 1em;
  }
}

.bsub-widget__group-header {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 1rem;
  transition: 0.3s;

  border: 1px solid $bsub-color-group-border;
  border-radius: 5px;
  background-color: white;

  .bsub-widget__image {
    display: block;
    width: 4em;
    height: 4em;
  }

  &:hover {
    box-shadow: 0px 0px 2px 2px rgba(0,0,0,0.2);
  }

  input:checked + & {
    border-color: $bsub-color-active-blue;
    color: $bsub-color-active-blue;
    font-weight: 700;
  }
}

.bsub-widget__group-label {
  height: 100%;
}

.bsub-widget__group-discount-summary {
  font-size: 12px;
}

.bsub-widget__plans-container,
.bsub-widget__options-container {
  animation: bsub-fadeInFromNone 100ms ease-in-out;
  margin-top: 24px;

  input[type='radio'] {
  	display: none;
  }

  fieldset + fieldset {
  	margin-top: 10px;
  }
}

.bsub-widget__plan,
.bsub-widget__option {
  width: 100%;

  & + & {
  	margin-top: 5px;
  }
}

.bsub-widget__plan-header {
  display: flex !important;
  align-items: center;
  padding: 6px;
  border-radius: 8px;

  .bsub-widget__image {
    width: 20px;
    height: 20px;
    margin-right: 8px;
  }

  .bsub-widget__text {
    flex-grow: 1;
  }

  input:checked + &  {
    font-weight: 700;
    color: $bsub-color-active-green;
    background: $bsub-color-bg-active-green;

    .bsub-widget__unchecked-icon {
      display: none;
    }
  }

  input:not(:checked) + &  {
    .bsub-widget__checked-icon {
      display: none;
    }

    &:hover {
      background: $bsub-color-bg-hover;
    }
  }
}

.bsub-cart__selling-plan-details,
.bsub-cart-popup__selling-plan-details {
  font-size: 12px;
}


.bsub-widget__collector-intro {
  margin: 8px 5px 14px;
  padding: 14px 16px;
  border: 1px solid rgba(5, 36, 34, 0.18);
  background: rgba(161, 193, 220, 0.14);
  border-radius: 6px;
  color: #052422;

  strong {
    display: block;
    margin-bottom: 4px;
    font-size: 16px;
    line-height: 1.35;
  }

  span {
    display: block;
    font-size: 13px;
    line-height: 1.5;
  }
}


.bsub-cart__subscription-note {
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid rgba(5, 36, 34, 0.14);
  border-radius: 5px;
  background: rgba(161, 193, 220, 0.12);
  color: #052422;
  line-height: 1.4;

  strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 600;
  }

  span {
    display: block;
    font-size: 12px;
  }
}

.bsub-cart__subscription-note--mini {
  margin-top: 6px;
  padding: 7px 9px;

  strong {
    font-size: 12px;
  }

  span {
    font-size: 11px;
  }
}
