/* ════════════════════════════════════════════════════════════════════
   product-cards-v8.css — The Pure Harvest Group
   Premium card · Cowberry-quality polish
   Used in: Featured, Best Sellers, Shop, Related
   ════════════════════════════════════════════════════════════════════ */

:root {
  --pc-green:        #0B4F2F;
  --pc-green-2:      #1A6940;
  --pc-green-deep:   #06351F;
  --pc-cream:        #FAF7EF;
  --pc-cream-2:      #F3E8D0;
  --pc-cream-3:      #FDFBF5;
  --pc-text:         #1A1A1A;
  --pc-text-2:       #333333;
  --pc-muted:        #666666;
  --pc-muted-2:      #B8B0A0;
  --pc-border:       rgba(172, 147, 98, 0.25);
  --pc-border-strong: rgba(172, 147, 98, 0.45);
  --pc-rose:         #A11C1C;
  --pc-gold:         #AC9362;
  --pc-gold-dark:    #8C7340;
  --pc-amber:        #C8A858;
  --pc-radius:       16px;
  --pc-radius-sm:    8px;
  --pc-card-bg:      #FFFAF2;
  --pc-shadow:       0 1px 3px rgba(11, 79, 47, 0.05), 0 1px 2px rgba(11, 79, 47, 0.03);
  --pc-shadow-hov:   0 14px 32px rgba(11, 79, 47, 0.13), 0 6px 12px rgba(11, 79, 47, 0.07);
}

/* ── GRID ─────────────────────────────────────────────────── */
/* Per brief: 24px desktop card gap, 16px mobile */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  align-items: stretch;
}
@media (min-width: 480px) { .prod-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 768px) { .prod-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1024px){ .prod-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 24px; } }
@media (min-width: 1280px){ .prod-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 24px; } }

/* ── CARD ─────────────────────────────────────────────────── */
.pcard {
  position: relative;
  background: var(--pc-card-bg);
  border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  box-shadow: var(--pc-shadow);
  transition: border-color .25s, transform .25s, box-shadow .25s;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.pcard:hover {
  border-color: var(--pc-gold);
  transform: translateY(-4px);
  box-shadow: var(--pc-shadow-hov);
}

.pcard:focus-visible {
  outline: 2px solid var(--pc-green);
  outline-offset: 2px;
}

.pcard.is-soon { opacity: .9; cursor: default; }
.pcard.is-soon:hover { transform: none; box-shadow: var(--pc-shadow); border-color: var(--pc-border); }

/* ── IMAGE AREA ─────────────────────────── */
/* Per brief: 1:1, object-fit contain, soft beige background, centered image. */
.pc-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--pc-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.pc-img img {
  width: 88%;
  height: 88%;
  object-fit: contain;
  display: block;
  transition: transform .4s ease;
}

.pcard:hover .pc-img img { transform: scale(1.05); }

.pc-img-fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pc-green);
  opacity: 0.25;
  z-index: 1;
  pointer-events: none;
}

.pc-img-fallback svg {
  width: 44px !important;
  height: 44px !important;
  max-width: 44px;
  max-height: 44px;
  display: block;
}

.pc-img img:not([style*="hidden"]) ~ .pc-img-fallback { display: none; }

/* ── BADGE — small pill, top-left (subtle, not full-width) ───────────── */
.pc-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 8px;
  letter-spacing: .04em;
  text-transform: uppercase;
  z-index: 2;
  pointer-events: none;
  line-height: 1.4;
  color: #fff;
  border-radius: 100px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  /* Hard width cap — never let the badge stretch across the image */
  max-width: 50%;
  white-space: nowrap;
}

