/* Shared catalog geometry, including archives where Woo's class is on body. */
body.chipak-site ul.products {
  display: grid !important;
  grid-template-columns: repeat(var(--cp-catalog-columns, 4), minmax(0, 1fr)) !important;
  grid-auto-flow: row;
  direction: rtl;
  clear: both;
  gap: 20px 16px !important;
  margin: 0 0 28px !important;
  padding: 0 !important;
  list-style: none;
}
body.chipak-site ul.products.columns-2 { --cp-catalog-columns: 2; }
body.chipak-site ul.products.columns-3 { --cp-catalog-columns: 3; }
/* Woo's float clearfix must never occupy a CSS grid cell. */
body.chipak-site ul.products::before,
body.chipak-site ul.products::after { content: none !important; display: none !important; }
body.chipak-site ul.products > li.product {
  display: flex !important;
  flex-direction: column;
  align-self: stretch;
  float: none !important;
  clear: none !important;
  width: auto !important;
  min-width: 0;
  height: auto;
  margin: 0 !important;
  text-align: right;
}
body.chipak-site ul.products > li.product > a.woocommerce-LoopProduct-link,
body.chipak-site ul.products > li.product > a.woocommerce-loop-product__link {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}
body.chipak-site ul.products > li.product picture {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1;
}
body.chipak-site ul.products > li.product img {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 !important;
  object-fit: contain !important;
  object-position: center;
}
body.chipak-site ul.products > li.product .woocommerce-loop-product__title {
  min-height: 3.6em;
}
body.chipak-site ul.products > li.product > .button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 100%;
  min-height: 48px !important;
  margin-top: 14px !important;
  padding: 10px 12px !important;
  border: 1px solid #102235 !important;
  border-radius: 11px !important;
  background: #102235 !important;
  color: #fff !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  text-align: center;
  white-space: normal;
}
body.chipak-site ul.products > li.product > .button:hover {
  background: #24435e !important;
  color: #fff !important;
}

/* Both the installed category finder and Core's replacement use this contract. */
body.chipak-site :is(.chipak-size-finder__grid, .chipak-core-size-finder__grid) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  direction: rtl;
  gap: 14px;
}
body.chipak-site :is(.chipak-size-finder__card, .chipak-core-size-finder__card) {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: auto;
  background: #fff;
}
body.chipak-site :is(.chipak-size-finder__media, .chipak-core-size-finder__media) {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  background: #fff;
}
body.chipak-site :is(.chipak-size-finder__media, .chipak-core-size-finder__media) img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: 100%;
  margin: 0 !important;
  padding: 8px;
  object-fit: contain !important;
  object-position: center;
}
body.chipak-site :is(.chipak-size-finder__card-body, .chipak-core-size-finder__card-body) {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 14px;
}
body.chipak-site :is(.chipak-size-finder__match, .chipak-core-size-finder__match) { align-self: flex-start; }
body.chipak-site :is(.chipak-size-finder__product-link, .chipak-core-size-finder__product-link) {
  margin-top: auto;
  min-height: 48px;
  flex: 0 0 auto;
}
/* Keep space above the CTA even when its auto margin has no free space. */
body.chipak-site :is(.chipak-size-finder__card-body, .chipak-core-size-finder__card-body) > p:last-of-type { padding-bottom: 12px; }

