@mixin ag-theme-base-part-header {

    .ag-header {
        @include ag-color-property(background-color, header-background-color);
        @include ag-border(critical, bottom);
    }

    .ag-header-row {
        @include ag-color-property(color, header-foreground-color);
        height: ag-param(header-height);
    }

    .ag-pinned-right-header {
        @include ag-border(critical, left);
    }

    .ag-pinned-left-header {
        @include ag-border(critical, right);
    }

    .ag-header-cell:not(.ag-right-aligned-header) .ag-header-label-icon {
        @include ag-theme-rtl(( margin-left: ag-param(grid-size) ));
    }

    .ag-header-cell.ag-right-aligned-header .ag-header-label-icon {
        @include ag-theme-rtl(( margin-right: ag-param(grid-size) ));
    }

    .ag-header-cell,
    .ag-header-group-cell {
        padding-left: ag-param(cell-horizontal-padding);
        padding-right: ag-param(cell-horizontal-padding);

        &.ag-header-cell-moving {
            @include ag-color-property(background-color, header-cell-moving-background-color);
        }
    }

    @include ag-keyboard-focus((ag-header-cell, ag-header-group-cell), 4px);

    .ag-header-icon {
        @include ag-color-property(color, secondary-foreground-color);
    }

    .ag-header-expand-icon {
        cursor: pointer;
        @include ag-theme-rtl(( padding-left: 4px ));
    }

    .ag-header-row:not(:first-child) {
        .ag-header-cell,
        .ag-header-group-cell.ag-header-group-cell-with-group {
            @include ag-border(critical, top);
        }
    }

    // This logic with :not(.ag-column-resizing) is to prevent a mouseover effect
    // being applied to the adjacent cell as the user resizes a cell, because
    // during a resize, the mouse will momentarily move over the neighbouring cell
    .ag-header-group-cell:not(.ag-column-resizing) + .ag-header-group-cell,
    .ag-header-cell:not(.ag-column-resizing) + .ag-header-cell,
    .ag-header-group-cell:first-of-type,
    .ag-header-cell:first-of-type {
        @if (ag-param-is-set(header-cell-hover-background-color) and ag-params-are-different(header-cell-hover-background-color, header-background-color)) {
            &:not(.ag-header-cell-moving):hover,
            &.ag-column-resizing {
                @include ag-color-property(background-color, header-cell-hover-background-color);
            }
        }
    }

    @if ag-param(header-column-separator) {
        .ag-header-cell::after,
        .ag-header-group-cell::after {
            content: "";
            position: absolute;
            z-index: 1;
            display: block;
            width: ag-param(header-column-separator-width);
            height: ag-param(header-column-separator-height);
            top: calc(50% - #{ag-param(header-column-separator-height) * 0.5});
            @include ag-color-property(background-color, header-column-separator-color);

            @include ag-theme-rtl(( right: 0 ));
        }
    }

    @if ag-param(header-column-resize-handle) {
        .ag-header-cell-resize {
            display: flex;
            align-items: center;
        }

        .ag-header-cell-resize::after {
            content: "";
            position: absolute;
            z-index: 1;
            display: block;
            left: calc(50% - #{ag-param(header-column-resize-handle-width) * 0.5});
            width: ag-param(header-column-resize-handle-width);
            height: ag-param(header-column-resize-handle-height);
            top: calc(50% - #{ag-param(header-column-resize-handle-height) * 0.5});
            @include ag-color-property(background-color, header-column-resize-handle-color);
        }

        .ag-pinned-right-header .ag-header-cell-resize::after {
            left: calc(50% - #{ag-param(header-column-resize-handle-width)});
        }
    }

    .ag-header-select-all {
        @include ag-theme-rtl(( margin-right: ag-param(cell-horizontal-padding) ));
    }

    .ag-floating-filter-button {
        @include ag-theme-rtl(( margin-left: ag-param(grid-size) * 3 ));
    }

    .ag-floating-filter-button-button {
        @include ag-inherit-text-styles();
        appearance: none;
        background: transparent;
        border: none;
        height: ag-param(icon-size);
        padding: 0;
        width: ag-param(icon-size);
    }

    .ag-filter-loading {
        @include ag-color-property(background-color, control-panel-background-color);
        height: 100%;
        padding: ag-param(widget-container-vertical-padding) ag-param(widget-container-horizontal-padding);
        position: absolute;
        width: 100%;
        z-index: 1;
    }
}
