/* Category / archive — Family Meble style layout */

/* CRITICAL: .fm-cat shares node with .fm-container — never use padding shorthand
   (padding: 16px 0 64px zeros inline gutter → breadcrumbs/filters misaligned vs header). */
.fm-cat {
  padding-block: 8px 48px;
}

.fm-cat__crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  color: var(--fm-gray-600);
  margin-bottom: 10px;
}
.fm-cat__crumb a {
  color: var(--fm-gray-600);
  display: inline-flex;
  align-items: center;
}
.fm-cat__crumb a:hover { color: var(--fm-red); }
.fm-cat__crumb svg {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}
.fm-cat__crumb-sep { color: #bbb; }

.fm-cat__head { margin-bottom: 12px; }
.fm-cat-promo {
  margin: 0 0 16px;
  border-radius: 10px;
  overflow: hidden;
  background: #ebe6df;
  line-height: 0;
}
.fm-cat-promo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  object-position: center center;
  image-rendering: auto;
}
@media (max-width: 900px) {
  .fm-cat-promo {
    margin-bottom: 12px;
    border-radius: 8px;
  }
  .fm-cat-promo img {
    max-height: none;
    object-fit: contain;
    object-position: center center;
  }
}
.fm-cat__title {
  margin: 0;
  font-size: clamp(28px, 3.5vw, 36px);
  font-weight: 700;
  letter-spacing: -.02em;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
.fm-cat__count {
  font-size: 15px;
  font-weight: 500;
  color: var(--fm-gray-600);
}

.fm-cat__banner {
  display: block;
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  line-height: 0;
}
.fm-cat__banner[hidden] { display: none !important; }
.fm-cat__banner img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1920 / 450;
  object-fit: cover;
}

/* Shop hub — large tiles only on /sklep (not category depth-1) */
.fm-cat-hub {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 20px;
  margin: 8px 0 20px;
}
.fm-cat-hub[hidden] { display: none !important; }
.fm-cat-tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  background: transparent;
  padding: 0;
  text-align: left;
  transform: none;
}
.fm-cat-tile:hover {
  background: transparent;
  transform: none;
}
.fm-cat-tile__media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  background: #f3f3f3;
}
.fm-cat-tile__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transition: transform .35s ease;
}
.fm-cat-tile__media img.fm-img--mirror {
  transform: scaleX(-1);
}
.fm-cat-tile:hover .fm-cat-tile__media img { transform: scale(1.04); }
.fm-cat-tile:hover .fm-cat-tile__media img.fm-img--mirror { transform: scaleX(-1) scale(1.04); }
.fm-cat-tile__label {
  font-size: 15px;
  font-weight: 700;
  color: var(--fm-gray-900);
  text-transform: none;
  letter-spacing: normal;
}

