@use "../custom" as *;

.payment {
  position: relative;
  z-index: 2;
  margin-top: -150px;
  &__wrapper {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;

    @media (max-width:62.5rem) {
      flex-direction: column;
    }
  }

  &__left {
    max-width: 72rem;
    width: 100%;
    background-color: $white;
    border-radius: 0.75rem;
    overflow: hidden;
    padding: 1.5rem;
  }

  &__title {
    font-weight: 500;
    font-size: 1rem;
    line-height: 1;
    color: #183b56;
    font-family: $roobert;
    display: block;
  }

  &__description {
    font-weight: 400;
    font-size: 0.75rem;
    line-height: 1.5;
    color: rgba(#7c8499, 0.5);
    margin: 0;
    font-family: $roobert;
    margin-top: 0.375rem;
  }

  &__input {
    width: 100%;
    border-radius: 0.375rem;
    height: 3.5rem;
    outline: none;
    border: 1px solid rgba(106, 106, 149, 0.06);
    background-color: $white;
    padding: 0 1rem;
    font-family: $roobert;
    font-size: 0.88rem;
    color: #183b56;

    &::placeholder {
      color: #7c8499;
    }

    &:focus {
      border-color: #183b56;
    }
  }

  &__divider {
    display: block;
    background-color: rgba(106, 106, 149, 0.06);
    width: 100%;
    height: 0.0625rem;
    margin: 1.875rem 0;
  }

  &__input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  &__check {
    display: flex;
    align-items: center;
    gap: 0.375rem;

    input {
      appearance: none;
      width: 1rem;
      height: 1rem;
      border-radius: 0.125rem;
      background: rgba(106, 106, 149, 0.06);
      position: relative;
      cursor: pointer;
      &:checked {
        background-color: $spotify;

        &::after {
          content: "";
          position: absolute;
          top: 0;
          left: 0;
          width: 100%;
          height: 100%;
          background: no-repeat url("../icons/checked-2.svg");
          background-size: contain;
          background-position: center;
        }
      }
    }

    label {
      font-weight: 500;
      font-size: 1rem;
      line-height: 1;
      color: #183b56;
      font-family: $roobert;
      display: block;
      cursor: pointer;
    }
  }

  &__methods {
    display: grid;
    margin-top: 1.5rem;
    gap: 1.5rem;
    align-items: center;
    justify-content: start;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));

    @include media-breakpoint-down(md) {
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
  }

  &__method {
    border-radius: 0.75rem;
    height: 4.375rem;
    width: 100%;
    overflow: hidden;
    position: relative;
    background: rgba(106, 106, 149, 0.04);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    cursor: pointer;
    transition: all ease-in-out 200ms;
    &::before {
      content: "";
      display: block;
      width: 0.9375rem;
      height: 0.9375rem;
      background-color: transparent;
      border-radius: 100vh;
      border: 0.0625rem solid #aeb6cb;
    }

    &-name {
      display: block;
      font-weight: 500;
      font-size: 1rem;
      color: #183b56;
      font-family: $inter;
      line-height: 1;
    }

    &-subtitle {
      font-family: $inter;
      font-weight: 400;
      font-size: 0.75rem;
      color: #aeb6cb;
    }

    &:not(.active):hover {
      background: rgba(106, 106, 149, 0.1);
    }
    &.active {
      background-color: #0c9f2c;

      &::before {
        content: "";
        display: block;
        width: 0.9375rem;
        height: 0.9375rem;
        background: no-repeat url("../icons/checked-white.svg");
        background-size: cover;
        background-position: center;
        border: none;
      }

      .payment__method-name {
        color: $white;
      }
      .payment__method-subtitle {
        color: rgba($white, 0.5);
      }
    }
  }

  &__right {
    max-width: 27rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;

    @media (max-width:62.5rem) {
      display: grid;
      grid-template-columns: repeat(2,1fr);
      max-width: 100%;
    }
    @media (max-width:650px) {
      display: grid;
      grid-template-columns: repeat(1,1fr);
      max-width: 100%;
    }
  }

  &Detail {
    background-color: $white;
    border-radius: 0.75rem;
    overflow: hidden;

    &__head {
      height: 4rem;
      width: 100%;
      position: relative;
      display: flex;
      align-items: center;
      padding-left: 1.25rem;
      border-bottom: 1px solid rgba(174, 184, 203, 0.2);
      &::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 0;
        transform: translateY(-50%);
        width: 0.1875rem;
        height: 2.5rem;
        background: #0c9f2c;
        border-radius: 0 0.38rem 0.38rem 0;
      }

      &-title {
        font-weight: 400;
        font-size: 1rem;
        line-height: 1;
        color: #183b56;
        font-family: $roobert;
      }
    }

    &__body {
      padding: 1.25rem;
    }

    &__coupon {
      width: 100%;
      display: flex;
      align-items: center;
      gap: 0;

      &-input {
        position: relative;
        height: 3.4375rem;
        width: 100%;
        border-radius: 0.75rem 0 0 0.75rem;
        overflow: hidden;

        input {
          width: 100%;
          height: 100%;
          border: none;
          outline: none;
          background: rgba(106, 106, 149, 0.04);
          padding-left: 3.125rem;
          padding-right: 1rem;
          font-weight: 400;
          font-size: 1rem;
          line-height: 1.5;
          color: $black;

          &::placeholder {
            color: rgba(#aeb6cb, 0.7);
          }

          &:focus,
          &:hover {
            background: rgba(106, 106, 149, 0.1);
          }
        }

        img {
          position: absolute;
          top: 50%;
          left: 1.25rem;
          transform: translateY(-50%);
        }
      }

      &-btn {
        height: 3.4375rem;
        background-color: #0c9f2c;
        border-radius: 0 0.38rem 0.38rem 0;
        border: none;
        color: $white;
        font-weight: 400;
        font-size: 1rem;
        text-align: center;
        color: #fff;
        padding: 0 2rem;
        transition: all ease-in-out 200ms;

        &:hover {
          background-color: rgba(#0c9f2c, 0.8);
        }
      }
    }

    &__list {
      margin: 1rem 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 0;

      li {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-weight: 400;
        font-size: 1rem;
        line-height: 156%;
        color: rgba(#7c8499, 0.7);
        height: 3.75rem;
        gap: 1.5rem;
        font-family: $roobert;
        &:not(:last-child) {
          border-bottom: 1px solid #e2eefe;
        }
      }
    }

    &__total {
      font-weight: 500;
      font-size: 1rem;
      line-height: 1.5;
      text-decoration: line-through !important;
      text-align: right;
      color: rgba(#7c8499, 0.7);
      font-family: $roobert;
    }

    &__discount {
      font-weight: 500;
      font-size: 1rem;
      line-height: 1.5;
      text-align: right;
      color: #0c9f2c;
      font-family: $roobert;
    }

    &__price {
      font-weight: 500;
      font-size: 1rem;
      line-height: 1.5;
      text-align: right;
      color: #183b56;
      font-family: $roobert;
    }

    &__submit {
      margin-left: auto;
      width: max-content;
      height: 3.125rem;
      border-radius: 0.375rem;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.75rem;
      font-weight: 500;
      font-size: 1rem;
      text-align: center;
      color: #fff;
      font-family: $roobert;
      padding: 0 2rem;
      background-color: #0C9F2C;
      border: none;
      outline: none;

      &:hover{
        background-color: rgba(#0C9F2C, 0.8);
      }
    }
  }
}
