form[data-op3-element-options-type="button"],
form[data-op3-element-options-type="coursebutton"],
form[data-op3-element-options-type="lessonbutton"] {
    // By default we are using max-width instead of width
    .op3-element-options-property[data-op3-element-options-property-id="width"] {
        display: none;
    }

    // Align icons
    .op3-element-options-property[data-op3-element-options-property-id="buttonAlignText"] {
        [data-jquery-select-buttons-option-value="stretch"] { display: none; }
        [data-jquery-select-buttons-option-value="normal"] .jquery-select-buttons-option-icon::before { content: $op3-icon-ban-1; }
        [data-jquery-select-buttons-option-value="flex-start"] .jquery-select-buttons-option-icon::before { content: $op3-icon-align-horizontal-left; }
        [data-jquery-select-buttons-option-value="center"] .jquery-select-buttons-option-icon::before { content: $op3-icon-align-horizontal-middle; }
        [data-jquery-select-buttons-option-value="flex-end"] .jquery-select-buttons-option-icon::before { content: $op3-icon-align-horizontal-right; }
    }

    .op3-element-options-property[data-op3-element-options-property-id="buttonTextAlign"] {
        [data-jquery-select-buttons-option-value="inherit"],
        [data-jquery-select-buttons-option-value="justify"] {
            display: none;
        }
    }

    // Hiding button element icons properties
    // depending on icon visibility property
    .op3-element-options-property[data-op3-element-options-property-id="visible"] {
        &[data-op3-element-options-property-value="0"] {
            ~ .op3-element-options-property,
            ~ .op3-element-options-property-filter {
                display: none;
            }
        }
    }

    // Hide label on 'tabbed view'
    .op3-element-options-property[data-op3-element-options-property-id="iconSize"],
    .op3-element-options-property[data-op3-element-options-property-id="iconDirection"],
    .op3-element-options-property[data-op3-element-options-property-id="iconSpacing"] {
        .op3-element-options-label-group {
            visibility: hidden;
        }
    }

    // More 'tabbed view' tweaks
    .op3-element-options-property[data-op3-element-options-property-id="iconDirection"] {
        padding-top: 0;
    }

    .op3-element-options-property[data-op3-element-options-property-id="iconSpacing"] {
        .op3-element-options-label-group {
            margin-bottom: 10px;
        }
    }

    // Subtext
    .op3-element-options-property[data-op3-element-options-property-id="subtextVisible"] {
        &[data-op3-element-options-property-value="0"] {
            ~ .op3-element-options-property,
            ~ .op3-element-options-property-filter {
                display: none;
            }
        }
    }

    // Hide description message for effectStyle and effectStyleHover properties.
    [data-op3-element-options-property-id="effectStyle"],
    [data-op3-element-options-property-id="effectStyleHover"],
    .op3-element-options-property[data-op3-element-options-property-id="transitionDuration"] {
        .op3-element-options-description {
            display: none;
        }
    }

    // When effectStyleHover property is set, effectStyle property must be disabled
    &[data-op3-parent-options-property-value-effectstylehover]:not([data-op3-parent-options-property-value-effectstylehover=""]) {
        [data-op3-element-options-property-id="effectStyle"],
        .op3-element-options-property[data-op3-element-options-property-id="transitionDuration"] {
            .op3-element-options-label-group,
            .op3-element-options-description {
                display: flex;
                margin-top: 0px;
            }

            > * {
                display: none;
            }
        }
    }

    // When effectStyle property is set, effectStyleHover property must be disabled
    &[data-op3-parent-options-property-value-effectstyle]:not([data-op3-parent-options-property-value-effectstyle=""]) {
        [data-op3-element-options-property-id="effectStyleHover"] {
            .op3-element-options-label-group,
            .op3-element-options-description {
                display: flex;
                margin-top: 0px;
            }

            > * {
                display: none;
            }
        }
    }
}

// Button on Form element
#toolbar form[data-op3-element-options-path$="/form/button"],
form[data-op3-element-options-path$="/form/button"],
#toolbar form[data-op3-element-options-path$="/contactform/button"],
form[data-op3-element-options-path$="/contactform/button"],
#toolbar form[data-op3-element-options-path$="/loginandsignupform/button"],
form[data-op3-element-options-path$="/loginandsignupform/button"],
#toolbar form[data-op3-element-options-path$="/userprofile/button"],
form[data-op3-element-options-path$="/userprofile/button"]{
    .op3-boxmodel {
        .op3-boxmodel-margin-top,
        .op3-boxmodel-margin-bottom,
        .op3-boxmodel-margin-left,
        .op3-boxmodel-margin-right {
            pointer-events: none;
            opacity: 0.5;

            & + .op3-boxmodel-handler {
                display: none;
            }
        }
    }

    [data-op3-toolbar-nav-id="advanced"],
    [data-op3-toolbar-nav-id="move"],
    [data-op3-toolbar-nav-id="link"],
    [data-op3-toolbar-nav-id="clone"],
    [data-op3-toolbar-nav-id="delete"] {
        display: none;
    }

    // Hide alignment when on form with inline layout
    &[data-op3-parent-options-property-value-optin-field-layout="inline"] {
        [data-op3-toolbar-nav-id="alignment"] {
            display: none;
        }
    }
}

#toolbar {
    [data-op3-element-options-type="button"] {
        [data-op3-toolbar-nav-id="product"] {
            display: none;
        }

        &[data-op3-element-options-path$="/onetimeoffer/button"] {
            [data-op3-toolbar-nav-id="product"] {
                display: block;
            }
        }
    }
}