/* Depth-1 subcategory chips — Agata compact horizontal tiles */
.fm-cat-pills-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  min-width: 0;
}
.fm-cat-pills-wrap[hidden] { display: none !important; }
.fm-cat-pills {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
}
.fm-cat-pills::-webkit-scrollbar { display: none; }
.fm-cat-pill {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 6px 14px 6px 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-decoration: none;
  color: var(--fm-gray-900);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  scroll-snap-align: start;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fm-cat-pill img {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: contain;
  object-position: center;
  background: #fff;
  flex-shrink: 0;
}
.fm-cat-pill:hover,
.fm-cat-pill.is-active {
  background: #fff;
  border-color: #c4c4c4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.fm-cat-pills-btn {
  position: static;
  flex: 0 0 auto;
  z-index: 1;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e5e7eb;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--fm-shadow-sm);
  color: var(--fm-gray-900);
  padding: 0;
}
.fm-cat-pills-btn:hover { background: #f9fafb; }
.fm-cat-pills-btn:disabled {
  opacity: .35;
  cursor: default;
}
.fm-cat-pills-btn[hidden] { display: none !important; }

/* Depth-2+ text chips — white, compact */
.fm-cat-subtext-wrap {
  margin: 0 0 8px;
  overflow: hidden;
}
.fm-cat-subtext {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.fm-cat-subtext__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  color: var(--fm-gray-900);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fm-cat-subtext__item:hover {
  background: #fff;
  border-color: #c4c4c4;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  color: var(--fm-gray-900);
}

.fm-cat__layout[hidden] { display: none !important; }

.fm-cat__layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 0;
  align-items: start;
  margin-top: 4px;
}

/* Filters — collapsed accordion + vertical rule like Agata */
.fm-cat-filters {
  position: sticky;
  top: 140px;
  border-right: 1px solid var(--fm-gray-200);
  padding-right: 20px;
  margin-right: 24px;
  z-index: 5;
  pointer-events: auto;
  isolation: isolate;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: clip;
}
.fm-cat-filters__form,
.fm-cat-filters__list,
.fm-cat-filter {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.fm-cat-filters__form {
  margin: 0;
  pointer-events: auto;
}
.fm-cat-filters__title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}
.fm-cat-filter {
  border-bottom: 1px solid var(--fm-gray-200);
}
.fm-cat-filter summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
}
.fm-cat-filter summary::-webkit-details-marker { display: none; }
.fm-cat-filter__chev {
  width: 10px;
  height: 10px;
  border-right: 2px solid #333;
  border-bottom: 2px solid #333;
  transform: rotate(45deg);
  transition: transform .15s;
  flex-shrink: 0;
  margin-top: -4px;
}
.fm-cat-filter[open] .fm-cat-filter__chev {
  transform: rotate(-135deg);
  margin-top: 4px;
}
.fm-cat-filter__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 0 12px;
  pointer-events: auto;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.fm-cat-filter__opts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.fm-cat-filter__body label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  pointer-events: auto;
  min-width: 0;
  max-width: 100%;
}
.fm-cat-filter__body label.is-hidden,
.fm-cat-filter__body label[hidden] {
  display: none !important;
}
.fm-cat-filter__body:not(.is-expanded):not(.is-searching) label.fm-cat-filter__opt--extra {
  display: none !important;
}
.fm-cat-filter__body input[type="checkbox"] {
  accent-color: var(--fm-red);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  pointer-events: auto;
}
.fm-cat-filter__search {
  display: block;
  width: 100%;
  margin: 0 0 4px;
  min-width: 0;
  max-width: 100%;
  align-self: stretch;
  box-sizing: border-box;
}
.fm-cat-filter__search-input,
.fm-cat-filters input.fm-cat-filter__search-input,
.fm-cat-filters input[type="search"],
.fm-cat-filters input[data-fm-brand-search],
.fm-cat-filters input[data-fm-filter-search] {
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  margin: 0;
  border: 1px solid var(--fm-gray-200);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  box-sizing: border-box !important;
  -webkit-appearance: none;
  appearance: none;
}
.fm-cat-filter__search-input::placeholder {
  color: #888;
  font-weight: 400;
}
.fm-cat-filter__search-input:focus {
  outline: none;
  border-color: #1a1a1a;
}
.fm-cat-filter__more {
  align-self: flex-start;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fm-red);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.fm-cat-filter__more:hover {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.fm-cat-filter__body[data-fm-brand-empty]::after {
  content: "Brak marek";
  display: block;
  padding: 4px 0 2px;
  font-size: 13px;
  color: #888;
}

/* Agata dual price slider */
.fm-cat-price {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  max-width: 100%;
  padding: 2px 0 6px;
  box-sizing: border-box;
}
.fm-cat-price__inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}
.fm-cat-price__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: #555;
}
.fm-cat-price__input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--fm-gray-200, #e5e7eb);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  box-sizing: border-box;
}
.fm-cat-price__input:focus {
  outline: none;
  border-color: #1a1a1a;
}
.fm-cat-price__slider {
  position: relative;
  height: 28px;
  margin: 4px 2px 0;
  min-width: 0;
}
.fm-cat-price__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  background: #e5e7eb;
  border-radius: 2px;
  pointer-events: none;
}
.fm-cat-price__track-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--fm-red, #d62828);
  border-radius: 2px;
}
.fm-cat-price__range {
  position: absolute;
  left: 0;
  width: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  height: 28px;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}
