/* APFN category template — v0.4.5 */

body#category #wrapper {
  background: #fff;
}

body#category #wrapper > .container {
  width: 100%;
  max-width: 1280px;
  padding-right: 24px;
  padding-left: 24px;
}

body#category #content-wrapper {
  min-width: 0;
}

body#category #main {
  color: var(--apfn-text, #494c50);
}

/* Hero */
.apfn-category-hero {
  position: relative;
  width: auto;
  margin: 0 calc(50% - 50vw) 56px;
  overflow: hidden;
  background: var(--apfn-surface, #f4f7fe);
}

.apfn-category-hero__container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: min(100%, 1280px);
  min-height: 320px;
  margin: 0 auto;
  padding: 62px 24px;
  box-sizing: border-box;
  text-align: left;
}

.apfn-category-hero__title {
  margin: 0 0 24px;
  color: var(--apfn-ink, #333c4c);
  font-size: clamp(2.7rem, 5vw, 4.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.apfn-category-hero__description {
  max-width: 760px;
  color: var(--apfn-text, #494c50);
  font-size: 1.08rem;
  line-height: 1.7;
  text-align: left;
}

.apfn-category-hero__description > :last-child {
  margin-bottom: 0;
}

/* Catalog layout and facets */
.apfn-category-columns {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
  gap: 32px;
  width: 100%;
}

.apfn-category-sidebar,
.apfn-category-results {
  min-width: 0;
}

.apfn-filters {
  position: sticky;
  top: 24px;
}

#search_filters {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--apfn-border, #e3e9f1);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(42, 55, 78, .05);
}

.apfn-filters-empty {
  min-height: 150px;
  padding: 24px;
  border: 1px solid var(--apfn-border, #e2e7ef);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(42, 55, 78, .05);
}

.apfn-filters-empty p {
  margin: 16px 0 0;
  color: var(--apfn-text, #494c50);
  font-size: .86rem;
  line-height: 1.5;
}

#search_filters .apfn-filters__empty-message {
  margin: 16px 0 0;
  color: var(--apfn-text, #494c50);
  font-size: .86rem;
  line-height: 1.5;
}

.apfn-filters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.apfn-filters__title {
  margin: 0;
  color: var(--apfn-ink, #333c4c);
  font-size: 1.35rem;
  font-weight: 700;
  text-transform: none;
}

#search_filters .clear-all-wrapper {
  margin: 0;
}

#search_filters .js-search-filters-clear-all {
  padding: 0;
  color: var(--apfn-primary, #395ca3);
  background: transparent;
  font-size: .78rem;
  text-transform: none;
}

#search_filters .js-search-filters-clear-all .material-icons {
  font-size: 1rem;
}

#search_filters .facet {
  margin: 0;
  padding: 20px 0;
  border-bottom: 1px solid #edf1f5;
}

#search_filters .facet:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

#search_filters .facet-title {
  margin: 0 0 14px;
  color: var(--apfn-ink, #333c4c);
  font-size: .92rem;
  font-weight: 700;
  text-transform: none;
}

#search_filters .facet ul {
  margin: 0;
  padding: 0;
}

#search_filters .facet li {
  margin: 0 0 10px;
}

#search_filters .facet-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
}

#search_filters .facet-label a {
  display: flex;
  flex: 1;
  justify-content: space-between;
  color: var(--apfn-text, #494c50);
  font-size: .9rem;
  line-height: 1.35;
}

#search_filters .facet-label.active a,
#search_filters .facet-label a:hover {
  color: var(--apfn-primary, #395ca3);
}

#search_filters .magnitude {
  margin-left: 8px;
  color: #98a2b1;
  font-size: .78rem;
}

#search_filters .custom-checkbox input[type="checkbox"] + span,
#search_filters .custom-radio {
  border-color: #b9c5d4;
}

