.givewp-form-title {
    .components-base-control__field {
        margin-bottom: 0;

        input {
            background: var(--givewp-gray-5);
            border-color: var(--givewp-gray-10);
            font-size: 1rem;
            height: 2.25rem;
            padding: var(--givewp-spacing-2) var(--givewp-spacing-4);
            max-width: 100%;
            text-align: center;
            width: 25rem;
        }
    }
}

.components-toolbar__control.components-button {
    width: 100px;
}

.components-form-toggle.is-checked .components-form-toggle__track {
    background-color: var(--wp-admin-theme-color);
}

/**
 * Fixes an issue with inspector select controls covering selected option.
 */
.components-select-control__input {
    font-weight: normal;
}

.components-button {
    &.has-icon {
        padding: 0 6px;

        svg {
            transition: transform 0.2s cubic-bezier(0.165, 0.84, 0.44, 1);
        }

        &.is-pressed {
            &.rotate-icon {
                svg {
                    transform: rotate(45deg);
                }
            }
        }
    }
}

/**
 * Remove outline from popover
 */

.components-popover__content {
    outline: 0 !important;
}

/**
 * Set spacing between field sub-components, ie label and input
 */
.components-base-control:not(.components-search-control) {
    width: 100%;
}

/** ------------------------------- */

/**
 * @todo The suffix isn't being displayed properly.
 */

.components-input-control__suffix {
    display: none;
}

.components-panel__row:first-of-type {
    margin-top: 0.5rem;
}


// Add border around template color setting popovers.
.block-editor-panel-color-gradient-settings__dropdown-content,
.components-color-palette__custom-color-dropdown-content {
    .components-popover__content,
    .components-color-picker {
        border: 1px solid var(--givewp-gray-40);
    }
}

.block-editor-panel-color-gradient-settings__dropdown-content .components-popover__content {
    // Move popover color panel out from underneath custom sidebar.
    margin-right: var(--givewp-sidebar-width) !important;

    // Remove fieldset border.
    .block-editor-color-gradient-control__fieldset {
        border: 0;
    }
}

.components-color-palette__custom-color-dropdown-content .components-popover__content {
    // Move popover color picker to not cover popover color panel.
    margin-left: -115%;

    // Prevent scrollbar in popover color picker.
    .components-color-picker .components-h-stack {
        width: auto;
    }
}

.components-modal__screen-overlay {
    z-index: 9999999999;

    &--givewpwp-custom-css {
        background-color: transparent;
    }
}

.components-modal__header {
    box-shadow: inset 0 -1px 0 0 #ddd;
}

.components-modal__header-heading {
    top: 1rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    margin-top: -0.2rem !important;
}

.components-modal__header {
    height: 3.5rem !important;
    padding: 16px 32px 8px !important;
}

.components-modal__content {
    margin-top: 3.25rem;

}

/*
Add border bottom to tabs, while removing body top border.
This creates a consistent separator between the tabs and the rest of the sidebar.
*/
.components-tab-panel__tabs {
    border-bottom: 1px solid #e0e0e0;
}

.givewp-sidebar-dropdown-content .components-popover__content {
    border: 1px solid var(--givewp-gray-40);
}

.components-popover.components-dropdown__content {
    z-index: 99999999;
}

.givewp-panel-body--summary .components-base-control__field .components-select-control,
.givewp-panel-body--summary .components-base-control__field {
    display: grid;
    grid-template-columns: 85px 1fr;

    input {
        background-color: var(--givewp-gray-10);

        &[aria-expanded='true'] {
            background-color: var(--givewp-primary-200);
        }
    }

    label {
        display: flex;
        align-items: center;
        margin-bottom: 0;
        margin-right: 0;
        font-weight: 400;
    }

    .components-input-control__container {
        width: 158px;
    }

    .components-flex.components-select-control > .components-flex-item {
        &,
        label {
            height: 100%;
        }
    }
}

.components-editor-notices__snackbar {
    position: fixed;
    right: 0;
    bottom: 20px;
    padding-left: 16px;
    padding-right: 16px;
}

.givewp-donation-level-control .components-base-control,
.givewp-donation-level-control .components-base-control__field {
    margin-bottom: 0;
}

.components-base-control.components-checkbox-control {
    margin: 5px 0;
}

.give-billing-period-control {
    .components-flex {
        display: flex;
        gap: 4px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .components-radio-control__option {
        flex: 1;
        text-align: center;

        input {
            display: none;

            & + label {
                cursor: pointer;
                display: block;
                padding: 12px 8px;
                border-radius: 2px;
                font-weight: 500;
                font-size: 16px;
                line-height: 16px;
                background-color: var(--givewp-gray-20);
            }

            &:checked + label {
                // (Maybe) Differentiate the selected billing period.
            }
        }
    }
}

.give-billing-period-control .components-radio-control__input[type='radio']:checked + label {
    background-color: var(--givewp-gray-60);
    color: var(--givewp-shades-white);
}

.givewp-options-header {
    display: flex;
    align-items: center;
    flex-direction: row;
    gap: 0.5rem;
    justify-content: space-between;
    width: 100%;

    &--label {
        margin-bottom: 0;
    }

    &--button {
        color: var(--givewp-grey-500);
        padding: 0 !important;
        min-width: fit-content !important;
        height: fit-content !important;

        svg {
            width: 1.25rem;
            height: 1.25rem;
        }
    }
}

.givewp-options-list {

    &--item {
        display: grid;
        gap: 0.5rem;
        grid-template-columns: auto auto 1fr auto;
        grid-template-rows: 1.875rem;
        margin-top: 0.5rem;

        > * {
            align-self: center;
        }

        &--draggable {
            color: var(--givewp-grey-500);
            cursor: grab;
            display: flex;
            user-select: none;
        }

        &--checked {
            margin: 0 !important;
            width: 1rem !important;
        }

        &--inputs {
            display: flex;
            flex-direction: column;
            gap: 0.25rem;

            .components-base-control {
                margin-bottom: 0 !important;
            }

            &--open {
                grid-row: span 2;
            }
        }

        &--button {
            color: var(--givewp-grey-500);
            padding: 0 !important;
            min-width: fit-content !important;
            height: fit-content !important;
        }
    }
}