/* The shop's native category form works with or without JavaScript. */
body.chipak-site .chipak-shop-category-filter {
  clear: both;
  margin: 20px 0;
  padding: 18px;
  border: 1px solid #b9c4cf;
  border-radius: 14px;
  background: #f7f9fb;
  color: #102235;
  direction: rtl;
  text-align: right;
}
body.chipak-site .chipak-shop-category-controls {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}
body.chipak-site .chipak-shop-category-field {
  display: grid;
  flex: 1 1 260px;
  gap: 8px;
  min-width: 0;
  margin: 0;
  color: #102235;
  font-weight: 700;
}
body.chipak-site .chipak-shop-category-select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #8b9aa8;
  border-radius: 10px;
  background: #fff;
  color: #102235;
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
}
body.chipak-site .chipak-shop-category-select option { background: #fff; color: #102235; }
body.chipak-site .chipak-shop-category-apply {
  min-height: 48px;
  margin: 0;
  padding: 10px 20px;
  border: 1px solid #102235;
  border-radius: 10px;
  background: #102235;
  color: #fff;
  font: inherit;
  font-weight: 700;
  line-height: 1.6;
  cursor: pointer;
}
body.chipak-site .chipak-shop-category-apply:hover { background: #24435e; color: #fff; }
body.chipak-site .chipak-shop-category-active {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 10px;
  color: #102235;
}
body.chipak-site .chipak-shop-category-active strong { color: inherit; }
body.chipak-site .chipak-shop-category-active a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #24435e;
  text-decoration: underline;
  text-underline-offset: 3px;
}
body.chipak-site .chipak-shop-category-filter :is(select, button, a):focus-visible { outline: 3px solid #ac7720; outline-offset: 3px; }

/* Pagination keeps Woo's canonical URLs/query arguments and a visible current page. */
body.chipak-site nav.woocommerce-pagination {
  clear: both;
  margin: 30px 0 42px;
  padding: 20px 12px;
  border: 1px solid #ded8ce;
  border-radius: 16px;
  background: #f7f9fb;
  text-align: center;
}
body.chipak-site .cp-pagination-label { margin: 0 0 12px; color: #102235; font-size: 14px; font-weight: 700; }
body.chipak-site nav.woocommerce-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  list-style: none;
  direction: rtl;
}
body.chipak-site nav.woocommerce-pagination ul li { float: none; border: 0; margin: 0; padding: 0; overflow: visible; }
body.chipak-site nav.woocommerce-pagination :is(a.page-numbers, span.page-numbers) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #b9c4cf;
  border-radius: 10px;
  background: #fff;
  color: #102235;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
}
body.chipak-site nav.woocommerce-pagination .page-numbers.current {
  border-color: #102235;
  background: #102235;
  color: #fff;
  box-shadow: 0 3px 8px #10223520;
}
body.chipak-site nav.woocommerce-pagination a.page-numbers:hover { border-color: #ac7720; background: #f5e7c8; color: #102235; }
body.chipak-site nav.woocommerce-pagination .page-numbers[aria-disabled="true"] { color: #66717f; background: #edf0f3; border-color: #d4dce3; }
body.chipak-site nav.woocommerce-pagination .page-numbers.dots { border-color: transparent; background: transparent; min-width: 24px; padding-inline: 3px; }
body.chipak-site :is(nav.woocommerce-pagination a, ul.products .button):focus-visible { outline: 3px solid #ac7720; outline-offset: 3px; }
@media (max-width: 900px) {
  body.chipak-site ul.products,
  body.chipak-site :is(.chipak-size-finder__grid, .chipak-core-size-finder__grid) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 560px) {
  body.chipak-site .chipak-shop-category-filter { padding: 14px; }
  body.chipak-site .chipak-shop-category-apply { width: 100%; }
  body.chipak-site ul.products { gap: 16px 10px !important; }
  body.chipak-site ul.products > li.product > .button { font-size: 12px !important; padding-inline: 6px !important; }
  body.chipak-site :is(.chipak-size-finder__grid, .chipak-core-size-finder__grid) { grid-template-columns: minmax(0, 1fr) !important; }
  body.chipak-site nav.woocommerce-pagination { padding-inline: 8px; }
  body.chipak-site nav.woocommerce-pagination ul.page-numbers { gap: 6px; }
  body.chipak-site nav.woocommerce-pagination :is(a.page-numbers, span.page-numbers) { min-width: 44px; padding-inline: 10px; }
}
