/**
 * Plik: assets/css/pages/category.css
 *
 * Odpowiada za:
 * - wygląd strony kategorii / listingu zgodny ze stroną główną Cercasa
 * - breadcrumb, nagłówek kategorii, filtry, pasek sortowania, paginację
 *
 * Nie umieszczać tutaj:
 * - stylów karty produktu (product-card.css)
 * - @import
 *
 * Powiązane pliki:
 * - templates/catalog/_partials/category-header.tpl
 * - templates/catalog/_partials/products-top.tpl
 * - assets/css/tokens.css
 */

/* ——— Wspólne tło listingu ——— */
body#category,
body#search,
body#best-sales,
body#new-products,
body#prices-drop,
body#manufacturer,
body#supplier {
  --cercasa-cat-gutter: var(--cercasa-hero-gutter, clamp(1.25rem, 3vw, 3rem));
  --cercasa-cat-text: var(--cercasa-text, #1a1a1a);
  --cercasa-cat-muted: var(--cercasa-text-muted, #5a605b);
  --cercasa-cat-soft: var(--cercasa-text-soft, #8a908a);
  --cercasa-cat-line: #e6e8eb;
  --cercasa-cat-soft-bg: #f3f4f6;
  --cercasa-cat-bg: #fff;
  background: var(--cercasa-cat-bg);
  font-family: var(--cercasa-font-sans, "Poppins", sans-serif);
  overflow-x: clip;
}

body#category {
  --cercasa-cat-bg: #FCFBF9;
}

body#category #content,
body#category .page-content,
body#category #js-product-list {
  background: transparent;
}

body#category #wrapper,
body#search #wrapper,
body#best-sales #wrapper,
body#new-products #wrapper,
body#prices-drop #wrapper,
body#manufacturer #wrapper,
body#supplier #wrapper {
  max-width: 100%;
  overflow-x: clip;
  background: var(--cercasa-cat-bg);
}

/* Bootstrap container → gutter jak na home */
body#category .columns-container.container,
body#search .columns-container.container,
body#best-sales .columns-container.container,
body#new-products .columns-container.container,
body#prices-drop .columns-container.container,
body#manufacturer .columns-container.container,
body#supplier .columns-container.container {
  max-width: none;
  padding-inline: var(--cercasa-cat-gutter);
}

/* ——— Breadcrumb ——— */
body#category .breadcrumb__wrapper,
body#search .breadcrumb__wrapper,
body#best-sales .breadcrumb__wrapper,
body#new-products .breadcrumb__wrapper,
body#prices-drop .breadcrumb__wrapper,
body#manufacturer .breadcrumb__wrapper,
body#supplier .breadcrumb__wrapper {
  margin: 0;
  padding: 0.85rem 0;
  background: #fff;
  border-bottom: 1px solid var(--cercasa-cat-line);
}

body#category .breadcrumb__wrapper {
  background: transparent;
}

body#category .breadcrumb__wrapper .container,
body#search .breadcrumb__wrapper .container,
body#best-sales .breadcrumb__wrapper .container,
body#new-products .breadcrumb__wrapper .container,
body#prices-drop .breadcrumb__wrapper .container,
body#manufacturer .breadcrumb__wrapper .container,
body#supplier .breadcrumb__wrapper .container {
  max-width: none;
  padding-inline: var(--cercasa-cat-gutter);
}

body#category .breadcrumb,
body#search .breadcrumb,
body#best-sales .breadcrumb,
body#new-products .breadcrumb,
body#prices-drop .breadcrumb,
body#manufacturer .breadcrumb,
body#supplier .breadcrumb {
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--cercasa-cat-soft);
  background: transparent;
}

body#category .breadcrumb-item + .breadcrumb-item::before,
body#search .breadcrumb-item + .breadcrumb-item::before,
body#best-sales .breadcrumb-item + .breadcrumb-item::before,
body#new-products .breadcrumb-item + .breadcrumb-item::before,
body#prices-drop .breadcrumb-item + .breadcrumb-item::before,
body#manufacturer .breadcrumb-item + .breadcrumb-item::before,
body#supplier .breadcrumb-item + .breadcrumb-item::before {
  color: var(--cercasa-cat-soft);
  content: "/";
  padding-inline: 0.45rem;
}

