/**
 * WPFilters Styles
 *
 * Custom styles for WPFilters plugin.
 * This file is automatically enqueued via wp_enqueue_style().
 *
 * @package BlockParty
 */

/* Filters search bar */
.wpfilters-element-search {
    .wpfilters-search-input {
        position: relative;
        display: block;
        width: 100%;
        color: #2D2F73 !important;
        border-radius: 1rem !important;
        border: 1px solid #E7E7F4 !important;
        padding: 1.5rem 2rem !important;
        box-sizing: border-box;
    }
}

/* Filters reset button */
.wpfilters-element-reset_filters {
    .wpfilters-reset-button {
        position: relative;
        width: 100%;
        padding: 14px 30px;
        box-sizing: border-box;
        text-align: center;
        text-transform: uppercase;
        letter-spacing: .5px;
        font-size: 10px;
        line-height: 1;
        font-weight: bold;
        color: #2D2F73;
        background-color: #ffffff;
        border: 1px solid #2D2F73;
        border-radius: 80px;
        cursor: pointer;

        &:hover {
            text-decoration: underline;
        }
    }
}

/* Filters checkbox */
.wpfilters-element-radio,
.wpfilters-element-checkbox {
    .wpfilters-element-title {
        font-size: 1rem;
        line-height: 1.5;
        text-transform: uppercase;
    }

    .wpfilters-items-list {
        gap: 1rem !important;

        > .wpfilters-element-item {
            position: relative;
            padding-top: 1rem;
            border-top: 1px solid var(--wp--preset--color--bleu-7, #E7E7F4);

            &:first-of-type {
                padding-top: 0;
                border-top: none;
            }

            .wpfilters-element-item-label {
                padding-left: 24px;

                &::before {
                    width: 16px;
                    height: 16px;
                }
            }
        }

        > .wpfilters-element-item-children {
            display: flex;
            flex-direction: column;
            gap: 10px;
            padding-left: 4px;

            .wpfilters-element-item-label {
                padding-left: 24px;

                &::before {
                    width: 12px;
                    height: 12px;
                }
            }
        }

        > .wpfilters-element-item,
        > .wpfilters-element-item-children {
            .wpfilters-element-item-input {
                position: absolute;
                opacity: 0;
                cursor: pointer;
                width: 0;
                height: 0;
            }

            .wpfilters-element-item-label {
                position: relative;
                padding-left: 24px;
                cursor: pointer;
                user-select: none;

                &::before {
                    position: absolute;
                    content: "";
                    left: 0;
                    top: 9px;
                    transform: translateY(-50%);
                    background: url('../../images/checkbox-empty.png') no-repeat center center;
                    background-size: contain;
                    box-sizing: border-box;
                    border-radius: 50%;
                    transition: all 0.2s ease;
                }
            }

            .wpfilters-element-item-input:checked + .wpfilters-element-item-label {
                font-weight: bold;

                &::before {
                    background: url('../../images/checkbox-checked.png') no-repeat center center;
                    background-size: contain;
                }
            }
        }
    }
}

/* Filters checkbox in details */
details.wpfilters-element-radio,
details.wpfilters-element-checkbox {
    background-color: var(--wp--preset--color--bleu-8, #f5f5fb);
    border-radius: 10px;
    box-sizing: border-box;
    transition: background-color ease .3s;

    &:hover {
        background-color: var(--wp--preset--color--bleu-7, #f5f5fb);
    }

    &[open] {
        &:hover {
            background-color: var(--wp--preset--color--bleu-8, #f5f5fb);
        }

        .wpfilters-element-title {
            &::after {
                border-color: var(--wp--preset--color--turquoise, #6BC4D1);
                transform: rotate(45deg) rotateX(-180deg);
            }
        }
    }

    .wpfilters-element-title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        list-style: none;
        padding: 20px 30px;
        box-sizing: border-box;
        cursor: pointer;

        &::-webkit-details-marker {
            display: none;
        }

        &::after {
            content: '';
            display: block;
            width: 8px;
            height: 8px;
            border-bottom: 2px solid var(--wp--preset--color--bleu-4, #5A5B91);
            border-left: 2px solid var(--wp--preset--color--bleu-4, #5A5B91);
            box-sizing: border-box;
            transition: border-color, transform 0.2s ease;
            transform: rotate(-45deg) rotateX(0deg);
        }
    }

    .wpfilters-items-list {
        margin-top: 20px;
        padding: 0 30px 20px 30px;
        box-sizing: border-box;
    }
}

/* Filters checkbox not details */
div.wpfilters-element-checkbox {}
