// /**
//  * Copyright © Magento, Inc. All rights reserved.
//  * See COPYING.txt for license details.
//  */

//
//  Variables
//  _____________________________________________

@checkout-payment-method-title__border: @checkout-shipping-method__border;
@checkout-payment-method-title__padding: @checkout-shipping-method__padding;
@checkout-payment-method-title-mobile__padding: 15px;

@checkout-payment-method-content__padding__xl: 22px;

@checkout-billing-address-details__line-height: 27px;
@checkout-billing-address-details__padding: 0 0 0 23px;
@checkout-billing-address-form__max-width: @checkout-shipping-address__max-width;

//
//  Common
//  _____________________________________________

& when (@media-common =true) {
    .checkout-payment-method {
        .step-title {}

        .payment-method {
            &:first-child {
                .payment-method-title {
                    border-top: 0;
                }
            }

            &._active {
                .payment-method-content {
                    display: block;
                }
            }

        }

        .payment-method-content {
            >.actions-toolbar {
                >.primary {
                    .action {
                        &.primary {
                            &:extend(.abs-button-l all);
                        }
                    }
                }
            }
        }

        .payment-methods {
            .payment-method-title {
                padding: 0;
                margin: 0;

                .payment-icon {
                    display: inline-block;
                    margin-left: @indent__xs;
                    vertical-align: middle;
                }

                .action-help {
                    display: inline-block;
                    margin-right: @indent__xs;
                }

                &.choice input+.label {
                    font-size: 16px;
                }

                input {
                    border-color: #333 !important;
                }
            }
        }


        .payment-method-content {
            display: none;
            .lib-css(padding, 15px 0 20px 0px);

            .fieldset {
                &:not(:last-child) {
                    margin: 0 0 @indent__base;
                }
            }
        }

        .payment-group {
            &+.payment-group {
                .step-title {
                    margin: @indent__base 0 0;
                }
            }
        }

        .field-select-billing,
        .billing-address-form {
            .lib-css(max-width, @checkout-billing-address-form__max-width);
        }

        .billing-address-same-as-shipping-block {
            margin: 0 0 @indent__s;
        }

        .checkout-billing-address {
            margin: 0 0 @indent__base;

            .primary {
                .action-update {
                    margin-left: 0;
                }
            }

            .action-cancel {
                &:extend(.abs-action-button-as-link all);
            }

            .billing-address-details {
                .lib-css(line-height, @checkout-billing-address-details__line-height);
                .lib-css(padding, @checkout-billing-address-details__padding);
            }
        }

        .payment-method-note {
            &+.checkout-billing-address {
                margin-top: @indent__base;
            }
        }

        .field-select-billing {
            >.label {
                &:extend(.abs-visually-hidden all);
            }
        }

        .payment-method-iframe {
            background-color: transparent;
            display: none;
            width: 100%;
        }

        .no-payments-block {
            margin: @indent__base 0;
        }

        .payments {
            .legend {
                &:extend(.abs-visually-hidden all);
            }
        }
    }

    .opc-payment {
        .payment-methods {
            .payment-method {
                padding-bottom: 13px;
                border-bottom: 1px solid #f0f0f0;

                &:not(:last-child) {
                    margin-bottom: 16px;
                }

                &:last-child {
                    margin-bottom: 10px;
                }

                .actions-toolbar {
                    margin: 0;

                    .primary {
                        float: right;

                        button {
                            border-radius: 40px;
                            font-size: 14px !important;
                            min-width: 200px;
                            font-weight: 600;
                            text-transform: uppercase;
                            letter-spacing: 0.1em;
                            border: 2px solid #222;
                            background-color: #222;
                            padding: 0 40px !important;
                            height: 44px;
                            line-height: 40px !important;

                            span {
                                font-size: 14px;
                            }

                            &:hover {
                                border-color: @theme-primary-color;
                                background-color: @theme-primary-color;
                                box-shadow: none;
                                outline: none;
                            }

                        }

                        @media screen and (min-width: 768px) {
                            button.action.action-update {
                                margin-left: 20px !important;
                            }
                        }
                    }
                }
            }
        }
    }

    .payment-option.discount-code {
        padding-bottom: 20px;

        .payment-option-title {
            padding-right: 0;
            border-bottom: 1px solid #f0f0f0;
            color: var(--thim-mgs-color-05);
            font-size: 18px;
            font-weight: 300;
            margin-bottom: 15px;
            padding-bottom: 10px;
            position: relative;
            border-top: none;
            padding-top: 10px;

            span.action.action-toggle {
                color: inherit;

                &:after {
                    position: absolute;
                    left: 0;
                    color: var(--thim-mgs-color-01);
                    bottom: 10px;
                }
            }
        }

        .payment-option-content {
            padding: 0;

            form.form.form-discount {
                max-width: 100%;

                .field {
                    label {
                        position: relative;
                        width: auto;
                        height: auto;
                        padding-bottom: 10px;
                    }
                }

                .actions-toolbar {
                    .primary {
                        float: right;

                        button.action.action-apply {
                            font-size: 14px;
                            padding: 0 30px;
                            height: 40px;
                            font-weight: 600;
                            color: #fff;
                            border: 1px solid var(--thim-mgs-color-05);
                            background-color: var(--thim-mgs-color-05);
                            border-radius: 40px;
                            -webkit-border-radius: 40px;
                            -moz-border-radius: 40px;
                            -o-border-radius: 40px;

                            &:hover {
                                color: #fff;
                                border: 1px solid @theme-primary-color;
                                background-color: @theme-primary-color;
                            }
                        }
                    }
                }
            }
        }
    }
}

//
//  Mobile
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum ='max') and (@break =@screen__m) {
    .checkout-payment-method {

        .payment-method-title {
            .lib-css(padding, @checkout-payment-method-title-mobile__padding)
        }


        .checkout-billing-address {
            .action-cancel {
                margin-top: @indent__s;
            }
        }
    }

    .opc-payment {
        .payment-methods {
            .payment-method {
                .actions-toolbar {
                    margin-top: 20px;

                    .primary {
                        float: none;

                        button+button {
                            margin-top: 15px !important;
                            display: block;
                        }
                    }
                }
            }
        }
    }

    .payment-option.discount-code {
        margin: 0 !important;
    }
}

//
//  Desktop
//  _____________________________________________

.media-width(@extremum, @break) when (@extremum ='min') and (@break =@screen__m) {
    .checkout-payment-method {
        .actions-toolbar {
            .primary {
                float: left;
                margin: 0;
            }
        }

        .fieldset {
            >.field-select-billing {
                >.control {
                    float: none;
                    width: 100%;
                }
            }
        }

        .payment-method-content {
            .fieldset {
                >.field {
                    margin: 0 0 @indent__base;

                    &.choice {
                        &:before {
                            padding: 0;
                            width: 0;
                        }
                    }

                    &.type {
                        .control {
                            margin-right: 25.8%;
                        }

                        &.no-detection {
                            .control {
                                margin-right: 0;
                            }
                        }
                    }
                }
            }
        }
    }

    .checkout-billing-address {
        .action-update {
            float: left;
        }

        .actions-toolbar {
            .action-cancel {
                margin: 6px 0 0 @indent__base;
            }
        }
    }
}