#search_filters .custom-checkbox input[type="checkbox"]:checked + span {
  border-color: var(--apfn-primary, #395ca3);
  background: var(--apfn-primary, #395ca3);
  color: #fff;
}

#search_filters .ui-slider .ui-slider-range,
#search_filters .ui-slider .ui-slider-handle {
  background: var(--apfn-primary, #395ca3);
}

/* Toolbar */
.apfn-catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 26px;
  padding: 15px 18px;
  border: 1px solid var(--apfn-border, #e3e9f1);
  border-radius: 10px;
  background: #fff;
}

.apfn-catalog-toolbar__count {
  margin: 0;
  color: var(--apfn-ink, #333c4c);
  font-size: .92rem;
  font-weight: 700;
  white-space: nowrap;
}

.apfn-catalog-toolbar__actions,
.apfn-page-size {
  display: flex;
  align-items: center;
  gap: 12px;
}

.apfn-catalog-toolbar .sort-by-row,
.apfn-catalog-toolbar .products-sort-order,
.apfn-catalog-toolbar .products-sort-order .select-title {
  width: auto;
  margin: 0;
}

.apfn-catalog-toolbar .sort-by {
  margin: 0 8px 0 0;
  color: var(--apfn-text, #494c50);
  font-size: .85rem;
  white-space: nowrap;
}

.apfn-catalog-toolbar .products-sort-order .select-title {
  min-width: 190px;
  padding: 10px 12px;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  box-shadow: none;
  color: var(--apfn-ink, #333c4c);
}

.apfn-page-size__label {
  color: var(--apfn-text, #494c50);
  font-size: .82rem;
}

.apfn-page-size__button {
  min-width: 34px;
  padding: 6px 8px;
  border: 1px solid #dce3ec;
  border-radius: 6px;
  background: #fff;
  color: var(--apfn-text, #494c50);
  cursor: pointer;
}

.apfn-page-size__button:hover,
.apfn-page-size__button.is-active {
  border-color: var(--apfn-primary, #395ca3);
  background: var(--apfn-primary, #395ca3);
  color: #fff;
}

.active_filters {
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 0;
  border-radius: 8px;
  background: #f2f6fb;
}

/* Product grid and cards */
#js-product-list .products {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100% !important;
  margin: 0 !important;
}

/* Bootstrap's row pseudo-elements otherwise become empty grid cells. */
#js-product-list .products::before,
#js-product-list .products::after {
  display: none !important;
  content: none !important;
}

#js-product-list .products > .product,
#js-product-list .products > .js-product {
  float: none !important;
  flex: none !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.apfn-product-card {
  height: 100%;
  margin: 0;
}

.apfn-product-card .thumbnail-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--apfn-border, #e3e9f1);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(42, 55, 78, .055);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.apfn-product-card .thumbnail-container:hover {
  transform: translateY(-3px);
  border-color: #cbd6e4;
  box-shadow: 0 14px 34px rgba(42, 55, 78, .11);
}

.apfn-product-card__media {
  position: relative;
  min-height: 245px;
  padding: 24px;
  background: #fff;
}

.apfn-product-card .product-thumbnail {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 225px;
}

.apfn-product-card .product-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: normal;
}

.apfn-product-card .product-flags {
  top: 12px;
  left: 12px;
}

.apfn-product-card .product-flags li.product-flag {
  margin: 0 0 6px;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: .68rem;
}

.apfn-product-card .apfn-product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  position: static;
  width: auto;
  height: auto;
  padding: 0 !important;
  background: #fff;
  text-align: left !important;
}

.apfn-product-card__content {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  padding: 24px;
  box-sizing: border-box;
  text-align: left !important;
}

.apfn-product-card .apfn-product-card__content > * {
  text-align: left;
}

.apfn-product-card__brand {
  margin: 0 0 7px;
  color: var(--apfn-text, #494c50);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.apfn-product-card .product-title {
  min-height: 48px;
  margin: 0 0 8px;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  line-height: 1.45;
  text-align: left !important;
  text-transform: none;
}

.apfn-product-card .product-title a {
  display: block;
  color: var(--apfn-ink, #333c4c);
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  line-height: 1.45;
  text-align: left !important;
  text-transform: none;
}

.apfn-product-card .product-title a:hover {
  color: var(--apfn-primary, #395ca3);
}

.apfn-product-card__reference {
  min-height: 19px;
  margin: 0 0 14px;
  color: #7d899b;
  font-size: .78rem;
  text-align: left !important;
}

.apfn-product-card__stock {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 20px;
  margin-bottom: 16px;
  color: #4e6d5a;
  font-size: .78rem;
}

.apfn-product-card__stock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #45a66d;
}

.apfn-product-card__commercial {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: flex-end;
  min-height: 118px;
  padding-top: 18px;
  border-top: 1px solid #edf1f5;
}

.apfn-product-card .product-price-and-shipping {
  margin: 0 0 16px;
  color: var(--apfn-ink, #333c4c);
  text-align: left;
}

.apfn-product-card .price {
  color: var(--apfn-ink, #333c4c);
  font-size: 1.2rem;
  font-weight: 700;
}

.apfn-product-card .regular-price {
  color: #8b95a5;
  font-size: .8rem;
}

.apfn-product-card__tax-label {
  margin-left: 5px;
  color: #7d899b;
  font-size: .7rem;
}

.apfn-product-card__login-copy,
.apfn-product-card__request-copy {
  margin: 0 0 14px;
  color: var(--apfn-text, #494c50);
  font-size: .86rem;
  line-height: 1.45;
  text-align: left !important;
}

.apfn-product-card__form {
  margin: 0;
}

.apfn-product-card__button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 43px;
  padding: 10px 15px;
  border-radius: 7px;
  font-size: .83rem;
  font-weight: 700;
  text-transform: none;
}

.apfn-product-card__button .material-icons {
  margin-right: 7px;
  font-size: 1.1rem;
}

/* Pagination */
.apfn-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 42px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--apfn-border, #e3e9f1);
}

.apfn-pagination__summary {
  color: var(--apfn-text, #494c50);
  font-size: .82rem;
}

.apfn-pagination .page-list {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.apfn-pagination .page-list li {
  display: block;
}

.apfn-pagination .page-list a,
.apfn-pagination .page-list .spacer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #dce3ec;
  border-radius: 7px;
  background: #fff;
  color: var(--apfn-text, #494c50);
  font-size: .86rem;
}

.apfn-pagination .current a,
.apfn-pagination .page-list a:hover {
  border-color: var(--apfn-primary, #395ca3);
  background: var(--apfn-primary, #395ca3);
  color: #fff;
}

.apfn-pagination .previous,
.apfn-pagination .next {
  gap: 5px;
}

/* CTA */
.apfn-category-cta {
  display: grid;
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr);
  margin: 64px 0 72px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--apfn-surface, #f4f7fe);
}

.apfn-category-cta__image {
  min-height: 300px;
  background: #dce9f6 url("../img/category-cta.jpg") center / cover no-repeat;
}

.apfn-category-cta__content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 56px;
}

.apfn-category-cta__eyebrow {
  margin: 0 0 12px;
  color: var(--apfn-text, #494c50);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.apfn-category-cta h2 {
  margin: 0 0 16px;
  color: var(--apfn-ink, #333c4c);
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
}

.apfn-category-cta p {
  margin: 0 0 26px;
  color: var(--apfn-text, #494c50);
  font-size: .98rem;
  line-height: 1.7;
}

.apfn-category-cta .btn {
  padding: 13px 25px;
  border-radius: 7px;
  font-size: .88rem;
  text-transform: none;
}

@media (max-width: 1199px) {
  #js-product-list .products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .apfn-page-size {
    display: none;
  }
}

@media (max-width: 991px) {
  .apfn-category-columns {
    grid-template-columns: minmax(0, 1fr);
  }

  .apfn-category-sidebar {
    display: none !important;
  }

  .apfn-filters {
    position: static;
  }

  .apfn-category-cta__content {
    padding: 40px;
  }
}

@media (max-width: 767px) {
  body#category #wrapper > .container {
    padding-right: 16px;
    padding-left: 16px;
  }

  .apfn-category-hero {
    margin-bottom: 30px;
  }

  .apfn-category-hero__container {
    width: min(100%, 620px);
    min-height: auto;
    padding: 48px 16px;
  }

  .apfn-category-hero__title {
    font-size: 2.45rem;
  }

  .apfn-catalog-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .apfn-catalog-toolbar__actions,
  .apfn-catalog-toolbar .sort-by-row,
  .apfn-catalog-toolbar .products-sort-order,
  .apfn-catalog-toolbar .products-sort-order .select-title {
    width: 100%;
  }

  .apfn-catalog-toolbar .filter-button {
    width: auto;
    padding: 0;
  }

  #js-product-list .products {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px;
  }

  .apfn-product-card__media {
    min-height: 180px;
    padding: 16px;
  }

  .apfn-product-card .product-thumbnail {
    height: 165px;
  }

  .apfn-product-card__content {
    padding: 18px;
  }

  .apfn-product-card .product-title {
    min-height: 62px;
    font-size: 1rem !important;
  }

  .apfn-product-card .product-title a {
    font-size: 1rem !important;
  }

  .apfn-pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .apfn-category-cta {
    grid-template-columns: 1fr;
  }

  .apfn-category-cta__image {
    min-height: 220px;
  }

  .apfn-category-cta__content {
    padding: 32px 24px;
  }
}

@media (max-width: 479px) {
  #js-product-list .products {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .apfn-product-card .product-title {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .apfn-product-card .thumbnail-container {
    transition: none;
  }
}
