/* Compact, progressively enhanced brand multi-select. */
.filter-sidebar .facetwp-facet-at_brand[data-type="checkboxes"] {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    max-height: 288px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-gutter: stable;
    margin-bottom: 0;
    padding: 3px;
}
.filter-sidebar .facetwp-facet-at_brand .facetwp-checkbox {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 64px;
    margin: 0 !important;
    padding: 6px 4px !important;
    background: #fff !important;
    border: 1px solid #dce4ea;
    border-radius: 4px;
    text-align: center;
    color: #263f51;
}
.filter-sidebar .facetwp-facet-at_brand .facetwp-display-value { width: 100%; }
.atl-brand-art { display: flex; align-items: center; justify-content: center; height: 26px; width: 100%; margin-bottom: 4px; }
.atl-brand-logo { display: block; width: 100%; height: 26px; object-fit: contain; }
.atl-brand-wordmark { font-size: 12px; font-weight: 700; color: #0079bd; line-height: 1.1; }
.atl-brand-name { display: block; font-size: 10px; line-height: 1.2; font-weight: 600; overflow-wrap: anywhere; }
.filter-sidebar .facetwp-facet-at_brand .facetwp-counter { display: none; }
.atl-brand-has-selection .facetwp-checkbox:not(.checked) .atl-brand-art { filter: grayscale(1); opacity: .40; }
.atl-brand-has-selection .facetwp-checkbox:not(.checked) .atl-brand-name { color: #677581; }
.filter-sidebar .facetwp-facet-at_brand .facetwp-checkbox.checked { border-color: #007cba; background: #f1f8fd !important; box-shadow: inset 0 0 0 1px #007cba; }
.filter-sidebar .facetwp-facet-at_brand .facetwp-checkbox.checked::after { content: '\2713'; position: absolute; top: 0; right: 3px; color: #007cba; font-size: 12px; font-weight: 700; }
@media (hover: hover) and (pointer: fine) {
    .filter-sidebar .facetwp-facet-at_brand .facetwp-checkbox:hover { border-color: #007cba; }
}
.filter-sidebar .facetwp-facet-at_brand .facetwp-checkbox:focus-visible { outline: 2px solid #007cba; outline-offset: 1px; }
.filter-sidebar .facetwp-facet-at_brand .facetwp-checkbox.disabled { cursor: not-allowed; border-style: dashed; }
.atl-brand-art--jaco { background: #075b8c; border-radius: 2px; padding: 3px; }
.filter-sidebar .atl-brand-header { margin-bottom: 0 !important; gap: 8px; }
.filter-sidebar .atl-brand-header > .wp-block-column:first-child { flex-basis: auto !important; flex-grow: 1; min-width: 0; }
.filter-sidebar .atl-brand-header > .wp-block-column.align-right { flex-basis: auto !important; flex-grow: 0; }
.filter-sidebar .atl-brand-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px;
    padding: 0; border: 0; border-radius: 0; box-shadow: none;
    background: transparent; color: inherit; text-align: left;
    font: inherit; text-transform: inherit; cursor: pointer;
}
.atl-brand-toggle::after {
    content: ''; width: 7px; height: 7px; border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor; transform: rotate(45deg); flex-shrink: 0; margin: 0 3px 4px 0;
}
.atl-brand-toggle[aria-expanded="true"]::after { transform: rotate(225deg); margin-bottom: -3px; }
.filter-sidebar .atl-brand-selection-count { margin-left: auto; color: #5f6c76; font-size: 11px; font-weight: 400; text-transform: none; white-space: nowrap; }
.filter-sidebar .atl-brand-summary { margin: 0; font-size: 12px; line-height: 1.4; color: #007cba; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.filter-sidebar .atl-brand-body { margin-top: 10px; }
.filter-sidebar input.atl-brand-search { box-sizing: border-box; width: 100%; max-width: 100%; height: 34px; padding: 5px 9px; margin: 0 0 7px; font-size: 13px; border-radius: 4px; }
.filter-sidebar .atl-brand-search-status { font-size: 12px; color: #5f6c76; margin: 0; }
.filter-sidebar .atl-brand-search-status:not(:empty) { margin-top: 8px; }
.filter-sidebar .atl-brand-toggle:focus-visible { outline: 2px solid #007cba; outline-offset: 2px; }
.filter-sidebar .atl-brand-body[hidden], .filter-sidebar .atl-brand-summary[hidden],
.filter-sidebar .atl-brand-search[hidden], .filter-sidebar .facetwp-facet-at_brand .facetwp-checkbox[hidden] { display: none !important; }
@media (max-width: 480px) {
    .filter-sidebar input.atl-brand-search { font-size: 16px; }
}

/* Native EWP-style text rows and quantity badges; logo option remains intact. */
.filter-sidebar .facetwp-facet-at_brand.atl-brand-list {
    display: block; max-height: none; overflow: visible; padding: 0; scrollbar-gutter: auto;
}
.filter-sidebar .facetwp-facet-at_brand.atl-brand-list .facetwp-checkbox {
    flex-direction: row; justify-content: space-between; gap: 8px;
    min-height: 0; margin: 0 !important; padding: 5px 0 !important;
    background: none !important; border: 0; border-radius: 0; box-shadow: none;
    text-align: left; color: var(--wd-link-color);
}
.filter-sidebar .facetwp-facet-at_brand.atl-brand-list .facetwp-checkbox:first-child { padding-top: 0 !important; }
.filter-sidebar .facetwp-facet-at_brand.atl-brand-list .facetwp-checkbox:last-child { padding-bottom: 0 !important; }
.filter-sidebar .facetwp-facet-at_brand.atl-brand-list .facetwp-checkbox::before,
.filter-sidebar .facetwp-facet-at_brand.atl-brand-list .facetwp-checkbox::after { display: none; }
.filter-sidebar .facetwp-facet-at_brand.atl-brand-list .facetwp-display-value { flex: 1; min-width: 0; width: auto; }
.filter-sidebar .facetwp-facet-at_brand.atl-brand-list .atl-brand-name { font-size: inherit; line-height: inherit; font-weight: 400; color: inherit; }
.filter-sidebar .facetwp-facet-at_brand.atl-brand-list .facetwp-counter {
    display: block; box-sizing: border-box; flex-shrink: 0; padding: 0 5px;
    min-width: 30px; height: 20px; border: 1px solid #ddd; border-radius: 35px;
    text-align: center; font-size: 12px; line-height: 18px;
}
.filter-sidebar .facetwp-facet-at_brand.atl-brand-list .facetwp-checkbox.checked { color: var(--wd-link-color-hover); }
.filter-sidebar .facetwp-facet-at_brand.atl-brand-list .facetwp-checkbox.checked .facetwp-counter {
    color: #fff; background: var(--wd-primary-color); border-color: var(--wd-primary-color);
}
@media (hover: hover) and (pointer: fine) {
    .filter-sidebar .facetwp-facet-at_brand.atl-brand-list .facetwp-checkbox:hover { color: var(--wd-link-color-hover); }
}
/* Top-five brand list, native-style See all, and keyboard-accessible accordion. */
.filter-sidebar .atl-brand-section-toggle {
    display: flex; align-items: center; gap: 8px; width: 100%; padding: 0;
    min-height: 24px; border: 0; border-radius: 0; box-shadow: none;
    background: transparent; color: inherit; font: inherit; text-align: left;
    text-transform: inherit; cursor: pointer;
}
.atl-brand-section-toggle::after {
    content: ''; flex-shrink: 0; width: 7px; height: 7px; margin: 0 3px 0 1px;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
}
.atl-brand-section-toggle[aria-expanded="true"]::after { transform: rotate(45deg); margin-bottom: 4px; }
.filter-sidebar .atl-brand-list-selected { margin-left: auto; font-size: 11px; font-weight: 400; text-transform: none; color: #677581; }
.filter-sidebar .atl-brand-see-all {
    display: inline-flex; align-items: center; gap: 7px; min-height: 32px;
    margin: 6px 0 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
    background: transparent; color: var(--wd-primary-color); cursor: pointer;
    font: inherit; text-transform: none; text-decoration: underline;
}
.atl-brand-see-all::before { content: '+'; font-size: 21px; line-height: 1; font-weight: 400; text-decoration: none; }
.atl-brand-see-all[aria-expanded="true"]::before { content: '\2212'; }
.filter-sidebar .atl-brand-section-toggle:focus-visible,
.filter-sidebar .atl-brand-see-all:focus-visible { outline: 2px solid var(--wd-primary-color); outline-offset: 3px; }
.filter-sidebar .atl-brand-list-body[hidden], .filter-sidebar .atl-brand-see-all[hidden] { display: none !important; }
/* Let the heading arrow use the full row when Reset is inactive. */
.filter-sidebar .atl-brand-list-widget .facetwp-slider-header-row > .wp-block-column:first-child { flex-basis: 0 !important; flex-grow: 1; min-width: 0; }
.filter-sidebar .atl-brand-list-widget .facetwp-slider-header-row > .wp-block-column.align-right { flex-basis: auto !important; flex-grow: 0; }
.filter-sidebar .atl-brand-list-widget .facetwp-slider-header-row:not(.has-active-reset) > .wp-block-column.align-right { display: none; }
/* Brand selection is staged locally; Apply replaces Reset only while dirty. */
.filter-sidebar .facetwp-slider-header-row.has-brand-draft > .wp-block-column.align-right { display: block !important; }
.filter-sidebar .facetwp-slider-header-row.has-brand-draft .atlantis-facet-reset { display: none !important; }
.filter-sidebar .atl-brand-apply {
    min-height: 30px; margin: 0; padding: 4px 10px; border: 1px solid var(--wd-primary-color);
    border-radius: 3px; box-shadow: none; background: var(--wd-primary-color); color: #fff;
    font-size: 12px; font-weight: 600; line-height: 1.2; text-transform: none; cursor: pointer;
}
.filter-sidebar .atl-brand-apply:disabled { cursor: wait; opacity: .65; }
.filter-sidebar .atl-brand-pending-note { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 11px; line-height: 1.4; color: #677581; }
.filter-sidebar .atl-brand-cancel { min-height: 24px; margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; color: var(--wd-primary-color); font-size: 11px; font-weight: 400; text-transform: none; text-decoration: underline; cursor: pointer; }
.filter-sidebar .atl-brand-apply:focus-visible, .filter-sidebar .atl-brand-cancel:focus-visible { outline: 2px solid var(--wd-primary-color); outline-offset: 2px; }
.filter-sidebar .atl-brand-apply[hidden], .filter-sidebar .atl-brand-pending-note[hidden] { display: none !important; }
/* Hidden Apply must not leave WordPress flow margins below Reset. */
.filter-sidebar .atl-brand-list-widget .facetwp-slider-header-row.has-active-reset > .wp-block-column.align-right,
.filter-sidebar .atl-brand-header.has-active-reset > .wp-block-column.align-right,
.filter-sidebar .facetwp-slider-header-row.has-brand-draft > .wp-block-column.align-right {
    display: flex !important; align-items: center; align-self: stretch; justify-content: flex-end;
}
.filter-sidebar .atl-brand-list-widget .facetwp-slider-header-row > .wp-block-column.align-right > *,
.filter-sidebar .atl-brand-header > .wp-block-column.align-right > * { margin: 0 !important; }
/* The product grid may load while brands remain interactive. */
.filter-sidebar .facetwp-facet-at_brand.atl-brand-live.is-loading { opacity: 1; pointer-events: auto; }
.filter-sidebar .atl-brand-cancel[hidden] { display: none !important; }