.fm-cat-price__range::-webkit-slider-runnable-track {
  height: 3px;
  background: transparent;
  border: none;
}
.fm-cat-price__range::-moz-range-track {
  height: 3px;
  background: transparent;
  border: none;
}
.fm-cat-price__range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  margin-top: -6.5px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #1a1a1a;
  cursor: pointer;
}
.fm-cat-price__range::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #1a1a1a;
  cursor: pointer;
}
.fm-cat-price__range--min { z-index: 2; }
.fm-cat-price__range--max { z-index: 3; }

.fm-cat-filters__apply {
  margin-top: 14px;
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: #1a1a1a;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.fm-cat-filters__apply:hover,
.fm-cat-filters__apply:focus {
  background: var(--fm-red);
  color: #fff !important;
}

.fm-cat__toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  min-height: 40px;
}
.fm-cat-filters-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--fm-gray-200);
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--fm-gray-900);
  cursor: pointer;
}
.fm-cat-filters-toggle:hover,
.fm-cat-filters-toggle[aria-expanded="true"] {
  border-color: var(--fm-red);
  color: var(--fm-red);
}
.fm-cat-filters__sheet-head {
  display: none;
}
.fm-cat-filters__close {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  color: var(--fm-gray-900);
  cursor: pointer;
}
.fm-cat__sort {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fm-gray-900);
  margin: 0;
}
.fm-cat__sort label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  cursor: pointer;
}
.fm-cat__sort label > span {
  white-space: nowrap;
  font-weight: 600;
}
/* Agata-like select: bordered dropdown, not bare text */
.fm-cat__sort select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-width: 188px;
  height: 40px;
  padding: 0 40px 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23333333' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--fm-gray-900);
  cursor: pointer;
  line-height: 1;
  box-shadow: none;
}
.fm-cat__sort select:hover {
  border-color: #9ca3af;
}
.fm-cat__sort select:focus {
  outline: 2px solid var(--fm-red);
  outline-offset: 2px;
  border-color: var(--fm-red);
}

