/* Shared card controls override the legacy homepage/archive rules together. */
body .hfj-card-buy {
  display:inline-flex!important; align-items:center; justify-content:center;
  box-sizing:border-box; gap:8px!important; min-width:0!important; min-height:48px!important;
  padding:12px 16px!important; border:1px solid var(--hfj-action)!important; border-radius:3px!important;
  background:var(--hfj-action)!important; color:var(--hfj-action-text)!important;
  font:600 14px/22px var(--hfj-font,Arial,sans-serif)!important;
  letter-spacing:0!important; text-transform:none; text-decoration:none!important;
  white-space:nowrap; transform:none!important; transition:background .18s,border-color .18s;
}
body .hfj-card-buy:hover,body .hfj-card-buy:focus-visible { background:var(--hfj-action-hover)!important; border-color:var(--hfj-action-hover)!important; color:var(--hfj-action-text)!important; }
body .hfj-card-buy:active { background:var(--hfj-action-active)!important; border-color:var(--hfj-action-active)!important; }
body .hfj-card-buy.loading { background:var(--hfj-action-hover)!important; opacity:1; }
body .hfj-home-product-card__footer .hfj-card-buy,
body.woocommerce ul.products li.product .hfj-card-buy { display:inline-flex!important; }
body .hfj-card-buy.is-replaced-by-view-basket { display:none!important; }
body .hfj-home-product-card__footer .hfj-card-buy.is-replaced-by-view-basket,
body.woocommerce ul.products li.product .hfj-card-buy.is-replaced-by-view-basket { display:none!important; }
/* A successful CTA occupies precisely the original card position. */
body:not(.hfj-products-view-list) ul.products li.product .hfj-card-buy.added_to_cart {
  grid-column:2; grid-row:4; align-self:center; justify-self:end; margin:0!important;
}
/* Separate 44px view controls, with a quiet selected surface and keyboard ring. */
body.woocommerce .hfj-shop-toolbar .hfj-shop-controls {
  border:0; border-radius:0; background:transparent; box-shadow:none;
  padding:0; gap:16px; overflow:visible; flex-wrap:wrap; width:auto;
}
body.woocommerce :is(.hfj-shop-toolbar,.hfj-catalogue-display) .hfj-product-view-toggle {
  --hfj-control-focus-ring:var(--hfj-accent);
  display:inline-flex; gap:4px; padding:0; border:0;
  border-radius:0; background:transparent; box-shadow:none; flex-shrink:0;
}
body.woocommerce :is(.hfj-shop-toolbar,.hfj-catalogue-display) .hfj-product-view-toggle__button {
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  flex:0 0 44px; width:44px; min-width:44px; height:44px; min-height:44px;
  padding:8px; border:1px solid transparent; border-radius:3px;
  background:transparent; color:var(--hfj-ink); box-shadow:none;
  font:500 13px/20px var(--hfj-font,Arial,sans-serif); text-transform:none;
  transition:background-color 160ms ease,color 160ms ease;
}
body.woocommerce :is(.hfj-shop-toolbar,.hfj-catalogue-display) .hfj-product-view-toggle__button:is(:hover,:focus-visible) { background:var(--hfj-soft); color:var(--hfj-ink); border-color:transparent; }
body.woocommerce :is(.hfj-shop-toolbar,.hfj-catalogue-display) .hfj-product-view-toggle__button.is-active,
body.woocommerce :is(.hfj-shop-toolbar,.hfj-catalogue-display) .hfj-product-view-toggle__button.is-active:is(:hover,:focus-visible) {
  background:var(--hfj-surface); border-color:transparent; color:var(--hfj-ink); box-shadow:none;
}
@media(forced-colors:active) {
  body.woocommerce :is(.hfj-shop-toolbar,.hfj-catalogue-display) .hfj-product-view-toggle__button.is-active { border-color:Highlight; }
}
body.woocommerce :is(.hfj-shop-toolbar,.hfj-catalogue-display) .hfj-product-view-toggle__label { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
@media(prefers-reduced-motion:reduce) { body.woocommerce :is(.hfj-shop-toolbar,.hfj-catalogue-display) .hfj-product-view-toggle__button { transition:none; } }
/* List cards keep the same product information and shopping actions as the grid. */
body.hfj-products-view-list.woocommerce ul.products {
  display:grid; grid-template-columns:1fr!important; gap:16px!important;
}
body.hfj-products-view-list.woocommerce ul.products li.product {
  --hfj-list-image:clamp(180px,18vw,240px);
  display:grid; grid-template-columns:var(--hfj-list-image) minmax(0,1fr);
  grid-template-rows:auto auto auto 1fr; align-items:start; align-content:start;
  gap:10px 28px; padding:20px; border:1px solid #dddddd; border-radius:6px;
  background:#ffffff; text-align:left;
}
body.hfj-products-view-list.woocommerce ul.products li.product a.woocommerce-loop-product__link { display:contents; }
body.hfj-products-view-list.woocommerce ul.products li.product a .hfj-card-media { grid-column:1; grid-row:1/5; margin:0; }
body.hfj-products-view-list.woocommerce ul.products li.product .woocommerce-loop-product__title {
  grid-column:2; grid-row:1; align-self:start; min-height:0; margin:0; padding:4px 0 0;
  font:500 clamp(17px,1.5vw,23px)/1.35 var(--hfj-font,Arial,sans-serif); text-wrap:pretty; max-width:44ch;
}
body.hfj-products-view-list.woocommerce ul.products li.product .hfj-product-attributes {
  grid-column:2; grid-row:2; min-height:0; margin:0; font-size:13px;
  line-height:1.6; letter-spacing:0; text-transform:none; max-width:72ch;
}
body.hfj-products-view-list.woocommerce ul.products li.product .price {
  grid-column:2; grid-row:3; margin:2px 0 6px; font-size:18px; line-height:1.4;
}
body.hfj-products-view-list.woocommerce ul.products li.product .hfj-card-buy {
  grid-column:2; grid-row:4; justify-self:start; align-self:start!important; width:auto; margin:0!important;
}
body.hfj-products-view-list.woocommerce ul.products li.product .hfj-enquiry-link { grid-column:2; grid-row:4; max-width:100%; }
body.hfj-products-view-list.woocommerce ul.products li.product .price:has(.hfj-enquiry-price) { white-space:normal; min-width:0; max-width:100%; }
body.hfj-products-view-list.woocommerce ul.products li.product .hfj-product-actions {
  position:absolute; grid-column:1 / 2; grid-row:1 / 2; top:-2px; right:-2px; left:auto; flex-direction:column;
}
@media(max-width:780px) {
  body .hfj-card-buy { font-size:12px!important; padding:10px 12px!important; min-height:44px!important; gap:6px!important; }
  body:not(.hfj-products-view-list).woocommerce ul.products li.product .hfj-card-buy { grid-column:1/-1; grid-row:5; width:100%; margin:8px 0 0!important; }
  body.woocommerce .hfj-shop-toolbar .hfj-shop-controls { width:100%; gap:12px; justify-content:space-between; }
  body.woocommerce .hfj-shop-toolbar .woocommerce-ordering { flex:1; min-width:150px; }
  body.hfj-products-view-list.woocommerce ul.products li.product {
    --hfj-list-image:clamp(136px,35vw,160px); padding:8px; gap:8px;
  }
  body.hfj-products-view-list.woocommerce ul.products li.product a .hfj-card-media { grid-row:1/4; }
  body.hfj-products-view-list.woocommerce ul.products li.product .woocommerce-loop-product__title { font-size:15px; padding:0; }
  body.hfj-products-view-list.woocommerce ul.products li.product .hfj-product-attributes { font-size:12px; line-height:1.45; }
  body.hfj-products-view-list.woocommerce ul.products li.product .price { font-size:16px; margin:0; }
  body.hfj-products-view-list.woocommerce ul.products li.product .hfj-product-actions {
    position:static; grid-column:1; grid-row:4; place-self:start center;
    flex-direction:row; gap:4px;
  }
  body.hfj-products-view-list.woocommerce ul.products li.product .hfj-product-actions > button {
    width:44px; height:44px; min-width:44px; min-height:44px;
  }
}
@media(prefers-reduced-motion:reduce) { body .hfj-card-buy { transition:none; } }
/* Shared bordered grid card: the media spans the border, only information is inset. */
body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product a.woocommerce-loop-product__link { display:contents!important; }
body .hfj-home-product-card,
body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product {
  container:hfj-card / inline-size;
  display:grid!important; grid-template-columns:12px minmax(0,1fr) auto 12px;
  grid-template-rows:auto auto minmax(1.5em,1fr) auto;
  align-content:stretch; align-items:start; gap:0; padding:0 0 12px;
  border:1px solid #dddddd; border-radius:3px; background:#ffffff;
}
body .hfj-home-product-card .hfj-home-product-card__image,
body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product a .hfj-card-media { grid-column:1/-1; grid-row:1; margin:0 0 12px; width:100%; border-radius:2px 2px 0 0; }
/* Temporary replacement status must remain visible on narrow product cards. */
body .product.hfj-photo-awaiting { --hfj-card-title-lines:none; }
body .hfj-home-product-card .hfj-home-product-card__title,
body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .woocommerce-loop-product__title {
  grid-column:2/4; grid-row:2; margin:0!important; padding:0; min-height:0;
  font:500 15.2px/1.35 var(--hfj-font,Arial,sans-serif); letter-spacing:0; text-transform:none; text-align:left; text-wrap:pretty;
}
body .hfj-home-product-card .hfj-home-product-card__meta,
body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .hfj-product-attributes { grid-column:2/4; grid-row:3; margin:4px 0 6px!important; min-height:0; font-size:12px; line-height:1.5; text-align:left; }
body .hfj-home-product-card .hfj-home-product-card__price,
body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .price { grid-column:2; grid-row:4; justify-self:start!important; align-self:center; width:auto; margin:0 8px 0 0!important; font-size:17px; line-height:1.4; white-space:nowrap; text-align:left!important; }
body .hfj-home-product-card .hfj-home-product-card__footer .hfj-card-buy,
body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .hfj-card-buy { grid-column:3; grid-row:4; justify-self:end; align-self:center; width:auto; max-width:none; margin:0!important; padding:10px 12px!important; font-size:12px!important; }
body .hfj-home-product-card .hfj-product-actions,
body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .hfj-product-actions { position:absolute; top:8px; right:8px; left:auto; display:flex; flex-direction:column; gap:2px; }
body .hfj-home-product-card .hfj-product-actions button,
body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .hfj-product-actions button { width:44px; height:44px; min-width:44px; min-height:44px; padding:12px; border:1px solid #e7e7e7; border-radius:50%; box-shadow:none; background:rgb(255 255 255 / 88%); }
body .hfj-home-product-card .hfj-product-actions button .hfj-icon,
body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .hfj-product-actions button .hfj-icon { font-size:17px; }
@media(any-hover:hover) {
  body .hfj-home-product-card .hfj-product-actions button:hover,
  body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .hfj-product-actions button:hover { background:var(--hfj-surface); color:#393633; box-shadow:none; }
}
body .hfj-home-product-card .hfj-product-actions button:active,
body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .hfj-product-actions button:active { background:var(--hfj-surface); color:#393633; box-shadow:none; }
@media(max-width:780px) {
  body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .hfj-product-actions { top:0; right:0; }
  body .hfj-home-product-card,
  body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product { grid-template-columns:8px minmax(0,1fr) auto 8px; padding-bottom:8px; }
  body .hfj-home-product-card .hfj-home-product-card__title,
  body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .woocommerce-loop-product__title { font-size:14.7px; }
}
@container hfj-card (max-width:259.98px) {
  body .hfj-home-product-card .hfj-home-product-card__price,
  body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .price { font-size:14px; }
  body .hfj-home-product-card .hfj-home-product-card__footer .hfj-card-buy,
  body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .hfj-card-buy { font-size:11px!important; padding:10px 8px!important; gap:6px!important; }
}
@container hfj-card (max-width:219.98px) {
  body .hfj-home-product-card .hfj-home-product-card__price,
  body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .price { font-size:13px; }
  body .hfj-home-product-card .hfj-home-product-card__footer .hfj-card-buy,
  body:not(.hfj-products-view-list).woocommerce ul.products[class*="columns-"] li.product .hfj-card-buy { width:44px!important; height:44px; min-height:44px!important; padding:0!important; gap:0!important; font-size:0!important; }
}
/* Existing body/footer hooks remain stable for AJAX basket and wishlist rendering. */
body .hfj-home-product-card .hfj-home-product-card__body,
body .hfj-home-product-card .hfj-home-product-card__footer { display:contents!important; }
body .hfj-home-product-card .hfj-home-product-card__title a { font:inherit; letter-spacing:inherit; text-transform:none; }
body .hfj-home-product-card .hfj-home-product-card__meta { letter-spacing:0; font-weight:400; }
body .hfj-home-product-card .hfj-home-product-card__price { font-weight:600; color:#333333; }

body .hfj-home-product-card .hfj-product-actions .hfj-wishlist-toggle>.hfj-icon:first-child,
body.woocommerce ul.products li.product .hfj-product-actions .hfj-wishlist-toggle>.hfj-icon:first-child { width:18px; height:18px; font-size:18px; }