body#category .breadcrumb-link,
body#search .breadcrumb-link,
body#best-sales .breadcrumb-link,
body#new-products .breadcrumb-link,
body#prices-drop .breadcrumb-link,
body#manufacturer .breadcrumb-link,
body#supplier .breadcrumb-link {
  color: var(--cercasa-cat-muted);
  text-decoration: none;
}

body#category .breadcrumb-link:hover,
body#search .breadcrumb-link:hover,
body#best-sales .breadcrumb-link:hover,
body#new-products .breadcrumb-link:hover,
body#prices-drop .breadcrumb-link:hover,
body#manufacturer .breadcrumb-link:hover,
body#supplier .breadcrumb-link:hover {
  color: var(--cercasa-cat-text);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* Aktualna pozycja w ścieżce */
body#category .breadcrumb-item:last-child > span,
body#search .breadcrumb-item:last-child > span,
body#best-sales .breadcrumb-item:last-child > span,
body#new-products .breadcrumb-item:last-child > span,
body#prices-drop .breadcrumb-item:last-child > span,
body#manufacturer .breadcrumb-item:last-child > span,
body#supplier .breadcrumb-item:last-child > span {
  color: #7A9A7E;
  font-weight: 500;
}

body#category .breadcrumb__scroller,
body#search .breadcrumb__scroller,
body#best-sales .breadcrumb__scroller,
body#new-products .breadcrumb__scroller,
body#prices-drop .breadcrumb__scroller,
body#manufacturer .breadcrumb__scroller,
body#supplier .breadcrumb__scroller {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

body#category .breadcrumb__scroller::-webkit-scrollbar,
body#search .breadcrumb__scroller::-webkit-scrollbar,
body#best-sales .breadcrumb__scroller::-webkit-scrollbar,
body#new-products .breadcrumb__scroller::-webkit-scrollbar,
body#prices-drop .breadcrumb__scroller::-webkit-scrollbar,
body#manufacturer .breadcrumb__scroller::-webkit-scrollbar,
body#supplier .breadcrumb__scroller::-webkit-scrollbar {
  display: none;
}

body#category .breadcrumb,
body#search .breadcrumb,
body#best-sales .breadcrumb,
body#new-products .breadcrumb,
body#prices-drop .breadcrumb,
body#manufacturer .breadcrumb,
body#supplier .breadcrumb {
  flex-wrap: nowrap;
  width: max-content;
  min-width: 100%;
}

body#category .breadcrumb-item,
body#search .breadcrumb-item,
body#best-sales .breadcrumb-item,
body#new-products .breadcrumb-item,
body#prices-drop .breadcrumb-item,
body#manufacturer .breadcrumb-item,
body#supplier .breadcrumb-item {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Tytuł listingu (wyszukiwanie / nowości itd.) — jak inne podstrony, nie hero H1 */
body#search #js-product-list-header,
body#best-sales #js-product-list-header,
body#new-products #js-product-list-header,
body#prices-drop #js-product-list-header,
body#manufacturer #js-product-list-header,
body#supplier #js-product-list-header {
  margin: 0;
  padding: 1.35rem 0 0;
}

body#search #js-product-list-header .page-title-section,
body#best-sales #js-product-list-header .page-title-section,
body#new-products #js-product-list-header .page-title-section,
body#prices-drop #js-product-list-header .page-title-section,
body#manufacturer #js-product-list-header .page-title-section,
body#supplier #js-product-list-header .page-title-section {
  margin: 0 0 1rem;
  padding: 0 0 0.85rem;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--cercasa-cat-text, #1a1a1a);
  border-bottom: 1px solid var(--cercasa-cat-line, #e4e8e3);
}

@media (max-width: 767.98px) {
  body#search #js-product-list-header,
  body#best-sales #js-product-list-header,
  body#new-products #js-product-list-header,
  body#prices-drop #js-product-list-header,
  body#manufacturer #js-product-list-header,
  body#supplier #js-product-list-header {
    padding-top: 1.15rem;
  }

  body#search #js-product-list-header .page-title-section,
  body#best-sales #js-product-list-header .page-title-section,
  body#new-products #js-product-list-header .page-title-section,
  body#prices-drop #js-product-list-header .page-title-section,
  body#manufacturer #js-product-list-header .page-title-section,
  body#supplier #js-product-list-header .page-title-section {
    font-size: 1.2rem;
    line-height: 1.3;
    padding-bottom: 0.75rem;
    margin-bottom: 0.85rem;
  }
}

