/* Product color, stock, and purchase controls shared by storefront listings and related products. */
:is(.home .home-catalog, .woocommerce .store-catalog, .woocommerce .related.products) ul.products li.product:has(.catalog-purchase) { display:flex; flex-direction:column; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-purchase {
  --catalog-colors-height:44px;
  --catalog-order-height:40px;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:var(--catalog-colors-height) 20px var(--catalog-order-height);
  gap:4px;
  padding-top:7px;
  margin-top:auto;
  border-top:1px solid #e4d5c9;
}
:is(.home-catalog, .store-catalog, .related.products) .catalog-colors {
  grid-row:1;
  display:flex;
  align-items:flex-start;
  gap:4px;
  padding:2px 2px 4px;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:thin;
  scrollbar-color:#bfa693 transparent;
}
:is(.home-catalog, .store-catalog, .related.products) .catalog-color { flex:none; display:grid; place-items:center; min-width:34px; min-height:34px; padding:2px; border:1px solid #ccb5a4; border-radius:6px; background:transparent; color:var(--brown); font-size:.69rem; }
:is(.home .home-catalog, .woocommerce .store-catalog, .woocommerce .related.products) ul.products li.product .catalog-color img { display:block; width:28px; height:28px; margin:0; object-fit:cover; border-radius:3px; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-color:focus-visible { outline-offset:-2px; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-color[aria-pressed="true"] { border-color:var(--brown); box-shadow:inset 0 0 0 1px var(--brown); }
:is(.home-catalog, .store-catalog, .related.products) .catalog-color[data-sold-out] { background:#eee8e2; color:#665950; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-color[data-sold-out] img { filter:grayscale(1); opacity:.62; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-order-row { --catalog-action-radius:7px; grid-row:3; display:grid; grid-template-columns:minmax(0,1fr); gap:6px; align-items:center; container-type:inline-size; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-order-row:has(.catalog-cart-action) { grid-template-columns:repeat(2,minmax(0,1fr)); }
:is(.home-catalog, .store-catalog, .related.products) .catalog-stock-info { grid-row:2; display:flex; align-items:center; gap:6px; min-width:0; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-color-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:var(--muted); font-size:.68rem; line-height:1.2; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-stock { order:-1; flex:none; display:inline-flex; align-items:baseline; gap:4px; color:#2b5e41; font-size:.73rem; line-height:1.26; font-weight:650; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-stock::before { content:''; flex:none; align-self:center; width:5px; height:5px; border-radius:50%; background:currentColor; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-stock.is-sold-out { color:#962e31; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-order-row > :is(form, .catalog-order) { grid-area:1 / -2; margin:0; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-order { display:inline-flex; align-items:center; justify-content:center; min-height:var(--catalog-order-height); width:100%; padding:4px 9px; border:1px solid #38624a; border-radius:var(--catalog-action-radius); background:#28563c; color:#fffaf4; font-size:.74rem; font-weight:650; text-decoration:none; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-order:hover { background:#204831; color:#fffaf4; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-order:disabled { color:#64534b; border-color:#e2d3c6; background:#eee5de; cursor:default; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-cart-action { grid-area:1 / 1; min-width:0; }
:is(.home .home-catalog, .woocommerce .store-catalog, .woocommerce .related.products) ul.products li.product .catalog-cart-action a.button {
  display:flex;
  justify-content:center;
  align-items:center;
  min-height:var(--catalog-order-height);
  width:100%;
  margin:0;
  padding:3px 4px;
  border:1px solid var(--cart-orange);
  border-radius:var(--catalog-action-radius);
  background:var(--cart-orange);
  color:var(--cart-orange-text);
  font-size:.74rem;
  font-weight:650;
  line-height:1.2;
  text-align:center;
}
:is(.home .home-catalog, .woocommerce .store-catalog, .woocommerce .related.products) ul.products li.product .catalog-cart-action a.button:hover { background:var(--cart-orange-hover); }
:is(.home .home-catalog, .woocommerce .store-catalog, .woocommerce .related.products) ul.products li.product .catalog-cart-action a.button[aria-disabled="true"] { border-color:#e2d3c6; background:#eee5de; color:#64534b; cursor:default; }
:is(.home .home-catalog, .woocommerce .store-catalog, .woocommerce .related.products) ul.products li.product .catalog-cart-action a.button.catalog-cart-icon {
  gap:4px;
  padding-inline:3px;
  white-space:nowrap;
}
:is(.home-catalog, .store-catalog, .related.products) .catalog-cart-icon::before { content:"\e01d"; font:13px/1 WooCommerce; }
:is(.home-catalog, .store-catalog, .related.products) .catalog-cart-icon:is(.loading,.added)::before { display:none; }
:is(.home .home-catalog, .woocommerce .store-catalog, .woocommerce .related.products) ul.products li.product .catalog-cart-action a.catalog-cart-icon:is(.loading,.added)::after { position:static; margin:0; font-size:13px; }
@container (max-width:135px) {
  :is(.home-catalog, .store-catalog, .related.products) .catalog-cart-icon::before,
  :is(.home .home-catalog, .woocommerce .store-catalog, .woocommerce .related.products) ul.products li.product .catalog-cart-action a.catalog-cart-icon:is(.loading,.added)::after { display:none; }
}
:is(.home-catalog, .store-catalog, .related.products) .catalog-cart-action .added_to_cart { display:none; }
.related.products .catalog-purchase:not(:has(.catalog-colors)) { --catalog-colors-height:0px; }

@media (max-width:700px) {
  :is(.home-catalog, .store-catalog, .related.products) .catalog-purchase { --catalog-colors-height:54px; --catalog-order-height:44px; }
  :is(.home-catalog, .store-catalog, .related.products) .catalog-color { min-width:44px; min-height:44px; }
  :is(.home .home-catalog, .woocommerce .store-catalog, .woocommerce .related.products) ul.products li.product .catalog-color img { width:38px; height:38px; }
  :is(.home-catalog, .store-catalog, .related.products) .catalog-order { padding-inline:12px; }
  :is(.home .home-catalog, .woocommerce .store-catalog, .woocommerce .related.products) ul.products li.product .catalog-cart-action a.button { font-size:.74rem; }
}

.catalog-pager {
  display:flex;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
  gap:.45rem .9rem;
  margin:clamp(1.15rem,3vw,2rem) 0 0;
  color:var(--brown);
  font-size:.9rem;
}
.catalog-pager-position { display:flex; align-items:center; }
.catalog-page-arrow {
  display:inline-grid;
  place-items:center;
  width:44px;
  height:44px;
  border-radius:8px;
  color:inherit;
  font-size:1.5rem;
  line-height:1;
  text-decoration:none;
}
.catalog-pager a.catalog-page-arrow:hover { background:#efe3d8; text-decoration:none; }
.catalog-pager span.catalog-page-arrow { color:#977e6c; opacity:.55; }
.catalog-current-page { min-width:4.75rem; text-align:center; font-variant-numeric:tabular-nums; white-space:nowrap; }
.catalog-page-size { display:flex; flex-wrap:wrap; align-items:center; gap:.35rem; margin:0; }
.catalog-page-size select { padding:.35rem .65rem; border-radius:7px; font-size:.87rem; }
