/* ─────────────────────────────────────────────────────────────────────
   AVENU product-card — section-specific styles.
   Primitives (.product-card, .product-grid, .badge--*, .product-card__name,
   .product-card__wishlist, .product-card__quick-add, etc.) live in
   assets/common.css. This file ONLY adds:
     · primary/secondary image swap mechanics for our markup
     · top-left badge COLUMN positioning
     · sale-red percent chip styling
     · color-swatch sizing + "+N" overflow indicator
     · mobile responsive tweaks (smaller fonts, fewer swatches, no quick-add)
   ───────────────────────────────────────────────────────────────────── */

/* ── Media ─────────────────────────────────────────────────────────── */
.product-card__media {
  display: block;
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
}
.product-card__media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 280ms ease, transform 600ms ease;
}
.product-card__media-img--primary   { opacity: 1; z-index: 1; }
.product-card__media-img--secondary { opacity: 0; z-index: 1; }
.product-card:hover .product-card__media-img--primary   { opacity: 0; }
.product-card:hover .product-card__media-img--secondary { opacity: 1; }

.product-card__media-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--color-text-soft);
  background: var(--color-surface);
}

/* ── Badge column (top-left, single badge per card per prototype) ──── */
.product-card__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 3;
  pointer-events: none;
}
.product-card__badges .badge {
  pointer-events: auto;
  padding: 5px 9px;
  font-size: 10px;
  letter-spacing: 0.08em;
  border-radius: 2px;
}

/* ── Wishlist heart — round white pill, top-right ──────────────────── */
.product-card__wishlist {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 160ms ease, background 160ms ease;
  z-index: 3;
}
.product-card__wishlist:hover  { transform: scale(1.08); background: #fff; }
.product-card__wishlist:active { transform: scale(0.96); }
.product-card__wishlist svg    { width: 14px; height: 14px; }
.product-card__wishlist[data-in-wishlist="1"] svg { fill: var(--color-accent); color: var(--color-accent); }

/* ── Quick-add slide-up at bottom of media ─────────────────────────── */
.product-card__quick-add {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  background: rgba(15, 15, 15, 0.92);
  color: #fff;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: none;
  border: 0;
  border-top: 0;
  transform: translateY(100%);
  transition: transform 260ms cubic-bezier(0.2, 0.7, 0.2, 1);
  z-index: 3;
}
.product-card:hover .product-card__quick-add,
.product-card:focus-within .product-card__quick-add {
  transform: translateY(0);
}

/* ── Body ──────────────────────────────────────────────────────────── */
.product-card__body {
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-card__name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--color-text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  transition: color 120ms ease;
}
.product-card__name:hover { color: var(--color-accent); }

/* ── Color swatches row (mock prototype: 14px circles + "+N" muted) ── */
.product-card__swatches {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.product-card__swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex: 0 0 auto;
}
.product-card__swatch-more {
  margin-left: 4px;
  font-family: var(--font-body);
  font-size: 10px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── Price row (bold price + strike MRP + sale-red %OFF chip) ──────── */
.product-card__price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.product-card__price {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1;
}
.product-card__mrp {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
  text-decoration: line-through;
  line-height: 1;
}
.product-card__off {
  display: inline-flex;
  align-items: center;
  padding: 3px 6px;
  background: #FDECEE;
  color: var(--color-accent);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 3px;
  line-height: 1;
}

/* ── Sold-out treatment ────────────────────────────────────────────── */
.product-card--soldout .product-card__media-img--primary,
.product-card--soldout .product-card__media-img--secondary { opacity: 0.55; }
.product-card--soldout .product-card__name { color: var(--color-text-muted); }

/* ── Rating row (rendered by rating-summary snippet) ───────────────── */
.product-card__body .rating-summary {
  font-size: 11px;
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.product-card__body .rating-summary__star          { color: var(--color-border); }
.product-card__body .rating-summary__star--filled  { color: #F5A524; }

/* ── Tablet (≤1024) ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .product-card__name { font-size: 13px; }
  .product-card__price { font-size: 13px; }
}

/* ── Mobile (≤640) — disable quick-add (no hover), trim swatches ───── */
@media (max-width: 640px) {
  .product-card__media        { border-radius: 2px; }
  .product-card__wishlist     { width: 28px; height: 28px; top: 8px; right: 8px; }
  .product-card__wishlist svg { width: 12px; height: 12px; }
  .product-card__badges       { top: 8px; left: 8px; }
  .product-card__badges .badge { font-size: 9px; padding: 4px 7px; }
  .product-card__body         { padding-top: 10px; gap: 4px; }
  .product-card__name         { font-size: 13px; }
  .product-card__price        { font-size: 13px; }
  .product-card__mrp          { font-size: 11px; }
  .product-card__off          { font-size: 9px; padding: 2px 5px; }
  .product-card__quick-add    { display: none; }

  /* Show fewer swatches on mobile to avoid overflow on 2-col grid */
  .product-card__swatch:nth-child(n+4) { display: none; }
  .product-card__swatch-more           { display: none; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .product-card__media-img,
  .product-card__quick-add { transition: none; }
}