/* ——— Nagłówek kategorii: hero ze zdjęciem + H1 ——— */
.cercasa-category-header {
  width: 100%;
  background: transparent;
}

.cercasa-category-hero {
  position: relative;
  /* Full-bleed w obrębie guttera strony — bez 100vw (scrollbar psuje wyrównanie H1) */
  width: calc(100% + (2 * var(--cercasa-cat-gutter)));
  max-width: none;
  height: clamp(13rem, 32vw, 26rem);
  margin-left: calc(-1 * var(--cercasa-cat-gutter));
  margin-right: calc(-1 * var(--cercasa-cat-gutter));
  overflow: hidden;
  background: #2a2a2a;
  isolation: isolate;
}

.cercasa-category-hero__media,
.cercasa-category-hero__placeholder {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.cercasa-category-hero__placeholder {
  background:
    linear-gradient(135deg, #3a3a3a 0%, #1f1f1f 55%, #2c2c2c 100%);
}

.cercasa-category-hero__image {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.cercasa-category-hero__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  /* Ten sam gutter co breadcrumb / lista produktów */
  padding: clamp(1.25rem, 3vw, 2.25rem) var(--cercasa-cat-gutter);
  box-sizing: border-box;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.62) 0%,
    rgba(0, 0, 0, 0.28) 48%,
    rgba(0, 0, 0, 0) 78%
  );
  pointer-events: none;
}

.cercasa-category-hero__copy {
  max-width: min(36rem, 100%);
}

.cercasa-category-page-title {
  margin: 1.15rem 0 0.35rem;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--cercasa-cat-text, #1a1a1a);
}