/* 4-col product cards — ONE Agata hairline per row (not per-card stacked borders) */
.fm-cat-grid {
  --fm-acat-cols: 4;
  --fm-acat-gap: 18px;
  --fm-acat-row-pad: 28px;
  display: grid;
  grid-template-columns: repeat(var(--fm-acat-cols), minmax(0, 1fr));
  column-gap: var(--fm-acat-gap);
  row-gap: var(--fm-acat-row-pad);
  align-items: stretch;
}
.fm-acat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 0 0 var(--fm-acat-row-pad);
  margin: 0;
  border: 0;
  position: relative;
  background: #fff;
  height: auto;
  align-self: stretch;
}
/* Single continuous hairline under the row (extends into column gaps) */
.fm-acat::after {
  content: '';
  position: absolute;
  left: calc(var(--fm-acat-gap) / -2);
  right: calc(var(--fm-acat-gap) / -2);
  bottom: 0;
  height: 1px;
  background: #e5e5e5;
  pointer-events: none;
  z-index: 1;
}
.fm-acat:nth-child(4n + 1)::after { left: 0; }
.fm-acat:nth-child(4n)::after { right: 0; }
/* No line under the last row */
.fm-cat-grid > .fm-acat:nth-child(4n + 1):nth-last-child(-n + 4)::after,
.fm-cat-grid > .fm-acat:nth-child(4n + 1):nth-last-child(-n + 4) ~ .fm-acat::after {
  content: none;
  display: none;
}
.fm-acat__labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 22px;
}
.fm-label {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .02em;
  white-space: nowrap;
}
.fm-label--red { background: var(--fm-red); }
.fm-label--gray { background: #6b7280; }
.fm-label--black { background: #111111; }
.fm-label--teal { background: #6b7280; }
.fm-label--blue { background: #111111; }
.fm-label--payu {
  background: #a6c307; /* PayU Lime Green */
  color: #fff;
}
.fm-label--ship {
  background: var(--fm-red);
  letter-spacing: 0.01em;
}
.fm-acat__installment,
.fm-pcard__installment {
  margin: 6px 0 0;
  min-height: 1.2em;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  color: #1d4ed8;
}
.fm-acat__installment a,
.fm-pcard__installment a,
.fm-acat__installment span,
.fm-pcard__installment span {
  color: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(29, 78, 216, 0.35);
}
.fm-acat__media {
  position: relative;
  aspect-ratio: 1;
  background: #fff;
  overflow: hidden;
  display: block;
}
.fm-acat__media-wrap {
  position: relative;
}
.fm-acat__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity .25s;
}
.fm-acat__media img.fm-acat__hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  object-fit: contain;
  background: #fff;
}
/* Only swap images when a real 2nd photo exists — otherwise hover = white blank. */
.fm-acat__media-wrap.has-hover:hover img.fm-acat__primary { opacity: 0; }
.fm-acat__media-wrap.has-hover:hover img.fm-acat__hover { opacity: 1; }

/* Fabric / color swatches under product image — Agata-like size, max 4 + expandable +N */
.fm-acat__swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  margin-top: 4px;
  padding: 0;
  background: #fff;
}
.fm-acat__swatch {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: #fff;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.fm-acat__swatch.has-img {
  border-color: #c4c4c4;
}
.fm-acat__swatch.is-placeholder {
  background: #fff;
}
.fm-acat__swatch:hover,
.fm-acat__swatch.is-active {
  border-color: #111;
  box-shadow: 0 0 0 1px #111;
}
.fm-acat__swatch--extra {
  display: none;
}
.fm-acat__swatches.is-expanded .fm-acat__swatch--extra {
  display: block;
}
.fm-acat__swatch-more {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  margin-left: 2px;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #666;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s ease;
}
.fm-acat__swatch-more:hover,
.fm-acat__swatch-more:focus-visible,
.fm-acat__swatches.is-expanded .fm-acat__swatch-more {
  color: var(--fm-red, #d62828);
}
.fm-acat__swatch-more:focus-visible {
  outline: 2px solid var(--fm-red, #d62828);
  outline-offset: 2px;
  border-radius: 2px;
}

.fm-acat__brand {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}
.fm-acat__desc {
  margin: 2px 0 0;
  font-size: 13px;
  line-height: 1.35;
  min-height: 1.35em;
  color: #444;
  text-decoration: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.fm-acat__desc a {
  color: inherit;
  text-decoration: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.fm-acat__desc a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.fm-acat__rating {
  margin: 0;
  font-size: 12px;
  color: #666;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fm-acat__rating-stars {
  color: #e6a800;
  letter-spacing: 1px;
  font-size: 13px;
  line-height: 1;
}
.fm-acat__rating-count {
  color: #666;
  font-size: 12px;
}
.fm-acat__price {
  margin: auto 0 0;
  padding-top: 4px;
  font-size: 20px;
  font-weight: 700;
}
.fm-acat__price small {
  font-size: 12px;
  font-weight: 600;
  vertical-align: super;
}
.fm-acat__ship {
  margin: 0;
  font-size: 12px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 6px;
}
.fm-acat__ship::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
}
.fm-acat__ship.is-fast::before { background: #22c55e; }

.fm-acat__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}
.fm-acat__compare {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  text-decoration: none;
}
.fm-acat__compare:hover { color: var(--fm-red); }
.fm-acat__atc {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid #1a1a1a;
  background: #fff;
  display: grid;
  place-items: center;
  color: #1a1a1a;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.fm-acat__atc:hover {
  background: #d62828;
  border-color: #d62828;
  color: #fff;
}
.fm-acat__atc svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

@media (max-width: 1100px) {
  .fm-cat-grid {
    --fm-acat-cols: 3;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fm-acat:nth-child(4n + 1)::after,
  .fm-acat:nth-child(4n)::after { left: calc(var(--fm-acat-gap) / -2); right: calc(var(--fm-acat-gap) / -2); }
  .fm-acat:nth-child(3n + 1)::after { left: 0; }
  .fm-acat:nth-child(3n)::after { right: 0; }
  .fm-cat-grid > .fm-acat:nth-child(4n + 1):nth-last-child(-n + 4)::after,
  .fm-cat-grid > .fm-acat:nth-child(4n + 1):nth-last-child(-n + 4) ~ .fm-acat::after {
    content: '';
    display: block;
  }
  .fm-cat-grid > .fm-acat:nth-child(3n + 1):nth-last-child(-n + 3)::after,
  .fm-cat-grid > .fm-acat:nth-child(3n + 1):nth-last-child(-n + 3) ~ .fm-acat::after {
    content: none;
    display: none;
  }
  .fm-cat-hub { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .fm-cat {
    padding-block: 6px 36px;
  }
  .fm-cat__title {
    font-size: clamp(22px, 6vw, 28px);
  }
  .fm-cat__banner img {
    aspect-ratio: 16 / 9;
    min-height: 140px;
  }
  .fm-cat__layout { grid-template-columns: 1fr; }
  .fm-cat__toolbar {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }
  .fm-cat-filters-toggle { display: inline-flex; }
  .fm-cat__sort {
    margin-left: auto;
  }
  .fm-cat__sort select {
    min-width: 148px;
    height: 40px;
  }

  /* Filtry: drawer jak Agata (domyślnie ukryte) */
  .fm-cat-filters {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: none;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.45);
    pointer-events: auto;
  }
  body.fm-filters-open .fm-cat-filters {
    display: block;
  }
  body.fm-filters-open {
    overflow: hidden;
  }
  .fm-cat-filters__sheet {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(100%, 360px);
    background: #fff;
    padding: 12px 16px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.18);
  }
  .fm-cat-filters__sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--fm-gray-200);
  }
  .fm-cat-filters__sheet-head strong {
    font-size: 16px;
  }
  .fm-cat-filters__title { display: none; }

  .fm-cat-grid {
    --fm-acat-cols: 2;
    --fm-acat-gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fm-acat:nth-child(3n + 1)::after,
  .fm-acat:nth-child(3n)::after { left: calc(var(--fm-acat-gap) / -2); right: calc(var(--fm-acat-gap) / -2); }
  .fm-acat:nth-child(2n + 1)::after { left: 0; }
  .fm-acat:nth-child(2n)::after { right: 0; }
  .fm-cat-grid > .fm-acat:nth-child(3n + 1):nth-last-child(-n + 3)::after,
  .fm-cat-grid > .fm-acat:nth-child(3n + 1):nth-last-child(-n + 3) ~ .fm-acat::after {
    content: '';
    display: block;
  }
  .fm-cat-grid > .fm-acat:nth-child(2n + 1):nth-last-child(-n + 2)::after,
  .fm-cat-grid > .fm-acat:nth-child(2n + 1):nth-last-child(-n + 2) ~ .fm-acat::after {
    content: none;
    display: none;
  }
  .fm-cat-hub {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    margin: 4px 0 16px;
  }
  .fm-cat-tile { gap: 8px; }
  .fm-cat-tile__media {
    aspect-ratio: 3 / 4;
    border-radius: 8px;
  }
  .fm-cat-pills-wrap { margin-block: 8px 12px; }
}
@media (max-width: 520px) {
  .fm-cat-grid {
    --fm-acat-cols: 2;
    --fm-acat-gap: 10px;
    grid-template-columns: 1fr 1fr;
  }
  .fm-cat-hub { grid-template-columns: 1fr 1fr; gap: 14px 10px; }
  .fm-acat__swatch { width: 28px; height: 28px; }
  .fm-acat__swatch-more { font-size: 12px; }
  .fm-cat__sort select { min-width: 132px; font-size: 12px; padding-inline: 10px 32px; }
}