.pc-badge.bd-off  { background: var(--pc-rose); }
.pc-badge.bd-new  { background: var(--pc-amber); color: #fff; }
.pc-badge.bd-sell { background: var(--pc-green); }
.pc-badge.bd-soon { background: var(--pc-gold-dark); }

/* ── ORGANIC TAG — hidden, brand-level redundant on cards ── */
.pc-organic { display: none; }

/* ── 4.5★ RATING ──────────────────────────────────────────── */
.pc-rating {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(20, 18, 14, 0.85);
  color: #fff;
  padding: 2px 6px 2px 5px;
  border-radius: 3px;
  z-index: 2;
  pointer-events: none;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 2px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.pc-rating::before {
  content: '\2605';
  color: var(--pc-amber);
  font-size: 9px;
  line-height: 1;
}

/* ── WISHLIST — subtle, fades in on hover (desktop), tap to save ── */
.pc-wish {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  padding: 0;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity .2s ease, transform .2s ease, background .15s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Show wishlist when hovering the card on desktop */
@media (hover: hover) {
  .pcard:hover .pc-wish { opacity: 1; transform: scale(1); }
}

/* Always show on touch devices (no hover available) */
@media (hover: none) {
  .pc-wish { opacity: 0.85; transform: scale(1); }
}

/* Always show if user has wishlisted this product */
.pc-wish.on { opacity: 1; transform: scale(1); }

.pc-wish:hover { background: #fff; transform: scale(1.06) !important; opacity: 1 !important; }
.pc-wish svg { width: 13px; height: 13px; fill: none; stroke: var(--pc-muted); stroke-width: 2; }
.pc-wish.on svg { fill: var(--pc-rose); stroke: var(--pc-rose); }

/* ── BODY ─────────────────────────────────────────────────── */
.pc-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.pc-cat {
  font-size: 9px;
  font-weight: 600;
  color: var(--pc-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 3px;
  line-height: 1.2;
}

.pc-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--pc-text);
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}

/* ── SIZE PILLS — refined: smaller, neutral, premium ──────────── */
.pc-szs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.pcsz {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border: 1px solid var(--pc-border);
  border-radius: 100px;
  background: transparent;
  color: var(--pc-muted);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.pcsz:hover {
  border-color: var(--pc-gold);
  color: var(--pc-text);
}

.pcsz.on {
  background: var(--pc-green);
  color: #fff;
  border-color: var(--pc-green);
}

.pc-spacer { flex: 1; }

/* ── PRICE ────────────────────────────────────────────────── */
.pc-price-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.pc-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--pc-green);
  line-height: 1;
}

.pc-old {
  font-size: 10px;
  color: var(--pc-muted-2);
  text-decoration: line-through;
}

.pc-coming-text {
  font-size: 10px;
  color: var(--pc-muted);
  font-weight: 500;
  margin-bottom: 6px;
}

/* ── ADD BUTTON — primary dark green per brief ─────────────────── */
.pc-add {
  width: 100%;
  height: 36px;
  min-height: 36px;
  min-width: 0;
  border: 1px solid var(--pc-green);
  background: var(--pc-green);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 100px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background .2s, border-color .2s, transform .12s, box-shadow .2s;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(11, 79, 47, 0.12);
}

.pc-add:hover {
  background: var(--pc-green-deep);
  border-color: var(--pc-green-deep);
  box-shadow: 0 4px 14px rgba(11, 79, 47, 0.22);
}

.pc-add:active { transform: scale(.97); }
.pc-add:disabled { opacity: .7; cursor: wait; }
.pc-add.added {
  background: var(--pc-green-2);
  border-color: var(--pc-green-2);
}

.pc-add-soon {
  width: 100%;
  height: 36px;
  border: 1px dashed var(--pc-gold-dark);
  background: transparent;
  color: var(--pc-muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (min-width: 480px) {
  .pcard { border-radius: var(--pc-radius); }
  .pc-body { padding: 14px; }
  .pc-name { font-size: 13.5px; min-height: 36px; }
  .pc-price { font-size: 16px; }
  .pc-old { font-size: 11px; }
  .pc-add { height: 38px; font-size: 12px; }
  .pc-add-soon { height: 38px; font-size: 11px; }
  .pcsz { font-size: 10.5px; padding: 4px 9px; }
  .pc-rating { font-size: 10px; padding: 3px 7px; bottom: 8px; right: 8px; }
  .pc-rating::before { font-size: 10px; }
  .pc-badge { font-size: 9.5px; padding: 3px 9px; top: 10px; left: 10px; }
}

@media (min-width: 768px) {
  .pc-body { padding: 16px; }
  .pc-name { font-size: 14.5px; min-height: 38px; margin-bottom: 10px; }
  .pc-price { font-size: 17px; }
  .pc-add { height: 42px; font-size: 12.5px; }
}

@media (min-width: 1024px) {
  .pc-name { font-size: 15px; min-height: 40px; }
  .pc-price { font-size: 18px; }
  .pc-add { height: 44px; font-size: 13px; }
}

/* ── SLIDER ROWS ────────────────────────────────────── */
.hsc-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 12px;
  scrollbar-width: none;
  align-items: stretch;
}

.hsc-row::-webkit-scrollbar { display: none; }

.hsc-row .pcard {
  flex: 0 0 160px;
  scroll-snap-align: start;
  height: auto;
}

@media (min-width: 480px) { .hsc-row .pcard { flex: 0 0 180px; } }
@media (min-width: 768px) { .hsc-row .pcard { flex: 0 0 210px; } }

.top-prod-slide {
  flex: 0 0 160px;
  scroll-snap-align: start;
}

@media (min-width: 480px) { .top-prod-slide { flex: 0 0 180px; } }
@media (min-width: 768px) { .top-prod-slide { flex: 0 0 210px; } }
@media (min-width: 1024px){ .top-prod-slide { flex: 0 0 230px; } }

.top-prod-slide > .pcard {
  width: 100%;
}
/* ── Card-link overlay — keeps interactive buttons clickable above invisible nav link ── */
.pcard { position: relative; }  /* ensures absolute children scope to card */
.pc-wish, .pc-add, .pcsz { position: relative; z-index: 5; }
.pc-card-link:focus-visible { outline: 2px solid var(--pc-green); outline-offset: -4px; }