/* ============================================================
   Affiliate Site Components — shared across all 6 sites
   Based on patterns from OutdoorGearLab, RTINGS, Electric Bike Report,
   Haven of Heat, Michael Kummer, FitnessVolt.
   ============================================================ */

/* ── Amazon-orange CTA button (the highest-leverage element) ── */
.aff-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #FF9900;
  color: #0F1111 !important;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  padding: 14px 24px;
  border-radius: 8px;
  text-decoration: none !important;
  border: 1px solid #E48A0E;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  min-height: 48px;
  letter-spacing: .01em;
  white-space: nowrap;
}
.aff-cta:hover {
  background: #FFA41C;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
  color: #0F1111 !important;
}
.aff-cta:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.aff-cta::after {
  content: "→";
  font-size: 17px;
  font-weight: 700;
  margin-left: 2px;
}
.aff-cta.aff-cta-block {
  width: 100%;
  font-size: 16px;
}
.aff-cta.aff-cta-secondary {
  background: #fff;
  color: #0F1111 !important;
  border: 2px solid #FF9900;
  box-shadow: none;
}
.aff-cta.aff-cta-secondary:hover {
  background: #FFF6E0;
  color: #0F1111 !important;
}

/* ── Star rating widget (social proof inline with product mentions) ── */
.aff-stars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #555;
  vertical-align: middle;
}
.aff-stars-icons {
  display: inline-flex;
  font-size: 16px;
  letter-spacing: 1px;
  color: #FFA41C;
  line-height: 1;
}
.aff-stars-icons::before { content: "★★★★★"; }
.aff-stars-num {
  font-weight: 700;
  color: #0F1111;
  font-size: 14px;
}
.aff-stars-count {
  color: #777;
  font-size: 13px;
}
.aff-stars-count::before { content: "("; }
.aff-stars-count::after  { content: ")"; }

/* ── Product image card (consistent ratio, hover lift) ── */
.aff-product-image {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 12px auto 18px;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.aff-product-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  padding: 12px;
  transition: transform .25s ease;
}
.aff-product-image:hover img {
  transform: scale(1.03);
}

/* ── Product card (top-of-review hero block) ── */
.aff-product-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  align-items: start;
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin: 24px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  position: relative;
}
@media (max-width: 640px) {
  .aff-product-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .aff-product-card .aff-product-image {
    max-width: 220px;
  }
}
.aff-product-card .aff-product-image {
  margin: 0;
  max-width: 100%;
  border: none;
  box-shadow: none;
  background: transparent;
}
.aff-product-card .aff-product-image img {
  padding: 0;
}
.aff-product-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aff-product-info .aff-product-title {
  font-size: 18px;
  font-weight: 700;
  color: #0F1111;
  margin: 0;
}
.aff-product-info .aff-product-price {
  font-size: 22px;
  font-weight: 800;
  color: #B12704;
  letter-spacing: -.01em;
}
.aff-product-info .aff-product-price-from {
  font-size: 13px;
  color: #555;
  font-weight: 400;
  margin-right: 4px;
}

