
/*
* 
* ==========================================================
* CLIENT.SCSS
* ==========================================================
*
* Client side SCSS file
*
*/

@import "shared.scss";

.crpay-main {
    max-width: 600px;
    font-size: 15px;
    text-align: left;

    .crpay-btn, .crpay-btn.crpay-btn-border {
        line-height: 32px;
        height: 31px;
    }

    > div {
        margin-top: 0 !important;
    }

    .crpay-input {
        span {
            border: 1px solid #d4d4d4;
            line-height: 42px;
            padding-left: 15px;
            border-top-left-radius: 4px;
            border-bottom-left-radius: 4px;
            height: 40px;
            min-height: 40px;
            border-right: none;
        }

        input, select, textarea {
            border-top-left-radius: 0 !important;
            border-bottom-left-radius: 0 !important;
        }

        &.crpay-input-textarea {
            align-items: stretch;

            > span {
                flex: 1;
                height: auto;
            }

            textarea {
                max-width: 100%;
            }
        }

        &.crpay-input-checkbox {
            justify-content: start;

            span {
                max-width: 150px;
            }
        }
    }

    &:not([data-price]) .crpay-vat {
        display: none;
    }

    .crpay-text .crpay-link {
        &:not(:hover) {
            text-decoration: none;
        }

        color: #5c7171;
    }
}

.crpay-main, .crpay-box {
    ::placeholder {
        color: #9eacac;
    }
}

body.crpay-loading {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    position: fixed;

    > div {
        display: none;
    }
}

.crpay-box {
    margin: 0;
    padding: 0;
    color: $color-black;
}

.crpay-top {
    max-width: 800px;
    padding: 30px 20px;

    .crpay-title {
        margin: 0;
        display: flex;
        justify-content: space-between;
    }

    & + .crpay-body {
        border-top: 1px solid $border-color;
    }
}

.crpay-cancel-transaction {
    margin-top: 15px;
}

.crpay-countdown {
    font-size: 17px;
    font-weight: 400;
    letter-spacing: .5px;
    position: relative;

    & + .crpay-btn {
        margin-left: 15px;
    }

    &:before, &:after {
        content: "";
        width: 10px;
        height: 10px;
        position: absolute;
        left: -30px;
        top: 50%;
        border-radius: 50%;
        margin-top: -5px;
        background-color: $color-red;
        animation: crpay-pulse 1s ease-in-out infinite both;
        display: none;
    }

    &:after {
        width: 30px;
        height: 30px;
        margin-top: -15px;
        left: -40px;
        animation: crpay-ping 1s ease-in-out infinite both;
    }

    &.crpay-countdown-expiring:before, &.crpay-countdown-expiring:after {
        display: block;
    }
}

.crpay-body {
    padding: 30px 20px;

    .crpay-title .crpay-text {
        font-weight: 400;
        margin-top: 5px;
    }
}

.crpay-cnt {
    text-align: center;

    .crpay-title {
        display: block;
    }
}

.crpay-amount-fiat {
    justify-content: center;

    > div {
        margin: 0 5px;
    }

    &:not(.crpay-donation) > div:first-child {
        display: none;
    }
}

.crpay-donation {
    text-align: left;

    #user-amount {
        align-items: center;

        span {
            margin: 0 0 0 60px;
            padding-right: 15px;
        }
    }
}

.crpay-vat {
    font-weight: 400;
    font-size: 13px;
    margin-top: 5px;
    display: block;
    letter-spacing: .3px;

    &:empty {
        display: none;
    }
}

.crpay-billing {
    .crpay-title-1 {
        margin-bottom: 30px;
    }

    .crpay-title-2 {
        margin-top: 30px;
    }

    &.crpay-hidden {
        display: none;
    }
}

.crpay-payment-methods-cnt, .crpay-billing-cnt {
    align-items: flex-start;
    padding-top: 30px;
}

.crpay-payment-methods-cnt > .crpay-title, .crpay-amount-fiat > .crpay-title {
    white-space: nowrap;
}

.crpay-payment-methods-cnt {

    .crpay-collapse {
        > div:first-child {
            height: 295px;
        }

        .crpay-collapse-btn {
            display: block;
        }
    }
}

.crpay-checkout-top {
    .crpay-text b {
        font-weight: 500;
        font-size: 14px;
    }
}

