@import '../helpers/helpers';

.checkout-action {
  padding: 15px 15px 24px;

  .btn-checkout {
    .checkout-text--mixed {
      display: none;
    }

    .checkout-text--collect {
      display: inline;
    }
  }

  &:not(:has(.checkout-widget__basket-block)) {
    .btn-checkout {
      .checkout-text--mixed {
        display: inline;
      }

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

  &:not(:has(.checkout-widget__basket-block)) {
    .btn-checkout {
      margin-bottom: 0;
    }
  }

  & .btn-checkout {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 42px;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 16px;
    line-height: 1.5rem;

    .icon {
      padding-left: 5px;
    }
  }

  & .form-row__col-btn {
    padding-right: 0;
    padding-left: 0;

    & .paypal-button-container {
      min-width: inherit;
      max-width: 100%;

      & .paypal-button {
        padding-top: 0;
        height: 42px;
      }

      & .paypal-button-text {
        padding-left: 3px;
        font-size: 1rem;
        font-weight: 500;
        line-height: 1rem;
      }
    }
  }

  &__wrapper {
    order: -2;
    background-color: $white;

    &.large {
      order: inherit;

      .checkout-action {
        margin-top: 20px;
      }
    }

    &.mounted {
      display: none;
    }

    &.mobile {
      display: block;
      position: static;
      order: 1;

      .checkout-action {
        margin-top: 20px;
        padding: 0;
        padding-bottom: 20px;

        .btn-checkout {
          margin-bottom: 20px;
        }

        &:not(:has(.checkout-widget__basket-block)) {
          padding-bottom: 0;

          .btn-checkout {
            margin-bottom: 0;
          }
        }
      }
    }
  }

  &__large {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: $gray-bg;
    border: 1px solid $border-grey;
    margin-bottom: 30px;


    & .checkout-action {
      &__section {
        @include make-col(12);

        &:last-of-type {
          padding-right: 0;
        }
      }
    }
  }

  &__section {
    &.checkout-widget__basket-block {
      margin-top: 0;
      padding-top: 0;
      border: 0;

      & .pay-pal_container {
        padding-top: 0;
        border: 0;
      }
    }
  }

  &-payways {
    .checkout-action {
      border-bottom: 0;
    }
  }
}

@include media-breakpoint-up(sm) {

  .checkout-action {
    margin-top: 0;
    padding: 0;
    border-bottom: 0;

    &__wrapper {
      padding: 20px 0 24px;
      background-color: $white;
      order: -2;

      &.large {
        order: inherit;

        .checkout-action {
          margin-top: 20px;
        }
      }

      &.mounted {
        display: none;
      }

      &.mobile {
        display: block;
        position: static;
        order: 1;
        padding: 0;

        .checkout-action {
          margin-top: 20px;
          padding: 0;
          padding-bottom: 20px;

          .btn-checkout {
            margin-bottom: 20px;
          }

          &:not(:has(.checkout-widget__basket-block)) {
            padding-bottom: 0;

            .btn-checkout {
              margin-bottom: 0;
            }
          }
        }
      }
    }
  }

  .checkout-action .btn-checkout {
    margin-bottom: 10px;
  }

  .checkout-action--single .btn-checkout {
    margin-bottom: 0;
  }
}

@include media-breakpoint-up(md) {
  .checkout-action {
    .pay-pal_wrap {
      .paypal-button-container {
        max-width: 100%;
      }
    }
  }
}

@include media-breakpoint-up(lg) {
  .checkout-action {
    margin-top: 5px;
    padding-bottom: 20px;
    border-bottom: 1px solid $gray;

    &__wrapper {
      order: inherit;
      position: static;

      &.large {
        order: -2;
        margin-top: 20px;
      }

      &.mounted {
        display: block;
        padding: 0;
        padding-top: 15px;
        background: $white;

        .checkout-action {
          border-bottom: 0;
        }
      }

      &.mobile {
        display: none;
      }
    }

    &__large {
      flex-direction: row;
      justify-content: center;
      padding: 35px;

      & .checkout-action {
        &__section {
          @include make-col(6);

          &:first-of-type {
            padding-right: 15px;
          }

          &:last-of-type {
            padding-left: 15px;
          }
        }
      }

      .btn-checkout {
        margin-bottom: 0;
      }
    }

    .btn-checkout {
      margin-bottom: 10px;
    }
  }
}
