.hide {
    display: none !important;
}
.show {
    display: block !important;
}

.product-filter-wrapper {
    width: 100%;
    margin-bottom: 2rem;

    .filter-sort-bar {
        display: grid;
        grid-template-columns: 4fr 1fr;
        gap: 20px;

        .sort-bar {
            .sorting-options {
                display: flex;
                padding: 1.5rem 0;

                label {
                    margin: 0;
                    color: var(--text-black);
                    text-transform: uppercase;
                    width: 105px;
                    font-weight: 500;
                    font-size: var(--text-sm);
                }

                select {
                    border: none;
                    height: auto;
                    line-height: 1;
                    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
                    background-repeat: no-repeat;
                    background-position: right 12px center;
                    background-size: 20px 20px;
                    padding-right: 30px;
                    appearance: none;
                    -webkit-appearance: none;
                    -moz-appearance: none;
                }
            }
        }
    }

    .active-filters {
        margin-top: 10px;
        margin-bottom: 10px;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
        text-transform: uppercase;
        padding: 18px 0;
        border-top: 1px solid var(--border-light);
        border-bottom: 1px solid var(--border-light);

        span {
            .filter-by-text {
                font-size: 14px;
                color: var(--text-secondary);
                margin-right: 0.5rem;
                font-weight: 500;
            }
        }

        .active-filter {
            background: var(--background-dark);
            border: 1px solid var(--border-dark);
            color: var(--text-white);
            padding: 0.25rem 1.2rem;
            font-size: 14px;
            display: flex;
            align-items: center;
            gap: 0.8rem;

            .remove-filter {
                background: transparent;
                border: none;
                cursor: pointer;
                color: var(--text-white);
                font-size: 24px;
                line-height: 1;
                padding: 0;
                display: flex;
                align-items: center;

                &:hover {
                    color: #666;
                }
            }
        }

        .clear-filters {
            text-transform: uppercase;
            background: transparent;
            border: none;
            cursor: pointer;
            font-size: 14px;
            text-decoration: underline;
            padding: 0.25rem 0.5rem;

            &:hover {
                color: #666;
            }
        }
    }
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.5rem 0;
}

.filter-left {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    flex: 1;
}

.filter-right {
    display: flex;
    align-items: center;
}

.filter-dropdown {
    position: relative;
    z-index: 10;
}

.filter-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
    white-space: nowrap;
    position: relative;
    z-index: 11;
}

.filter-btn:hover {
    color: #666;
}

.filter-btn svg {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.filter-dropdown.active .filter-btn svg {
    transform: rotate(180deg);
}

.filter-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 0.5rem;
}

.filter-dropdown.active .filter-dropdown-menu {
    display: block;
}

.filter-option {
    padding: 0.75rem 1rem;
    font-size: 14px;
    color: #1a1a1a;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: block;
}

.filter-option:hover {
    background-color: #f5f5f5;
}

.filter-option.selected {
    background-color: #f0f0f0;
    font-weight: 500;
}

.filter-option input[type="radio"] {
    display: none;
}

.sort-dropdown .filter-btn {
    color: #1a1a1a;
}

.sort-label {
    font-weight: 400;
}

.filter-divider {
    width: 100%;
    height: 1px;
    background-color: #e5e5e5;
    margin: 1rem 0;
}

.product-count {
    font-size: 16px;
    color: #1a1a1a;
    padding: 0.5rem 0;
}

.count-number {
    font-weight: 600;
}

.product-loop-wrapper.loading {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Make sure product loop supports ordering */
#products-archive-loop {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

@media (max-width: 768px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-left {
        flex-direction: column;
        gap: 0.5rem;
    }

    .filter-right {
        justify-content: flex-start;
    }

    .filter-btn {
        width: 100%;
        justify-content: space-between;
        padding: 1rem;
        border: 1px solid #e5e5e5;
        border-radius: 4px;
    }

    .filter-dropdown-menu {
        width: 100%;
        left: 0;
        right: 0;
    }
}
