/* ============================================
   Reusable components: buttons, badges, cards,
   stars, table
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  text-align: center;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--color-blue);
  color: #fff;
  padding: 16px 28px;
  box-shadow: 0 6px 18px rgba(47, 174, 110, 0.32);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: var(--color-blue-dark);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
}

.btn-outline {
  background: transparent;
  color: var(--color-navy);
  padding: 16px 28px;
  border: 2px solid var(--color-border);
}

@media (max-width: 899px) {
  .btn-outline {
    background: rgba(255, 255, 255, 0.9);
    border-color: var(--color-navy);
  }
}

.btn-outline:hover,
.btn-outline:focus-visible {
  border-color: var(--color-navy);
  transform: translateY(-1px);
}

.btn-small {
  padding: 9px 18px;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
}

.stars {
  color: var(--color-star);
  letter-spacing: 2px;
  font-size: 1.1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-bg-alt);
  color: var(--color-navy);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
}

.badge-gold {
  background: #fdf1de;
  color: #8a5c00;
  border-color: #f5d9a8;
}

/* Reason cards ("Before The Rankings") */
.reason-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: 24px;
  height: 100%;
}

.reason-card__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-navy);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 14px;
}

.reason-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.reason-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.reason-card__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
}

.reason-card__list li {
  font-size: 0.9rem;
  color: var(--color-text);
  font-weight: 600;
}

/* Score category pills ("How We Tested") */
.score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 640px) {
  .score-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1000px) {
  .score-grid {
    grid-template-columns: repeat(8, 1fr);
    gap: 0;
  }
}

.score-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 16px 10px;
}

@media (min-width: 1000px) {
  .score-pill {
    border: none;
    border-right: 1px solid #c8e6d5;
    border-radius: 0;
    padding: 18px 12px;
  }

  .score-pill:last-child {
    border-right: none;
  }
}

.score-pill__label {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.25;
}

.score-pill__desc {
  font-weight: 400;
  font-size: 0.76rem;
  line-height: 1.15;
  color: var(--color-text-muted);
}

.score-pill__icon {
  color: var(--color-gold);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Comparison table */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 0.95rem;
}

.compare-table th,
.compare-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

.compare-table thead th {
  background: var(--color-navy);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compare-table tbody tr:last-child td {
  border-bottom: none;
}

.compare-table tbody tr.is-winner {
  background: #fdf1de;
  font-weight: 700;
}

.compare-table .check {
  color: var(--color-success);
  font-weight: 800;
}

.compare-table__product {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.compare-table__product img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: var(--color-bg-alt);
  flex-shrink: 0;
}

/* Award badges (winner section) */
.award-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.award-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-navy);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 999px;
}

/* Feature / love cards */
.love-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (min-width: 640px) {
  .love-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.love-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-md);
  padding: 18px;
  text-align: center;
}

.love-card__icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  color: var(--color-blue);
}

.love-card p {
  font-weight: 700;
  font-size: 0.92rem;
}

/* Perfect-for tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 700;
  font-size: 0.88rem;
}

/* Real world test rows */
.test-table {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.test-table td {
  padding: 14px 8px;
  border-bottom: 1px solid var(--color-border);
}

.test-table tr:last-child td {
  border-bottom: none;
}

.test-table .stars {
  font-size: 0.95rem;
}

.test-table .time {
  font-weight: 800;
  color: var(--color-navy);
  text-align: right;
  white-space: nowrap;
}

.test-table .pending {
  color: var(--color-text-muted);
  font-style: italic;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.test-table__item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.test-table__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e2f3e9;
  color: var(--color-blue);
  flex-shrink: 0;
}

/* Checklist ("Who Should Buy") */
.check-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 640px) {
  .check-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.check-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 0.98rem;
}

.check-list .check {
  color: var(--color-success);
  font-weight: 800;
  flex-shrink: 0;
}

/* FAQ accordion */
.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 20px 0;
  font-weight: 700;
  font-size: 1.02rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.faq-question__icon {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-question[aria-expanded="true"] .faq-question__icon {
  transform: rotate(45deg);
}

.faq-answer {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.faq-answer p {
  padding-bottom: 20px;
  color: var(--color-text-muted);
  font-size: 0.96rem;
}

/* Sticky mobile CTA */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: #fff;
  border-top: 1px solid var(--color-border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(20, 35, 31, 0.12);
}

@media (min-width: 900px) {
  .sticky-cta {
    display: none;
  }
}