/* ── Editor's Pick / Best Value award ribbons ── */
.aff-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 6px;
}
.aff-badge-gold    { background: linear-gradient(135deg, #FFD700, #E6B800); color: #4A3500; border: 1px solid #C9A100; }
.aff-badge-silver  { background: linear-gradient(135deg, #E8E8E8, #C7C7C7); color: #333; border: 1px solid #A0A0A0; }
.aff-badge-bronze  { background: linear-gradient(135deg, #DDA15E, #C28846); color: #3D2400; border: 1px solid #A06A2C; }
.aff-badge-deal    { background: #D70015; color: #fff; border: 1px solid #B80012; }
.aff-badge-new     { background: #008060; color: #fff; border: 1px solid #006A4F; }

/* Diagonal ribbon variant (top-left corner of product card) */
.aff-ribbon {
  position: absolute;
  top: 14px;
  left: -8px;
  background: linear-gradient(135deg, #FFD700, #E6B800);
  color: #4A3500;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 14px 6px 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  z-index: 1;
}
.aff-ribbon::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  border: 4px solid #8B7100;
  border-bottom-color: transparent;
  border-left-color: transparent;
}

/* ── Numeric score badge (0-100) — top-right ── */
.aff-score {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #008060;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #0F1111;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.aff-score-label {
  position: absolute;
  top: 72px;
  right: 14px;
  font-size: 10px;
  text-align: center;
  color: #555;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  width: 54px;
}

/* ── Pros/Cons two-column ── */
.aff-proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 20px 0;
}
@media (max-width: 640px) { .aff-proscons { grid-template-columns: 1fr; } }
.aff-pros, .aff-cons {
  background: #f8fafc;
  border-radius: 10px;
  padding: 16px 18px;
  border: 1px solid #e5e7eb;
}
.aff-pros { border-left: 4px solid #16a34a; }
.aff-cons { border-left: 4px solid #dc2626; }
.aff-pros h4, .aff-cons h4 {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin: 0 0 10px;
  color: #0F1111;
}
.aff-pros h4::before { content: "✓ "; color: #16a34a; }
.aff-cons h4::before { content: "✗ "; color: #dc2626; }
.aff-pros ul, .aff-cons ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #1f2937;
}
.aff-pros li, .aff-cons li {
  padding: 4px 0 4px 22px;
  position: relative;
}
.aff-pros li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 700;
}
.aff-cons li::before {
  content: "✗";
  position: absolute;
  left: 0;
  color: #dc2626;
  font-weight: 700;
}

/* ── Trust strip (author + tested + updated) ── */
.aff-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin: 16px 0 24px;
  font-size: 13px;
  color: #4b5563;
}
.aff-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.aff-trust-item strong { color: #0F1111; }
.aff-trust-item::before {
  content: "✓";
  color: #16a34a;
  font-weight: 700;
  font-size: 14px;
}

/* ── Quick Picks comparison table with thumbnails ── */
.aff-comparison {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  font-size: 14px;
}
.aff-comparison thead {
  background: linear-gradient(180deg, #f1f5f9, #e2e8f0);
}
.aff-comparison th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #1f2937;
  border-bottom: 2px solid #cbd5e1;
}
.aff-comparison td {
  padding: 14px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}
.aff-comparison tr:last-child td { border-bottom: none; }
.aff-comparison tr:hover td { background: #f8fafc; }
.aff-comparison .aff-comp-thumb {
  width: 70px;
  height: 70px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 4px;
}
.aff-comparison .aff-comp-name {
  font-weight: 700;
  color: #0F1111;
  font-size: 14px;
}
.aff-comparison .aff-comp-name a { color: #0F1111; text-decoration: none; }
.aff-comparison .aff-comp-name a:hover { text-decoration: underline; }
.aff-comparison .aff-comp-cta {
  font-size: 12px;
  padding: 8px 12px;
  min-height: 36px;
}
@media (max-width: 720px) {
  .aff-comparison { display: block; overflow-x: auto; white-space: nowrap; }
  .aff-comparison thead, .aff-comparison tbody, .aff-comparison tr { display: revert; }
  .aff-comparison th, .aff-comparison td { white-space: normal; }
}

/* ── Sticky desktop sidebar with best-pick CTA ── */
@media (min-width: 1100px) {
  .aff-sticky-sidebar {
    position: fixed;
    top: 96px;
    right: 24px;
    width: 280px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,.08);
    z-index: 40;
    display: block;
  }
  .aff-sticky-sidebar .aff-sticky-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #d97706;
    margin-bottom: 6px;
  }
  .aff-sticky-sidebar .aff-sticky-title {
    font-size: 15px;
    font-weight: 700;
    color: #0F1111;
    margin-bottom: 8px;
    line-height: 1.3;
  }
  .aff-sticky-sidebar img {
    width: 100%;
    height: 140px;
    object-fit: contain;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 8px;
    margin-bottom: 10px;
  }
}
@media (max-width: 1099px) { .aff-sticky-sidebar { display: none; } }

/* ── Mobile bottom-bar CTA ── */
.aff-mobile-bar {
  display: none;
}
@media (max-width: 1099px) {
  .aff-mobile-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 12px rgba(0,0,0,.1);
    padding: 10px 14px;
    gap: 12px;
    align-items: center;
    z-index: 50;
  }
  .aff-mobile-bar img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 2px;
    flex-shrink: 0;
  }
  .aff-mobile-bar-info {
    flex: 1;
    min-width: 0;
  }
  .aff-mobile-bar-name {
    font-size: 13px;
    font-weight: 700;
    color: #0F1111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .aff-mobile-bar-label {
    font-size: 11px;
    color: #d97706;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
  }
  .aff-mobile-bar .aff-cta {
    font-size: 13px;
    padding: 10px 14px;
    min-height: 40px;
  }
  /* Push content above the mobile bar */
  body.has-aff-mobile-bar main { padding-bottom: 80px; }
}

/* ── FAQ accordion (for bottom-of-article FAQ schema) ── */
.aff-faq { margin: 32px 0; }
.aff-faq h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 16px;
  color: #0F1111;
}
.aff-faq-item {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 10px;
}
.aff-faq-item summary {
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 28px;
  color: #0F1111;
}
.aff-faq-item summary::-webkit-details-marker { display: none; }
.aff-faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 22px;
  font-weight: 400;
  color: #6b7280;
  transition: transform .2s;
}
.aff-faq-item[open] summary::after {
  content: "−";
}
.aff-faq-item .aff-faq-answer {
  padding-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
}
