/* Category-only skin derived from the original BAG88 storefront palette. */
.catalog-category-page {
  --catalog-primary: #7f87ab;
  --catalog-primary-dark: #5d6385;
  --catalog-primary-pale: #f0f2f7;
  --catalog-accent: #c0996d;
  --catalog-ink: #333;
  --catalog-muted: #666;
  --catalog-line: #eaeaf0;
  --catalog-soft: #f8f8fb;
  background: #fff;
  color: var(--catalog-ink);
}

/* Desktop keeps the filter actions visible in the toolbar. */
@media (min-width: 761px) {
  .catalog-category-page .catalog-toolbar {
    position: relative;
    display: flex !important;
    align-items: flex-start;
    min-height: 116px;
    padding: 13px 0 57px;
    border-bottom: 0;
  }
  .catalog-category-page .catalog-toolbar .title-block {
    display: flex;
    width: 100%;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--catalog-line);
  }
  .catalog-category-page .catalog-toolbar .title-block h1 {
    min-width: 0;
  }
  .catalog-category-page .catalog-toolbar .title-block p {
    margin-left: auto;
    color: var(--catalog-primary-dark);
    font-weight: 700;
    white-space: nowrap;
  }
  .catalog-category-page .catalog-toolbar .toolbar-actions {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 9px;
  }
  .catalog-category-page .mobile-filter-toggle {
    display: none !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #d9dbe7;
    border-radius: 4px;
    background: #fff;
    color: var(--catalog-primary-dark);
    cursor: pointer;
    position: static;
    grid-column: 1;
    grid-row: 1;
    white-space: nowrap;
  }
  .catalog-category-page .mobile-filter-toggle:hover {
    border-color: var(--catalog-primary);
    background: var(--catalog-primary-pale);
  }
  .catalog-category-page .mobile-filter-toggle b {
    min-width: 19px;
    height: 19px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: var(--catalog-primary);
    color: #fff;
    font-size: 10px;
  }
  .catalog-category-page .desktop-clear-filters {
    display: none !important;
  }
  .catalog-category-page .desktop-clear-filters:hover {
    background: #f7e4d8;
  }
  .catalog-category-page .catalog-toolbar .toolbar-actions > label {
    grid-column: 4;
    grid-row: 1;
  }
  .catalog-category-page .catalog-toolbar .toolbar-actions > select {
    grid-column: 5;
    grid-row: 1;
  }
  .catalog-category-page .mobile-active-filters {
    display: flex !important;
    align-items: center;
    gap: 7px;
    width: calc(100% - 280px);
    min-height: 40px;
    margin-top: -48px;
    margin-bottom: 14px;
    padding: 4px 0 5px;
    border: 0;
    background: transparent;
  }
  .catalog-category-page .mobile-active-filters > .active-filter-chip {
    display: inline-flex;
    align-items: center;
    height: 38px;
    margin-left: 0 !important;
    padding: 4px 7px 4px 10px;
    border: 1px solid var(--catalog-primary-dark);
    border-radius: 4px;
    background: var(--catalog-primary-dark);
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto;
    position: relative;
    z-index: 2;
  }
  .catalog-category-page .mobile-active-filters > .active-filter-chip:hover {
    background: #4d567c;
    color: #fff !important;
  }
  .catalog-category-page .mobile-active-filters .active-filter-remove {
    width: 19px;
    height: 19px;
    margin-left: 8px !important;
    border-radius: 50%;
    background: #fff;
    color: var(--catalog-primary-dark) !important;
    font-size: 0 !important;
  }
  .catalog-category-page .mobile-active-filters .active-filter-remove::after {
    color: var(--catalog-primary-dark);
    font-size: 14px;
    font-weight: 700;
  }
  .catalog-category-page .mobile-active-filters .active-filters-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    margin-left: 0 !important;
    padding: 4px 11px;
    border: 1px solid #c38b69;
    border-radius: 4px;
    background: #fff5ef;
    color: #985c3b !important;
    font-size: 12px;
    font-weight: 700;
    pointer-events: auto;
    position: relative;
    z-index: 2;
  }
  .catalog-category-page .mobile-active-filters .active-filters-clear { display: inline-flex; }
}

