fpd-element-toolbar {

    display: none;
    overflow: hidden;
    z-index: 2;
    color: var(--fpd-text-color);

    &.fpd-show {
        display: flex !important;
    }

    .fpd-close,
    .fpd-close-sub-panel {
        display: none;
        position: absolute;
        right: 0;
        top: 5px;
        height: 30px;
        min-width: 35px;
        padding: 0 7px;
        line-height: 30px;
        text-align: center;
        cursor: pointer;
        background: #fff;
        font-size: 14px;
        transform: translateY(-100%);
        box-shadow: 0px -1px 2px rgba(110, 111, 114, 0.2);
        border-top-left-radius: var(--fpd-border-radius);
        border-top-right-radius: var(--fpd-border-radius);
        gap: 3px;
        align-items: center;
    }

    .fpd-close-sub-panel > .fpd-label {
        font-size: 12px;
    }

    >.fpd-tools-nav {

        display: flex;
        flex-direction: column;

        > div {
            display: flex;
        
        }

        > div > div {
            flex: 1;
            padding: 0 15px;
            white-space: nowrap;
            text-align: center;
            cursor: pointer;

            >span[class^=fpd-icon-] {
                display: block;
                font-size: 20px !important;
                line-height: 28px;
            }

            >.fpd-label {
                margin-top: 5px;
                font-size: 11px;
                display: inline-block;
                line-height: 1;
                vertical-align: bottom;
            }

            >.fpd-current-fill {
                display: block;
                width: 28px;
                height: 28px;
                border-radius: 50%;
                border: 2px solid rgba(0, 0, 0, .1);
            }

            &.fpd-active {
                color: var(--fpd-secondary-color);
            }

        }
    }

    .fpd-sub-panel {

        flex: 1;
        overscroll-behavior: none;

        > div {

            display: none;
            height: 100%;
            width: 100%;

            > * {
                margin-bottom: 10px;

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

            &.fpd-active {
                display: flex;
                flex-flow: column nowrap;
            }

            &.fpd-padding {
                padding: 15px;
            }

            .fpd-input {
                flex-flow: row wrap;
                box-shadow: none;
                overflow: visible;

                > span, input {
                    flex: 1;
                    border: none;
                }

                > span {
                    padding: 0;
                }

                fpd-range-slider {
                    order: 3;
                }
            }

            .fpd-panel-tabs {

                display: flex;
                align-items: center;

                > span {
                    flex: 1;
                    text-align: center;
                    padding: 8px 0 6px 0;
                    cursor: pointer;
                    opacity: 0.7;
                    
                    &.fpd-active {
                        color: var(--fpd-secondary-color);
                        position: relative;
                        opacity: 1;

                        &:after {
                            background-color: var(--fpd-secondary-color);
                            position: absolute;
                            content: "";
                            width: 60%;
                            height: 2px;
                            left: 20%;
                            bottom: 0;
                        }
                    }
                }
            }

            .fpd-panel-tabs-content {

                > div {

                    display: none;
                    padding: 10px;

                    &.fpd-active {
                        display: block;
                    }

                    > * {
                        margin-bottom: 20px;
                    }
                }

            }

            .fpd-tools-group,
            .fpd-btn-group {

                display: flex;
                align-items: center;
                justify-content: center;
                text-align: center;
                gap: 4px;
                flex-flow: row wrap;

                > * {

                    flex: 1;
                    border: 1px solid var(--fpd-border-color);
                    border-radius: var(--fpd-border-radius);
                    font-size: 13px;
                    padding: 5px 0;
                    cursor: pointer;
                    line-height: 1;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    gap: 5px;

                    &:hover {
                        background: var(--fpd-light-bg-color);
                    }
                }

                [class^="fpd-icon-"] {
                    font-size: 18px;
                }
            }

            .fpd-btn-group {

                border: 1px solid var(--fpd-border-color);

                > * {
                    border: none;
                    border-radius: 0;

                    &.fpd-active {
                        color: var(--fpd-secondary-color);
                    }
                }

            }

            .fpd-toggle {

                &.fpd-enabled {
                    color: var(--fpd-secondary-color)
                }

            }

            .fpd-tool-position-align {

                > div {
                    flex: 1 0 32%;
                }

            }

            .fpd-tool-uniscaling-locker {

                font-size: 18px;
                text-align: right;
            }

            .fpd-curved-options {

                display: flex;
                gap: 30px;
                
                > span {
                    flex: 1;
                    display: flex;
                    justify-content: center;
                    align-items: center;
                    aspect-ratio: 1 / 1;
                    cursor: pointer;
                    background: var(--fpd-light-bg-color);
                    border-radius: var(--fpd-border-radius);
                    padding: 5px;

                    &.fpd-active {

                        svg * {
                            fill: var(--fpd-secondary-color);
                        }

                    }
                }

            }
            
        }

        .fpd-panel-color {

            > .fpd-scroll-area {
                overflow: visible;
            }

            .fpd-colorpicker-wrapper {
                padding: 0;
            }

        }

        .fpd-panel-font-family {

            flex-flow: column nowrap;
            height: 100%;

            .fpd-fonts-list {
                display: flex;
                flex-flow: column nowrap;
                height: 100%;
                gap: 20px;

                > .fpd-item {
                    cursor: pointer;
                    font-size: 16px;
                    transition: all 200ms ease-in-out;

                    &.fpd-active {
                        color: var(--fpd-secondary-color)
                    }

                    &:hover {
                        padding-left: 5px;
                    }
                }
            }

        }

        .fpd-tool-filters {

            display: flex;
            flex-flow: row wrap;
            justify-content: flex-start;
            gap: 35px 10px;
            padding-bottom: 40px;
            overflow: auto;
            height: auto;

            > .fpd-item {
                flex: 0 0 60px;
                height: 60px;
                background-repeat: no-repeat;
                background-size: cover;
                position: relative;

                &:after {
                    content: attr(aria-label);
                    position: absolute;
                    top: 100%;
                    left: 0;
                    line-height: 14px;
                    font-size: 12px;
                    overflow: hidden;
                    transform: translateY(3px);
                    max-width: inherit;
                }
            }

        }

        .fpd-tool-crop-masks {

            display: flex;
            flex-flow: row wrap;
            justify-content: space-evenly;
            gap: 40px 20px !important;

            .fpd-item {
                flex: 0 0 25%;
                height: 70px;
                background-repeat: no-repeat;
                background-position: center;
                background-size: contain;
            }

        }
            

    }

}

fpd-element-toolbar.fpd-smart {

    display: none;
    background: #fff;
    position: fixed;
    top: 50%;
    left: 50%;
    max-width: var(--fpd-et-max-width);
    min-width: 300px;
    border-radius: var(--fpd-border-radius);
    transform: translateX(-50%);
    z-index: 10000000000;
    box-shadow: 0px 0px 10px rgba(110, 111, 114, 0.22);
    overflow: visible;


    > .fpd-tools-nav {

        > div {
            margin: 10px 0;
            
            > div {
                display: flex;
                flex-direction: column;
                justify-content: space-between;
                flex: 0;
            }
        }

        > .fpd-primary-tools {

            justify-content: space-between;
            padding-left: 5px;

            > div {
                padding: 0 10px;
            }

            .fpd-tool-text-size {
                flex: 0 70px;

                input {
                    margin: 0;
                    width: 100%;
                    pointer-events: none;
                    text-align: center;
                }
            }

            .fpd-tool-font-family {

                flex: 1 180px;

                fpd-dropdown {
                    width: 100%;
                    pointer-events: none;
                }

            }
            
            .fpd-tool-text-size,
            .fpd-tool-font-family {

                align-self: flex-end;

                > [class^="fpd-icon-"] {
                    display: none;
                }

                .fpd-label {
                    display: none;
                }

                > fpd-dropdown {
                    min-height: 42px;
                }

            }

        }

        > .fpd-secondary-tools {
            padding-bottom: 10px;
        }
    }

    &[data-element-type="image"] {

        .fpd-tools-nav {
            flex-direction: row;

            > div {
                margin: 20px 0;
                overflow: hidden;
                flex: 1 0 auto;
                max-width: none;
            }

            > .fpd-secondary-tools {
                padding-bottom: 0;
            }
        }

    }

    > .fpd-sub-panel {
        display: none;
        width: 100%;
    }

    &.fpd-panel-visible {

        width: var(--fpd-et-max-width);

        .fpd-close {
            display: none !important;
        }

        > .fpd-tools-nav {
            display: none !important;
        }

        > .fpd-sub-panel {

            display: flex;

            .fpd-panel-tabs-content.fpd-scroll-area {
                overflow: auto;
                max-height: 200px;
            }

            .fpd-panel-font-family .fpd-fonts-list {
                max-height: 100px;
            }

        }

    }

    &.fpd-panel-visible {

        > .fpd-close-sub-panel {
            display: flex;
        }

    }

    &.fpd-show {

        > .fpd-close {
            display: block;
        }

    }

    .fpd-tool-filters,
    .fpd-tool-crop-masks {
        display: flex;
        flex-wrap: nowrap;
        padding-bottom: 30px;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .fpd-tool-crop-masks {

        gap: 0 20px !important;
        justify-content: flex-start;

        .fpd-item {
            height: 50px;
        }

    }

    &.fpd-layout-small {
        position: fixed;
        left: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        width: 100%;
        transform: none;
        border-radius: 0;
        box-shadow: 0px -1px 8px rgba(110, 111, 114, 0.2);
        padding-bottom: env(safe-area-inset-bottom);
        max-width: none;

        .fpd-close,
        .fpd-close-sub-panel {
            border-top-right-radius: 0;
        }
        
    }

}

fpd-element-toolbar.fpd-sidebar {

    .fpd-tool-filters {
        row-gap: 35px !important;
    }
    
    .fpd-tools-nav {

        flex-direction: column;

        > div {
            flex-direction: column;
            gap: 25px 0;
            height: auto;
            overflow: visible;

        }

        > .fpd-primary-tools {
            
            .fpd-tool-text-size input,
            .fpd-tool-font-family fpd-dropdown {
                display: none !important;
            }

        }

    }

}

fpd-main-bar {

    > fpd-element-toolbar {

        background: var(--fpd-primary-fg-color);
        position: absolute;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100%;
        flex-flow: row nowrap;

        >.fpd-tools-nav {
            flex: 0 80px;
            flex-flow: column;
            align-items: center;
            border-right: 1px solid var(--fpd-border-color);

            >div {

                flex: 0;
                margin: 10px 0;

                .fpd-label {
                    white-space: normal;
                }
            }


        }

    }

}

fpd-element-toolbar {

    &[data-fabric-type="engraved-text"],
    &[data-fabric-type="neon-text"] {

        .fpd-panel-color > .fpd-panel-tabs,
        .fpd-tool-text-format,
        .fpd-tool-curved-text,
        .fpd-patterns-wrapper,
        .fpd-tool-fill-opacity {
            display: none !important;
        }

    }

}

.fpd-toolbar-visible {

    .fpd-toolbar-sidebar {

        fpd-main-bar {

            overflow: visible;

            > .fpd-close {
                display: block;
                right: 0;
                left: auto;
                top: 20px;
                transform: translateX(100%);
                font-size: 12px;
                height: 30px;
                line-height: 30px;
                width: 30px;
                padding: 0 5px;
            }

        }

    }

}

body[data-fpd-industry-type="engraving"]:not(.fpd-editor-mode)  {

    .fpd-tool-fill-opacity,
    .fpd-tool-advanced-editing,
    .fpd-tool-remove-bg {
        display: none !important;
    }

}