.crpay-payment-methods {

    > div {
        justify-content: flex-start;
        padding: 5px 15px 5px 5px;
        border: 1px solid $border-color;
        border-radius: 40px;
        cursor: pointer;
        text-align: left;
        transition: $transition;

        img {
            max-width: 30px;
        }

        img + span {
            display: block;
            padding: 0 10px;
            font-weight: 600;
            font-size: 16px;
            line-height: 17px;
            letter-spacing: .1px;
            white-space: nowrap;
        }

        span + span {
            display: block;
            font-size: 15px;
            line-height: 15px;
            min-width: 40px;
            margin-left: auto;
            color: $color-gray;
            transition: $transition;
        }

        &:not(.crpay-hidden) + div {
            margin-top: 10px;
        }

        &:hover, &:hover .crpay-label {
            border-color: $color-main-hover;
            color: $color-main;

            span + span {
                color: $color-main-hover;
            }
        }
    }

    [data-cryptocurrency="stripe"] > img, [data-cryptocurrency="verifone"] > img, [data-cryptocurrency="paypal"] > img {
        max-width: 74px;
    }

    .crpay-label {
        display: inline;
        border-color: $border-color;
        background: $white;
        z-index: 2;
        position: relative;

        div {
            display: inline;
        }
    }
}

.crpay-pay {
    display: none;
    animation: crpay-fade-in .5s;
}

.crpay-pay-cnt {
    display: none;
    animation: crpay-fade-in .5s;

    .crpay-body {
        padding: 0;

        > div {
            padding: 10px 20px;
            border-top: 1px solid $border-color;
        }

        > div:first-child {
            padding: 30px 20px;
            border-top: none;
        }
    }

    .crpay-top .crpay-title {
        align-items: center;
    }

    .crpay-cnt {
        display: none;
    }

    .crpay-pay {
        display: block;
    }
}

.crpay-pay-cnt-active {
    .crpay-cnt {
        display: none;
    }

    .crpay-pay-cnt {
        display: block;
    }
}

.crpay-qrcode {
    max-width: 130px;
}

.crpay-qrcode-text {
    padding: 0;
    width: 100%;

    img {
        max-width: 35px;
        margin-right: 15px;
    }
}

img + .crpay-qrcode-text {
    padding-left: 30px;
    width: auto;
}

.crpay-pay-address, .crpay-pay-amount {
    .crpay-title {
        font-weight: 500;
        font-size: 15px;
        letter-spacing: .3px;
        margin: 5px 0 0 0;
        overflow: hidden;
        text-overflow: ellipsis;

        > div {
            display: inline-block;
            color: $color-gray;
            padding-left: 10px;
            font-weight: 400;
            font-size: 11px;
            line-height: 11px;
        }
    }

    .crpay-clipboard {
        line-height: 37px;
        height: 30px;
        width: 30px;
        text-align: center;
        margin: 0 -7px 0 7px;

        &:before {
            line-height: 30px;
        }
    }

    > div:first-child {
        overflow: hidden;
    }
}

.crpay-pay-top-back {
    display: none;

    .crpay-text {
        margin-bottom: 15px;
    }
}

.crpay-pay-top-main.crpay-hidden + .crpay-pay-top-back {
    display: block;
}

.crpay-tx-cnt {
    display: none;
    text-align: center;
    padding: 60px 0;

    .crpay-loading {
        width: 30px;
        height: 30px;
        margin: 0 auto 15px auto;

        &:before {
            line-height: 30px;
            font-size: 30px;
            color: $color-main;
        }
    }

    .crpay-flex {
        justify-content: center;
        margin-top: 15px;
        letter-spacing: .3px;

        > div {
            margin: 0 5px;
        }
    }
}

.crpay-tx-status {
    background: $color-main;
    color: #FFF;
    padding: 5px 10px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
}

.crpay-tx-confirmations {
    font-weight: 500;
}

.crpay-tx-cnt-active {
    .crpay-tx-cnt {
        display: block;
    }

    .crpay-cnt, .crpay-pay-cnt {
        display: none;
    }
}

.crpay-complete-cnt, .crpay-failed-cnt, .crpay-underpayment-cnt {
    display: none;
    text-align: center;
    padding: 60px 30px;
    animation: crpay-fade-in .5s;

    > i {
        color: $color-main;
        font-size: 30px;
        margin-bottom: 15px;
        display: inline-block;
    }
}

.crpay-failed-cnt, .crpay-underpayment-cnt {
    > i {
        color: $color-red;
    }

    .crpay-btn {
        margin-top: 15px;
    }
}

.crpay-complete-cnt-active, .crpay-failed-cnt-active, .crpay-underpayment-cnt-active {
    .crpay-cnt {
        display: none;
    }
}

.crpay-complete-cnt-active {
    .crpay-complete-cnt {
        display: block;
    }
}