.catalog-category-page .service-bar {
  background: #69739b;
}

.catalog-category-page .service-points {
  color: #fff;
}

.catalog-category-page .service-points span::before {
  background: var(--catalog-accent);
}

.catalog-category-page .service-inner > a {
  border-left-color: rgba(255, 255, 255, .28);
}

.catalog-category-page .site-header {
  border-bottom-color: var(--catalog-line);
}

.catalog-category-page .brand-word {
  background: var(--catalog-primary);
}

.catalog-category-page .brand-number,
.catalog-category-page .main-nav a:hover,
.catalog-category-page .main-nav a.active {
  color: var(--catalog-primary-dark);
}

.catalog-category-page .brand-mark small {
  color: #7b7b84;
}

.catalog-category-page .site-search input {
  border-color: #d9dbe7;
}

.catalog-category-page .site-search input:focus {
  border-color: var(--catalog-primary);
  outline-color: #e5e7f0;
}

.catalog-category-page .site-search button {
  border-color: var(--catalog-primary);
  background: var(--catalog-primary);
}

.catalog-category-page .site-search button:hover {
  background: var(--catalog-primary-dark);
}

.catalog-category-page .header-contact {
  border-color: #d9dbe7;
  color: var(--catalog-primary-dark);
}

.catalog-category-page .main-nav,
.catalog-category-page .catalog-toolbar {
  border-color: var(--catalog-line);
}

.catalog-category-page .main-nav a.active::after {
  background: var(--catalog-primary);
}

.catalog-category-page .breadcrumbs {
  color: #888;
}

.catalog-category-page .breadcrumbs a:hover,
.catalog-category-page .active-filters a,
.catalog-category-page .empty-state a {
  color: var(--catalog-primary);
}

.catalog-category-page .catalog-filter-board {
  margin-top: 12px;
  border: 1px solid var(--catalog-line);
  background: #fff;
}

.catalog-category-page .catalog-filter-row {
  display: grid;
  grid-template-columns: 106px minmax(0, 1fr);
  min-height: 51px;
  border-bottom: 1px solid var(--catalog-line);
}

.catalog-category-page .catalog-filter-row:last-child {
  border-bottom: 0;
}

.catalog-category-page .catalog-filter-row h2 {
  display: flex;
  align-items: flex-start;
  margin: 0;
  padding: 15px 16px;
  border-right: 1px solid var(--catalog-line);
  background: var(--catalog-soft);
  color: var(--catalog-ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 20px;
}

.catalog-category-page .catalog-filter-options {
  display: flex;
  align-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-width: 0;
  padding: 9px 12px;
}

.catalog-category-page .catalog-filter-options a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 31px;
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--catalog-muted);
  white-space: nowrap;
}

.catalog-category-page .catalog-filter-options a:hover {
  border-color: #d9dbe7;
  background: var(--catalog-soft);
  color: var(--catalog-primary-dark);
}

.catalog-category-page .catalog-filter-options a.selected {
  border-color: var(--catalog-primary);
  background: var(--catalog-primary);
  color: #fff;
}

.catalog-category-page .brand-category-row h2 {
  padding: 0;
}

.catalog-category-page .brand-category-row h2 a {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  padding: 12px 16px;
  color: var(--catalog-ink);
  font-weight: 700;
}

.catalog-category-page .brand-category-row h2 a:hover {
  color: var(--catalog-primary-dark);
  background: var(--catalog-primary-pale);
}

.catalog-category-page .catalog-filter-options small {
  color: #999;
  font-size: 10px;
}

.catalog-category-page .brand-category-row .catalog-filter-options small {
  margin-left: -3px;
}

