/*
 * Saltfah Catalog UI Update
 * Scoped to WooCommerce product-category archives and the Article Studio blog.
 */

/* Compact, accessible pagination shared by product categories and /blog/. */
body.tax-product_cat nav.woocommerce-pagination,
.saltfah-blog-page .saltfah-blog-pagination {
  --sf-pager-bg: #171a21;
  --sf-pager-border: #454a55;
  --sf-pager-text: #f7f8fa;
  --sf-pager-hover: #2b303a;
  display: flex;
  justify-content: center;
  width: max-content;
  max-width: 100%;
  margin: 30px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.tax-product_cat nav.woocommerce-pagination ul.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  list-style: none;
}

body.tax-product_cat nav.woocommerce-pagination ul.page-numbers li {
  display: flex;
  float: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.saltfah-blog-page .saltfah-blog-pagination {
  align-items: center;
  gap: 7px;
}

body.tax-product_cat nav.woocommerce-pagination ul.page-numbers li .page-numbers,
.saltfah-blog-page .saltfah-blog-pagination > .page-numbers {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--sf-pager-border);
  border-radius: 8px;
  background: var(--sf-pager-bg);
  color: var(--sf-pager-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
}

body.tax-product_cat nav.woocommerce-pagination ul.page-numbers li .page-numbers.current,
.saltfah-blog-page .saltfah-blog-pagination > .page-numbers.current {
  border-color: #bb422d;
  background: #bb422d;
  color: #fff;
}

body.tax-product_cat nav.woocommerce-pagination ul.page-numbers li a.page-numbers:hover,
.saltfah-blog-page .saltfah-blog-pagination > a.page-numbers:hover {
  border-color: #c56448;
  background: var(--sf-pager-hover);
  color: var(--sf-pager-text);
}

body.tax-product_cat nav.woocommerce-pagination ul.page-numbers li a.page-numbers:focus-visible,
.saltfah-blog-page .saltfah-blog-pagination > a.page-numbers:focus-visible {
  outline: 3px solid #ffad86;
  outline-offset: 2px;
}

body.tax-product_cat nav.woocommerce-pagination ul.page-numbers li .page-numbers.dots,
.saltfah-blog-page .saltfah-blog-pagination > .page-numbers.dots {
  min-width: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #b9bec8;
}

html.saltfah-light-mode body.tax-product_cat nav.woocommerce-pagination,
html.saltfah-light-mode .saltfah-blog-page .saltfah-blog-pagination {
  --sf-pager-bg: #f7f7f8;
  --sf-pager-border: #9da5b0;
  --sf-pager-text: #202632;
  --sf-pager-hover: #eaecef;
}

/* Keep the existing desktop category image hero and expose the term-name span on mobile. */
body.tax-product_cat .saltfah-category-title-mobile,
body.tax-product_cat .saltfah-category-mobile-empty {
  display: none;
}

@media (max-width: 640px) {
  html:has(body.tax-product_cat),
  body.tax-product_cat {
    overflow-x: hidden;
  }

  body.tax-product_cat .sf-main {
    padding-top: 0;
  }

  body.tax-product_cat .saltfah-disposable-breadcrumb,
  body.tax-product_cat .saltfah-disposable-shortcuts {
    display: none;
  }

  body.tax-product_cat .saltfah-disposable-hero {
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    width: 100%;
    min-height: 0;
    height: auto;
    margin: 0 0 20px;
    padding: 28px 22px 26px;
    overflow: hidden;
    border: 0;
    border-right: 14px solid #eb493b;
    border-bottom: 1px solid #34383f;
    border-radius: 0;
    background: #111315;
    background-image: none;
    box-shadow: none;
  }

  body.tax-product_cat .saltfah-disposable-hero::before,
  body.tax-product_cat .saltfah-disposable-hero::after {
    display: none;
  }

  body.tax-product_cat .saltfah-disposable-hero__copy {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  body.tax-product_cat .saltfah-disposable-kicker {
    display: none;
  }

  body.tax-product_cat.sorfah-mobile-layout-active.sf-ml-shop .saltfah-disposable-hero h1,
  body.tax-product_cat .saltfah-disposable-hero h1 {
    margin: 0 0 10px;
    color: #fff;
    font-size: clamp(32px, 9vw, 40px) !important;
    font-weight: 800;
    line-height: 1.08 !important;
    letter-spacing: -.02em;
    overflow-wrap: anywhere;
  }

  body.tax-product_cat .saltfah-category-title-desktop {
    display: none;
  }

  body.tax-product_cat .saltfah-category-title-mobile {
    display: inline;
  }

  body.tax-product_cat .saltfah-disposable-hero p {
    max-width: 100%;
    margin: 0;
    overflow: visible;
    color: #aeb9c9;
    font-size: 14px;
    line-height: 1.55;
    text-overflow: clip;
    white-space: normal;
  }

  body.tax-product_cat .saltfah-disposable-toolbar {
    gap: 16px;
    margin: 0 0 18px;
    padding: 0 0 18px;
    border-top: 0;
  }

  body.tax-product_cat .saltfah-disposable-toolbar__actions,
  body.tax-product_cat .saltfah-disposable-ordering {
    min-width: 0;
  }

  body.tax-product_cat .saltfah-disposable-ordering select {
    max-width: 100%;
  }

  body.tax-product_cat .saltfah-disposable-result-count {
    color: #dae3ef;
  }

  body.tax-product_cat .saltfah-disposable-result-count strong {
    color: #fff;
  }

  body.tax-product_cat.term-disposable-pod ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.tax-product_cat nav.woocommerce-pagination ul.page-numbers,
  .saltfah-blog-page .saltfah-blog-pagination {
    flex-wrap: wrap;
    gap: 5px;
  }

  body.tax-product_cat nav.woocommerce-pagination ul.page-numbers li .page-numbers,
  .saltfah-blog-page .saltfah-blog-pagination > .page-numbers {
    min-width: 42px;
    min-height: 44px;
    padding: 0 9px;
    font-size: 13px;
  }

  body.tax-product_cat nav.woocommerce-pagination ul.page-numbers li .page-numbers.dots,
  .saltfah-blog-page .saltfah-blog-pagination > .page-numbers.dots {
    display: none;
  }

  @supports selector(:has(*)) {
    body.tax-product_cat nav.woocommerce-pagination ul.page-numbers li:not(:has(> .prev, > .next, > .current)):not(:has(+ li > .current)):not(li:has(> .current) + li) {
      display: none;
    }

    .saltfah-blog-page .saltfah-blog-pagination > .page-numbers:not(.prev):not(.next):not(.current):not(:has(+ .current)):not(.current + .page-numbers) {
      display: none;
    }
  }
}

html.saltfah-light-mode body.tax-product_cat .saltfah-disposable-result-count,
body.tax-product_cat.saltfah-light-mode .saltfah-disposable-result-count {
  color: #394351;
}

html.saltfah-light-mode body.tax-product_cat .saltfah-disposable-result-count strong,
body.tax-product_cat.saltfah-light-mode .saltfah-disposable-result-count strong {
  color: #172334;
}
