$klarna-btn-color: #e4eeed;
$klarna-fill-color: #000000;

#klarna-pay-button {
    background: $klarna-btn-color;
    border: none;
    width: 140px;
    height: 42px;
    box-sizing: border-box;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;

    &:hover {
        background: darken($klarna-btn-color, 8%);
    }

    span {
        color: $klarna-fill-color;
        font-size: 0.75em;
    }

    svg {
        max-width: 50px;
        height: 100%;
        width: 100%;
        display: block;
        margin-left: 6px;

        path, rect {
            fill: $klarna-fill-color;
        }
    }
}

main.checkoutwc.woocommerce {
    .woocommerce-form-coupon-toggle { display: none; }

    #kco-wrapper { padding: 0; }
}

#kco-order-review {
    thead, tfoot, tbody, tr, th, td {
        border: 0;
        font-family: inherit;
        font-size: 100%;
        font-style: inherit;
        font-weight: inherit;
        margin: 0;
        outline: 0;
        padding: 0;
        vertical-align: baseline;
    }

    table {
        border-spacing: 0;
    }

    table, th, td {
        border: 1px solid rgba(51, 51, 51, 0.1);
    }

    th {
        border-width: 0 1px 1px 0;
    }

    td {
        border-width: 0 1px 1px 0;
    }

    .shop_table.woocommerce-checkout-review-order-table {
        font-size: 0.9em;
        border: 1px solid rgba(0, 0, 0, .1);
        margin: 0 -1px 24px 0;
        text-align: left;
        width: 100%;
        border-collapse: separate;
        border-radius: 5px;

        tr.woocommerce-shipping-totals {
            &.shipping th { border-bottom: 1px solid rgba(0, 0, 0, .1) !important; }

            td, th {
                &[data-title="Shipping"] {
                    padding: 10px !important;
                }

                #shipping_method {
                    border: none;

                    .cfw-shipping-methods-list {
                        margin: 0 !important;
                        border: none;
                    }

                    li {
                        display: flex;
                        align-items: center;
                        margin-bottom: 6px;

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

                        label {
                            line-height: normal;
                            border-radius: 0;
                            border: none;
                            padding: 0;
                            width: 100% !important;
                        }
                        input {
                            margin-right: 6px;
                            margin-bottom: 0;
                            font-size: 100%;
                            line-height: 1.15;
                        }
                    }
                }
            }
        }

        .quantity .qty {
            width: 3.631em;
            text-align: center;
        }

        .product-name {
            width: auto;
        }

        #shipping_method {
            list-style: none outside;
            margin: 0;
            padding: 0;
        }

        td {
            border-top: 1px solid rgba(0,0,0,.1);
            padding: 9px 12px;
            vertical-align: middle;
            line-height: 1.5em;
        }

        th {
            font-weight: 700;
            padding: 9px 12px;
            line-height: 1.5em;
        }

        // Flatsome override
        .shipping__inner {
            padding: 0;
        }

        tr.woocommerce-shipping-totals table.shipping__table {
            border: none;
            width: 100%;

            th, td {
                border-top: none !important;
                border-bottom: none !important;
            }
        }

        tfoot {
            td {
                font-weight: 700;
                border-top: 1px solid rgba(0,0,0,.1);
            }
            th {
                font-weight: 700;
                border-top: 1px solid rgba(0,0,0,.1);
            }
        }
    }
}

// Login Container
#order_review {
    .woocommerce-form-login {
        margin-bottom: 40px;

        button[type="submit"][name="login"] {
            @extend .cfw-secondary-btn;

            float: right;
            max-width: 200px;
        }
    }
}

#kco-wrapper {
    .woocommerce-account-fields {
        .form-row {
            padding: 3px;
            margin: 1em 0;
        }
    }
}

// Klarna General Mobile Styles
@mixin klarna-mobile-view() {
    #kco-order-review {
        margin-bottom: 50px;
        float: none;
        margin-left: 1em;
        margin-right: 1em;
        padding-right: 0;
        box-sizing: border-box;
    }

    #kco-iframe {
        float: none;
        width: 100%;
        padding-left: 0;
        box-sizing: border-box;
    }
}

@mixin klarna-mobile-button-view() {
    #klarna-checkout-select-other {
        display: inline-block;
    }
}

// Mobile Login Styles
@media(max-width: 500px) {
    #order_review {
        .woocommerce-form-login {
            display: flex;
            flex-direction: column;

            .form-row {
                width: 100%;
                float: none;
            }

            button[type="submit"][name="login"] {
                float: none;
                max-width: 100%;
            }

            .woocommerce-form__label-for-checkbox {
                margin-top: 10px;
            }
        }
    }
}

// Other Theme Mobile Styles
@media(max-width: 1100px) {
    main.checkoutwc {
        @include klarna-mobile-view();
    }
}

// Other Theme Button Mobile Styles
@media(max-width: 1150px) {
    main.checkoutwc {
        @include klarna-mobile-button-view();
    }
}

main.checkoutwc .klarna-checkout-select-other-wrapper {
  margin-top: 1em;
}