/* ============================================================
   PRODUCTS — SabziBuddy
   Merged: grid layout + product card + all badges
   ============================================================ */


/* ════════════════════════════════════════
   1. PRODUCTS GRID
════════════════════════════════════════ */

.products {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 12px 24px;
}

@media (min-width: 480px) {
  .products { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 700px) {
  .products { grid-template-columns: repeat(4, 1fr); }
}

/* ── LOADING STATE ───────────────────────────────────────── */
.products-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--tmut);
}

/* ── EMPTY / NO RESULTS ──────────────────────────────────── */
.products-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--tmut);
}
.products-empty-icon { font-size: 48px; margin-bottom: 12px; }
.products-empty-text { font-size: 15px; font-weight: 600; color: var(--tm); margin-bottom: 6px; }
.products-empty-sub  { font-size: 13px; color: var(--tmut); }


/* ════════════════════════════════════════
   2. PRODUCT CARD
════════════════════════════════════════ */

/* ── CARD WRAPPER ────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(28,56,41,0.07);
  transition: box-shadow var(--t-base) var(--ease),
              transform   var(--t-base) var(--ease);
  position: relative;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ── CARD IMAGE ──────────────────────────────────────────── */
/*.card-img {
  position: relative;
  width: 100%;
  padding-top: 75%;     
  background: #f5f5f0;
  overflow: hidden;
  border-radius: var(--r-md) var(--r-md) 0 0;
}  */

/* ── Card Image ── */
.card-img {
  position: relative;
  width: 100%;
  padding-top: 100%;
  background: #f5f5f0;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
}


.sabzi-img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s var(--ease);
}
@media (hover: hover) {
  .card:hover .sabzi-img { transform: scale(1.04); }
}

/* Emoji / text fallback when no image */
.sabzi-placeholder {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 4px;
  background: var(--cream2);
  color: var(--tmut); font-size: 12px;
}

/* ── CARD BODY ───────────────────────────────────────────── */
.card-body { padding: 10px 12px 14px; }

.price-row {
  display: flex; align-items: center;
  gap: 6px; margin-bottom: 2px;
}

.card-name {
  font-weight: 600; font-size: 13px; color: #111;
  margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-weight { font-size: 11px; color: var(--tmut); }

.card-stock { font-size: 10px; font-weight: 600; margin-top: 2px; }
.card-stock.ok  { color: #16a34a; }
.card-stock.low { color: var(--terra); }


/* ════════════════════════════════════════
   3. BADGES
════════════════════════════════════════ */

/* ── CARD PROMO BADGE (top-left) ─────────────────────────── */
.card-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: var(--ga); color: var(--g2);
  font-size: 9px; font-weight: 800; padding: 3px 7px;
  border-radius: 6px; pointer-events: none;
}
.card-badge.new-badge { background: #FFD700; color: #333; }

/* ── STOCK WARNING BADGE (top-right) ─────────────────────── */
.stock-badge {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: rgba(220,38,38,0.9); color: #fff;
  font-size: 9px; font-weight: 700; padding: 2px 6px;
  border-radius: 5px; pointer-events: none;
}
.stock-badge.low { background: rgba(217,119,6,0.9); }

/* ── SOLD OUT LABEL ──────────────────────────────────────── */
.sold-out-label {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  background: rgba(30,30,30,0.72); color: #fff;
  font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 6px; pointer-events: none;
}

/* ── PRICE BADGE (green pill on card) ────────────────────── */
.price-badge {
  background: var(--green-price); color: #fff;
  font-size: 14px; font-weight: 700; padding: 3px 8px;
  border-radius: 6px; display: inline-flex; align-items: center; line-height: 1;
}
.price-mrp { font-size: 12px; color: var(--tmut); text-decoration: line-through; }
.price-off  { font-size: 11px; font-weight: 600; color: var(--green-price); margin-bottom: 5px; }

/* ── PD PAGE BADGES ──────────────────────────────────────── */
.pd-badge-fresh {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--green-price); color: #fff;
  padding: 4px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 700; font-family: 'Outfit', sans-serif; pointer-events: none;
}
.pd-badge-disc {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: #FF6B35; color: #fff;
  padding: 4px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 700; font-family: 'Outfit', sans-serif; pointer-events: none;
}
.pd-sim-disc {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  background: #FF6B35; color: #fff;
  padding: 2px 8px; border-radius: 12px;
  font-size: 10px; font-weight: 700; font-family: 'Outfit', sans-serif; pointer-events: none;
}

/* ── CART VIEW BADGE (PD page) ───────────────────────────── */
.pd-vc-badge {
  background: var(--green-price); color: #fff;
  font-size: 11px; font-weight: 800;
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif;
}

/* ── WISHLIST (HEART) BUTTON ─────────────────────────────── */
.wish-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.13);
  transition: transform var(--t-fast) var(--ease);
}
.wish-btn:hover      { transform: scale(1.12); }
.wish-btn.wishlisted { color: #E8335A; }

/* ── CTRL DIV POSITION (add btn + qty overlay container) ── */
[id^="ctrl-"] {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 3;
}

/* ── ADD TO CART (+) BUTTON ──────────────────────────────── */
.add-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--g2);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(28, 56, 41, 0.28);
  transition: background var(--t-fast) var(--ease),
              transform  var(--t-fast) var(--ease);
}
.add-btn:hover  { background: var(--g3); transform: scale(1.06); }
.add-btn:active { transform: scale(0.94); }

/* ── QTY OVERLAY (− qty +) ───────────────────────────────── */
.qty-overlay {
  display: flex;
  align-items: center;
  background: var(--g2);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(28, 56, 41, 0.28);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.qo-btn {
  width: 26px;
  height: 30px;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.qo-btn:active { background: rgba(255,255,255,0.15); }

.qo-num {
  flex: 0 0 28px;
  width: 28px;
  height: 30px;
  background: transparent;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