.cercasa-category-hero__title {
  margin: 0;
  font-size: clamp(1.35rem, 2.6vw, 2.15rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.cercasa-category-hero__arrow {
  display: inline-block;
  margin-left: 0.35em;
  font-weight: 400;
}

.cercasa-category-hero__arrow::before {
  content: "→";
}

/* Krótki opis na tle hero, pod H1 */
.cercasa-category-hero__lead,
.cercasa-category-hero__lead.rich-text {
  display: -webkit-box;
  max-width: 32rem;
  margin: 0.55rem 0 0;
  overflow: hidden;
  font-family: var(--cercasa-font-sans, "Poppins", sans-serif) !important;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  color: rgba(255, 255, 255, 0.92) !important;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.cercasa-category-hero__lead p,
.cercasa-category-hero__lead li,
.cercasa-category-hero__lead span,
.cercasa-category-hero__lead div,
.cercasa-category-hero__lead font,
.cercasa-category-hero__lead h1,
.cercasa-category-hero__lead h2,
.cercasa-category-hero__lead h3,
.cercasa-category-hero__lead h4,
.cercasa-category-hero__lead.rich-text p,
.cercasa-category-hero__lead.rich-text span {
  display: inline;
  margin: 0 !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: 400 !important;
  line-height: inherit !important;
  color: inherit !important;
}

.cercasa-category-hero__lead p + p::before,
.cercasa-category-hero__lead.rich-text p + p::before {
  content: " ";
}

.cercasa-category-hero__lead a {
  color: #fff !important;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.cercasa-category-header__inner {
  max-width: none;
  margin: 0;
  padding: clamp(1.15rem, 2.2vw, 1.75rem) 0 0;
  box-sizing: border-box;
}

@media (max-width: 767.98px) {
  .cercasa-category-hero {
    height: clamp(12rem, 58vw, 18rem);
  }

  .cercasa-category-hero__lead,
  .cercasa-category-hero__lead.rich-text {
    max-width: 100%;
    margin-top: 0.45rem;
    font-size: 0.82rem !important;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

/* Podkategorie — poziomy tor + strzałki na desktopie */
.cercasa-category-subs {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0 0 clamp(1.1rem, 2.2vw, 1.65rem);
}

.cercasa-category-subs__viewport {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.cercasa-category-subs__list {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.1rem;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0.1rem 0 0.25rem;
  overflow-x: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  user-select: none;
}

.cercasa-category-subs__list::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.cercasa-category-subs__list.is-animating {
  scroll-snap-type: none;
}

.cercasa-category-subs__card {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  width: 11.5rem;
  min-width: 11.5rem;
  max-width: 11.5rem;
  padding: 0;
  text-decoration: none;
  color: var(--cercasa-cat-text, #1a1a1a);
  background: transparent;
  border: 0;
  border-radius: 0;
  scroll-snap-align: start;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.cercasa-category-subs__card:hover,
.cercasa-category-subs__card:focus-visible {
  color: #000;
  opacity: 0.92;
}

.cercasa-category-subs__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin-bottom: 0.65rem;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-sizing: border-box;
}

.cercasa-category-subs__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.cercasa-category-subs__name {
  display: -webkit-box;
  width: 100%;
  overflow: hidden;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  color: inherit;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.cercasa-category-subs__controls {
  display: none;
  width: 100%;
  margin-top: 1rem;
  min-height: 2.75rem;
}

.cercasa-category-subs.is-scrollable .cercasa-category-subs__controls {
  display: block;
}

.cercasa-category-subs__arrows {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.cercasa-category-subs__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #2a2d33;
}

.cercasa-category-subs__arrow span {
  width: 0.8rem;
  height: 0.8rem;
  border-right: 3px solid currentColor;
  border-top: 3px solid currentColor;
}

.cercasa-category-subs__arrow--prev span {
  margin-left: 0.15rem;
  transform: rotate(-135deg);
}

.cercasa-category-subs__arrow--next span {
  margin-right: 0.15rem;
  transform: rotate(45deg);
}

.cercasa-category-subs__arrow:hover,
.cercasa-category-subs__arrow:focus-visible {
  background: #f3f4f6;
}

.cercasa-category-subs__arrow:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

.cercasa-category-subs__arrow:disabled {
  cursor: default;
  opacity: 0.35;
}

@media (max-width: 767.98px), (hover: none) and (pointer: coarse) {
  .cercasa-category-subs__list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cercasa-category-subs__controls {
    display: none !important;
  }
}

/* Ukryj lewą kolumnę / drzewo kategorii */
body#category #left-column,
body#search #left-column,
body#best-sales #left-column,
body#new-products #left-column,
body#prices-drop #left-column,
body#manufacturer #left-column,
body#supplier #left-column,
body#category .block-categories,
body#category #search_filters_wrapper.left-block {
  display: none !important;
}

body#category #center-column,
body#search #center-column,
body#best-sales #center-column,
body#new-products #center-column,
body#prices-drop #center-column,
body#manufacturer #center-column,
body#supplier #center-column {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  padding-top: 0;
  padding-bottom: 2.5rem;
}

/* ——— Toolbar: ładne przyciski filtrów + sort ——— */
.cercasa-listing-top {
  margin: 0 0 1.25rem;
}

/* Strona 2+ kategorii: bez hero — większy odstęp od breadcrumb */
.cercasa-listing-top--paged {
  margin-top: 1.75rem;
}

.cercasa-listing-toolbar__left,
.cercasa-listing-toolbar__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.cercasa-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 2.65rem;
  padding: 0.55rem 1.1rem;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--cercasa-cat-text, #1a1a1a) !important;
  text-decoration: none !important;
  background: #fff !important;
  border: 1px solid #d8dde0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.cercasa-toolbar-btn:hover,
.cercasa-toolbar-btn:focus-visible {
  background: var(--cercasa-cat-soft-bg, #f3f4f6) !important;
  border-color: #c9ced3 !important;
  color: #000 !important;
}

.cercasa-toolbar-btn__label {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.cercasa-toolbar-btn__label strong {
  font-weight: 600;
}

.cercasa-toolbar-btn__filters-icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  color: inherit;
}

.cercasa-toolbar-btn__filters-icon .cercasa-icon,
.cercasa-toolbar-btn__filters-icon .cercasa-icon__svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

.cercasa-toolbar-btn__caret {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.15rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.1rem) rotate(45deg);
  opacity: 0.7;
}

.cercasa-sort {
  position: relative;
}

.cercasa-sort__menu {
  min-width: 100%;
}

/* Panel filtrów z prawej */
#offcanvas-faceted.cercasa-filters-drawer,
#offcanvas-faceted.offcanvas-end,
#offcanvas-faceted {
  z-index: 1085;
  width: min(22.5rem, 100vw);
  border-left: 1px solid var(--cercasa-cat-line, #e6e8eb);
  font-family: var(--cercasa-font-sans, "Poppins", sans-serif);
}

#offcanvas-faceted .cercasa-filters-drawer__facets:empty {
  display: none;
}

.cercasa-filters-drawer__header,
#offcanvas-faceted .offcanvas-header {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--cercasa-cat-line, #e6e8eb);
}

.cercasa-filters-drawer__title,
#offcanvas-faceted .offcanvas-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--cercasa-cat-text, #1a1a1a);
}

.cercasa-filters-drawer__body,
#offcanvas-faceted .offcanvas-body {
  padding: 0.5rem 1.25rem 1.5rem;
}

#offcanvas-faceted .left-block__title,
#search-filters .left-block__title,
.search-filters > .left-block__title,
#offcanvas-faceted .search-filters > .h4,
#offcanvas-faceted .search-filters > .h5,
#offcanvas-faceted .search-filters > .h6,
#offcanvas-faceted .search-filters > p.h6 {
  display: none !important;
}

#offcanvas-faceted .accordion-item {
  border: 0;
  border-bottom: 1px solid var(--cercasa-cat-line, #e6e8eb);
  border-radius: 0 !important;
  background: transparent;
}

#offcanvas-faceted .accordion-button {
  padding: 0.95rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cercasa-cat-text, #1a1a1a);
  background: transparent !important;
  box-shadow: none !important;
}

