/* ============================================================
   SWAWLAMBAN — Amazon/Flipkart Inspired Product Card
   ============================================================ */

/* ── Card Shell ── */
.pc {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow .22s ease, transform .22s ease;
  overflow: hidden;
  height: 100%;
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  cursor: pointer;
}

.pc:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,.13);
  transform: translateY(-2px);
  border-color: #d0d0d0;
  z-index: 2;
}

/* ── Image area ── */
.pc-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f8f8f8;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.pc-img-link {
  display: block;
  width: 100%;
  height: 100%;
}

.pc-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  display: block;
  transition: transform .4s cubic-bezier(.25,.46,.45,.94);
}

.pc:hover .pc-img-wrap img {
  transform: scale(1.06);
}

/* ── Placeholder ── */
.pc-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f9f5ef 0%, #f0e8dc 100%);
  color: #a48b70;
  gap: 10px;
}
.pc-img-placeholder i { font-size: 2.6rem; }
.pc-img-placeholder .placeholder-label {
  font-size: .68rem; font-weight: 600; color: #888;
  text-align: center; padding: 0 12px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

/* ── Discount Badge ── */
.pc-discount-badge {
  position: absolute;
  top: 0; left: 0;
  background: #388e3c;
  color: #fff;
  font-size: .68rem; font-weight: 800;
  text-align: center;
  padding: 4px 9px;
  border-radius: 0 0 8px 0;
  line-height: 1.3;
  z-index: 5;
  letter-spacing: .2px;
}
.pc-discount-badge small { font-size: .55rem; font-weight: 700; }

/* ── Label Badges ── */
.pc-label-badges {
  position: absolute;
  top: 36px; left: 8px;
  display: flex; flex-direction: column; gap: 4px;
  z-index: 4;
}
.pc-label-badge {
  font-size: .54rem; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
  letter-spacing: .2px;
}
.pc-badge-deal  { background: #fff7ed; color: #c05621; border: 1px solid #fed7aa; }
.pc-badge-nat   { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.pc-badge-rx    { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.pc-badge-oos   { background: #f9fafb; color: #6b7280; border: 1px solid #e5e7eb; }

/* ── Wishlist Button ── */
.pc-wishlist-heart-btn {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,0,0,.08);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; cursor: pointer;
  color: #aaa;
  transition: all .2s ease;
  z-index: 5;
  box-shadow: 0 1px 6px rgba(0,0,0,.1);
}
.pc-wishlist-heart-btn:hover,
.pc-wishlist-heart-btn.active {
  color: #e53935;
  border-color: #ffcdd2;
  transform: scale(1.12);
}
.pc-wishlist-heart-btn.active i { color: #e53935; }

/* ── Share Button ── */
.pc-share-btn {
  position: absolute; bottom: 8px; left: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(0,0,0,.07);
  display: flex; align-items: center; justify-content: center;
  font-size: .78rem; cursor: pointer;
  color: #666;
  transition: all .2s ease;
  z-index: 5;
  opacity: 0;
}
.pc:hover .pc-share-btn { opacity: 1; }
.pc-share-btn:hover { background: #fff; color: #111; transform: scale(1.1); }

/* ── Body ── */
.pc-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 3px;
}

/* Category label */
.pc-cat {
  font-size: .58rem;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .7px;
}

/* Product name — Amazon-style clamped */
.pc-name {
  font-size: .84rem;
  font-weight: 600;
  color: #212121;
  line-height: 1.35;
  margin: 2px 0 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
}
.pc-name a { color: inherit; text-decoration: none; }
.pc-name a:hover { color: #1565c0; }

/* ── Star Rating — Flipkart green pill ── */
.pc-rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0;
}
.pc-stars {
  background: #388e3c;
  color: #fff;
  font-size: .58rem;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 700;
}
.pc-stars i { font-size: .52rem; }
.pc-rating-count {
  font-size: .66rem;
  color: #9ca3af;
}

/* ── Pricing — Amazon style ── */
.pc-pricing {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
  margin: 4px 0;
}
.pc-price-now {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0d0d0d;
  letter-spacing: -.4px;
}
.pc-price-now::before { content: '₹'; font-size: .8rem; font-weight: 700; vertical-align: middle; margin-right: 1px; }
.pc-price-old {
  font-size: .78rem;
  color: #9ca3af;
  text-decoration: line-through;
}
.pc-saving {
  font-size: .65rem;
  font-weight: 700;
  color: #388e3c;
}

/* SKU label */
.pc-sku-label {
  font-size: .62rem;
  color: #757575;
  font-weight: 500;
}

/* Free Delivery */
.pc-free-delivery {
  font-size: .61rem;
  color: #0277bd;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pc-free-delivery i { font-size: .68rem; }

/* ── CTA Area ── */
.pc-cta-area { margin-top: auto; padding-top: 8px; }

/* Out-of-stock */
.pc-oos-btn {
  width: 100%;
  padding: 8px;
  background: #f5f5f5;
  color: #bdbdbd;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 600;
  cursor: not-allowed;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .pc-body { padding: 8px 10px 10px; }
  .pc-name  { font-size: .76rem; min-height: 2em; }
  .pc-price-now { font-size: .96rem; }
  .pc-wishlist-heart-btn { width: 28px; height: 28px; top: 6px; right: 6px; }
  .pc-share-btn { opacity: 1; width: 24px; height: 24px; }
  .pc-label-badges { top: 32px; left: 6px; }
}
@media (max-width: 480px) {
  .pc-body { padding: 6px 8px 8px; }
  .pc-name  { font-size: .72rem; }
  .pc-price-now { font-size: .9rem; }
  .pc-saving { display: none; }
  .pc-img-wrap img { padding: 8px; }
}

/* ── Card entrance animation ── */
.product-grid .pc {
  animation: pcFadeUp .3s ease both;
}
@keyframes pcFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.product-grid .pc:nth-child(1)  { animation-delay: .02s; }
.product-grid .pc:nth-child(2)  { animation-delay: .05s; }
.product-grid .pc:nth-child(3)  { animation-delay: .08s; }
.product-grid .pc:nth-child(4)  { animation-delay: .11s; }
.product-grid .pc:nth-child(5)  { animation-delay: .14s; }
.product-grid .pc:nth-child(6)  { animation-delay: .17s; }
.product-grid .pc:nth-child(7)  { animation-delay: .20s; }
.product-grid .pc:nth-child(8)  { animation-delay: .23s; }
.product-grid .pc:nth-child(9)  { animation-delay: .26s; }
.product-grid .pc:nth-child(10) { animation-delay: .29s; }
.product-grid .pc:nth-child(11) { animation-delay: .32s; }
.product-grid .pc:nth-child(12) { animation-delay: .35s; }

/* ── Add to cart + Buy Now buttons inside cards ── */
.add-to-cart-btn {
  flex: 1;
  padding: 9px 6px;
  background: #ff9f00;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background .18s, transform .15s;
  letter-spacing: .2px;
}
.add-to-cart-btn:hover { background: #e65100; }
.add-to-cart-btn:active { transform: scale(.97); }

.btn-buy-now {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 6px;
  background: #fb641b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, transform .15s;
  letter-spacing: .2px;
}
.btn-buy-now:hover { background: #c0392b; }
.btn-buy-now:active { transform: scale(.97); }

/* Two-button row */
.card-buttons-group {
  display: flex;
  gap: 6px;
  width: 100%;
}
.card-buttons-group .add-to-cart-btn,
.card-buttons-group .btn-buy-now-wrap { flex: 1; }
.card-buttons-group .btn-buy-now-wrap form { margin: 0; }
.card-buttons-group .btn-buy-now { padding: 9px 4px; }

/* Qty selector in card */
.quantity-selector-v2.product-card-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff3e0;
  border: 1.5px solid #ff9f00;
  border-radius: 6px;
  overflow: hidden;
  height: 34px;
}
.quantity-selector-v2.product-card-qty .qty-btn {
  width: 34px; height: 34px;
  border: none;
  background: none;
  color: #e65100;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.quantity-selector-v2.product-card-qty .qty-btn:hover { background: #ffe0b2; }
.quantity-selector-v2.product-card-qty .qty-val {
  flex: 1;
  text-align: center;
  font-weight: 800;
  font-size: .88rem;
  color: #212121;
}

/* Spinner */
.btn-spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  animation: btn-spin .65s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.btn-loading { pointer-events: none; opacity: .75; }
.add-to-cart-btn .btn-spinner {
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
}
.btn-buy-now .btn-spinner {
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
}