.crpay-complete-cnt {
    .crpay-order-processing span:first-child {
        display: none;
    }

    .crpay-text:not(.crpay-order-processing) span:last-child {
        display: none;
    }

    .crpay-link {
        color: $color-gray;
        margin-top: 15px;
        margin-bottom: 5px;

        &:hover {
            color: $color-main;
        }
    }
}

.crpay-failed-cnt-active {
    .crpay-failed-cnt {
        display: block;
    }
}

.crpay-underpayment-cnt-active {
    .crpay-underpayment-cnt {
        display: block;
    }
}

#crpay-expired-tx-id {
    font-weight: 500;
}

.crpay-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: crpay-fade-in .5s;
    z-index: 9999995;
}

.crpay-popup-overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 9999991;
    background-color: rgba(227, 227, 227, .5);
    animation: crpay-fade-in .5s;
}

.crpay-popup, .crpay-popup-overlay {
    &:not(.crpay-active) {
        display: none;
    }
}

@media (min-width: 429px) {
    .crpay-popup {
        width: 600px;
    }
}

.crpay-btn-popup {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;

    img {
        margin: 0 15px 0 0;
        height: 20px;
    }
}

.crpay-popup-close {
    position: absolute;
    right: 10px;
    top: 10px;
    font-size: 10px;
    opacity: .5;
    cursor: pointer;
    z-index: 9;
    transition: $transition;

    &:hover {
        color: $color-red;
        opacity: 1;
    }
}

#user-amount {
    justify-content: flex-end;
    margin-bottom: 0;

    span {
        width: auto;
        min-width: 0;
        margin-right: 30px;
    }

    input {
        min-width: 150px;
        width: 150px;
    }
}

.crpay-error {
    margin-bottom: 30px;
    color: $color-red;
    font-weight: 500;

    &:empty {
        display: none;
    }
}

[data-cryptopayment]:empty {
    min-height: 35px;
}

.crpay-billing {
    position: relative;
}

.crpay-billing-cnt.crpay-flex .crpay-input + .crpay-input {
    margin: 5px 0 0 0 !important;
}

#crpay-btn-invoice-close {
    position: absolute;
    right: -10px;
    top: -10px;
    border: none !important;
    background: none !important;

    &:before {
        font-size: 12px;
    }
}

#crpay-btn-invoice.crpay-hidden {
    display: none;
}

.crpay-collapse {
    > div:first-child {
        overflow: hidden;
        position: relative;

        &:after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 30px;
            background: linear-gradient(rgba(64,64,64,0), rgb(255, 255, 255));
            z-index: 0;
        }
    }
}

.crpay-collapse-btn {
    display: none;
    text-align: center;
    letter-spacing: .5px;
    margin-top: 10px;

    i {
        font-size: 12px;
        transform: translateY(1px);
    }
}

.crpay-cloud-branding {
    display: flex !important;
    justify-content: center;
    align-items: center;
    letter-spacing: .3px;
    cursor: pointer;
    text-decoration: none;
    padding: 15px;
    font-size: 13px;
    color: #000;
    transition: $transition;

    img {
        height: 18px;
        margin-left: 5px;
    }

    &:hover {
        opacity: .8;
    }
}

#metamask, #walletconnect, #metamask.crpay-loading:before, #walletconnect.crpay-loading:before {
    color: #384242;
}

#metamask {
    background: rgba(248, 132, 42, .2);
    display: none;

    &:hover {
        background: rgba(248, 132, 42, .4);
    }
}

#walletconnect {
    background: rgba(31, 149, 252, .2);
    display: none;

    img {
        left: 13px;
    }

    &:hover {
        background: rgba(31, 149, 252, .4);
    }
}

[data-active="eth"], [data-active="usdt"], [data-active="usdc"], [data-active="link"], [data-active="shib"], [data-active="bat"], [data-custom-token="erc-20"], [data-active="bnb"] {
    #metamask {
        display: block;
    }
}

.crpay-background-image {
    background-position: center center;
    background-size: cover;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    border-bottom: 1px solid $border-color;
    height: 300px;
}

/* 

# SHOP
==========================================================

*/

.crpay-user-details, .crpay-custom-fields {
    padding-top: 30px;

    .crpay-title {
        margin-bottom: 30px;
    }
}

#crpay-discount-field, .crpay-user-details .crpay-input, .crpay-billing-cnt .crpay-input, .crpay-custom-fields .crpay-input {
    text-align: left;
    align-items: center;
    margin-bottom: 0;
}

