.wpcfto-box {
    &.checkbox {
        .wpcfto-field-aside {
            margin: 3px 0 0;
        }
    }
}

.wpcfto-admin-checkbox {

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

    label {
        display: inline-block !important;
        margin: 0;
    }

    span {
        display: inline-block;
        vertical-align: top;
        line-height: 24px;
    }

    .wpcfto-admin-checkbox-wrapper {
        &.is_toggle {
            & {
                position: relative;
                display: inline-block;
                vertical-align: top;
                margin: 0;
                width: 50px;
                height: 26px;
                border: 1px solid #bec5cb;
                background-color: transparent;
                top: 50%;
                border-radius: 20px;
            }
            input {
                position: absolute;
                width: 100%;
                height: 100%;
                display: block;
                margin: 0 !important;
                opacity: 0;
                z-index: 30;
            }

            .wpcfto-checkbox-switcher {
                position: absolute;
                left: 4px;
                top: 3px;
                width: 18px;
                height: 18px;
                background-color: #bec5cb;
                border-radius: 20px;
                z-index: 10;
                transition: .15s ease;
            }

            &:not(.active) {
                &::after {
                    content: "Off";
                    color: $color_muted;
                    font-size: 10px;
                    font-weight: 400;
                    position: absolute;
                    right: 8px;
                    top: 3px;
                }
            }

            &.active {
                background-color: $accent;
                border-color: $accent;

                &::before {
                    content: "On";
                    color: $white;
                    font-size: 10px;
                    font-weight: 400;
                    position: absolute;
                    left: 8px;
                    top: 3px;
                }

                .wpcfto-checkbox-switcher {
                    transform: translateX(22px);
                    background-color: #fff;

                }
                + span {
                    opacity: 1;
                }
            }

        }
        &:not(.is_toggle) {
            & {
                display: inline-block;
            }
            .wpcfto-checkbox-switcher {
                display: none;
            }
            input {
                width: 16px;
                height: 16px;
                border-radius: 2px;
                border: 1px solid $accent;
                background-color: #ffffff;
                &:checked {
                    background-color: $accent;
                    &::before {
                        width: 14px;
                        margin: 2px 0 0;
                        padding: 0;
                        height: 14px;
                        content: url(data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2012%209%22%3E%3Cpath%20fill%3D%22none%22%20stroke%3D%22%23fff%22%20d%3D%22M1.862%203.988v0l2.086%202.183v0l1.05%201.1v0l4.489-4.74v0l.691-.731v0%22%2F%3E%3C%2Fsvg%3E);
                    }
                }
                &:focus {
                    outline: none;
                    box-shadow: 0 0 0 transparent;
                }
            }
            & ~ span {
                vertical-align: baseline;
                font-size: 15px;
                font-weight: 400;
            }
        }

    }
}

.wpcfto_checkbox {
    position: relative;

    i.fa-check {
        position: absolute;
        top: 1px;
        left: 0;
        width: 16px;
        height: 16px;
        border: 1px solid $accent;
        background-color: #fff;
        font-size: 8px;
        line-height: 14px;
        text-align: center;
        color: #fff;
        border-radius: 2px;
        transition: .3s ease;

        &:before {
            content: '';
        }
    }

    input[type="checkbox"] {
        opacity: 0;

        &:checked {
            + i {
                background-color: $accent;
                border-color: $accent;

                &:before {
                    content: "\f00c";
                }
            }
        }
    }
}

.wpcfto-box {
    .wpcfto-box-child {
        .wpcfto_generic_field.wpcfto_generic_checkbox {
            padding: 0;

            .wpcfto-field-aside {
                margin-bottom: 0;
            }

            .wpcfto-admin-checkbox-wrapper input {
                margin: 0;
            }
        }
    }
}

.wpcfto_radio {
    position: relative;

    i {
        position: absolute;
        top: 9px;
        left: 0;
        width: 16px;
        height: 16px;
        border: 1px solid #bfbfbf;
        background-color: #f1f1f1;
        border-radius: 50%;
        transition: .3s ease;

        &:before {
            content: '';
            position: absolute;
            top: 3px;
            left: 3px;
            display: block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
        }
    }

    span {
        font-size: 15px;
        font-weight: 400;
        opacity: .6;
    }

    input[type="radio"] {
        opacity: 0;

        &:checked {
            + i {
                border-color: #195ec8;
                background: #fff;

                &:before {
                    background-color: #195ec8;
                }

                + span {
                    opacity: 1;
                }
            }
        }
    }
}

//HACK FOR OLD FIELD REVERSED!!!!!!
.section_accessibility-not_single_sale {
    .wpcfto-admin-checkbox-wrapper {
        background-color: #00b163;
        border-color: #00b163;
        .wpcfto-checkbox-switcher {
            //transform: translateX(16px);
            //background-color: #fff;
        }

        &.active {
            border-color: #bfbfbf;
            background-color: #bfbfbf;
            .wpcfto-checkbox-switcher {
                //transform: translateX(0);
                //background-color: #f6f6f6;
            }
            +span {
                opacity: .6;
            }
        }
    }
    span {
        opacity: 1;
    }
}

.wocommerce_checkout, .checkbox {
    .wpcfto_generic_checkbox {
        .wpcfto-field-content {
            display: flex;
            align-items: center;
        }
    }
    &.is_pro {
        .wpcfto_generic_checkbox {
            order: 2;
        }
        .pro-notice {
            order: 1;
        }
    }
}

.wpcfto_generic_field_multi_checkbox {
    .wpcfto_multi_checkbox.wpcfto-admin-checkbox {
        label {
            width: 50%;
            display: block;
            padding: 0 13px;
            margin-bottom: 0.8em;
            input {
                margin: 0 0.3em 0 0 !important;
            }
        }
    }

}
