/* ============================================================
   Listing pages — extends assets/site.css
   ============================================================ */

/* ---- Breadcrumbs ---- */
.breadcrumbs {
  padding: 28px 0 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.breadcrumbs a {
  color: var(--text-secondary);
  transition: color 0.15s;
}
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 8px; opacity: 0.5; }

/* ---- Listing header ---- */
.listing-header { padding: 16px 0 24px; }
.listing-header h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-bottom: 18px;
  max-width: 880px;
}
.listing-header h1 .accent-dot { color: var(--accent); }
.listing-intro {
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 760px;
  margin-bottom: 20px;
  font-weight: 400;
}
.listing-intro strong { color: var(--text-primary); font-weight: 600; }

.listing-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0 24px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 36px;
  gap: 16px;
  flex-wrap: wrap;
}
.updated-at {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.updated-at::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2d8a2d;
  box-shadow: 0 0 0 3px rgba(45, 138, 45, 0.18);
  display: inline-block;
}
.updated-at em { font-style: normal; }

.ad-disclosure-toggle { position: relative; }
.disclosure-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s;
}
.disclosure-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.disclosure-popup {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 10px;
  width: 520px;
  max-width: calc(100vw - 40px);
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(14,17,22,0.14);
  z-index: 50;
}
.disclosure-popup.active { display: block; }
.disclosure-popup p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 12px;
}
.disclosure-popup p:last-child { margin-bottom: 0; }

/* ---- Product card ---- */
.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
  padding: 28px 28px;
  margin-bottom: 18px;
  position: relative;
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
}
.product-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.product-card.rank-1 {
  background: linear-gradient(180deg, #FFF8F2 0%, #FFFFFF 60%);
  border: 1px solid var(--accent-ring);
  box-shadow: 0 1px 0 rgba(232,93,38,0.06), 0 18px 40px rgba(232,93,38,0.12);
}
.product-card.rank-1::before {
  content: "EDITOR'S PICK";
  position: absolute;
  top: -10px;
  left: 28px;
  background: var(--accent);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 5px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(232,93,38,0.3);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.rank-number {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1;
  min-width: 36px;
  height: 36px;
  background: var(--bg-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.product-card.rank-1 .rank-number {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.12em;
}
.badge-best { background: var(--accent); color: #fff; }
.badge-affordable { background: #1f6f1f; color: #fff; }
.badge-hot { background: #d62828; color: #fff; }
.badge-popular { background: #1e4f8f; color: #fff; }
.badge-limited { background: #6b46c1; color: #fff; }
.badge-wireless { background: #0f4c81; color: #fff; }

.discount-flag {
  display: inline-block;
  background: rgba(214, 40, 40, 0.10);
  color: #b32020;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  margin-left: auto;
  letter-spacing: 0.04em;
}

.card-body {
  display: grid;
  grid-template-columns: 160px 1fr 130px 180px;
  gap: 24px;
  align-items: start;
}

.product-image {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-alt);
  border-radius: 14px;
  padding: 10px;
  aspect-ratio: 1;
}
.product-image img {
  width: 100%;
  max-width: 140px;
  height: 140px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-info { min-width: 0; }
.product-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
  line-height: 1.25;
}
.product-name a {
  color: var(--text-primary);
  transition: color 0.15s;
}
.product-name a:hover { color: var(--accent); }
.product-features { list-style: none; }
.product-features li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 3px 0;
  padding-left: 24px;
  position: relative;
  line-height: 1.55;
}
.product-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 14px;
  height: 14px;
  background: var(--social-proof-bg);
  border-radius: 50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'><path d='M3.5 7.5l2.5 2.5 5-5.5' stroke='%231f6f1f' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
}

.score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--text-on-ink);
  border-radius: 14px;
  padding: 18px 12px;
  text-align: center;
}
.product-card.rank-1 .score-box {
  background: linear-gradient(160deg, var(--accent), #c84a18);
}
.score-number {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1;
  margin-bottom: 6px;
}
.score-number.score-rating {
  font-size: 1.9rem;
}
.score-stars {
  font-size: 0.85rem;
  margin-bottom: 6px;
}
.star {
  display: inline-block;
  line-height: 1;
  position: relative;
}
.star-full { color: #ffc857; }
.star-empty { color: rgba(255, 255, 255, 0.35); }
.star-half { color: rgba(255, 255, 255, 0.35); }
.star-half::before {
  content: '\2605';
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  overflow: hidden;
  color: #ffc857;
}
.review-count {
  font-size: 0.7rem;
  color: rgba(247, 244, 238, 0.7);
  font-weight: 500;
}

.product-action {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-top: 4px;
}
.social-proof {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 2px;
  font-weight: 500;
}
.cta-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 14px 20px;
  border-radius: 999px;
  text-align: center;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(232, 93, 38, 0.28);
}
.cta-button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(232, 93, 38, 0.34);
}
.cta-button::after {
  content: "→";
  display: inline-block;
  transition: transform 0.2s;
}
.cta-button:hover::after { transform: translateX(3px); }

.amazon-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  gap: 2px;
}
.amazon-badge img {
  height: 18px;
  width: auto;
  display: block;
  opacity: 0.85;
}

/* ---- Scroll to top ---- */
.scroll-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--text-on-ink);
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(0,0,0,0.22);
  transition: background 0.2s, transform 0.2s;
  z-index: 50;
  font-size: 1.1rem;
}
.scroll-top:hover {
  background: var(--accent);
  transform: translateY(-2px);
}
.scroll-top.visible { display: inline-flex; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .card-body {
    grid-template-columns: 130px 1fr 180px;
    gap: 20px;
  }
  .score-box {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: 14px;
    padding: 14px 18px;
  }
  .score-number { font-size: 1.7rem; margin-bottom: 0; }
  .score-stars { margin-bottom: 0; }
}

@media (max-width: 640px) {
  .product-card { padding: 24px 20px; }
  .product-card.rank-1::before { left: 20px; }
  .card-body {
    grid-template-columns: 1fr;
    justify-items: stretch;
    text-align: left;
  }
  .product-image { width: 100%; max-width: 220px; margin: 0 auto; }
  .product-info { width: 100%; }
  .product-action { width: 100%; }
  .score-box { flex-direction: row; width: 100%; }
  .listing-meta { flex-direction: column; align-items: flex-start; gap: 10px; }
  .disclosure-popup { width: calc(100vw - 36px); right: auto; left: 0; }
}
