.checkout-widget {
  padding: 20px;
  background-color: $gray-bg;
  margin-bottom: 20px;

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

  .heading-3 {
    margin-bottom: 15px;
  }

  .heading-3_checkout-widget-supply {
    .checkout-widget__edit-link {
      margin-top: 2px;
    }
  }

  .accordion {
    padding: 0;
    border-bottom: 0;

    .accordion__content {
      padding: 0;
      margin-top: 20px;

      &-inner > :last-child {
        border-bottom: 0;
        padding-bottom: 0;
      }

    }

    .accordion__header {
      padding-left: 0;
    }

    .accordion__header-icon {
      left: -30px;
    }
  }

  &__accordion-wrap {
    position: relative;

    .collapsed .accordion__header-icon-small {
      transform: rotate(180deg);
    }

    .accordion__header-icon-small {
      display: block;
      position: absolute;
      left: 80px;
      top: -2px;
      color: $blue;
      font-size: 1.25rem;
    }
  }

  &__detail-name_accordion {
    display: block;
    cursor: pointer;
  }

  &__detail-name_accordion + .checkout-widget__details-hidden + span {
    position: absolute;
    top: 0;
    right: 0;
  }

  .accordion + .checkout-widget__detail-value {
    position: absolute;
    right: 0;
    top: 0;
  }

  &__details {
    font-size: $font-size-base;
    font-weight: 500;
    line-height: 1.375rem;
    padding-left: 0;
    margin-bottom: 0;
    list-style-type: none;

    & > li:not(:first-of-type) {
      margin-top: 5px;
    }

    .checkout-widget__details-hidden {
      padding-left: 15px;
      list-style: disc;
      margin-top: 5px;

      li {
        font-size: .75rem;
        line-height: 1rem;
        position: relative;
        font-weight: normal;
        padding-right: 20px;

        &.checkout-widget__voucher-removed {
          color: $red;
          list-style: none;
        }

        & .icon {
          width: 16px;
          height: 16px;
          line-height: 16px;
          position: absolute;
          right: 0;
          top: 0;
          cursor: pointer;
          color: $warm-grey;
          font-size: $font-size-base;
        }
      }
    }

    & > .checkout-widget__details__item {
      overflow: hidden;

      .checkout-widget__detail-name {
        white-space: nowrap;
      }
    }
  }

  &__detail-name {
    font-weight: 700;
  }

  &__detail-block {
    &:first-child {
      font-weight: 700;
    }
  }

  &__detail-value:not(.checkout-widget__details-hidden),
  &__detail-value_payment:not(.checkout-widget__details-hidden),
  &__detail-value_no-float {
    display: block;
    color: $warm-grey;
  }

  &__detail-value:not(.checkout-widget__details-hidden) {
    float: right;
  }

  .checkout-widget__detail-text_accented {
    color: $red;
  }

  &__total {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid $gray;
  }

  &__total-legend {
    font-weight: 700;
  }

  &__price {
    color: $blue-dark;
    font-size: 2.125rem;
    font-weight: 700;
    line-height: 2.25rem;
  }

  &__actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid $gray;
  }

  &__basket-block {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid $gray;

    &_cards {
      text-align: center;
      border-top: 0;
      margin-top: 0;
    }

    &_small {
      border-top: 0;
      background: $gray-bg;
      margin: 0 -15px 15px;
      padding: 30px 15px;

      .form-row__col-btn.pay-pal_container {
        padding-top: 20px;
        border-bottom: 0;
        margin-bottom: -10px;
      }
    }

    .pay-pal_container {
      padding: 0;
      padding-top: 20px;
      border-bottom: 1px solid $gray;

      .paypal-button-container {
        min-width: inherit;
      }

      .paypal-button-text {
        line-height: 35px;
        font-size: $font-size-base;
        font-weight: 500;
        padding-left: 5px;
      }

      .checkout-payment-details__link {
        margin: 0;
      }

      &-link {
        margin-top: 20px;
        width: 100%;
        text-align: center;
        font-size: .75rem;
        display: inline-block;
      }

      &-email {
        position: relative;
        bottom: 5px;
        margin: 20px auto 0;
        text-align: center;
        font-size: .75rem;
        line-height: 1.25rem;

        .pay-pal_email {
          &-heading {
            color: $warm-grey;
            font-weight: 500;
          }
        }
      }
    }
  }

  &__payment-wrapper {
    position: relative;
    margin-top: 10px;
    margin-left: -5px;
    margin-right: -5px;
    border: 1px solid $gray;
  }

  &__secure {
    &-header {
      position: absolute;
      top: -10px;
      left: calc(50% - 100px);
      text-align: center;
      width: 200px;
      font-weight: bold;
      font-size: $font-size-13;
      background: $gray-bg;
    }

    &-icon {
      display: inline-block;
      margin-right: 5px;
    }

    &-ssl,
    &-message {
      font-size: .625rem;
      margin-bottom: 0;
    }

    &-ssl {
      padding-top: 9px;
      line-height: 1rem;
    }

    &-message {
      position: absolute;
      bottom: -7px;
      left: calc(50% - 80px);
      text-align: center;
      width: 160px;
      background: $gray-bg;
    }

    &-link {
      display: block;
      text-align: center;
      margin-top: 10px;
      padding-bottom: 20px;
      border-bottom: 1px solid $gray;
    }
  }

  &__payment-list {
    margin: 13px 20px 20px;
  }

  &__payment-item {
    display: inline-block;
    margin: 0 1px 6px;
  }

  &__payment-img {
    height: 24px;

    &_large {
      height: 30px;
      display: block;

      &.verified-by-visa {
        background: url("../../img/visa-secure-border.png") no-repeat;
        width: 38px;
        background-size: contain;
      }

      &.mastercard-secure-code {
        background: url("../../img/payments-small-2.png") no-repeat;
        width: 48px;
        background-size: contain;
      }

      &.mastercard {
        background: url("../../img/basket-mastercard.png") no-repeat;
        width: 36px;
        background-size: contain;
      }

      &.visa {
        background: url("../../img/visa.png") no-repeat;
        width: 39px;
        background-size: contain;
      }

      &.paypal {
        background: url("../../img/basket-paypal.png") no-repeat;
        width: 39px;
        background-size: contain;
      }
    }
  }

  &__card-save {

    .success {
      text-align: center;
      width: 100%;
      color: $green;
      font-size: 4rem;
      margin: 10px 0 20px;
    }

    .error {
      // sass-lint:disable placeholder-in-extend
      @extend .success;
      color: $red;
    }
  }

  &__action-description {
    @include additional-text;
    margin-top: 16px;

    &_accented {
      @include additional-text;
      font-weight: 500;
      color: $warm-grey;
    }
  }

  &__edit-link {
    font-size: $font-size-base;
    font-weight: 500;
    margin-top: 4px;
    text-align: right;
    float: right;
  }

  &__delivery-option {
    margin: 0 -15px;
  }

  &__subscribe-message {
    font-size: .75rem;
  }

  &__detail-name.checkout-widget__detail-block,
  &__detail-value.checkout-widget__detail-block {
    width: 100%;
    text-align: left;
  }

  &_order-summary {

    .content & {
      margin-bottom: 40px;
    }

    &_paypal-add {
      .checkout-widget {
        &_order-summary {
          padding: 0;
        }

        &__header {
          text-align: center;
        }
      }

      .voucher-applied {
        display: none;
      }
    }
  }

  &.voucher-applied {

    .fa-check-circle {
      text-align: center;
      width: 100%;
      color: $green;
      font-size: 4rem;
      margin-bottom: 10px;
    }
  }

  // sass-lint:disable no-ids
  #voucher-code {
    text-transform: uppercase;
  }

  &__tooltip-bb {
    position: relative;
    display: inline-block;
  }
}

