/* =========================================================
   Shared Product Card Styles
   Used by: homepage, category, featured-brands
   ========================================================= */

/* =========================================================
   Product Card
   ========================================================= */
.product-card {
  background: #ffffff;
  color: #000;
  border: 1px solid rgba(1, 68, 33, 0.1);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column;
  padding: 16px; cursor: pointer; overflow: visible;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  position: relative;
  box-sizing: border-box;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 28px rgba(1, 68, 33, 0.15);
  border-color: rgba(1, 68, 33, 0.25);
}

.product-top {
  display: flex; flex-direction: row; align-items: flex-start;
  gap: 0 14px; padding-bottom: 4px;
}

.product-image {
  width: 180px; height: 180px; object-fit: contain;
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  padding: 6px; transition: transform 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
}
.product-card:hover .product-image {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.14);
}

.product-info {
  display: flex; flex-direction: column;
  align-items: flex-start; gap: 6px;
  background: transparent; padding: 4px 0;
  box-sizing: border-box; flex: 1; min-width: 0;
}

/* Score + Price row */
.product-score-price-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  width: 100%;
}

.product-score { display: flex; align-items: center; justify-content: center; }
.product-score .circular-score {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

/* Dual score wheels (percentile + raw) */
.product-score-dual {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.product-score-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.product-score-group-label {
  font-size: 8px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-align: center;
  line-height: 1;
}

.product-price {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-variant-numeric: tabular-nums;
  color: #111; font-size: 20px; text-align: center;
}

/* Stars */
.product-stars { display: flex; align-items: center; margin-top: 2px; }
.product-stars .rating { display: inline-flex; align-items: center; gap: 5px; color: #666; }
.product-stars .stars { display: inline-grid; grid-auto-flow: column; gap: 3px; }
.product-stars .star { width: 18px; height: 18px; }
.product-stars .star path { stroke: #f5a623; stroke-width: 1; fill: none; }
.product-stars .star--empty path { fill: rgba(0,0,0,0.10); stroke: rgba(0,0,0,0.10); }
.product-stars .star--full path,
.product-stars .star--half path { fill: #f5a623; stroke: #f5a623; }
.product-stars .rating-count { font-size: 12px; color: #777; }

/* Product attribute tags (materials, features, demographics) */
.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.product-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,0.12);
  background: rgba(0,0,0,0.04);
  color: #333;
  line-height: 1.3;
}
.product-tag--material {
  background: #edf5f0;
  border-color: rgba(11,122,79,0.25);
  color: #0b5e3f;
}
.product-tag--feature {
  background: #eef3fa;
  border-color: rgba(23,105,170,0.25);
  color: #1a5276;
}
.product-tag--demographic {
  background: #f5f0eb;
  border-color: rgba(139,109,71,0.25);
  color: #5c4a2e;
}
.product-tag--origin {
  background: #f0eef5;
  border-color: rgba(93,71,139,0.25);
  color: #3d2e5c;
}

/* Brand value attributes — full-width row below image+info area */
.product-brand-values {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.product-brand-values--below {
  padding: 0 2px;
  margin-top: 6px;
}
.brand-value-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.12);
  color: #333;
  line-height: 1.3;
}
.brand-value-pill.brand-value--more {
  background: transparent;
  border: 1px dashed rgba(0,0,0,0.2);
  color: #666;
  font-style: italic;
}
.brand-value-icon {
  font-weight: 700;
  font-size: 11px;
  color: #e03a3a;
}
.brand-value-pill.brand-value--true .brand-value-icon {
  color: #2e7d32;
}

/* Product title */
.product-title {
  position: relative; margin-top: 8px; padding-top: 8px;
  font-size: 13px; font-weight: 600; text-align: center; line-height: 1.4;
}
.product-title::before {
  content: ""; position: absolute; top: 0; left: 5%; right: 5%;
  height: 1px; background: rgba(0,0,0,0.12);
}
.product-title a {
  color: #000000; text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; text-overflow: ellipsis;
}
.product-title a:hover { color: #0b7a4f; text-decoration: underline; }

/* =========================================================
   Source Badge (Amazon, Target, Walmart)
   ========================================================= */
.source-badge {
  position: absolute;
  bottom: -10px;
  right: 10px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  z-index: 10;
}
.source-badge--amazon {
  background: linear-gradient(135deg, #072908 0%, #0b4f0b 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(7, 41, 8, 0.3);
}
.source-badge--target {
  background: linear-gradient(135deg, #cc0000 0%, #b30000 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(204, 0, 0, 0.25);
}
.source-badge--walmart {
  background: linear-gradient(135deg, #0071ce 0%, #005fa3 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 113, 206, 0.25);
}

/* Leif Certified badge on product cards */
.certified-card-badge {
  position: absolute;
  bottom: -8px;
  right: 80px;
  width: 26px;
  height: 26px;
  z-index: 11;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
}
.certified-card-badge svg {
  width: 100%;
  height: 100%;
}

/* Sponsored badge for sponsored product slots */
.sponsored-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #fdf5e6 0%, #f9f0d9 100%);
  color: #5a5a5a;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(180, 148, 31, 0.15);
  letter-spacing: 0.3px;
  z-index: 10;
}

/* =========================================================
   Heart (Wishlist) Button on Product Cards
   ========================================================= */
.product-heart-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.product-heart-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(0,0,0,0.18);
  background: #fff;
}
.product-heart-btn svg {
  width: 18px;
  height: 18px;
  stroke: #999;
  fill: none;
  stroke-width: 2;
  transition: stroke 0.2s ease, fill 0.3s ease, transform 0.3s ease;
}
.product-heart-btn.hearted svg {
  stroke: #e91e63;
  fill: #e91e63;
}

/* Heart pop animation */
@keyframes heartPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.4); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}
.product-heart-btn.heart-pop svg {
  animation: heartPop 0.4s ease;
}

/* =========================================================
   No Results Message
   ========================================================= */
.no-results-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
}
.no-results-title {
  font-size: 28px;
  font-weight: 800;
  color: #000000;
  margin-bottom: 8px;
}
.no-results-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: #000000;
  margin-bottom: 20px;
}
.no-results-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.no-results-suggestion {
  font-size: 14px;
  font-weight: 500;
  color: #000000;
  background: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.12);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.no-results-suggestion--all {
  font-weight: 700;
  margin-top: 4px;
}

/* =========================================================
   RESPONSIVE — Product Card breakpoints
   ========================================================= */

/* --- Tablet (max 900px) --- */
@media (max-width: 900px) {
  .product-card {
    max-width: none;
  }
  .product-image {
    width: 100px;
    height: 100px;
  }
}

/* --- Mobile (max 640px) --- */
@media (max-width: 640px) {
  /* Product cards: cleaner mobile layout */
  .product-card {
    max-width: none;
    padding: 12px;
    min-height: auto;
    border-radius: 10px;
  }
  .product-top {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 8px;
  }
  .product-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: none;
    padding: 4px;
  }
  .product-info {
    min-width: 0;
    width: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .product-score-price-row {
    gap: 4px;
  }
  .product-score .circular-score {
    width: 40px;
    height: 40px;
  }
  .product-price {
    font-size: 16px;
  }
  .product-stars .star {
    width: 14px;
    height: 14px;
  }
  .product-stars .rating-count {
    font-size: 10px;
  }
  .product-tags {
    gap: 4px;
  }
  .product-tag {
    font-size: 10px;
    padding: 3px 8px;
  }
  .brand-value-pill {
    font-size: 10px;
    padding: 3px 8px;
  }
  .product-title {
    font-size: 12px;
    line-height: 1.35;
    margin-top: 8px;
    padding-top: 8px;
  }
  .product-title a {
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }

  /* Sponsored cards: compact on mobile */
  .product-card[aria-label="Sponsored Product"] {
    min-height: auto;
    padding: 10px;
  }
  .product-card[aria-label="Sponsored Product"] .product-image {
    width: 60px;
    height: 60px;
    padding: 6px;
    background: #f9f9f3;
  }
  .product-card[aria-label="Sponsored Product"] .product-title {
    font-size: 11px;
    color: #999;
  }
  .sponsored-badge {
    font-size: 9px;
    padding: 3px 7px;
    top: 8px;
    left: 8px;
  }

  /* Source badge */
  .source-badge {
    font-size: 10px;
    padding: 3px 8px;
    bottom: -8px;
    right: 8px;
  }

  /* Heart button — reposition on mobile */
  .product-heart-btn {
    width: 28px;
    height: 28px;
    top: auto;
    bottom: 8px;
    right: 8px;
  }
  .product-heart-btn svg {
    width: 14px;
    height: 14px;
  }
}
