.loyalty-suite-checkout-wallet {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 10px;

  &.loyalty-suite-checkout-wallet_usage {
    .loyalty-suite-checkout-wallet-button {
      margin-right: 10px;
    }
  }

  .loyalty-suite-checkout-wallet-button {
    display: flex;
    flex: 1;
    padding: 0 15px;
    justify-content: center;
    align-items: center;
    height: 40px;
    border-radius: 4px;
    background: var(--loyalty-suite-primary);
    font-size: 16px;
    line-height: normal;
    font-weight: 500;
    color: var(--loyalty-suite-light);
    white-space: nowrap;
    transition: 0.3s;
    margin-bottom: 10px;

    &:hover {
      cursor: pointer;
      background: var(--loyalty-suite-primary-90);
    }
  }

  .loyalty-suite-checkout-wallet-popup {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 30px 35px;
    min-width: 350px;
    max-width: 576px;
    max-height: calc(100vh - 48px);
    border-radius: 8px;
    background: var(--loyalty-suite-light);
    box-shadow: 0 5px 15px 0 var(--loyalty-suite-borders-40);
    position: relative;
    box-sizing: border-box;

    &-wrapper {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.4);
      z-index: 9999999;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      visibility: hidden;
      transition: 0.3s;

      &.loyalty-suite-rewards-modal-wrapper_show {
        opacity: 1;
        visibility: visible;
      }
    }

    &__close {
      display: flex;
      width: 20px;
      height: 20px;
      justify-content: center;
      align-items: center;
      background: var(--loyalty-suite-negative);
      border-radius: 4px;
      transition: 0.3s;
      position: absolute;
      top: 10px;
      right: 10px;

      span {
        color: var(--loyalty-suite-light);
        font-size: 14px;
        line-height: normal;
        font-weight: 400;
      }

      &:hover {
        cursor: pointer;
        background: var(--loyalty-suite-negative-90);
      }
    }

    &__label {
      display: flex;
      width: 100%;
      margin-bottom: 5px;
      color: var(--loyalty-suite-dark);
      font-weight: 700;
      font-size: 14px;
      line-height: normal;
    }

    &__content {
      display: flex;
      flex-direction: column;
      width: 100%;
      box-sizing: border-box;
    }
  }

  .loyalty-suite-checkout-wallet-popup-select {
    display: flex;
    align-items: center;
    position: relative;
    width: auto;
    height: 40px;
    max-width: 100%;
    border: 1px solid var(--loyalty-suite-borders-60);
    border-radius: 4px;
    background: var(--loyalty-suite-light);
    transition: 0.3s;
    margin-bottom: 20px;

    &.loyalty-suite-checkout-wallet-popup-select_single {
      &:hover {
        cursor: default;
        border-color: var(--loyalty-suite-borders-60);
      }
    }

    &:hover {
      cursor: pointer;
      border-color: var(--loyalty-suite-primary);

      .loyalty-suite-checkout-wallet-popup-select__icon {
        color: var(--loyalty-suite-primary);
      }
    }

    &__wrapper {
      display: flex;
      width: 100%;
      justify-content: space-between;
      align-items: center;
      flex-wrap: nowrap;
      height: 28px;
      padding: 0 12px;
    }

    &__selected {
      display: flex;
      width: 100%;
      flex-wrap: nowrap;
      white-space: nowrap;
      user-select: none;
      font-size: 14px;
      color: var(--loyalty-suite-dark);
      line-height: normal;
      font-weight: 400;
    }

    &__icon {
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 20px;
      margin-left: 10px;
      width: 15px;
      color: var(--loyalty-suite-borders);
      transition: 0.3s;

      &_revert {
        transform: rotate(180deg);
      }
    }

    &__dropdown {
      display: flex;
      flex-direction: column;
      position: absolute;
      background: var(--loyalty-suite-light);
      border: 1px solid var(--loyalty-suite-borders-60);
      border-radius: 4px;
      width: calc(100% + 1px);
      margin-top: 42px;
      max-height: 200px;
      top: 0;
      left: -1px;
      overflow-y: auto;
      overflow-x: hidden;
      opacity: 0;
      visibility: hidden;
      transition: 0.3s;
      z-index: 1000;
      box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.15);

      &.loyalty-suite-checkout-wallet-popup-select__dropdown_show {
        opacity: 1;
        visibility: visible;
      }

      &::-webkit-scrollbar {
        width: 6px;
      }

      &::-webkit-scrollbar-thumb {
        background-color: var(--loyalty-suite-borders-60);
        border-radius: 10px;
      }

      &::-webkit-scrollbar-button {
        display: none;
        height: 0;
        width: 0;
      }

      &-item {
        display: flex;
        align-items: center;
        width: 100%;
        height: 40px;
        white-space: normal;
        padding: 10px;
        font-size: 14px;
        user-select: none;
        font-weight: 400;
        color: var(--loyalty-suite-dark);
        line-height: normal;
        border-bottom: 1px solid var(--loyalty-suite-borders-60);

        &:last-child {
          border-bottom: none;
        }

        &:hover {
          cursor: pointer;
          background: var(--loyalty-suite-borders-10);
        }

        &_selected {
          background: var(--loyalty-suite-borders-20);

          &:hover {
            background: var(--loyalty-suite-borders-20);
          }
        }
      }
    }

    &__option {
      display: flex;
      flex-shrink: 0;
      white-space: nowrap;
    }
  }

  input[type='number'].loyalty-suite-checkout-wallet__input {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 100%;
    height: 40px;
    min-height: 40px;
    border: 1px solid var(--loyalty-suite-borders-60);
    background: var(--loyalty-suite-light);
    box-shadow: none;
    outline: none;
    border-radius: 4px;
    margin: 0 0 20px 0;
    padding: 0 10px;
    font-size: 14px;
    color: var(--loyalty-suite-dark);
    font-weight: 400;
    line-height: normal;
    transition: 0.3s;
    appearance: textfield;

    &::-webkit-outer-spin-button,
    &::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

    &:hover {
      border-color: var(--loyalty-suite-primary);
      box-shadow: none;
      outline: none;
    }

    &:focus {
      box-shadow: none;
      outline: none;
    }

    &::placeholder {
      font-size: 16px;
      color: var(--loyalty-suite-borders-60);
      font-weight: 400;
      line-height: normal;
    }
  }

  &__error {
    display: none;
    width: 100%;
    color: var(--loyalty-suite-negative);
    font-weight: 400;
    font-size: 14px;
    line-height: normal;
    margin-top: 10px;

    &.loyalty-suite-checkout-wallet__error_show {
      display: flex;
    }
  }

  &__converted {
    display: flex;
    width: 100%;
    color: var(--loyalty-suite-dark);
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    margin-bottom: 20px;
  }

  &__used-now {
    display: flex;
    width: 100%;
    color: var(--loyalty-suite-negative);
    font-size: 13px;
    font-weight: 400;
    line-height: normal;
    margin-bottom: 20px;
    margin-top: -15px;

    &.loyalty-suite-checkout-wallet__used-now_hide {
      display: none;
    }
  }

  &__apply {
    display: flex;
    width: 100%;
    height: 40px;
    padding: 0 15px;
    justify-content: center;
    align-items: center;
    background: var(--loyalty-suite-primary);
    color: var(--loyalty-suite-light);
    font-size: 14px;
    font-weight: 500;
    line-height: normal;
    border-radius: 4px;
    transition: 0.3s;
    position: relative;
    box-sizing: border-box;

    &.loyalty-suite-checkout-wallet__apply_loading {
      pointer-events: none;

      &::after {
        display: flex;
        content: '';
        width: 100%;
        height: 100%;
        position: absolute;
        z-index: 2;
        top: 0;
        left: 0;
        background: var(--loyalty-suite-primary);
        border-radius: 5px;
      }

      &::before {
        display: flex;
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin: 0;
        border: 2px solid var(--loyalty-suite-light);
        border-top: 2px solid transparent;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        animation: lsp-spin 1s linear infinite;
        z-index: 3;
        position: absolute;
      }
    }

    &:hover {
      cursor: pointer;
      background: var(--loyalty-suite-primary-90);
    }
  }

  &__remove {
    display: flex;
    padding: 0 15px;
    justify-content: center;
    align-items: center;
    height: 40px;
    border-radius: 4px;
    background: var(--loyalty-suite-negative);
    font-size: 16px;
    line-height: normal;
    font-weight: 500;
    white-space: nowrap;
    color: var(--loyalty-suite-light);
    transition: 0.3s;
    position: relative;
    margin-bottom: 10px;

    &.loyalty-suite-checkout-wallet__remove_loading {
      pointer-events: none;

      &::after {
        display: flex;
        content: '';
        width: 100%;
        height: 100%;
        position: absolute;
        z-index: 2;
        top: 0;
        left: 0;
        background: var(--loyalty-suite-negative);
        border-radius: 5px;
      }

      &::before {
        display: flex;
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin: 0;
        border: 2px solid var(--loyalty-suite-light);
        border-top: 2px solid transparent;
        border-radius: 50%;
        transform: translate(-50%, -50%);
        animation: lsp-spin 1s linear infinite;
        z-index: 3;
        position: absolute;
      }
    }

    &:hover {
      cursor: pointer;
      background: var(--loyalty-suite-negative-90);
    }
  }
}

.wc-block-components-totals-wrapper {
  .loyalty-suite-checkout-wallet {
    padding: 5px !important;
    margin-bottom: 0;
    .loyalty-suite-checkout-wallet-button {
      margin: 5px;
    }
    .loyalty-suite-checkout-wallet__remove {
      margin: 5px;
    }
  }
}

body.loyalty-suite-no-scroll {
  overflow: hidden;
}

html.loyalty-suite-no-scroll {
  overflow: hidden;
}

@keyframes lsp-spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (max-width: 576px) {
  .loyalty-suite-checkout-wallet {
    .loyalty-suite-checkout-wallet-popup {
      width: 100%;
      height: 100%;
      max-height: 100vh;
      border-radius: 0;
    }
  }
}