.tooltip-bb {
  &__element {
    display: inline-block;
    text-align: center;
    background: $blue-dark;
    color: $white;
    font-weight: 400;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;

    &:hover {
      & + .tooltip-bb__info,
      & + .tooltip-bb__info::after {
        visibility: visible;
      }
    }
  }

  &__info {
    position: absolute;
    display: block;
    width: 154px;
    height: 50px;
    padding: 5px 5px 5px 10px;
    background: $blue-dark;
    color: $white;
    font-weight: 400;
    bottom: 130%;
    left: 80%;
    visibility: hidden;

    &::after {
      display: block;
      content: '';
      width: 0;
      height: 0;
      border-top: 15px solid $blue-dark;
      border-right: 15px solid transparent;
      position: absolute;
      left: 0;
      bottom: -20%;
      visibility: hidden;
    }
  }
}

// sass-lint:disable no-ids
#checkout-widget-information {
  line-height: 1.375rem;
}

.checkout-widget__outer-button {
  margin-top: 20px;
  margin-bottom: 20px;

  .simplebar-content & {
    // IE issue with custom scroll calculations
    width: calc(100% - 1px);
  }
}

.checkout-voucher {
  border: 1px solid $border-grey;

  &-hide {
    display: none;
  }

  & .form-row__field {
    padding-left: 0;
    padding-right: 0;
  }

  &-hide {
    display: none;
  }
}

