.wprm-admin-modal-field-ingredient,
.wprm-admin-modal-field-ingredient-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    background-color: white;

    .wprm-admin-modal-field-ingredient-handle {
        flex-shrink: 0;

        .wprm-admin-icon {
            margin: 0 5px;
            cursor: move;
        }
    }
}

.wprm-admin-modal-field-ingredient-group {
    .wprm-admin-modal-field-ingredient-group-name-container {
        flex: auto;

        .wprm-admin-modal-field-richtext-singleline,
        .wprm-admin-modal-field-richtext-legacy {
            font-weight: bold;
        }
    }
}

.wprm-admin-modal-field-ingredient-header-container {
    display: flex;
    align-items: center;
    margin: 0 26px 10px 26px;
    font-weight: bold;

    .wprm-admin-modal-field-ingredient-header {
        &:nth-child(1),
        &:nth-child(2) {
            flex: 0 0 50%;
        }

        &:nth-child(3),
        &:nth-child(4) {
            display: none;
        }

        .wprm-admin-modal-field-ingredient-header-required {
            font-size: 0.8em;
            font-weight: normal;
            color: darkred;
        }
    }
}

.wprm-admin-modal-field-ingredient {    
    .wprm-admin-modal-field-ingredient-text-container {
        display: flex;
        flex: auto;
        flex-wrap: wrap;
        align-items: center;

        .wprm-admin-modal-field-richtext,
        .wprm-admin-modal-field-richtext-legacy {
            &:nth-child(1),
            &:nth-child(2) {
                flex: 0 0 50%;
            }

            &:nth-child(3),
            &:nth-child(4) {
                flex: 0 0 100%;
            }
        }
    }
}

.wprm-admin-modal-field-ingredient-after-container {
    .wprm-admin-modal-field-ingredient-after-container-icons {
        flex-shrink: 0;
        margin: 5px;

        .wprm-admin-icon {
            margin-right: 5px;
        }
    }
}

.wprm-admin-modal-field-ingredient-actions {
    margin-left: 26px;
    margin-top: 10px;

    .button {
        margin-top: 5px;
        margin-right: 5px;
    }

    p {
        font-style: italic;
    }
}

@media screen and (min-width: 550px) {
    .wprm-admin-modal-field-ingredient-header-container {
        .wprm-admin-modal-field-ingredient-header {
            &:nth-child(1),
            &:nth-child(2) {
                flex: 0 0 25%;
            }

            &:nth-child(3) {
                display: block;
                flex: 0 0 50%;
            }
        }
    }

    .wprm-admin-modal-field-ingredient {    
        .wprm-admin-modal-field-ingredient-text-container {
            .wprm-admin-modal-field-richtext,
            .wprm-admin-modal-field-richtext-legacy {
                &:nth-child(1),
                &:nth-child(2) {
                    flex: 0 0 25%;
                }
    
                &:nth-child(3) {
                    flex: 0 0 50%;
                }
            }
        }
    }
}

@media screen and (min-width: 782px) {
    .wprm-admin-modal-field-ingredient,
    .wprm-admin-modal-field-ingredient-group {
        margin-bottom: 5px;
    }
    
    .wprm-admin-modal-field-ingredient-header-container {
        .wprm-admin-modal-field-ingredient-header {
            &:nth-child(1) {
                flex: 0 0 75px;
                margin-right: 5px;
            }
            &:nth-child(2) {
                flex: 0 0 90px;
                margin-right: 5px;
            }    
            &:nth-child(3) {
                flex: 0 0 250px;
                margin-right: 5px;
            }
            &:nth-child(4) {
                display: block;
                flex: auto;
            }
        }
    }

    .wprm-admin-modal-field-ingredient {
        display: flex;
        align-items: center;

        .wprm-admin-modal-field-ingredient-text-container {
            flex-wrap: nowrap;

            .wprm-admin-modal-field-richtext,
            .wprm-admin-modal-field-richtext-legacy {
                &:nth-child(1) {
                    flex: 0 0 75px;
                    margin-right: 5px;
                }
                &:nth-child(2) {
                    flex: 0 0 90px;
                    margin-right: 5px;
                }    
                &:nth-child(3) {
                    flex: 0 0 250px;
                    margin-right: 5px;
                }
                &:nth-child(4) {
                    flex: auto;
                }
            }
        }
    }
}

@media screen and (min-width: 900px) {
    .wprm-admin-modal-field-ingredient-header-container {
        .wprm-admin-modal-field-ingredient-header {
            &:nth-child(3) {
                flex: 0 0 300px;
            }
        }
    }

    .wprm-admin-modal-field-ingredient {
        .wprm-admin-modal-field-ingredient-text-container {
            .wprm-admin-modal-field-richtext,
            .wprm-admin-modal-field-richtext-legacy {
                &:nth-child(3) {
                    flex: 0 0 300px;
                };
            }
        }
    }
}

@media screen and (min-width: 1024px) {
    .wprm-admin-modal-field-ingredient-header-container {
        .wprm-admin-modal-field-ingredient-header {
            &:nth-child(3) {
                flex: 0 0 350px;
            }
        }
    }

    .wprm-admin-modal-field-ingredient {
        .wprm-admin-modal-field-ingredient-text-container {

            .wprm-admin-modal-field-richtext,
            .wprm-admin-modal-field-richtext-legacy {
                &:nth-child(3) {
                    flex: 0 0 350px;
                };
            }
        }
    }
}