//spatie parts plugin

.parts {
    @extend .clearfix;

    margin: 4em 0 2em 0;

    background: $white-off;
    border: solid 2px color($gray, light);
    border-radius: border-radius(s);
    box-shadow: 0 3px rgba(34, 34, 34, .05);

    font-size: font-size(s);

    transition: transform .3s ease-out;

    label {
        position: absolute;
        top: -2.35em;
        left: 0;

        background: $white;
        background: transparent;
        border-radius: border-radius(m);
    }

    .dataTables_wrapper {
        margin: 0 !important;
    }

    .dataTable {
        width: 100% !important;
        margin: 0 !important;
    }
}

th.part_thumb {
    min-width: 4rem;
}

td.-edit {
    word-break: break-all;

    cursor: text !important;

    &:after {
        content: '\f040'; //pencil

        display: inline-block;
        margin-left: .5em;
        vertical-align: middle;

        color: rgba(color($gray), .3);

        font-family: font-family(icons);
        font-size: font-size(s);
    }

    &:focus {
        outline: solid 4px color($blue, light);
        &:after {
            display: none;
        }
    }
}

td.part_thumb {
    white-space: nowrap;

    div {
        display: inline-block;
        width: 3rem;
        height: 3rem;
        vertical-align: middle;

        background-color: color($gray,dark);
        background-position: center;
        background-repeat: no-repeat;
        background-size: cover;
        border: solid 1px color($gray, lighter);
        border-radius: border-radius(s);
    }
}
td.part_thumb.-download {
    div {
        display: inline-block;
        overflow: hidden;
        vertical-align: middle;

        color: color($gray,lightest);

        font-weight: bold;
        line-height: 3rem;
        text-align: center;
        text-transform: uppercase;
    }
}

.parts_new {
    @extend .clearfix;

    position: relative;
    padding: 1em;

    font-size: font-size(xs);
    label {
        display: block;
        position: relative;
        top: 0;

        font-style: italic;
    }

    input {
        width: 100%;
    }
}

.-dropzone {
    background: color($blue, lightest);
    border-color: color($blue, light);
    border-style: dashed;
    opacity: .8;

    transform: scale(1.05);

    tr,
    td {
        background: color($blue, lightest) !important;
    }
}

.parts_alerts {
    .alert {
        margin: .5em 0;
        padding: 1em;
    }
}

.ui-autocomplete {
    position: relative;
    top: -3px !important;
    padding: 0;

    background: #fff;
    background: #fff;
    border: 2px solid color($gray, light);
    border-top-color: transparent;
    border-radius: 3px;
    box-shadow: 0 1px 20px rgba(0, 0, 0, .25);

    list-style: none;

    .ui-state-focus {
        background: color($blue, lightest);

        font-weight: bold;
    }

    li {
        display: block;
        position: relative;
        padding: 10px 50px 10px 10px ;

        text-decoration: none;

        cursor: pointer;
    }
}

.ui-helper-hidden-accessible {
    display: none;
}

.image_editor {
    display: none;
    width: 90vw !important;
    max-height: 80vh !important;
    margin: 0 !important;
    padding: 30px !important;
    overflow: auto;

    transform: translate(-50%, -50%);
}

.image_editor_title {
    margin-bottom: 28px;

    font-size: 1.3rem;
    font-weight: bold;
}

.image_editor_preview {
    border: 3px solid color($gray, lighter);
    border-radius: 1px;

    .-has-metadata & {
        width: calc(100% - 380px);
        float: left;
    }
}

.image_editor_image {
    display: block;
    width: 100%;
}

.image_editor_options {
    display: none;
    width: 380px;
    float: left;
    padding-left: 30px;

    .-has-metadata & {
        display: block;
    }

    label,
    input,
    textarea {
        display: block;
        width: 100%;
    }
}

.image_editor_confirm {
    margin-top: 30px;

    .-has-metadata & {
        width: 100%;
        float: left;
    }
}
