/* ============================================================================
   PRODUCT GRID
   ============================================================================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 10px;
  padding: 14px var(--side);
}

/* ============================================================================
   PRODUCT CARD
   ============================================================================ */
.product-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.image-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  aspect-ratio: 0.95;
  border-radius: 13px;
  background: var(--c-surface-image);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(2, 6, 12, 0.03);
}

.image-box {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 10px 0;
  background: var(--c-bg);
}

.image-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 30px;
  padding: 5px 6px 5px 10px;
  background: var(--c-surface-image);
  z-index: 5;
}

.card-bottom .weight {
  min-width: 0;
  font-family: var(--font-family);
font-weight: 600;
font-size: 10px;
letter-spacing: 1px;
  color: var(--c-text-soft);
  letter-spacing: -0.36px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================================
   ADD BUTTON (in-card)
   ============================================================================ */
.add-btn {
  position: absolute;
top: 6px;
right: 6px;
z-index: 7;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1.75px solid var(--c-blue);
  border-radius: 9px;
  background: linear-gradient(180deg, var(--c-bg) 0%, #f6faff 48%, #cce0fc 100%);
  color: var(--c-blue);
  transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.add-btn::before,
.add-btn::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: currentColor;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

.add-btn::before {
  width: 16px;
  height: 2.5px;
}

.add-btn::after {
  width: 2.5px;
  height: 16px;
}

.add-btn:active {
  transform: scale(0.88);
}

.add-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: var(--c-surface-strip);
}

.add-btn.is-hidden {
  display: none;
}

/* ============================================================================
   QTY STEPPER (in-card, swaps with .add-btn when item is in cart)
   ============================================================================ */
.qty-stepper {
    position: absolute;
top: 6px;
right: 6px;
z-index: 7;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 90px;
  height: 32px;
  padding: 0 6px;
  border: 1.75px solid var(--c-blue);
  border-radius: 9px;
  background: linear-gradient(180deg, var(--c-bg) 0%, #f6faff 48%, #cce0fc 100%);
  color: var(--c-blue);
  transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.qty-stepper.is-hidden {
  display: none;
}

.qty-stepper.is-error,
.add-btn.is-error {
  border-color: var(--c-accent-text);
}

.korbi-stock-toast {
  position: fixed;
  z-index: 99999;
  background: var(--c-accent-text);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 4px));
  transition: opacity 200ms ease;
}

.korbi-stock-toast.is-visible {
  opacity: 1;
}

.qty-stepper .qbtn {
  position: relative;
  width: 22px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.qty-stepper .qbtn::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2.3px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.qty-stepper .qbtn.plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.3px;
  height: 12px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
}

.qty-stepper .qval {
  flex: 1;
  text-align: center;
  font: var(--t-card);
  font-weight: 800;
  color: inherit;
}

/* Qty bump animation */
@keyframes qtyBump {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.qty-stepper .qval.is-bumping {
  animation: qtyBump 200ms ease;
}

.qty-stepper.is-bumping {
  transform: scale(1.04);
}

/* ============================================================================
   BADGES
   ============================================================================ */
.ad-badge,
.sold-badge {
  position: absolute;
  z-index: 6;
  padding: 3px 7px;
  border-radius: var(--r-sm);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  font: var(--t-micro);
  font-weight: 800;
  color: var(--c-text-soft);
  opacity: 0.92;
}

.ad-badge {
  top: 8px;
  left: 8px;
}

.sold-badge {
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  padding: 3px 9px;
  background: rgba(255, 255, 255, 0.94);
  font-size: 12px;
}

.image-card.is-sold .image-box img {
  opacity: 0.45;
  filter: grayscale(0.25);
}

/* ============================================================================
   CARD META
   ============================================================================ */
.product-card .meta {
  padding: 8px 1px 0;
}

.product-card .rating-row {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 12px;
  overflow: hidden;
}

.product-card .star {
  font-size: 11px;
  line-height: 12px;
  font-weight: 700;
  color: var(--c-rating);
  transform: translateY(-0.4px);
}

.product-card .score {
  font: var(--t-micro);
  color: var(--c-green);
  letter-spacing: -0.18px;
}

.product-card .count {
  font: var(--t-micro);
  color: var(--c-text-muted);
}

.product-card .name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 4px 0 0;
  height: 32px;
  font: var(--t-card);
  color: var(--c-card-name);
  letter-spacing: -0.3px;
  overflow: hidden;
  overflow-wrap: anywhere;
}

.product-card .offer-row {
  display: flex;
  align-items: center;
  margin-top: 3px;
  height: 15px;
  overflow: hidden;
}

.product-card .offer {
  padding-right: 5px;
  background: transparent;
  font: var(--t-caption);
  font-weight: 700;
  color: var(--c-green);
  letter-spacing: -0.34px;
  white-space: nowrap;
}

.product-card .dash {
  flex: 1;
  height: 1px;
  min-width: 22px;
  background-image: linear-gradient(to right, rgba(2, 6, 12, 0.16) 45%, transparent 0);
  background-size: 5px 1px;
}

.product-card .price-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 1px;
  height: 18px;
}

.product-card .price {
  font: var(--t-body-strong);
  color: var(--c-text-strong);
  letter-spacing: -0.38px;
}

.product-card .mrp {
  position: relative;
  font: var(--t-caption);
  color: var(--c-text-faint);
}

.product-card .mrp::after {
  content: "";
  position: absolute;
  inset: 50% 0 auto 0;
  height: 1px;
  background: var(--c-strike);
  transform: translateY(-50%);
}
