.pof-controls,
.pof-units,
.pof-selected,
.pof-after {
    --brand: #c02031;
    --border: #dedede;
    --muted: #666;
    --text: #343434;
    box-sizing: border-box;
    color: var(--text);

    * {
        box-sizing: border-box;
    }
}

/* Dimension filter controls */
.pof-controls {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;

    header {
        display: flex;
        align-items: center;
        margin: 0;

        h3 {
            margin: 0;
            padding: 0;
            color: var(--text) !important;
            font-size: 18px;
            font-weight: 700;
            line-height: 25px;
        }
    }

    .pof-description {
        margin: 8px 0 0;
        padding: 0;
        color: var(--text);
        font-size: 14px;
        font-weight: 400;
        line-height: 20px;
    }

    .pof-filters {
        .pof-filter-set {
            &[hidden] {
                display: none !important;
            }

            .pof-filter-tabs {
                display: flex;
                flex-wrap: wrap;
                width: 100%;
                margin-top: 11px;
                padding: 0;
                border-bottom: 1px solid #ededed;

                .pof-filter-tab {
                    min-height: 40px;
                    margin: 16px 32px 0 0;
                    padding: 0 0 16px;
                    color: #000;
                    background: transparent;
                    border: 0;
                    border-bottom: 4px solid transparent;
                    border-radius: 0;
                    font: inherit;
                    font-size: 16px;
                    font-weight: 700;
                    line-height: 20px;
                    white-space: nowrap;
                    cursor: pointer;

                    &:hover,
                    &.is-active {
                        color: var(--brand);
                        border-bottom-color: var(--brand);
                    }

                    &:focus-visible {
                        outline: 2px solid var(--brand);
                        outline-offset: 2px;
                    }

                    @media (max-width: 767px) {
                        margin-right: 24px;
                    }
                }
            }

            .pof-filter-panels {
                margin-top: 23px;

                .pof-filter {
                    width: min(100%, 224px);
                    min-width: 0;
                    margin: 0;
                    padding: 0;
                    border: 0;

                    &[hidden] {
                        display: none !important;
                    }

                    .pof-range {
                        display: flex;
                        margin: 0 -4px;

                        .pof-range__item {
                            display: block;
                            flex: 1;
                            min-width: 0;
                            margin: 0;
                            padding: 0 4px;

                            > span {
                                display: block;
                                margin: 0 0 8px;
                                color: var(--muted);
                                font-size: 12px;
                                font-weight: 500;
                                line-height: 16px;
                                text-transform: uppercase;
                            }

                            input {
                                width: 100%;
                                min-width: 0;
                                height: 48px;
                                margin: 0;
                                padding: 12px 16px;
                                color: var(--text);
                                background: #fff;
                                border: 1px solid #ccc;
                                border-radius: 4px;
                                font: inherit;
                                font-size: 15px;
                                font-weight: 500;
                                line-height: 18px;

                                &:focus {
                                    border-color: var(--brand);
                                    outline: 2px solid rgba(192, 32, 49, .16);
                                    outline-offset: 1px;
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    .pof-apply {
        display: block;
        width: min(100%, 224px);
        height: 36px;
        margin: 24px 0 0;
        padding: 6px 16px;
        color: #fff;
        background: var(--brand);
        border: 1px solid var(--brand);
        border-radius: 4px;
        font: inherit;
        font-size: 14px;
        font-weight: 700;
        line-height: 22px;
        text-transform: uppercase;
        cursor: pointer;

        &:hover {
            background: #9f1a29;
            border-color: #9f1a29;
        }

        &:focus-visible {
            outline: 2px solid var(--brand);
            outline-offset: 2px;
        }
    }

    .pof-filter-status {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        width: min(100%, 445px);
        margin-top: 12px;

        .pof-count {
            color: var(--muted);
            font-size: 13px;
            font-weight: 600;
            line-height: 20px;
            white-space: nowrap;

            @media (max-width: 767px) {
                white-space: normal;
            }
        }

        @media (max-width: 767px) {
            flex-wrap: wrap;
        }
    }
}

/* Imperial and Metric switcher */
.pof-units {
    display: flex;
    align-items: flex-start;
    width: 152px;
    min-width: 0;
    height: 28px;
    margin: 0;
    padding: 0;
    background: transparent;

    button {
        width: 76px;
        height: 28px;
        margin: 0;
        padding: 0 12px;
        color: var(--text);
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 0 4px 4px 0;
        font: inherit;
        font-size: 12px;
        font-weight: 500;
        line-height: 18px;
        cursor: pointer;

        &:first-child {
            border-radius: 4px 0 0 4px;
        }

        & + button {
            margin-left: -1px;
        }

        &:hover {
            position: relative;
            border-color: var(--brand);
        }

        &.is-active {
            position: relative;
            z-index: 1;
            padding: 0 11px;
            background: #faeeef;
            border: 2px solid var(--brand);
        }

        &:focus-visible {
            outline: 2px solid var(--brand);
            outline-offset: 2px;
        }
    }
}

/* Applied filter pills */
.pof-selected {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin: 0 0 16px;
    padding-top: 8px;

    &[hidden] {
        display: none !important;
    }

    .pof-pills {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        justify-content: flex-end;

        .pof-pill {
            position: relative;
            max-width: 100%;
            min-height: 28px;
            margin: 4px 8px 4px 0;
            padding: 8px 32px 6px 16px;
            color: var(--text);
            background: #ededed;
            border-radius: 18px;
            font-size: 12px;
            font-weight: 500;
            line-height: 14px;
            white-space: nowrap;

            .pof-pill__remove {
                position: absolute;
                top: 0;
                right: 0;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                width: 32px;
                height: 28px;
                margin: 0;
                padding: 0;
                color: var(--text);
                background: transparent;
                border: 0;
                border-radius: 0 18px 18px 0;
                font: inherit;
                cursor: pointer;

                > span {
                    font-size: 17px;
                    font-weight: 400;
                    line-height: 1;
                }

                &:hover {
                    background: #dedede;
                }

                &:focus-visible {
                    outline: 2px solid var(--brand);
                    outline-offset: 2px;
                }
            }

            @media (max-width: 767px) {
                white-space: normal;
            }
        }

        .pof-pills__reset {
            margin: 4px 0;
            padding: 0;
            color: #00639a;
            background: transparent;
            border: 0;
            border-radius: 0;
            font: inherit;
            font-size: 14px;
            font-weight: 400;
            line-height: 16px;
            cursor: pointer;

            &:hover {
                text-decoration: underline;
            }

            &:focus-visible {
                outline: 2px solid var(--brand);
                outline-offset: 2px;
            }
        }
    }

    @media (max-width: 767px) {
        justify-content: flex-start;

        .pof-pills {
            justify-content: flex-start;
        }
    }
}

/* Product table and row actions */
.pof-table {
    position: relative;
    isolation: isolate;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;

    &::-webkit-scrollbar {
        width: 10px;
    }

    &::-webkit-scrollbar-track {
        background: #e9e7e6;
    }

    &::-webkit-scrollbar-thumb {
        background: rgba(192, 32, 49, .8);
        border: 4px solid #e9e7e6;
        border-radius: 100px;

        &:hover {
            background: #c02031;
        }
    }

    table {
        width: 100% !important;
        min-width: 100% !important;
        table-layout: auto !important;
        border: 0 !important;
        border-collapse: separate !important;
        border-spacing: 0 !important;

        colgroup {
            col {
                width: auto !important;
            }
        }

        > tbody {
            > .wptb-row:not(.wptb-row-responsive) {
                > td:not(.pof-column-hide):not(.pof-action-header):not(.pof-action-cell) {
                    box-sizing: border-box !important;
                    width: 1% !important;
                    min-width: 108px !important;
                    padding: 0 0 0 16px !important;
                    color: #343434 !important;
                    background: #fff !important;
                    border: 0 !important;
                    font-size: 14px !important;
                    font-weight: 400 !important;
                    line-height: 16px !important;
                    vertical-align: middle !important;

                    .wptb-cell-content,
                    .wptb-text-container,
                    .wptb-text-container > div,
                    .wptb-text-container p {
                        margin: 0 !important;
                        padding: 0 !important;
                        color: inherit !important;
                        font: inherit !important;
                        line-height: inherit !important;
                    }
                }

                &:first-child {
                    > td:not(.pof-column-hide):not(.pof-action-header):not(.pof-action-cell) {
                        padding: 8px 0 8px 16px !important;
                        color: #343434 !important;
                        background: #e9e7e6 !important;
                        border: 0 !important;
                        font-size: 14px !important;
                        font-weight: 500 !important;
                        line-height: 20px !important;
                        text-align: left;
                        vertical-align: middle !important;

                        strong {
                            font-weight: inherit;
                        }
                    }
                }

                &:nth-child(odd):not(:first-child) {
                    > td:not(.pof-column-hide) {
                        background: #f8f7f7 !important;
                    }
                }
            }

            > .wptb-row.wptb-row-responsive {
                > td:not(.pof-column-hide) {
                    box-sizing: border-box !important;
                    padding: 10px 16px !important;
                    color: #343434 !important;
                    border: 0 !important;
                    font-size: 14px !important;
                    line-height: 20px !important;
                    vertical-align: middle !important;

                    .wptb-cell-content,
                    .wptb-text-container,
                    .wptb-text-container > div,
                    .wptb-text-container p {
                        margin: 0 !important;
                        padding: 0 !important;
                        color: inherit !important;
                        font: inherit !important;
                        line-height: inherit !important;
                    }
                }

                > td:first-child:not(.pof-action-cell) {
                    width: 46% !important;
                    background: #e9e7e6 !important;
                    font-weight: 500 !important;
                }

                > td:last-child:not(.pof-action-label) {
                    width: 54% !important;
                    font-weight: 400 !important;
                }
            }
        }
    }

    .pof-action-header,
    .pof-action-cell {
        position: sticky !important;
        right: 0 !important;
        z-index: 2;
        box-sizing: border-box !important;
        width: auto !important;
        min-width: 190px !important;
        padding: 10px 16px !important;
        border: 0 !important;
        vertical-align: middle !important;
    }

    .pof-action-header {
        z-index: 3;
        background: #e9e7e6 !important;
    }

    .pof-action-label {
        box-sizing: border-box;
        padding: 8px 16px;
        color: #343434;
        background: #e9e7e6;
        border: 0;
        font-size: 14px;
        font-weight: 500;
        text-align: left;
        vertical-align: middle;
    }

    .pof-action-cell {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        text-align: right;

        .pof-select-item {
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            width: 158px;
            min-width: 158px;
            min-height: 36px;
            margin: 0;
            padding: 6px 16px;
            color: #fff !important;
            background: #c02031;
            border: 1px solid #c02031;
            border-radius: 4px;
            font-size: 14px;
            font-weight: 700;
            line-height: 22px;
            text-align: center;
            text-decoration: none !important;
            text-transform: uppercase;
            white-space: nowrap;

            &:hover,
            &:focus {
                color: #fff !important;
                background: #9f1a29;
                border-color: #9f1a29;
            }

            &:focus-visible {
                outline: 2px solid #202631;
                outline-offset: 2px;
            }

            > span {
                margin-right: 10px;
                font-size: 24px;
                font-weight: 300;
                line-height: .75;
            }

            > b {
                font: inherit;
            }
        }
    }
}

.pof-row-hide,
.pof-column-hide {
    display: none !important;
}

/* Empty state and pagination below the table */
.pof-after {
    .pof-empty {
        margin: 16px 0;
        padding: 18px;
        color: #78202c;
        background: #fff5f6;
        border: 1px solid #efc6cb;
        border-radius: 4px;
        font-weight: 600;
        text-align: center;

        &[hidden] {
            display: none !important;
        }
    }

    .pof-footer {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        width: 100%;
        margin-top: 18px;

        > label {
            color: var(--muted);
            font-size: 14px;
            font-weight: 600;
            white-space: nowrap;

            select {
                min-width: 68px;
                height: 38px;
                margin: 0 7px;
                padding: 6px 28px 6px 10px;
                color: var(--text);
                background: #fff;
                border: 1px solid #b8c0ca;
                border-radius: 4px;
                font: inherit;
            }
        }

        .pof-pages {
            display: flex;
            align-items: center;
            gap: 6px;

            &[hidden] {
                display: none !important;
            }

            button {
                display: inline-flex;
                align-items: center;
                justify-content: center;
                min-width: 38px;
                height: 38px;
                margin: 0;
                padding: 6px 10px;
                color: #3f4752;
                background: #fff;
                border: 1px solid #c6ccd4;
                font: inherit;
                cursor: pointer;

                &:hover:not(:disabled),
                &.is-active {
                    color: #fff;
                    background: var(--brand);
                    border-color: var(--brand);
                }

                &:disabled {
                    opacity: .45;
                    cursor: not-allowed;
                }

                &:focus-visible {
                    outline: 2px solid var(--brand);
                    outline-offset: 2px;
                }
            }

            > button {
                min-width: 86px;

                @media (max-width: 767px) {
                    min-width: 78px;
                }
            }

            .pof-page-numbers {
                display: flex;
                align-items: center;
                gap: 6px;

                i {
                    min-width: 18px;
                    color: var(--muted);
                    text-align: center;
                }

                @media (max-width: 767px) {
                    flex-wrap: wrap;
                    justify-content: center;
                }
            }

            @media (max-width: 767px) {
                justify-content: space-between;
                width: 100%;
            }
        }

        @media (max-width: 767px) {
            align-items: stretch;
            flex-direction: column;
        }
    }
}

/* Contact form and accessibility helpers */
#wpforms-166661.pof-selected-form {
    scroll-margin-top: 110px;
}

.pof-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