#offcanvas-faceted .accordion-button::after {
  width: 0.5rem;
  height: 0.5rem;
  background-image: none;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.65;
}

#offcanvas-faceted .accordion-button:not(.collapsed)::after {
  transform: rotate(-135deg);
}

#offcanvas-faceted .accordion-collapse {
  position: static;
  border: 0;
  box-shadow: none;
  max-width: none;
  width: auto;
}

#offcanvas-faceted .accordion-body {
  padding: 0 0 1rem;
}

#offcanvas-faceted .form-check-label,
#offcanvas-faceted .facet-label,
#offcanvas-faceted .search-filters__link {
  font-size: 0.9rem;
  color: var(--cercasa-cat-muted, #5a605b);
}

#offcanvas-faceted .search-filters__clear {
  display: block;
  width: 100%;
  margin: 1rem 0 0;
  padding: 0;
  background: transparent;
  border: 0;
}

#offcanvas-faceted .js-search-filters-clear-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-sizing: border-box;
  width: 100%;
  height: 3.325rem;
  min-height: 3.325rem;
  margin: 0;
  padding: 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
  background: #1a1a1a;
  border: 1px solid #1a1a1a;
  border-radius: 0;
  box-shadow: none;
}

#offcanvas-faceted .cercasa-clear-x {
  position: relative;
  display: block;
  flex: 0 0 auto;
  width: 0.62em;
  height: 0.62em;
  margin-top: -0.08em;
}

#offcanvas-faceted .cercasa-clear-x::before,
#offcanvas-faceted .cercasa-clear-x::after {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 100%;
  height: 1.5px;
  background: currentColor;
}

#offcanvas-faceted .cercasa-clear-x::before {
  transform: translateY(-50%) rotate(45deg);
}

#offcanvas-faceted .cercasa-clear-x::after {
  transform: translateY(-50%) rotate(-45deg);
}

/* Active filters */
.active-filters {
  margin: 0 0 1rem;
  padding: 0;
  background: transparent;
  border: 0;
}

.active-filters__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.active-filters__link,
.active-filters .btn {
  border-radius: 0 !important;
  border: 1px solid var(--cercasa-cat-line, #e4e8e3) !important;
  background: #fff !important;
  color: var(--cercasa-cat-text, #1a1a1a) !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}

/* ——— Toolbar: liczba + sort ——— */
.cercasa-listing-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
  margin: 0 0 1.15rem;
  padding: 0;
  border: 0;
}

.cercasa-listing-toolbar__count {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--cercasa-cat-soft, #8a908a);
}

.cercasa-listing-toolbar__sort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
}

.cercasa-listing-toolbar .dropdown-menu {
  border-radius: 0;
  border: 1px solid var(--cercasa-cat-line, #e6e8eb);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
  font-family: inherit;
  margin-top: 0.35rem !important;
}

.cercasa-listing-toolbar .dropdown-item {
  font-size: 0.9rem;
  color: var(--cercasa-cat-text, #1a1a1a);
}

.cercasa-listing-toolbar .dropdown-item.current,
.cercasa-listing-toolbar .dropdown-item:hover {
  background: #f5f5f5;
  color: #000;
}

/* Karty produktów — na kategorii białe bloczki na kremowym tle */
body#category .cercasa-product-card {
  background: #fff;
  border: 1px solid rgba(26, 26, 26, 0.08);
  border-radius: 0;
  padding-bottom: 0.85rem;
  box-sizing: border-box;
}

body#search .cercasa-product-card,
body#best-sales .cercasa-product-card,
body#new-products .cercasa-product-card,
body#prices-drop .cercasa-product-card {
  background: var(--cercasa-cat-soft-bg, #f3f4f6);
  border-radius: 0;
  padding-bottom: 0.85rem;
}

body#category .cercasa-product-card__media,
body#search .cercasa-product-card__media,
body#best-sales .cercasa-product-card__media,
body#new-products .cercasa-product-card__media,
body#prices-drop .cercasa-product-card__media {
  border: 0;
  background: transparent;
  border-radius: 0;
}

body#category .cercasa-product-card__body,
body#search .cercasa-product-card__body {
  flex: 1 1 auto;
  padding-inline: 0.5rem;
}