.catalog-category-page .catalog-filter-options a.selected small {
  color: rgba(255, 255, 255, .78);
}

.catalog-category-page .catalog-brand-row {
  align-items: stretch;
  gap: 8px;
  padding-block: 10px;
}

.catalog-category-page .catalog-filter-options .catalog-brand-option {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 5px 10px;
  border-color: transparent;
  background: transparent;
}

.catalog-category-page .catalog-filter-options .catalog-brand-option:hover {
  border-color: #d9dbe7;
  background: var(--catalog-soft);
}

.catalog-category-page .catalog-filter-options .catalog-brand-option.selected {
  border-color: var(--catalog-primary);
  background: var(--catalog-primary);
  color: #fff;
  box-shadow: none;
}

.catalog-category-page .catalog-brand-logo {
  display: grid;
  width: 72px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #efeff3;
  border-radius: 3px;
  background: #fff;
}

.catalog-category-page .catalog-brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.catalog-category-page .catalog-brand-logo-all {
  color: var(--catalog-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.catalog-category-page .catalog-brand-copy {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  gap: 4px;
  padding-left: 0;
  line-height: 1.25;
}

.catalog-category-page .catalog-brand-copy strong {
  max-width: none;
  overflow: visible;
  color: var(--catalog-ink);
  font-size: inherit;
  font-weight: 400;
  text-overflow: clip;
}

.catalog-category-page .catalog-brand-copy small {
  margin-top: 0;
  color: #92939c;
  font-size: 12px;
  font-weight: 400;
}

.catalog-category-page .catalog-brand-option.selected .catalog-brand-copy strong {
  color: #fff;
}

.catalog-category-page .catalog-brand-option.selected .catalog-brand-copy small {
  color: rgba(255, 255, 255, .78);
}

/* The expand control is only needed when the compact mobile grid is collapsed. */
.catalog-category-page .catalog-brand-toggle {
  display: none;
}

.catalog-category-page .title-block h1 {
  color: var(--catalog-primary);
  font-weight: 500;
  letter-spacing: 0;
}

.catalog-category-page .title-block p,
.catalog-category-page .toolbar-actions > label {
  color: #777;
}

.catalog-category-page .toolbar-actions select {
  border-color: #d9dbe7;
  color: var(--catalog-ink);
}

.catalog-category-page .catalog-layout-wide {
  display: block;
}

.catalog-category-page .active-filters {
  display: none;
}

.catalog-category-page .active-filters span {
  border-color: #d9dbe7;
  color: var(--catalog-primary-dark);
}

.catalog-category-page .product-card {
  padding-bottom: 12px;
  border: 1px solid var(--catalog-line);
  border-radius: 6px;
  overflow: hidden;
}

.catalog-category-page .product-image {
  border: 0;
  border-bottom: 1px solid #eee;
  border-radius: 6px 6px 0 0;
  background: #f8f8f8;
}

.catalog-category-page .product-info {
  padding: 10px 10px 0;
}

.catalog-category-page .product-card:hover .product-image {
  border-color: #d9dbe7;
  box-shadow: 0 8px 18px rgba(63, 66, 87, .08);
}

.catalog-category-page .product-badge {
  border-color: #dfc8af;
  color: #8a6845;
}

.catalog-category-page .product-brand,
.catalog-category-page .product-info h2 a:hover {
  color: var(--catalog-primary);
}

.catalog-category-page .product-tags span {
  background: rgba(127, 135, 171, .1);
  color: var(--catalog-primary-dark);
}

.catalog-category-page .product-bottom strong {
  color: var(--catalog-primary);
}

.catalog-category-page .product-bottom > a {
  border-color: #c9cbd8;
  color: #777;
}

.catalog-category-page .product-bottom > a:hover {
  border-color: var(--catalog-primary);
  color: var(--catalog-primary-dark);
}

.catalog-category-page .pagination a {
  border-color: #dddfe8;
}

.catalog-category-page .pagination a:hover,
.catalog-category-page .pagination a.active {
  border-color: var(--catalog-primary);
  background: var(--catalog-primary);
}

.catalog-category-page .empty-state {
  border-color: var(--catalog-line);
  background: var(--catalog-soft);
}

@media (max-width: 760px) {
  .catalog-category-page .mobile-active-filters {
    display: flex;
    margin-top: 0;
  }
  .catalog-category-page .results > .active-filters {
    display: none;
  }
  .catalog-category-page .toolbar-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .catalog-category-page .mobile-filter-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 124px;
  }
  .catalog-category-page .toolbar-actions {
    justify-content: flex-end;
    gap: 8px;
  }

  .catalog-category-page .toolbar-actions select {
    width: 145px;
  }

  .catalog-category-page .catalog-filter-row {
    grid-template-columns: 76px minmax(0, 1fr);
    min-height: 48px;
  }

  .catalog-category-page .catalog-filter-row h2 {
    align-items: center;
    padding: 11px 10px;
    font-size: 12px;
  }

  .catalog-category-page .catalog-filter-options {
    flex-wrap: nowrap;
    gap: 5px;
    padding: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .catalog-category-page .catalog-filter-options a {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 4px 9px;
  }

  .catalog-category-page .catalog-brand-row {
    align-items: stretch;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    max-height: 88px;
    overflow: hidden;
    transition: max-height .2s ease;
  }

  .catalog-category-page .catalog-brand-row.is-expanded {
    max-height: 2000px;
  }

  .catalog-category-page .catalog-brand-row .catalog-brand-option {
    min-width: 0;
  }

  .catalog-category-page .catalog-brand-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 2px 8px 8px;
    padding: 4px 8px;
    border: 0;
    background: transparent;
    color: var(--catalog-primary-dark);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
  }

  .catalog-category-page .catalog-brand-toggle > span:last-child {
    font-size: 15px;
    line-height: 10px;
    transform: rotate(0deg);
    transition: transform .2s ease;
  }

  .catalog-category-page .catalog-brand-toggle[aria-expanded="true"] > span:last-child {
    transform: rotate(180deg);
  }

  .catalog-category-page .catalog-filter-options .catalog-brand-option {
    display: flex;
    align-items: center;
    min-height: 31px;
    padding: 4px 9px;
  }

  .catalog-category-page .catalog-brand-row .catalog-brand-option {
    width: auto;
  }

  .catalog-category-page .catalog-brand-logo {
    width: 62px;
    height: 40px;
  }

  .catalog-category-page .catalog-brand-copy {
    min-width: 0;
    padding-left: 0;
  }

  .catalog-category-page .product-card {
    padding-bottom: 10px;
  }
}

/* Mobile-only toolbar: keep the result count with the controls instead of the desktop title block. */
@media (max-width: 760px) {
  .catalog-category-page .catalog-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    min-height: 0;
    padding: 12px 0 10px;
  }
  .catalog-category-page .catalog-toolbar .title-block {
    display: flex;
    width: 100%;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }
  .catalog-category-page .catalog-toolbar .title-block h1 {
    min-width: 0;
    max-width: 70%;
    font-size: 20px;
  }
  .catalog-category-page .catalog-toolbar .title-block p {
    margin-left: auto;
    color: var(--catalog-primary-dark);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
  }
  .catalog-category-page .catalog-toolbar .toolbar-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    margin-top: 10px;
    gap: 8px;
  }
  .catalog-category-page .catalog-toolbar .toolbar-actions select,
  .catalog-category-page .catalog-toolbar .mobile-filter-toggle {
    width: 100% !important;
    min-width: 0;
    height: 40px;
  }
  .catalog-category-page .mobile-active-filters {
    flex-wrap: wrap;
    align-items: center;
    padding: 7px 0 9px;
    margin-bottom: 0;
    border-top: 1px solid var(--catalog-line);
  }
  .catalog-category-page .mobile-active-filters > .active-filter-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    margin-left: 0 !important;
    padding: 4px 7px 4px 10px;
    border: 1px solid var(--catalog-primary-dark);
    border-radius: 4px;
    background: var(--catalog-primary-dark);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
  }
  .catalog-category-page .mobile-active-filters > .active-filter-chip:hover {
    color: #fff;
  }
  .catalog-category-page .mobile-active-filters .active-filter-remove {
    width: 19px;
    height: 19px;
    margin-left: 8px !important;
    border-radius: 50%;
    background: #fff;
    color: var(--catalog-primary-dark) !important;
    font-size: 0 !important;
  }
  .catalog-category-page .mobile-active-filters .active-filter-remove::after {
    color: var(--catalog-primary-dark);
    font-size: 14px;
    font-weight: 700;
  }
  .catalog-category-page .mobile-active-filters .active-filters-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    margin-left: 0 !important;
    padding: 4px 11px;
    border: 1px solid #c38b69;
    border-radius: 4px;
    background: #fff5ef;
    color: #985c3b !important;
    font-size: 12px;
    font-weight: 700;
    pointer-events: auto;
    position: relative;
    z-index: 2;
  }
}

