/* ═══════════════════════════════════════════════════════════════
   HariyaliBasket — PHP wale cards ko bhi "card D" look (v4.22.4)
   /bulk/ (template-bulk.php), /fresh/ (archive-hb_product.php) aur
   category pages (taxonomy-hb_category.php) ke .hb-cat-card.
   Sirf CSS — markup / JS / cart keys bilkul nahi chhuye.
   Templates ki inline <style> ko override karne ke liye "body" prefix + !important.
   ═══════════════════════════════════════════════════════════════ */

body .hb-cat-grid{ gap: 12px !important; align-items: stretch; }

body .hb-cat-card{
  position: relative;
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  padding: 6px 6px 10px !important;
  background: #eaf6ee !important;
  border: 1px solid #d3ebdc !important;
  border-radius: 22px !important;
  box-shadow: 0 6px 16px rgba(13,51,32,.07) !important;
  overflow: visible !important;
  font-family: 'Nunito', system-ui, sans-serif;
  color: #1f2937;
  min-width: 0;
}
body .hb-cat-card:hover{ border-color: #d3ebdc !important; box-shadow: 0 10px 24px rgba(13,51,32,.12) !important; transform: none !important; }
body .hb-cat-card.out{ opacity: 1 !important; }

/* /fresh/ page: img+naam+price ek <a> me hain — use bhi column banao */
body .hb-cat-card .hb-cat-card-link{ display: flex !important; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; flex-grow: 1; }

/* Card D ka kram: photo → naam → info → price → per-kg → size pills → button */
body .hb-cat-card .hb-cat-card-img   { order: 0; }
body .hb-cat-card .hb-cat-card-name  { order: 1; }
body .hb-cat-card .hb-cat-origin,
body .hb-cat-card .hb-bulk-pack      { order: 2; }
body .hb-cat-card .hb-cat-card-price { order: 3; }
body .hb-cat-card .hb-bulk-perkg     { order: 4; }
body .hb-cat-card .hb-shop-varpills  { order: 5; }
body .hb-cat-card .hb-qty-zone,
body .hb-cat-card .hb-cat-add,
body .hb-cat-card .hb-qty-stepper,
body .hb-cat-card .hb-bulk-notify    { order: 6; }

/* ── Photo: safed frame ── */
body .hb-cat-card .hb-cat-card-img{
  position: relative;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  border: 4px solid #ffffff;
  border-radius: 18px !important;
  background: #ffffff !important;
  overflow: hidden;
  margin: 0 !important;
}
body .hb-cat-card .hb-cat-card-img img{ width: 100% !important; height: 100% !important; object-fit: cover; display: block; border-radius: 0 !important; }
body .hb-cat-card .hb-cat-card-img .noimg{ font-size: 52px; opacity: 1; }
body .hb-cat-card.out .hb-cat-card-img img,
body .hb-cat-card.out .hb-cat-card-img .noimg{ opacity: .45; filter: grayscale(.4); }

/* Tircha sticker (% OFF / Out of stock) */
body .hb-cat-card .hb-cat-badge{
  top: 6px !important; left: 4px !important;
  transform: rotate(-6deg);
  height: 24px; padding: 0 10px !important;
  display: inline-flex; align-items: center;
  border-radius: 999px !important;
  font-size: 11.5px !important; font-weight: 900 !important;
  box-shadow: 0 2px 0 rgba(13,51,32,.25);
  z-index: 2;
}
body .hb-cat-card .disc-badge{ background: var(--amber, #f59e0b) !important; color: #0d3320 !important; }
body .hb-cat-card .out-badge{ background: #4b5563 !important; color: #ffffff !important; }

/* ── Text ── */
body .hb-cat-card .hb-cat-card-name{
  margin: 0 !important; padding: 0 4px !important; min-height: 0 !important;
  font-family: 'Nunito', system-ui, sans-serif !important;
  font-weight: 900 !important; font-size: 16px !important; line-height: 20px !important;
  color: #0d3320 !important;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
body .hb-cat-card .hb-cat-origin{
  margin: -3px 0 0 !important; padding: 0 4px !important;
  font-size: 12.5px !important; font-weight: 700 !important; color: #3f6b52 !important;
}
body .hb-cat-card .hb-bulk-pack{
  align-self: flex-start;
  margin: -2px 4px 0 !important; padding: 3px 9px !important;
  font-size: 11.5px !important; font-weight: 800 !important;
  color: #1a5c38 !important; background: #ffffff !important;
  border: 1.5px solid #bfe0cb !important; border-radius: 999px !important;
}

/* ── Price chip (peela, tircha) ── */
body .hb-cat-card .hb-cat-card-price{
  align-self: flex-start;
  display: inline-flex !important; align-items: center; gap: 5px !important;
  min-height: 32px; margin: 0 4px !important; padding: 4px 11px !important;
  flex-wrap: wrap !important; row-gap: 0 !important;
  border-radius: 10px;
  background: #fdf0cf;
  box-shadow: 0 2px 0 #f1d68f;
  transform: rotate(-2deg);
  max-width: calc(100% - 8px); box-sizing: border-box; overflow: hidden;
}
body .hb-cat-card .hb-cat-card-price::before{ content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--amber-deep, #d97706); flex-shrink: 0; }
body .hb-cat-card .hb-cat-card-price .sp{
  font-family: 'Sora', system-ui, sans-serif !important;
  font-weight: 800 !important; font-size: 17px !important; color: #0d3320 !important;
  font-variant-numeric: tabular-nums;
}
body .hb-cat-card .hb-cat-card-price .sp{ order: 1; }
body .hb-cat-card .hb-cat-card-price .uom{ order: 2; }
body .hb-cat-card .hb-cat-card-price .mrp{ order: 3; flex-basis: 100%; padding-left: 11px; font-size: 11.5px !important; font-weight: 700; line-height: 14px; color: #8a948c !important; }
body .hb-cat-card .hb-cat-card-price .uom{ font-size: 11.5px !important; font-weight: 800; color: #6b4b12 !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body .hb-cat-card .hb-bulk-perkg{ margin: 0 !important; padding: 0 4px !important; font-size: 12px !important; font-weight: 800 !important; color: #1f7a3e !important; }

/* ── Size pills: 2 column (3 ho to 3) ── */
body .hb-cat-card .hb-shop-varpills{
  display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px !important;
  padding: 0 !important; margin: 0 !important;
}
body .hb-cat-card .hb-shop-varpills:has(> :nth-child(3)){ grid-template-columns: repeat(3, minmax(0, 1fr)); }
body .hb-cat-card .hb-shop-vpill{
  min-height: 34px; padding: 0 4px !important; margin: 0 !important;
  border-radius: 999px !important;
  border: 2px solid #bfe0cb !important;
  background: #ffffff !important; color: #1a5c38 !important;
  font-size: 12px !important; font-weight: 900 !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body .hb-cat-card .hb-shop-vpill.active{ background: #0d3320 !important; border-color: #0d3320 !important; color: #ffffff !important; }

/* ── Add to cart (3D hara pill, bag icon) — text CSS se, JS ka "＋ Add" chhupa ── */
body .hb-cat-card .hb-qty-zone{ margin-top: auto; padding: 0 !important; width: 100%; }
body .hb-cat-card .hb-cat-add:not(.oos){
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100% !important; height: 46px !important; margin: auto 0 4px !important; padding: 0 !important;
  border: 0 !important; border-radius: 999px !important;
  background: var(--green-mid, #25834f) !important; color: #ffffff !important;
  box-shadow: 0 4px 0 #0d3320 !important;
  font-size: 0 !important;
  transition: transform .08s ease, box-shadow .08s ease;
}
body .hb-cat-card .hb-qty-zone .hb-cat-add:not(.oos){ margin-top: 0 !important; }
body .hb-cat-card .hb-cat-add:not(.oos)::before{
  content: ''; width: 18px; height: 18px; flex-shrink: 0; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8h12l-1 12H7z'/%3E%3Cpath d='M9 8V6a3 3 0 0 1 6 0v2'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 8h12l-1 12H7z'/%3E%3Cpath d='M9 8V6a3 3 0 0 1 6 0v2'/%3E%3C/svg%3E") center / contain no-repeat;
}
body .hb-cat-card .hb-cat-add:not(.oos)::after{ content: 'Add to cart'; font-size: 15px; font-weight: 900; letter-spacing: .01em; }
/* Category page: add ke baad JS "✓ 2 in cart" likhta hai — wahi text dikhao (dark pill) */
body .hb-cat-card .hb-cat-add.added:not(.oos){ font-size: 13.5px !important; font-weight: 900 !important; background: #0d3320 !important; color: var(--green-glow, #4dda85) !important; box-shadow: 0 4px 0 var(--green-mid, #25834f) !important; }
body .hb-cat-card .hb-cat-add.added:not(.oos)::before,
body .hb-cat-card .hb-cat-add.added:not(.oos)::after{ content: none; }
body .hb-cat-card .hb-cat-add:not(.oos):active{ transform: translateY(3px) !important; box-shadow: 0 1px 0 #0d3320 !important; }
body .hb-cat-card .hb-cat-add.oos{
  display: block; margin: auto 0 0 !important; padding: 12px 8px !important;
  border-radius: 999px !important; background: #e5e7eb !important; color: #4b5563 !important;
  font-size: 12px !important; font-weight: 800 !important; text-align: center; box-shadow: none !important;
}

/* ── Stepper (dark pill) ── */
body .hb-cat-card .hb-qty-stepper{
  width: 100% !important; height: 46px !important; margin: auto 0 4px !important; padding: 0 !important;
  box-sizing: border-box;
  border-radius: 999px !important;
  background: #0d3320 !important;
  box-shadow: 0 4px 0 var(--green-mid, #25834f) !important;
  align-items: center; justify-content: space-between;
}
body .hb-cat-card .hb-qty-zone .hb-qty-stepper{ margin-top: 0 !important; }
body .hb-cat-card .hb-qty-stepper .hb-qty-btn{
  width: 46px !important; height: 46px !important; min-width: 46px;
  border: 0 !important; border-radius: 999px !important;
  background: transparent !important; color: var(--green-glow, #4dda85) !important;
  font-size: 22px !important; font-weight: 900 !important; line-height: 1; box-shadow: none !important;
}
body .hb-cat-card .hb-qty-stepper .hb-qty-val{
  font-family: 'Sora', system-ui, sans-serif !important;
  font-weight: 800 !important; font-size: 16px !important; color: #ffffff !important; background: none !important;
}

/* ── Notify me (bulk OOS) ── */
body .hb-cat-card .hb-bulk-notify{
  width: 100% !important; height: 44px; margin: auto 0 4px !important; padding: 0 !important;
  border: 2px solid #0d3320 !important; border-radius: 999px !important;
  background: #ffffff !important; color: #0d3320 !important;
  font-size: 13.5px !important; font-weight: 900 !important;
}

body .hb-cat-card button:focus-visible,
body .hb-cat-card a:focus-visible{ outline: 3px solid var(--green-light, #38b26a); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce){
  body .hb-cat-card .hb-cat-badge, body .hb-cat-card .hb-cat-card-price{ transform: none; }
}
@media (max-width: 359px){
  body .hb-cat-card .hb-cat-card-name{ font-size: 14.5px !important; }
  body .hb-cat-card .hb-cat-add:not(.oos)::after{ font-size: 13.5px; }
  body .hb-cat-card .hb-cat-card-price .sp{ font-size: 15.5px !important; }
}