body#category .cercasa-product-card__name,
body#search .cercasa-product-card__name {
  font-size: 0.75rem;
  height: calc(1.35em * 2);
  min-height: calc(1.35em * 2);
  max-height: calc(1.35em * 2);
}

body#category .cercasa-product-card__meta,
body#search .cercasa-product-card__meta {
  margin-top: auto;
}

body#category .cercasa-product-card__price,
body#search .cercasa-product-card__price {
  font-size: 0.8rem;
}

body#category .cercasa-product-card__segments,
body#search .cercasa-product-card__segments {
  margin-inline: 0.5rem;
}

/* ——— Dodatkowy opis kategorii (pod produktami) ———
   To osobne pole BO: „Dodatkowy opis” / additional_description
   Kontener wycentrowany, max 1000px */
.cercasa-category-seo,
#js-product-list-footer .category__footer {
  --cercasa-cat-seo-size: 0.84rem;
  --cercasa-cat-seo-h1: 1.05rem;
  --cercasa-cat-seo-h2: 0.95rem;
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--cercasa-font-sans, "Poppins", sans-serif);
}

#js-product-list-footer {
  --cercasa-cat-seo-size: 0.84rem;
  --cercasa-cat-seo-h1: 1.05rem;
  --cercasa-cat-seo-h2: 0.95rem;
}

#js-product-list-footer .category__additional-description {
  max-width: none;
  margin: 0;
}

.cercasa-category-seo__body,
#js-product-list-footer .category__additional-description,
#js-product-list-footer .category__additional-description.rich-text {
  margin: 0;
  padding: 0;
  font-family: var(--cercasa-font-sans, "Poppins", sans-serif) !important;
  font-size: var(--cercasa-cat-seo-size) !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  color: var(--cercasa-cat-muted, #5a605b) !important;
}

.cercasa-category-seo__body p,
.cercasa-category-seo__body li,
.cercasa-category-seo__body span,
.cercasa-category-seo__body div,
.cercasa-category-seo__body font,
#js-product-list-footer .category__additional-description p,
#js-product-list-footer .category__additional-description li,
#js-product-list-footer .category__additional-description span,
#js-product-list-footer .category__additional-description div,
#js-product-list-footer .category__additional-description font {
  font-family: inherit !important;
  font-size: var(--cercasa-cat-seo-size) !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  color: var(--cercasa-cat-muted, #5a605b) !important;
}

.cercasa-category-seo__body p,
#js-product-list-footer .category__additional-description p {
  margin: 0 0 0.75em !important;
}

.cercasa-category-seo__body p:last-child,
#js-product-list-footer .category__additional-description p:last-child {
  margin-bottom: 0 !important;
}

.cercasa-category-seo__body h1,
#js-product-list-footer .category__additional-description h1,
#js-product-list-footer .rich-text h1 {
  margin: 0 0 0.65em !important;
  font-family: inherit !important;
  font-size: var(--cercasa-cat-seo-h1) !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.01em;
  color: var(--cercasa-cat-text, #1a1a1a) !important;
}

.cercasa-category-seo__body h2,
.cercasa-category-seo__body h3,
.cercasa-category-seo__body h4,
#js-product-list-footer .category__additional-description h2,
#js-product-list-footer .category__additional-description h3,
#js-product-list-footer .category__additional-description h4,
#js-product-list-footer .rich-text h2,
#js-product-list-footer .rich-text h3,
#js-product-list-footer .rich-text h4 {
  margin: 1.15em 0 0.45em !important;
  font-family: inherit !important;
  font-size: var(--cercasa-cat-seo-h2) !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  color: var(--cercasa-cat-text, #1a1a1a) !important;
}

