.ml-category-controls {
    --ml-category-blue: #014782;
    --ml-category-border: #cad9e7;
}

.ml-category-toolbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    align-items: stretch;
    gap: 6px;
    margin: 0 0 12px;
}

.ml-category-toolbar::before,
.ml-category-toolbar::after {
    display: none;
}

.ml-category-action {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 6px 8px;
    border: 1px solid #cad9e7;
    border-radius: 9px;
    background: #fff;
    color: #014782;
    font: 800 14px/1.15 Manrope, Arial, sans-serif;
    text-align: center;
}

.ml-category-action[hidden],
.ml-category-find [hidden],
.ml-category-refine [hidden] {
    display: none !important;
}

.ml-category-action:focus-visible,
.ml-category-sort:has(#input-sort:focus-visible) .ml-category-action,
.ml-category-filter-dialog button:focus-visible {
    outline: 2px solid #b72164;
    outline-offset: 2px;
}

.ml-category-toolbar :is(.ml-category-filter-button, .ml-category-brands[aria-expanded="true"]) {
    border-color: var(--ml-category-blue);
    background: var(--ml-category-blue);
    color: #fff;
}

.ml-category-filter-button.is-active::after {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffb4d8;
}

.ml-category-refine .ml-category-find {
    display: none;
}

.ml-category-controls.has-brand-search {
    display: flex;
    flex-direction: column-reverse;
}

.has-brand-search .ml-category-refine:not(.is-expanded),
.has-brand-search .ml-category-refine-title {
    display: none;
}

.has-brand-search .ml-category-refine {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--ml-category-border);
    border-radius: 10px;
    background: #f1f6fa;
}

.has-brand-search .ml-category-find {
    display: block;
}

.ml-category-find input {
    height: 44px;
    margin-bottom: 8px;
    font-size: 16px;
}

.has-brand-search .ml-category-refine > .row {
    max-height: min(40vh, 300px);
    overflow-y: auto;
    overscroll-behavior: contain;
    margin-inline: 0;
}

.has-brand-search .ml-category-refine > .row > div {
    padding: 0;
}

.has-brand-search .ml-category-refine ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.has-brand-search .ml-category-refine li a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 6px 8px;
    border-bottom: 1px solid #dae5ee;
    font: 700 14px/1.3 Manrope, Arial, sans-serif !important;
    overflow-wrap: anywhere;
}

.ml-category-toolbar .ml-category-sort {
    width: auto;
    min-width: 0;
    padding: 0;
}

.ml-category-toolbar .ml-category-sort > div {
    position: relative;
    display: flex;
    margin: 0;
}

.ml-category-toolbar .ml-category-sort-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    padding: 0;
    border: 0;
}

.ml-category-toolbar .ml-category-sort-caption {
    display: flex;
    width: 100%;
    min-height: 44px;
    font-size: 13px;
    gap: 4px;
    padding-inline: 4px;
}

.ml-category-toolbar .ml-category-sort-caption::after {
    content: '';
    width: 6px;
    height: 6px;
    margin-top: -3px;
    border-right: 1px solid;
    border-bottom: 1px solid;
    transform: rotate(45deg);
}

.ml-category-toolbar .ml-category-sort #input-sort.form-control {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 44px;
    opacity: 0;
    font-size: 16px;
}

.ml-category-toolbar .ml-category-compare {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: start;
    padding: 0;
}

.ml-category-toolbar :is(.ml-category-compare, .ml-category-limit) .form-group {
    margin: 0;
}

.ml-category-toolbar .ml-category-compare a {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    padding: 4px 0;
}

.ml-category-toolbar .ml-category-limit {
    grid-row: 2;
    grid-column: 1 / -1;
    align-self: center;
    justify-self: end;
    width: auto;
    padding: 0;
}

.ml-category-limit .input-group-addon {
    padding-inline: 4px;
}

.ml-category-limit #input-limit.form-control {
    width: auto;
    min-height: 36px;
    font-size: 16px;
}

.bf-responsive.bf-active.ml-category-filter-ready > .bf-btn-show,
.bf-responsive.bf-active.ml-category-filter-ready > .bf-btn-reset {
    display: none;
}

.ml-category-filter-dialog[open] {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: auto 0 0;
    width: min(100%, 540px);
    max-width: 100%;
    max-height: 85vh;
    max-height: 85dvh;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 18px 18px 0 0;
    background: #fff;
    color: #102d45;
}

.ml-category-filter-dialog::backdrop {
    background: rgba(12, 29, 46, .55);
}

body:has(.ml-category-filter-dialog[open]) {
    overflow: hidden;
}

.ml-category-filter-heading,
.ml-category-filter-footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 14px;
}

.ml-category-filter-heading h2 {
    margin: 0;
    color: #014782;
    font: 800 20px/1.2 Manrope, Arial, sans-serif;
}

.ml-category-filter-close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 9px;
    background: #f1f6fa;
    color: #014782;
}

.ml-category-filter-footer {
    border-top: 1px solid #cad9e7;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
}

.ml-category-filter-footer .ml-category-apply {
    flex: 1;
    border-color: #014782;
    background: #014782;
    color: #fff;
}

.ml-category-filter-dialog > .bf-check-position {
    position: static;
    flex: 1 1 auto;
    width: 100% !important;
    max-height: none !important;
    margin: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 0;
    font: 500 14px/1.4 Manrope, Arial, sans-serif;
}

.ml-category-filter-dialog .bf-form {
    display: flex;
    flex-direction: column;
}

.ml-category-filter-dialog .bf-attr-header {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding-right: 32px;
    font-weight: 700;
}

.ml-category-filter-dialog .bf-arrow {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
}

.ml-category-filter-dialog .bf-attr-filter label {
    display: block;
    min-height: 38px;
    padding-block: 8px;
}

.ml-category-filter-dialog :is(.bf-range-min, .bf-range-max, .bf-search, .bf-form select) {
    min-height: 40px;
    max-width: 100%;
    font-size: 16px;
}

.ml-category-filter-dialog .bf-expanded {
    overflow-y: auto;
}

.ml-category-filter-dialog .bf-check-position > .box-heading,
.ml-category-filter-dialog .bf-buttonclear-box {
    display: none;
}