@media (max-width: 380px) {
  .catalog-category-page .toolbar-actions select {
    width: 118px;
  }

}


/* Unified mobile category and brand filter disclosure. */
.catalog-category-page .catalog-filter-toggle { display: none; }
@media (max-width: 760px) {
  .catalog-category-page .catalog-filter-board {
    position: relative;
    padding-bottom: 0;
  }
  .catalog-category-page .catalog-filter-board .catalog-filter-row {
    display: none;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .catalog-category-page .catalog-filter-board.is-expanded .catalog-filter-row {
    display: block;
  }
  .catalog-category-page .catalog-filter-board .catalog-filter-row h2 {
    display: block;
    padding: 11px 12px 6px;
    border-right: 0;
    background: transparent;
    font-size: 12px;
    line-height: 18px;
  }
  .catalog-category-page .catalog-filter-board .catalog-filter-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    max-height: none;
    padding: 0 10px 10px;
    overflow: visible;
  }
  .catalog-category-page .catalog-filter-board .catalog-filter-options a {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 4px 9px;
  }
  .catalog-category-page .catalog-filter-board .catalog-brand-row {
    display: flex;
    max-height: none;
    overflow: visible;
    transition: none;
  }
  .catalog-category-page .catalog-filter-board .catalog-brand-row .catalog-brand-option {
    width: auto;
    min-width: 0;
  }
  .catalog-category-page .catalog-filter-board .catalog-brand-toggle {
    display: none;
  }
  .catalog-category-page .search-brand-options.is-collapsed {
    max-height: var(--search-brand-collapsed-height, 246px) !important;
    overflow: hidden !important;
  }
  .catalog-category-page .search-brand-toggle {
    margin: 0 10px 10px;
  }
  .catalog-category-page .catalog-filter-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 42px;
    padding: 9px 12px;
    border: 0;
    border-top: 1px solid var(--catalog-line);
    background: var(--catalog-soft);
    color: var(--catalog-primary-dark);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
  }
  .catalog-category-page .catalog-filter-toggle .catalog-toggle-caret {
    display: inline-flex;
    width: 8px;
    height: 6px;
    align-items: center;
    justify-content: center;
    transform: rotate(0deg);
    transition: transform .2s ease;
  }
  .catalog-category-page .catalog-filter-toggle .catalog-toggle-caret svg {
    display: block;
    width: 8px;
    height: 6px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.25;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .catalog-category-page .catalog-filter-toggle[aria-expanded="true"] .catalog-toggle-caret {
    transform: rotate(180deg);
  }
  .catalog-category-page .brand-category-row h2 {
    padding: 0;
  }
  .catalog-category-page .brand-category-row h2 a {
    min-height: 38px;
    padding: 9px 12px 5px;
  }
}