.cercasa-category-seo__body h2:first-child,
.cercasa-category-seo__body h3:first-child,
.cercasa-category-seo__body h1:first-child,
#js-product-list-footer .category__additional-description h1:first-child,
#js-product-list-footer .category__additional-description h2:first-child {
  margin-top: 0 !important;
}

.cercasa-category-seo__body a,
#js-product-list-footer .category__additional-description a {
  color: #7A9A7E !important;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

/* FAQ pod opisem kategorii — ta sama wielkość pisma co długi opis */
#js-product-list-footer .cercasa-faq--category .cercasa-faq__title {
  font-size: var(--cercasa-cat-seo-h1);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

#js-product-list-footer .cercasa-faq--category .cercasa-faq__text,
#js-product-list-footer .cercasa-faq--category .cercasa-faq__answer {
  font-size: var(--cercasa-cat-seo-size);
  font-weight: 400;
  line-height: 1.55;
  color: var(--cercasa-cat-muted, #5a605b);
}

#js-product-list-footer .cercasa-faq--category .cercasa-faq__question-text {
  font-size: var(--cercasa-cat-seo-size);
  font-weight: 600;
  line-height: 1.35;
}

#js-product-list-footer .cercasa-faq--category .cercasa-faq__number {
  font-size: var(--cercasa-cat-seo-size);
  font-weight: 500;
}

@media (max-width: 767.98px) {
  #js-product-list-footer {
    --cercasa-cat-seo-size: 0.8rem;
    --cercasa-cat-seo-h1: 0.98rem;
    --cercasa-cat-seo-h2: 0.9rem;
  }

  .cercasa-category-seo,
  #js-product-list-footer .category__footer {
    --cercasa-cat-seo-size: 0.8rem;
    --cercasa-cat-seo-h1: 0.98rem;
    --cercasa-cat-seo-h2: 0.9rem;
    margin-top: 1.5rem;
  }
}

/* ——— Paginacja ——— */
.products__pagination {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--cercasa-cat-line, #e4e8e3);
}

.products__pagination .pagination,
.products__pagination .page-link {
  font-family: inherit;
}

.products__pagination .cercasa-pagination,
.products__pagination .pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.products__pagination .page-item {
  display: flex;
  align-items: center;
  margin: 0;
}

.products__pagination .page-link {
  box-sizing: border-box;
  min-width: 2.5rem;
  height: 2.5rem;
  margin: 0;
  padding: 0 0.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  line-height: 1;
  border-radius: 0 !important;
  border: 1px solid var(--cercasa-cat-line, #e4e8e3) !important;
  background: #fff !important;
  color: var(--cercasa-cat-text, #1a1a1a) !important;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: none !important;
  vertical-align: middle;
}

.products__pagination .page-link.previous,
.products__pagination .page-link.next {
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
}

.products__pagination .page-link .material-icons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  font-size: 1.15rem;
  line-height: 1;
  margin: 0;
}

.products__pagination .cercasa-pagination__label {
  display: none;
  align-items: center;
  line-height: 1;
  white-space: nowrap;
}

@media (min-width: 1200px) {
  .products__pagination .cercasa-pagination__label {
    display: inline-flex;
  }
}

.products__pagination .page-item.active .page-link,
.products__pagination .page-link:hover:not(:disabled):not(.disabled) {
  background: #1a1a1a !important;
  border-color: #1a1a1a !important;
  color: #fff !important;
}

.products__pagination .page-link:disabled,
.products__pagination .page-link.disabled {
  opacity: 0.45;
  cursor: default;
}

/* Offcanvas filtry mobile */
#offcanvas-faceted {
  font-family: var(--cercasa-font-sans, "Poppins", sans-serif);
}

#offcanvas-faceted .offcanvas-header {
  border-bottom: 1px solid var(--cercasa-cat-line, #e4e8e3);
}

#offcanvas-faceted .offcanvas-title {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cercasa-cat-soft, #8a908a);
}

