/* ============================================================
   WiseIQ UX Features v128
   9 new features: sticky CTA bar, credit score filter,
   soft pull badges, TOC active highlighting, mobile sidebar
   accordion, sticky Best Match sidebar, compare side-by-side,
   exit-intent modal, hub jump-to-situation
   ============================================================ */

/* ============================================================
   1. STICKY BOTTOM CTA BAR
   Shows on all article/guide/review pages
   ============================================================ */
.wiq-sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9990;
  background: #0B1F3A;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 -4px 24px rgba(11,31,58,0.18);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  will-change: transform;
}
.wiq-sticky-cta.visible {
  transform: translateY(0);
}
.wiq-sticky-cta-text {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}
.wiq-sticky-cta-text strong {
  display: block;
  font-size: 14px;
  font-weight: 800;
}
.wiq-sticky-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #1A6FD4;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
  border: none;
  cursor: pointer;
}
.wiq-sticky-cta-btn:hover {
  background: #1558B0;
}
.wiq-sticky-cta-sub {
  font-size: 10px;
  opacity: 0.55;
  margin-top: 2px;
  display: block;
}
.wiq-sticky-cta-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
}
.wiq-sticky-cta-close:hover {
  color: #fff;
}
/* Hide on very small screens if no room */
@media (max-width: 360px) {
  .wiq-sticky-cta-text { display: none; }
}

/* ============================================================
   2. SOFT PULL BADGE under CTA buttons
   ============================================================ */
.wiq-soft-pull-badge {
  display: block;
  font-size: 10px;
  color: #64748B;
  text-align: center;
  margin-top: 5px;
  letter-spacing: 0.02em;
}
.wiq-soft-pull-badge svg {
  vertical-align: middle;
  margin-right: 3px;
}
/* Inject badge after btn-apply-v2 and similar CTA buttons */
.btn-apply-v2 + .wiq-soft-pull-badge,
.btn-check-rate + .wiq-soft-pull-badge,
a[class*="btn-apply"] + .wiq-soft-pull-badge {
  margin-top: 5px;
}

/* ============================================================
   3. TOC ACTIVE SECTION HIGHLIGHTING
   ============================================================ */
.toc-container {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #E2E8F0 transparent;
}
.toc-container::-webkit-scrollbar {
  width: 4px;
}
.toc-container::-webkit-scrollbar-track {
  background: transparent;
}
.toc-container::-webkit-scrollbar-thumb {
  background: #E2E8F0;
  border-radius: 2px;
}
.toc-list a,
.toc-container a {
  transition: color 0.15s, background 0.15s, padding-left 0.15s;
  display: block;
  padding: 4px 8px;
  border-radius: 5px;
  color: #374151;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
}
.toc-list a:hover,
.toc-container a:hover {
  color: #1A6FD4;
  background: #EFF6FF;
}
.toc-list a.toc-active,
.toc-container a.toc-active {
  color: #1A6FD4;
  background: #EFF6FF;
  font-weight: 700;
  padding-left: 12px;
  border-left: 3px solid #1A6FD4;
}

/* ============================================================
   4. CREDIT SCORE FILTER BAR (on best-of pages)
   ============================================================ */
.wiq-score-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 14px 0 10px;
  margin-bottom: 8px;
}
.wiq-score-filter-label {
  font-size: 12px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.wiq-score-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 100px;
  border: 1.5px solid #E2E8F0;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  user-select: none;
}
.wiq-score-chip:hover {
  border-color: #1A6FD4;
  color: #1A6FD4;
  background: #EFF6FF;
}
.wiq-score-chip.active {
  background: #1A6FD4;
  border-color: #1A6FD4;
  color: #fff;
}
.wiq-score-chip .chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}
.product-card[data-min-score].hidden-by-score {
  display: none !important;
}
.wiq-score-no-results {
  display: none;
  padding: 20px;
  text-align: center;
  color: #64748B;
  font-size: 14px;
  background: #F8FAFC;
  border-radius: 12px;
  margin: 12px 0;
}
.wiq-score-no-results.visible {
  display: block;
}

/* ============================================================
   5. MOBILE SIDEBAR ACCORDION
   On mobile, show sidebar as collapsible accordion at top
   ============================================================ */
.wiq-mobile-sidebar-accordion {
  display: none;
  margin: 0 0 20px;
  border: 1.5px solid #E2E8F0;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.wiq-mobile-sidebar-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #F8FAFC;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  color: #0B1F3A;
  border: none;
  width: 100%;
  text-align: left;
  gap: 8px;
}
.wiq-mobile-sidebar-toggle svg {
  flex-shrink: 0;
  transition: transform 0.2s;
}
.wiq-mobile-sidebar-toggle.open svg {
  transform: rotate(180deg);
}
.wiq-mobile-sidebar-body {
  display: none;
  padding: 16px 18px;
}
.wiq-mobile-sidebar-body.open {
  display: block;
}
@media (max-width: 900px) {
  .wiq-mobile-sidebar-accordion {
    display: block;
  }
}

/* ============================================================
   6. COMPARE SIDE-BY-SIDE
   ============================================================ */