@include media-breakpoint-up(md) {
  .checkout-widget {
    .accordion {
      .accordion__content {
        // sass-lint:disable no-important
        display: block !important;
        margin-top: 0;
      }
    }

    .accordion .accordion__header,
    &__basket-block_small,
    .content &_order-summary {
      display: none;
    }
  }

  .basket-checkout-widget {
    position: sticky;
    top: 35px;
  }

  .checkout-voucher {
    & #form-checkout-voucher {
      display: flex;
      justify-content: space-between;
      align-items: center;

      & .voucher__btn {
        max-width: 115px;
        height: 40px;
      }

      .form-row {
        @include make-col(6);
        margin-bottom: 0;
      }
    }

    & .form-row__field {
      padding-left: 15px;
      padding-right: 15px;
    }
  }
}

@include media-breakpoint-up(xl) {
  .checkout-widget {
    &__detail-value_payment:not(.checkout-widget__details-hidden) {
      float: right;
    }
  }

  .tooltip-bb {
    &__element {
      margin-left: 5px;
    }

    &__info {
      width: 160px;
    }
  }
}

@include media-breakpoint-down(lg) {
  .checkout-widget {
    &__secure {
      &-header {
        font-size: .6875rem;
        left: calc(50% - 85px);
        width: 170px;
        top: -9px;
      }
    }
  }
}

@include media-breakpoint-down(md) {
  .checkout-widget {
    &__secure {
      &-ssl {
        padding-top: 10px;
      }
    }
  }
}

@include media-breakpoint-down(sm) {
  .checkout-widget {
    .heading-3 {
      font-size: 1.5rem;
    }

    &__header,
    &__actions {
      display: none;
    }

    &__detail-value_payment:not(.checkout-widget__details-hidden) {
      float: right;
    }

    &__total {
      padding-top: 10px;
    }

    &__price {
      margin-top: 5px;
    }

    &__basket-block {
      .pay-pal_container {
        &-link {
          font-size: $font-size-base;
        }

        &-email {
          font-size: $font-size-base;
          line-height: 1.5rem;
        }
      }
    }

    &__secure {
      &-header {
        top: -12px;
        left: calc(50% - 110px);
        text-align: center;
        width: 220px;
        font-size: $font-size-base;
      }

      &-ssl {
        padding-top: 14px;
      }

      &-ssl,
      &-message {
        font-size: .75rem;
      }

      &-message {
        left: calc(50% - 100px);
        width: 200px;
        bottom: -9px;
      }
    }

    &_order-summary {
      padding: 20px 30px;

      .accordion__header-text {
        margin-left: 4px;
      }

      .accordion__content-inner {
        padding-left: 4px;
      }
    }

    &_email {
      .checkout-widget__header {
        display: block;
      }
    }
  }

  .tooltip-bb {
    &__element {
      margin-left: 5px;
    }

    &__info {
      width: 160px;
    }
  }

  .checkout-widget__click-collect {
    display: none;
  }
}

@include media-breakpoint-down(xs) {
  .checkout-widget {
    &_order-summary {
      padding: 20px 45px;
      margin-left: -15px;
      margin-right: -15px;
    }

    &__payment-wrapper {
      margin-left: -30px;
      margin-right: -25px;
    }
  }
}

@include media-breakpoint-only(lg) {
  .checkout-widget {
    .heading-3_checkout-widget-supply {
      font-size: 1.125rem;
    }

    &__detail-name,
    &__detail-value:not(.checkout-widget__details-hidden) {
      display: block;
    }

    &__detail-value:not(.checkout-widget__details-hidden) {
      float: none;
    }
  }
}

@include media-breakpoint-only(md) {
  .checkout-widget {
    .heading-3_checkout-widget-supply {
      font-size: 1.125rem;
    }

    &__detail-name_accordion {
      padding-bottom: 20px;
    }

    &__detail-name_accordion + .checkout-widget__details-hidden + span {
      right: auto;
      left: 0;
      top: 20px;
    }

    &__detail-name,
    &__detail-value:not(.checkout-widget__details-hidden) {
      display: block;
    }

    &__detail-value:not(.checkout-widget__details-hidden) {
      float: none;
    }

    &__action-description {
      &_accented {
        font-size: .625rem;
      }
    }
  }
}

@include media-breakpoint-only(xs) {
  .checkout-widget {
    &__detail-value_payment:not(.checkout-widget__details-hidden) {
      float: none;
      display: block;
    }
  }
}

@include media-breakpoint-up(lg) {
  .checkout-voucher {
    padding: 40px 35px;
    margin-bottom: 30px;

    .heading-3 {
      margin-bottom: 0;
    }

    #form-checkout-voucher {
      align-items: flex-start;
    }
  }
}