/* Compact brand-product filters: concise desktop rows and a mobile bottom sheet. */
.catalog-category-page .brand-filter-sheet-header,
.catalog-category-page .brand-filter-sheet-footer {
  display: none;
}

.catalog-category-page .brand-compact-filter .brand-filter-sheet-body {
  display: contents;
}

.catalog-category-page .brand-compact-filter .brand-child-category-row {
  grid-template-columns: 106px minmax(0, 1fr) auto;
}

.catalog-category-page .brand-compact-filter .brand-child-category-options {
  max-height: none;
  overflow: visible;
}

/* Brand pages expose every available child category, avoiding a parent-page round trip. */
.catalog-category-page .brand-category-direct-row {
  align-items: stretch;
}

.catalog-category-page .brand-category-direct-panel {
  min-width: 0;
  padding: 10px 12px 12px;
}

.catalog-category-page .brand-category-direct-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.catalog-category-page .brand-category-direct-group {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 8px;
  min-width: 0;
  align-items: start;
  padding: 8px 0;
  border-top: 1px solid #ececf2;
}

.catalog-category-page .brand-category-direct-group.is-active {
  border-top-color: #c5c9dc;
  background: linear-gradient(90deg, rgba(127, 135, 171, .08), transparent 70%);
}

.catalog-category-page .brand-category-direct-parent {
  display: flex;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--catalog-ink);
}