.crpay-input-license-key {
    display: inline-flex;
    text-align: left;
    align-items: center;
    margin-top: 15px;

    span {
        min-width: 0;
        width: 190px;
        white-space: nowrap;
    }

    input {
        min-width: 310px;
        text-align: center;
    }
}

#crpay-discount-field {
    margin-top: 30px;
}

/* 

# RTL
==========================================================

*/

.crpay-rtl, .crpay-rtl textarea, .crpay-rtl input, .crpay-rtl ul, .crpay-rtl ul li {
    direction: rtl;
    text-align: right;
}

.crpay-rtl {
    .crpay-payment-methods {
        padding-left: 0;

        > div {
            padding: 5px 5px 5px 15px;

            img + span {
                text-align: right;
                display: flex;
            }

            span + span {
                margin-left: 0;
                margin-right: auto;
            }
        }
    }

    .crpay-countdown + .crpay-btn, .crpay-btn + .crpay-btn {
        margin-right: 15px;
        margin-left: 0;
    }

    .crpay-qrcode-text img {
        margin-left: 35px;
        margin-right: 0;
    }

    .crpay-countdown:after {
        left: auto;
        right: -40px;
    }

    .crpay-countdown:before {
        left: auto;
        right: -30px;
    }

    .crpay-btn-popup img {
        margin: 0 0 0 15px;
    }

    .crpay-btn i {
        transform: translateY(3px);
        margin: 0 -5px 0 7px;
    }

    .crpay-donation #user-amount span {
        margin: 0 0 0 10px;
    }
}

/* 

# RESPONSIVE
==========================================================

*/

@media (min-width: 600px) {
    .crpay-payment-methods > div img + span {
        width: 265px;
    }
}

@media (max-width: 428px) {
    .crpay-main {
        text-align: center;

        .crpay-input {
            display: block;

            span {
                width: auto;
                border: 1px solid #d4d4d4;
                border-bottom: none;
                border-bottom-left-radius: 0;
                border-top-right-radius: 4px;
                white-space: nowrap;
                text-overflow: ellipsis;
                overflow: hidden;
            }

            input, select {
                border-bottom-left-radius: 4px !important;
                border-top-right-radius: 0 !important;
            }

            &.crpay-input-checkbox span {
                max-width: none;
            }

            [type="checkbox"] {
                width: 100%;
            }
        }

        .crpay-input-btn {
            .crpay-btn {
                width: auto;
                display: block;
                margin-left: 0;
                border-top: none;
                border-top-right-radius: 0;
                border-top-left-radius: 0;
            }

            input {
                border-bottom-left-radius: 0 !important;
                border-bottom-right-radius: 0 !important;
            }
        }
    }

    .crpay-top .crpay-title, .crpay-payment-methods-cnt {
        display: block;
    }

    .crpay-amount-fiat {
        justify-content: center;

        > div {
            margin: 0 5px;
        }
    }

    .crpay-donation {
        display: block;
        text-align: center;

        #user-amount {
            margin-top: 15px;
            justify-content: center;

            span {
                margin: 0 10px 0 0;
                text-align: right;
                display: inline-block;
                flex-grow: 0;
            }
        }
    }

    .crpay-payment-methods {
        padding: 0;
        margin: 0 auto;

        > div {
            overflow: hidden;

            img + span {
                max-width: 65%;
            }
        }

        .crpay-label div {
            display: none;
        }
    }

    .crpay-pay-amount {
        > .crpay-flex {
            display: block;
        }

        #metamask {
            margin: 15px 0 0 0;
        }
    }

    .crpay-pay-top-main {
        .crpay-title .crpay-flex {
            margin-top: 20px;
            justify-content: center;

            > div {
                margin: 0 10px;
            }
        }
    }

    .crpay-pay-cnt .crpay-body > div:first-child {
        display: block;
    }

    .crpay-qrcode {
        margin: 0 auto 30px auto;
    }

    .crpay-pay-address, .crpay-pay-amount {
        display: block;
        position: relative;

        .crpay-clipboard {
            margin: 5px auto 0 auto;
            display: block;
        }
    }

    .crpay-qrcode-text, .crpay-pay-address, .crpay-pay-amount {
        justify-content: center;
    }

    .crpay-qrcode-text {
        padding-left: 0 !important;
        display: block;

        img {
            margin: 0 0 30px 0;
        }
    }

    .crpay-payment-methods-cnt .crpay-collapse-btn {
        padding-left: 0 !important;
    }

    [data-active="eth"], [data-active="usdt"], [data-active="usdc"], [data-active="link"], [data-active="shib"], [data-active="bat"] {
        #metamask {
            display: inline-block;
        }
    }

    .crpay-background-image {
        height: 200px;
    }
}
