/* Compact active-filter rail and stable mobile sort/filter toolbar. */
body#category #js-active-search-filters .active-filters__list {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  overflow: hidden;
}

body#category #js-active-search-filters .active-filters__item {
  flex: 0 1 auto;
  min-width: 0;
}

body#category #js-active-search-filters .active-filters__title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body#category #js-active-search-filters .active-filters__link {
  display: inline-flex;
  align-items: center;
  max-width: none;
  min-height: 1.55rem;
  padding: 0.12rem 0.4rem;
  overflow: visible;
  border: 0;
  border-radius: 0.45rem;
  background: #f7f7f8;
  color: rgba(33, 37, 41, 0.64);
  font-size: 0.7rem;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: none;
}

body#category #js-active-search-filters .active-filters__link .material-icons {
  flex: 0 0 auto;
  margin-left: 0.25rem;
  color: rgba(33, 37, 41, 0.4);
  font-size: 0.85rem;
}

body#category #js-active-search-filters .active-filters__link:is(:hover, :focus-visible) {
  background: rgba(229, 0, 125, 0.07);
  color: #212529;
}

body#category #js-active-search-filters .active-filters__link:is(:hover, :focus-visible) .material-icons {
  color: var(--bs-primary);
}

body#category #js-active-search-filters:not(.plassimo-active-filters--expanded) .plassimo-active-filter--extra {
  display: none;
}

body#category #js-active-search-filters.plassimo-active-filters--expanded .active-filters__list {
  flex-wrap: wrap;
  overflow: visible;
}

body#category #js-active-search-filters.plassimo-active-filters--expanded .active-filters__item {
  display: inline-flex;
}

body#category #js-active-search-filters .plassimo-active-filters-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.75rem;
}

body#category #js-active-search-filters .plassimo-active-filters-toggle,
body#category #js-active-search-filters .plassimo-active-filters-clear {
  border: 0;
  padding: 0.18rem 0.25rem;
  background: transparent;
  color: rgba(33, 37, 41, 0.62);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
}

body#category #js-active-search-filters .plassimo-active-filters-toggle {
  border-radius: 0.45rem;
  background: rgba(229, 0, 125, 0.07);
  color: var(--bs-primary);
}

body#category #js-active-search-filters .plassimo-active-filters-toggle:is(:hover, :focus-visible),
body#category #js-active-search-filters .plassimo-active-filters-clear:is(:hover, :focus-visible) {
  color: var(--bs-primary);
}

body#category #js-product-list-top .products__sort-dropdown .dropdown-menu {
  padding: 0.375rem;
  border: 1px solid #e5e2e6;
  border-radius: 0.625rem;
  background: #fff;
  box-shadow: 0 0.75rem 2rem rgba(31, 28, 33, 0.12);
}

body#category #js-product-list-top .products__sort-dropdown {
  position: relative;
}

body#category #js-product-list-top .products__sort-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.45rem;
  color: #353238;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.25;
}

body#category #js-product-list-top .products__sort-dropdown .dropdown-item:is(:hover, :focus-visible) {
  background: #f7f4f6;
  color: #212025;
}

@media (min-width: 768px) {
  /* CSS-first cap prevents a flash before the enhancement runs. */
  body#category #js-active-search-filters:not(.plassimo-active-filters--expanded)
    .active-filters__list > .active-filters__item:nth-child(n + 6):not(.plassimo-active-filters-actions) {
    display: none;
  }

  body#category #js-product-list-top .products__selection {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
  }

  body#category #js-product-list-top .products__count {
    flex: 1 1 auto;
    margin: 0;
    color: rgba(33, 37, 41, 0.62);
    font-size: 0.8125rem;
  }

  body#category #js-product-list-top .products__sort {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
    padding: 0;
    border-radius: 0.625rem;
    background: transparent;
  }

  body#category #js-product-list-top .products__sort-label {
    display: none;
  }

  body#category #js-product-list-top .products__sort-dropdown {
    width: 12rem;
  }

  body#category #js-product-list-top .products__sort-dropdown-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid #e5e2e6;
    border-radius: 0.625rem;
    background: #fff;
    box-shadow: none;
    color: #353238;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.2;
  }

  body#category #js-product-list-top .products__sort-dropdown-button::after {
    content: '' !important;
    flex: 0 0 1.125rem;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0 !important;
    border: 0 !important;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23353238' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
    transition: transform 160ms ease;
  }

  body#category #js-product-list-top .products__sort-dropdown-button[aria-expanded='true']::after {
    transform: rotate(180deg);
  }

  body#category #js-product-list-top .products__sort-dropdown-button:is(:hover, :focus-visible) {
    border-color: #cfcbd0;
    background: #fff;
  }

  body#category #js-product-list-top .products__sort-dropdown-button:focus-visible {
    outline: 2px solid rgba(237, 0, 140, 0.24);
    outline-offset: 2px;
  }

  body#category #js-product-list-top .products__sort-dropdown .dropdown-menu {
    width: 100%;
    min-width: 100%;
    margin-top: 0.375rem !important;
  }

  body#category #js-product-list-top .products__filter-button {
    display: none;
  }
}

