/* ================================================================
   THE PURE HARVEST GROUP — cards.css  v1.0
   Premium product card system. Mobile-first.
   Applies to: .product-card (carousel + grid)
   ================================================================ */

/* ── CARD BASE ───────────────────────────────────────────────── */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 16px;
  border: 1.5px solid #ede8df;
  box-shadow: 0 2px 12px rgba(30,58,30,0.07);
  overflow: hidden;
  cursor: pointer;                        /* full card is clickable */
  transition: transform 0.22s ease,
              box-shadow 0.22s ease,
              border-color 0.22s ease;
  -webkit-tap-highlight-color: transparent; /* no grey flash on iOS */
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(30,58,30,0.14);
  border-color: #c8a030;
}
.product-card:focus-visible {
  outline: 2px solid #c8a030;
  outline-offset: 2px;
}
/* Touch: scale-down instead of lift (prevents jank on scroll) */
@media (hover: none) {
  .product-card:hover { transform: none; box-shadow: 0 2px 12px rgba(30,58,30,0.07); }
  .product-card:active { transform: scale(0.97); border-color: #c8a030; }
}

/* ── IMAGE AREA ──────────────────────────────────────────────── */
.product-img,
.product-image-wrap {
  width: 100%;
  height: 190px;
  background: #f5f0e8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.product-img img,
.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.35s ease;
  border-radius: 0;       /* image fills wrap — wrap has radius */
}
.product-card:hover .product-img img,
.product-card:hover .product-image-wrap img {
  transform: scale(1.05);
}
/* Emoji fallback */
.product-img > span,
.product-image-wrap > span[aria-hidden] {
  font-size: 52px;
  line-height: 1;
}

/* ── BADGES (overlaid on image) ──────────────────────────────── */
.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: #1e3a1e;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 20px;
  z-index: 2;
  pointer-events: none;   /* never intercept card click */
}
.product-badge.badge-gold,
.badge-bestseller { background: #c8a030; color: #1e3a1e; }
.badge-new        { background: #1e3a1e; color: #e8c060; }

.product-disc-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #c0392b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  z-index: 2;
  pointer-events: none;
}
.out-of-stock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 3;
  pointer-events: none;
}

/* ── CARD BODY ───────────────────────────────────────────────── */
.product-info,
.product-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 5px;
}

/* Category tag */
.product-cat,
.product-category-tag {
  font-size: 10px !important;
  font-weight: 900 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  color: #2c7a2c !important;       /* vivid green — always readable */
  opacity: 1 !important;
  margin: 0 !important;
  line-height: 1.2;
}

/* Product name */
.product-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 700;
  color: #1e3a1e;
  line-height: 1.3;
  margin: 0;
  pointer-events: none;   /* clicks fall through to card */
}

/* Description — 2-line clamp */
.product-desc {
  font-size: 12.5px;
  color: #6b6b5a;
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  pointer-events: none;
}

/* ── SKU SELECTOR + PRICE ROW ─────────────────────────────────── */
.product-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  pointer-events: auto;   /* explicitly allow */
}
.sku-select {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1.5px solid #e0d8cc;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #faf8f4;
  color: #1e3a1e;
  cursor: pointer;
  /* stop card click when selecting SKU */
  pointer-events: auto;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231e3a1e' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}
.sku-select:focus {
  outline: none;
  border-color: #c8a030;
  box-shadow: 0 0 0 3px rgba(200,160,48,0.12);
}
.product-price,
.product-card-price {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: #2c6e2c;
  white-space: nowrap;
  pointer-events: none;
}
.product-price-original {
  font-size: 12px;
  color: #aaa;
  text-decoration: line-through;
  font-family: 'Lato', sans-serif;
  font-weight: 400;
}
.product-price-discounted {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  color: #c0392b;
}
/* Index.php carousel uses product-footer layout */
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
}
.product-sku-label {
  font-size: 11px;
  color: #aaa;
  font-family: 'Lato', sans-serif;
}

/* ── ADD TO CART BUTTON ──────────────────────────────────────── */
/* Positioned OUTSIDE the click zone — stopPropagation handles the rest */
.product-actions {
  display: flex;
  gap: 0;
  margin-top: 12px;
  pointer-events: auto;
}
.btn-add-cart,
button.btn-add-cart {
  flex: 1;
  background: #1e3a1e;
  color: #ffffff;
  border: none;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  font-family: 'Lato', inherit;
  transition: background 0.18s, transform 0.12s;
  min-height: 44px;               /* thumb-friendly touch target */
  pointer-events: auto;           /* must stay clickable */
  -webkit-tap-highlight-color: transparent;
}
.btn-add-cart:hover   { background: #152e15; }
.btn-add-cart:active  { transform: scale(0.97); }
.btn-add-cart:disabled {
  background: #c5c0b8;
  color: #888;
  cursor: not-allowed;
  transform: none;
}
/* "Details" button — REMOVED from HTML; this hides it if any remain */
.btn-view-product { display: none !important; }

/* ── TRUST PILLS (small inline badges) ───────────────────────── */
.trust-pill-sm {
  font-size: 9.5px !important;
  padding: 2px 7px !important;
  border-radius: 10px;
  pointer-events: none;
}

/* ================================================================
   GRID SIZES
   Mobile: 2 columns  Tablet: 3  Desktop: 4
   ================================================================ */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 640px)  { .products-grid { gap: 18px; } }
@media (min-width: 900px)  { .products-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .products-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 359px)  { .products-grid { grid-template-columns: 1fr; } }

/* Carousel cards */
.carousel-track .product-card {
  flex: 0 0 80%;
  min-width: 0;
  scroll-snap-align: start;
}
@media (min-width: 480px)  { .carousel-track .product-card { flex: 0 0 calc(50% - 8px); } }
@media (min-width: 900px)  { .carousel-track .product-card { flex: 0 0 calc(25% - 12px); } }

/* ================================================================
   CARD IMAGE HEIGHTS — responsive
   ================================================================ */
@media (max-width: 400px) {
  .product-img,
  .product-image-wrap { height: 160px; }
  .product-name       { font-size: 14px; }
  .product-info,
  .product-body       { padding: 12px 12px 14px; }
}
@media (min-width: 900px) {
  .product-img,
  .product-image-wrap { height: 210px; }
}

/* ── ORGANIC PILL ─────────────────────────────────────────── */
.organic-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #e8f5e0;
  color: #1e5c1e;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1px solid #b8dca0;
  width: fit-content;
  pointer-events: none;
  flex-shrink: 0;
  line-height: 1.4;
}
