.ravita-product-filter {
    --rvpf-border: #e6eaed;
    --rvpf-bg: #ffffff;
    --rvpf-soft: #f6f8f9;
    --rvpf-muted: #727b82;
    --rvpf-text: #1b252b;
    --rvpf-accent: #075d73;
    --rvpf-accent-soft: #edf6f8;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 14px;
    box-sizing: border-box;
    border: 1px solid var(--rvpf-border);
    border-radius: 14px;
    background: var(--rvpf-bg);
    color: var(--rvpf-text);
    font-size: 13px;
    line-height: 1.7;
}

.ravita-product-filter *,
.ravita-product-filter *::before,
.ravita-product-filter *::after {
    box-sizing: border-box;
}

.rvpf-heading,
.rvpf-title-wrap,
.rvpf-actions,
.rvpf-stock,
.rvpf-option,
.rvpf-price,
.rvpf-chip,
.rvpf-categories a {
    display: flex;
    align-items: center;
}

.rvpf-heading {
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 11px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--rvpf-border);
}

.rvpf-title-wrap {
    min-width: 0;
    gap: 7px;
}

.rvpf-heading strong {
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
}

.rvpf-active-count,
.rvpf-summary-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--rvpf-accent-soft);
    color: var(--rvpf-accent);
    font-size: 11px;
    font-weight: 700;
}

.rvpf-reset {
    flex: 0 0 auto;
    color: var(--rvpf-accent);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.rvpf-reset:hover {
    text-decoration: underline;
}

.rvpf-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.rvpf-chip {
    max-width: 100%;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid #d9e9ed;
    border-radius: 999px;
    background: var(--rvpf-accent-soft);
    color: var(--rvpf-accent);
    font-size: 11px;
    line-height: 1.5;
    text-decoration: none;
}

.rvpf-chip span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rvpf-chip b {
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: 400;
    line-height: 1;
}

.rvpf-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    align-items: start;
}

.rvpf-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 1px solid var(--rvpf-border);
    border-radius: 10px;
    background: var(--rvpf-bg);
    overflow: hidden;
}

.rvpf-group > summary {
    position: relative;
    display: flex;
    align-items: center;
    gap: 7px;
    min-height: 40px;
    padding: 8px 11px 8px 32px;
    cursor: pointer;
    font-weight: 750;
    list-style: none;
    user-select: none;
}

.rvpf-group > summary::-webkit-details-marker {
    display: none;
}

.rvpf-group > summary::after {
    content: '';
    position: absolute;
    left: 12px;
    width: 7px;
    height: 7px;
    border-left: 1.5px solid var(--rvpf-muted);
    border-bottom: 1.5px solid var(--rvpf-muted);
    transform: rotate(-45deg);
    transition: transform .16s ease;
}

.rvpf-group[open] > summary::after {
    transform: rotate(135deg);
}

.rvpf-group[open] > summary {
    border-bottom: 1px solid var(--rvpf-border);
}

.rvpf-summary-count {
    margin-inline-start: auto;
}

.rvpf-options {
    display: grid;
    gap: 2px;
    max-height: 245px;
    padding: 7px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.rvpf-sort-options {
    max-height: none;
}

.rvpf-option {
    gap: 8px;
    min-height: 34px;
    padding: 4px 5px;
    border-radius: 7px;
    cursor: pointer;
    transition: background-color .12s ease;
}

.rvpf-option:hover {
    background: var(--rvpf-soft);
}

.rvpf-option.is-disabled {
    opacity: .42;
    cursor: default;
}

.rvpf-option.is-disabled:hover {
    background: transparent;
}

.rvpf-option span {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.rvpf-option small,
.rvpf-categories small {
    flex: 0 0 auto;
    min-width: 25px;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--rvpf-soft);
    color: var(--rvpf-muted);
    font-size: 10px;
    line-height: 1.6;
    text-align: center;
}

.rvpf-option input,
.rvpf-stock input {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 0;
    border: 1.5px solid #bac4ca;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}

.rvpf-sort-option input[type="radio"] {
    border-radius: 50%;
}

.rvpf-option input:checked,
.rvpf-stock input:checked {
    border-color: var(--rvpf-accent);
    background: var(--rvpf-accent);
    box-shadow: inset 0 0 0 3px #fff;
}

.rvpf-option input:focus-visible,
.rvpf-stock input:focus-visible,
.rvpf-price input:focus-visible {
    outline: 2px solid var(--rvpf-accent);
    outline-offset: 1px;
}

.rvpf-categories {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2px;
    max-height: 250px;
    padding: 7px;
    overflow: auto;
    scrollbar-width: thin;
}

.rvpf-categories a {
    gap: 8px;
    min-height: 34px;
    padding: 5px 7px;
    border-radius: 7px;
    color: inherit;
    text-decoration: none;
}

.rvpf-categories a:hover {
    background: var(--rvpf-soft);
}

.rvpf-categories a span {
    flex: 1;
    min-width: 0;
}

.rvpf-categories a.is-active {
    background: var(--rvpf-accent-soft);
    color: var(--rvpf-accent);
    font-weight: 750;
}

.rvpf-price {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 5px;
    padding: 10px;
}

.rvpf-price input {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 5px 7px;
    border: 1px solid #d7dde1;
    border-radius: 7px;
    background: var(--rvpf-bg);
    color: var(--rvpf-text);
    font: inherit;
    direction: ltr;
    text-align: center;
    font-size: 11px;
}

.rvpf-price span {
    color: var(--rvpf-muted);
    font-size: 11px;
}

.rvpf-stock {
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid var(--rvpf-border);
    border-radius: 10px;
    cursor: pointer;
}

.rvpf-stock:hover {
    background: var(--rvpf-soft);
}

.rvpf-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    margin-top: 2px;
}

.rvpf-actions button {
    width: 100%;
    min-height: 40px;
    padding: 7px 12px;
    border: 1px solid var(--rvpf-accent);
    border-radius: 9px;
    background: var(--rvpf-accent);
    color: #fff;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
    transition: opacity .12s ease, transform .12s ease;
}

.rvpf-actions button:hover {
    opacity: .92;
}

.rvpf-actions button:active {
    transform: translateY(1px);
}

@media (max-width: 640px) {
    .ravita-product-filter {
        padding: 12px;
        border-radius: 12px;
    }

    .rvpf-options,
    .rvpf-categories {
        max-height: 210px;
    }

    .rvpf-sort-options {
        max-height: none;
    }

    .rvpf-actions {
        position: sticky;
        bottom: 8px;
        z-index: 3;
        padding-top: 6px;
        background: var(--rvpf-bg);
    }
}