.catalog-category-page .brand-category-direct-parent:hover,
.catalog-category-page .brand-category-direct-parent.selected {
  background: var(--catalog-primary-pale);
  color: var(--catalog-primary-dark);
}

.catalog-category-page .brand-category-direct-parent strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-category-page .brand-category-direct-children {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px 6px;
  padding-left: 6px;
}

.catalog-category-page .brand-category-direct-children a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--catalog-muted);
  font-size: 12px;
  white-space: nowrap;
}

.catalog-category-page .brand-category-direct-children a:hover {
  border-color: #d9dbe7;
  background: var(--catalog-soft);
  color: var(--catalog-primary-dark);
}

.catalog-category-page .brand-category-direct-children a.selected {
  border-color: var(--catalog-primary);
  background: var(--catalog-primary);
  color: #fff;
}

.catalog-category-page .brand-category-direct-children small {
  color: #999daf;
  font-size: 10px;
}

.catalog-category-page .brand-category-direct-children a.selected small {
  color: rgba(255, 255, 255, .78);
}

.catalog-category-page .brand-child-toggle,
.catalog-category-page .brand-picker-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: var(--catalog-primary-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.catalog-category-page .brand-child-toggle {
  min-width: 112px;
  margin: 8px 10px 8px 0;
  padding: 5px 8px;
}

.catalog-category-page .brand-child-toggle:hover,
.catalog-category-page .brand-picker-toggle:hover {
  color: #444b70;
  background: var(--catalog-primary-pale);
}

.catalog-category-page .brand-child-toggle .catalog-toggle-caret,
.catalog-category-page .brand-picker-toggle .catalog-toggle-caret {
  display: inline-flex;
  width: 8px;
  height: 6px;
  transition: transform .2s ease;
}

.catalog-category-page .brand-child-toggle .catalog-toggle-caret svg,
.catalog-category-page .brand-picker-toggle .catalog-toggle-caret svg {
  width: 8px;
  height: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.catalog-category-page .brand-child-toggle[aria-expanded="true"] .catalog-toggle-caret,
.catalog-category-page .brand-picker-toggle[aria-expanded="true"] .catalog-toggle-caret {
  transform: rotate(180deg);
}

.catalog-category-page .brand-current-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 12px;
}

.catalog-category-page .search-brand-content {
  min-width: 0;
}

.catalog-category-page .search-brand-options {
  align-items: center;
  max-height: none;
  overflow: visible;
}

.catalog-category-page .search-brand-options.is-collapsed {
  max-height: var(--search-brand-collapsed-height, 123px);
  overflow: hidden;
}

.catalog-category-page .search-brand-toggle {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 6px;
  margin: 0 12px 10px;
  padding: 5px 10px;
  border: 1px solid #d9dbe7;
  border-radius: 4px;
  background: #fff;
  color: var(--catalog-primary-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.catalog-category-page .search-brand-toggle:hover {
  border-color: var(--catalog-primary);
  background: var(--catalog-primary-pale);
}

.catalog-category-page .search-brand-toggle .catalog-toggle-caret {
  display: inline-flex;
  width: 8px;
  height: 6px;
  transition: transform .2s ease;
}

.catalog-category-page .search-brand-toggle .catalog-toggle-caret svg {
  width: 8px;
  height: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.catalog-category-page .search-brand-toggle[aria-expanded="true"] .catalog-toggle-caret {
  transform: rotate(180deg);
}

.catalog-category-page .brand-current-chip {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  padding: 5px 11px;
  border-radius: 4px;
  background: var(--catalog-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.catalog-category-page .brand-picker-toggle {
  min-height: 31px;
  padding: 5px 10px;
  border: 1px solid #d9dbe7;
  border-radius: 4px;
  background: #fff;
}

.brand-filter-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 940;
  background: rgba(22, 27, 42, .38);
}

.brand-filter-sheet-backdrop[hidden],
.brand-picker-panel[hidden] {
  display: none;
}

.brand-picker-panel {
  grid-column: 2;
  margin: 0 12px 12px;
  overflow: hidden;
  border: 1px solid #dfe1eb;
  border-radius: 6px;
  background: #fafbfe;
}

.brand-filter-sheet-header button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #777d8f;
  cursor: pointer;
  font-size: 27px;
  line-height: 1;
}

.brand-picker-search {
  padding: 12px 18px 8px;
}

.brand-picker-search input {
  width: 100%;
  height: 40px;
  padding: 0 13px;
  border: 1px solid #d9dbe7;
  border-radius: 5px;
  outline: 0;
}

.brand-picker-search input:focus {
  border-color: var(--catalog-primary);
  box-shadow: 0 0 0 2px rgba(127, 135, 171, .14);
}

.brand-picker-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 2px 18px 10px;
  border-bottom: 1px solid var(--catalog-line);
}

.brand-picker-letters button {
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  border: 1px solid #e0e2eb;
  border-radius: 4px;
  background: #fff;
  color: #676d7d;
  cursor: pointer;
  font-size: 12px;
}

.brand-picker-letters button:hover,
.brand-picker-letters button.is-active {
  border-color: var(--catalog-primary);
  background: var(--catalog-primary);
  color: #fff;
}

.brand-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(39px, max-content);
  align-content: start;
  gap: 7px;
  padding: 13px 18px 18px;
  overflow: visible;
}

.brand-picker-grid a {
  min-width: 0;
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid #e5e6ed;
  border-radius: 4px;
  color: var(--catalog-ink);
}

.brand-picker-grid a[hidden] {
  display: none !important;
}

.brand-picker-grid a:hover {
  border-color: var(--catalog-primary);
  background: var(--catalog-primary-pale);
}

.brand-picker-grid a.selected {
  border-color: var(--catalog-primary);
  background: var(--catalog-primary);
  color: #fff;
}

.brand-picker-grid a span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-picker-grid a small {
  color: #989cab;
  font-size: 10px;
}

.brand-picker-grid a.selected small {
  color: rgba(255, 255, 255, .78);
}

.brand-picker-empty {
  margin: 0;
  padding: 35px 18px;
  color: var(--catalog-muted);
  text-align: center;
}

body.brand-filter-sheet-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .catalog-category-page .brand-compact-filter {
    position: fixed;
    z-index: 945;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: min(86vh, 760px);
    display: none;
    flex-direction: column;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 12px 12px 0 0;
    background: #fff;
    box-shadow: 0 -12px 38px rgba(24, 29, 48, .22);
  }

  .catalog-category-page .brand-compact-filter.is-sheet-open {
    display: flex;
  }

  .catalog-category-page .brand-compact-filter .brand-filter-sheet-header,
  .catalog-category-page .brand-compact-filter .brand-filter-sheet-footer {
    display: flex;
    flex: 0 0 auto;
  }

  .catalog-category-page .brand-filter-sheet-header {
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 0 16px;
    border-bottom: 1px solid var(--catalog-line);
  }

  .catalog-category-page .brand-filter-sheet-header strong {
    font-size: 16px;
  }

  .catalog-category-page .brand-compact-filter .brand-filter-sheet-body {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .catalog-category-page .brand-compact-filter .catalog-filter-row,
  .catalog-category-page .catalog-filter-board.brand-compact-filter .catalog-filter-row {
    display: block;
    min-height: 0;
    border-bottom: 1px solid var(--catalog-line);
  }

  .catalog-category-page .brand-compact-filter .catalog-filter-row h2 {
    display: block;
    padding: 11px 12px 5px;
    border: 0;
    background: transparent;
    font-size: 12px;
  }

  .catalog-category-page .brand-compact-filter .catalog-filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: none;
    padding: 0 10px 11px;
    overflow: visible;
  }

  .catalog-category-page .brand-compact-filter .catalog-filter-options a {
    flex: 0 0 auto;
  }

  .catalog-category-page .brand-compact-filter .brand-child-category-options {
    max-height: none;
    overflow: visible;
  }

  .catalog-category-page .brand-compact-filter .brand-category-direct-row {
    display: block;
  }

  .catalog-category-page .brand-category-direct-panel {
    padding: 2px 10px 11px;
  }

  .catalog-category-page .brand-category-direct-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .catalog-category-page .brand-category-direct-group {
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 6px;
    padding: 8px 0;
  }

  .catalog-category-page .brand-category-direct-parent {
    padding-inline: 6px;
  }

  .catalog-category-page .brand-category-direct-children {
    gap: 5px;
    padding-left: 4px;
  }

  .catalog-category-page .brand-category-direct-children a {
    min-height: 31px;
    padding: 4px 7px;
  }

  .catalog-category-page .brand-current-control {
    justify-content: space-between;
    padding: 0 10px 11px;
  }

  .catalog-category-page .brand-filter-sheet-footer {
    align-items: center;
    gap: 9px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--catalog-line);
    background: #fff;
  }

  .catalog-category-page .brand-filter-sheet-footer a,
  .catalog-category-page .brand-filter-sheet-footer button {
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 700;
  }

  .catalog-category-page .brand-filter-sheet-footer a {
    flex: 0 0 105px;
    border: 1px solid #d9dbe7;
    background: #fff;
    color: var(--catalog-primary-dark);
  }

  .catalog-category-page .brand-filter-sheet-footer button {
    flex: 1 1 auto;
    border: 1px solid var(--catalog-primary);
    background: var(--catalog-primary);
    color: #fff;
  }

  .brand-filter-sheet-backdrop {
    z-index: 940;
  }

  .brand-picker-panel {
    margin: 0 10px 11px;
    overflow: visible;
  }

  .brand-picker-search {
    padding: 10px 12px 7px;
  }

  .brand-picker-letters {
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    padding: 3px 12px 11px;
    overflow: visible;
  }

  .brand-picker-letters button {
    flex: 0 0 calc((100% - 36px) / 7);
    min-width: 0;
    height: 34px;
    padding: 0 3px;
  }

  .brand-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    padding: 11px 10px 13px;
    overflow: visible;
  }
}