@media (max-width: 767.98px) {
  /* Miejsce na dock + pływający przycisk filtrów */
  body#category,
  body#search,
  body#best-sales,
  body#new-products,
  body#prices-drop,
  body#manufacturer,
  body#supplier {
    padding-bottom: calc(4rem + 3.75rem + env(safe-area-inset-bottom, 0px));
  }

  .cercasa-category-hero__title {
    font-size: clamp(1.2rem, 5.5vw, 1.55rem);
  }

  .cercasa-category-subs__card {
    width: 9.25rem;
    min-width: 9.25rem;
    max-width: 9.25rem;
  }

  .cercasa-category-subs__list {
    gap: 0.85rem;
  }

  .cercasa-category-subs__name {
    font-size: 0.8rem;
  }

  .cercasa-listing-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .cercasa-listing-toolbar__left {
    height: 0;
    margin: 0;
    padding: 0;
    overflow: visible;
  }

  .cercasa-listing-toolbar__right {
    width: 100%;
  }

  .cercasa-listing-toolbar__sort,
  .cercasa-listing-toolbar__sort .cercasa-toolbar-btn {
    width: 100%;
  }

  .cercasa-listing-toolbar__count {
    display: none;
  }

  /* Pływający „Pokaż filtry” nad dolnym menu */
  .cercasa-filters-fab.cercasa-toolbar-btn--filters {
    position: fixed;
    left: 50%;
    bottom: calc(4rem + 0.85rem + env(safe-area-inset-bottom, 0px));
    z-index: 1035;
    width: auto !important;
    min-width: 10.5rem;
    min-height: 2.85rem;
    padding: 0.7rem 1.35rem;
    transform: translateX(-50%);
    font-size: 0.92rem;
    font-weight: 500;
    color: #fff !important;
    background: #111 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  }

  .cercasa-filters-fab.cercasa-toolbar-btn--filters:hover,
  .cercasa-filters-fab.cercasa-toolbar-btn--filters:focus-visible {
    background: #000 !important;
    color: #fff !important;
    border-color: transparent !important;
  }

  .cercasa-filters-fab.is-hidden,
  body.cercasa-filters-open .cercasa-filters-fab {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  /* Filtry na telefonie — pełna szerokość */
  #offcanvas-faceted.cercasa-filters-drawer,
  #offcanvas-faceted.offcanvas-end,
  #offcanvas-faceted {
    width: 100vw !important;
    max-width: 100vw !important;
    border-left: 0;
  }
}

/* ——— Lista marek (/marki): tytuł nad siatką, większe loga ——— */
body#manufacturer .cercasa-brands-header,
body#manufacturer #js-product-list-header.cercasa-brands-header {
  position: relative;
  z-index: 1;
  float: none;
  width: 100%;
  margin: 0 0 1.5rem;
  padding: 1.35rem 0 0;
  clear: both;
}

body#manufacturer .cercasa-brands-header .page-title-section {
  position: relative;
  float: none;
  display: block;
  width: 100%;
  margin: 0 0 1.15rem;
  padding: 0 0 0.85rem;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--cercasa-cat-text, #1a1a1a);
  border-bottom: 1px solid var(--cercasa-cat-line, #e4e8e3);
}

body#manufacturer .brand__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
  clear: both;
}

body#manufacturer .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  margin: 0;
  padding: 1.5rem 1.15rem 1.25rem;
  background: #fff;
  border: 1px solid var(--cercasa-cat-line, #e6e8eb);
  border-radius: 0;
}

body#manufacturer .brand__image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 9.5rem;
  margin: 0 0 1rem;
}

body#manufacturer .brand__image picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

body#manufacturer .brand__img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 9.5rem;
  object-fit: contain;
  object-position: center;
}

body#manufacturer .brand__infos {
  margin: 0;
}

body#manufacturer .brand__title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  color: #7A9A7E;
  text-decoration: none;
}

body#manufacturer .brand__products {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--cercasa-cat-soft, #8a908a);
}

@media (min-width: 768px) {
  body#manufacturer .brand__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }

  body#manufacturer .brand__image,
  body#manufacturer .brand__img {
    height: 10.5rem;
    max-height: 10.5rem;
  }
}

@media (min-width: 1200px) {
  body#manufacturer .brand__list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  body#manufacturer .cercasa-brands-header,
  body#manufacturer #js-product-list-header.cercasa-brands-header {
    padding-top: 1.15rem;
    margin-bottom: 1.15rem;
  }

  body#manufacturer .brand {
    padding: 1.15rem 0.9rem 1rem;
  }

  body#manufacturer .brand__image,
  body#manufacturer .brand__img {
    height: 7.5rem;
    max-height: 7.5rem;
  }
}