@media (max-width: 767.98px) {
  /* Keep the mobile header completely clean; the breadcrumb separates content. */
  #header .header-bottom {
    border-bottom: 0 !important;
  }

  #header {
    box-shadow: none !important;
  }

  #wrapper > .breadcrumb__wrapper {
    background-color: #fbfbfc;
  }

  #wrapper > .breadcrumb__wrapper .breadcrumb {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
    font-size: 0.75rem;
    line-height: 1.25;
  }

  body#category .category__header {
    margin-top: -0.4rem;
  }

  /* Keep result metadata useful but visually secondary. */
  body#category #js-product-list-top .products__selection {
    margin-bottom: 0.55rem;
  }

  body#category #js-product-list-top .products__count {
    color: rgba(33, 37, 41, 0.62);
    font-size: 0.75rem;
    line-height: 1.35;
  }

  body#category #js-active-search-filters .active-filters__list {
    gap: 0.3rem;
    margin-bottom: 0.6rem;
  }

  body#category #js-active-search-filters .active-filters__title {
    color: inherit;
  }

  body#category #js-active-search-filters .active-filters__item:first-child {
    align-items: center;
    display: inline-flex;
  }

  body#category #js-active-search-filters .active-filters__link {
    max-width: none;
  }

  body#category #js-active-search-filters:not(.plassimo-active-filters--expanded) .plassimo-active-filter--extra {
    display: none;
  }

  /* Prevent a flash of every filter before JavaScript enhances the list. */
  body#category #js-active-search-filters:not(.plassimo-active-filters--expanded)
    .active-filters__list > .active-filters__item:nth-child(n + 3):not(.plassimo-active-filters-actions) {
    display: none;
  }

  body#category #js-active-search-filters.plassimo-active-filters--expanded
    .active-filters__list > .active-filters__item {
    display: inline-flex;
  }

  body#category #js-product-list-top .products__sort {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 7.5rem;
    gap: 0;
    align-items: stretch;
    overflow: visible;
    min-width: 0;
    padding: 0;
    border: 1px solid #ebe8eb;
    border-radius: 0.625rem;
    background: #f7f7f8;
  }

  body#category #js-product-list-top .products__sort-dropdown,
  body#category #js-product-list-top .products__sort-dropdown-button,
  body#category #js-product-list-top .products__filter-button {
    min-width: 0;
    width: 100%;
  }

  body#category #js-product-list-top .products__sort-dropdown-button {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    gap: 0.5rem;
    white-space: nowrap;
    min-height: 2.75rem;
    height: 2.75rem;
    padding: 0 0.875rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #353238;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.2;
  }

  body#category #js-product-list-top .products__sort-dropdown-button .plassimo-sort-label {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  body#category #js-product-list-top .products__sort-dropdown-button::after {
    content: '' !important;
    flex: 0 0 auto;
    width: 1.125rem;
    height: 1.125rem;
    margin: 0;
    align-self: center;
    border: 0 !important;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23353238' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
    transition: transform 160ms ease;
  }

  body#category #js-product-list-top .products__sort-dropdown-button[aria-expanded='true']::after {
    transform: rotate(180deg);
  }

  body#category #js-product-list-top .products__filter-button {
    flex-wrap: nowrap;
    justify-content: center;
    white-space: nowrap;
    gap: 0.5rem;
    min-height: 2.75rem;
    height: 2.75rem;
    padding: 0 0.875rem;
    border: 0 !important;
    border-left: 1px solid #e5e2e6 !important;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #353238;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.2;
  }

  body#category #js-product-list-top .products__filter-button .material-icons {
    display: inline-block;
    flex: 0 0 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    overflow: hidden;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23353238' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h10'/%3E%3Cpath d='M18 7h2'/%3E%3Ccircle cx='16' cy='7' r='2'/%3E%3Cpath d='M4 17h2'/%3E%3Cpath d='M10 17h10'/%3E%3Ccircle cx='8' cy='17' r='2'/%3E%3C/svg%3E");
    color: transparent;
    font-size: 0;
    line-height: 1;
  }

  body#category #js-product-list-top .products__sort-dropdown-button:focus-visible,
  body#category #js-product-list-top .products__filter-button:focus-visible {
    outline: 2px solid #ed008c;
    outline-offset: -3px;
  }

  body#category #js-product-list-top .products__sort-dropdown .dropdown-menu {
    z-index: 1030;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    margin-top: 0.375rem !important;
  }

  body#category .ps-facetedsearch--mobile.offcanvas {
    --bs-offcanvas-width: 100vw;
    width: 100vw;
    max-width: 100vw;
  }

  body#category .products__sort.plassimo-mobile-controls--fixed {
    position: fixed;
    top: var(--plassimo-mobile-header-height, 52px);
    left: 0;
    z-index: 1010;
    box-sizing: border-box;
    width: 100vw;
    height: 2.875rem;
    padding: 0 12px;
    background: #fff !important;
    border: 0;
    border-top: 1px solid #f1eef1;
    border-bottom: 1px solid #e5e2e6;
    box-shadow: none;
    animation: none !important;
    transition: none !important;
    border-radius: 0 !important;
    overflow: visible;
  }

  body#category .products__sort.plassimo-mobile-controls--fixed .products__sort-dropdown .dropdown-menu {
    z-index: 1040;
    max-height: calc(100vh - var(--plassimo-mobile-header-height, 52px) - 3.5rem);
    overflow-y: auto;
  }

  body#category .products__sort.plassimo-mobile-controls--fixed .products__sort-dropdown-button,
  body#category .products__sort.plassimo-mobile-controls--fixed .products__filter-button {
    background: #fff;
  }

  body#category .products__sort.plassimo-mobile-controls--fixed .products__sort-dropdown-button,
  body#category .products__sort.plassimo-mobile-controls--fixed .products__filter-button {
    min-height: 2.75rem;
    height: 2.75rem;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 0.9375rem;
    line-height: 1.2;
  }

  body#category .plassimo-mobile-controls-placeholder {
    display: none;
    height: 0;
  }
}