.wiq-compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9985;
  background: #fff;
  border-top: 2px solid #1A6FD4;
  padding: 12px 20px;
  display: none;
  align-items: center;
  gap: 12px;
  box-shadow: 0 -4px 24px rgba(11,31,58,0.12);
  flex-wrap: wrap;
}
.wiq-compare-bar.visible {
  display: flex;
}
.wiq-compare-bar-label {
  font-size: 13px;
  font-weight: 700;
  color: #0B1F3A;
  white-space: nowrap;
}
.wiq-compare-chips {
  display: flex;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
  min-width: 0;
}
.wiq-compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #EFF6FF;
  border: 1.5px solid #BFDBFE;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  color: #1A6FD4;
}
.wiq-compare-chip-remove {
  background: none;
  border: none;
  color: #64748B;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  margin-left: 2px;
}
.wiq-compare-btn {
  padding: 10px 20px;
  background: #1A6FD4;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.wiq-compare-btn:hover {
  background: #1558B0;
}
.wiq-compare-btn:disabled {
  background: #94A3B8;
  cursor: default;
}
.wiq-compare-clear {
  background: none;
  border: none;
  color: #64748B;
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}
/* Compare checkbox on product cards */
.wiq-compare-check-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #F1F5F9;
}
.wiq-compare-check-wrap input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: #1A6FD4;
  cursor: pointer;
  flex-shrink: 0;
}
.wiq-compare-check-wrap label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
}
/* Compare modal */
.wiq-compare-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,31,58,0.55);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wiq-compare-modal-overlay.visible {
  display: flex;
}
.wiq-compare-modal {
  background: #fff;
  border-radius: 20px;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(11,31,58,0.25);
}
.wiq-compare-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #E2E8F0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.wiq-compare-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #0B1F3A;
}
.wiq-compare-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #64748B;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.wiq-compare-modal-close:hover {
  color: #0B1F3A;
}
.wiq-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.wiq-compare-table th {
  background: #F8FAFC;
  padding: 12px 16px;
  text-align: left;
  font-weight: 800;
  color: #0B1F3A;
  border-bottom: 2px solid #E2E8F0;
  font-size: 14px;
}
.wiq-compare-table th:first-child {
  color: #64748B;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}
.wiq-compare-table td {
  padding: 10px 16px;
  border-bottom: 1px solid #F1F5F9;
  color: #374151;
  vertical-align: top;
}
.wiq-compare-table td:first-child {
  font-weight: 700;
  color: #64748B;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  background: #F8FAFC;
}
.wiq-compare-table tr:last-child td {
  border-bottom: none;
}
.wiq-compare-table .best-val {
  color: #16A34A;
  font-weight: 800;
}
.wiq-compare-modal-ctas {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #E2E8F0;
  flex-wrap: wrap;
}
.wiq-compare-modal-ctas a {
  flex: 1;
  min-width: 140px;
  padding: 12px 16px;
  background: #1A6FD4;
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
}
.wiq-compare-modal-ctas a:hover {
  background: #1558B0;
}

/* ============================================================
   7. EXIT-INTENT MODAL
   ============================================================ */
.wiq-exit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,31,58,0.6);
  z-index: 10001;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wiq-exit-overlay.visible {
  display: flex;
}
.wiq-exit-modal {
  background: #fff;
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(11,31,58,0.3);
  animation: wiqSlideUp 0.3s cubic-bezier(0.4,0,0.2,1);
}
@keyframes wiqSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.wiq-exit-header {
  background: linear-gradient(135deg, #0B1F3A 0%, #1A3A6B 100%);
  padding: 28px 28px 20px;
  color: #fff;
  position: relative;
}
.wiq-exit-header-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.wiq-exit-header-close:hover {
  color: #fff;
}
.wiq-exit-headline {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 6px;
}
.wiq-exit-subhead {
  font-size: 13px;
  opacity: 0.75;
  line-height: 1.5;
}
.wiq-exit-body {
  padding: 24px 28px;
}
.wiq-exit-trust {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.wiq-exit-trust-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}
.wiq-exit-trust-item svg {
  color: #10B981;
  flex-shrink: 0;
}
.wiq-exit-cta {
  display: block;
  width: 100%;
  padding: 15px;
  background: #1A6FD4;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 10px;
}
.wiq-exit-cta:hover {
  background: #1558B0;
}
.wiq-exit-dismiss {
  display: block;
  text-align: center;
  font-size: 12px;
  color: #94A3B8;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  padding: 4px;
}
.wiq-exit-dismiss:hover {
  color: #64748B;
}

/* ============================================================
   8. HUB JUMP-TO-SITUATION BUTTONS
   ============================================================ */
.wiq-jump-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0 28px;
}
.wiq-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: #fff;
  border: 1.5px solid #E2E8F0;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  color: #0B1F3A;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.wiq-jump-btn:hover {
  background: #EFF6FF;
  border-color: #1A6FD4;
  color: #1A6FD4;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,111,212,0.12);
}
.wiq-jump-btn .jump-icon {
  font-size: 16px;
  line-height: 1;
}

/* ============================================================
   9. STICKY BEST MATCH SIDEBAR CTA
   (already partially exists — enhance with pulsing badge)
   ============================================================ */
.wiq-top-pick-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #FEF3C7;
  color: #92400E;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.wiq-top-pick-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #F59E0B;
  animation: wiqPulse 1.8s ease-in-out infinite;
}
@keyframes wiqPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
/* When sticky CTA bar is visible, add bottom padding to body */
body.wiq-cta-active {
  padding-bottom: 64px;
}
/* When compare bar is also visible */
body.wiq-compare-active {
  padding-bottom: 120px;
}
@media (max-width: 600px) {
  .wiq-exit-headline { font-size: 18px; }
  .wiq-exit-body { padding: 18px 20px; }
  .wiq-exit-header { padding: 22px 20px 16px; }
  .wiq-compare-modal { border-radius: 14px; }
  .wiq-compare-table th, .wiq-compare-table td { padding: 8px 12px; }
}
