/* WhipWashPro — How We Compare (cinematic redesign). Namespaced wwp-compare-*, no global selectors. */

#wwp-compare-root {
  --wwp-compare-navy: #060e1c;
  --wwp-compare-navy-alt: #0a1830;
  --wwp-compare-accent: #1177fe;
  --wwp-compare-accent-soft: rgba(17, 119, 254, 0.35);
  --wwp-compare-orange: #ff7a1f;
  --wwp-compare-text: #ffffff;
  --wwp-compare-text-muted: #9fb0cc;
  --wwp-compare-border: rgba(90, 148, 255, 0.24);
  --wwp-compare-radius: 16px;
  --wwp-compare-header-offset: var(--wwp-header-offset, 64px);
  --wwp-compare-bottom-bar: var(--wwp-mobile-bottom-bar-height, 0px);

  position: relative;
  background: var(--wwp-compare-navy);
  color: var(--wwp-compare-text);
  overflow: hidden;
  isolation: isolate;
}

#wwp-compare-root * { box-sizing: border-box; }
#wwp-compare-root .wwp-compare-visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------- Background ---------------- */

#wwp-compare-root .wwp-compare-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--wwp-compare-navy);
}
#wwp-compare-root .wwp-compare-bg picture { display: contents; }
#wwp-compare-root .wwp-compare-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0.55;
  transition: opacity 1.1s ease;
}
#wwp-compare-root.wwp-compare-in-view .wwp-compare-bg img { opacity: 0.85; }

#wwp-compare-root .wwp-compare-bg-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6,14,28,.94) 0%, rgba(6,14,28,.72) 14%, rgba(6,14,28,.55) 40%, rgba(6,14,28,.75) 78%, rgba(6,14,28,.97) 100%),
    linear-gradient(90deg, rgba(6,14,28,.55) 0%, rgba(6,14,28,.15) 30%, rgba(6,14,28,.15) 70%, rgba(6,14,28,.55) 100%);
}

/* ---------------- Progress rail ---------------- */

#wwp-compare-root .wwp-compare-progress-rail {
  position: sticky;
  top: var(--wwp-compare-header-offset);
  z-index: 3;
  height: 3px;
  background: rgba(255,255,255,.08);
  margin: 0 auto;
  max-width: 1600px;
}
#wwp-compare-root .wwp-compare-progress-rail i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--wwp-compare-accent), var(--wwp-compare-orange));
  transition: width 0.15s linear;
}

/* ---------------- Layout ---------------- */

#wwp-compare-root .wwp-compare-inner {
  position: relative;
  z-index: 2;
  max-width: 1600px;
  margin: 0 auto;
  padding: 90px clamp(20px, 5vw, 64px) 80px;
}

#wwp-compare-root .wwp-compare-intro {
  max-width: 760px;
  margin: 0 auto 18vh;
  text-align: center;
}
#wwp-compare-root .wwp-compare-eyebrow {
  display: inline-block;
  color: var(--wwp-compare-accent);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 12px;
}
#wwp-compare-root .wwp-compare-display {
  margin: 14px 0 2px;
  font-size: clamp(15px, 1.6vw, 18px);
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--wwp-compare-orange);
}
#wwp-compare-root .wwp-compare-title {
  margin: 8px 0 16px;
  font-size: clamp(26px, 3.6vw, 40px);
  font-weight: 900;
  line-height: 1.15;
  color: var(--wwp-compare-text);
}
#wwp-compare-root .wwp-compare-support {
  color: var(--wwp-compare-text-muted);
  font-size: 15.5px;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 62ch;
}
#wwp-compare-root .wwp-compare-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* Initial hidden state ONLY when JS has confirmed it can reveal these again --
   without JS (no .wwp-compare-js class) everything stays visible by default. */
#wwp-compare-root.wwp-compare-js .wwp-compare-eyebrow { opacity: 0; transform: translateY(16px); }
#wwp-compare-root.wwp-compare-js .wwp-compare-display { opacity: 0; transform: translateY(14px); }
#wwp-compare-root.wwp-compare-js .wwp-compare-title { opacity: 0; transform: translateY(20px); }
#wwp-compare-root.wwp-compare-js .wwp-compare-support { opacity: 0; transform: translateY(14px); }
#wwp-compare-root.wwp-compare-js .wwp-compare-badges { opacity: 0; transform: translateY(12px); }
#wwp-compare-root .wwp-compare-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--wwp-compare-border);
  background: rgba(255,255,255,.04);
  font-size: 13px;
  font-weight: 700;
  color: var(--wwp-compare-text);
}
#wwp-compare-root .wwp-compare-badge svg { width: 15px; height: 15px; color: var(--wwp-compare-accent); flex-shrink: 0; }

#wwp-compare-root.wwp-compare-in-view .wwp-compare-eyebrow,
#wwp-compare-root.wwp-compare-in-view .wwp-compare-display,
#wwp-compare-root.wwp-compare-in-view .wwp-compare-title,
#wwp-compare-root.wwp-compare-in-view .wwp-compare-support,
#wwp-compare-root.wwp-compare-in-view .wwp-compare-badges {
  opacity: 1;
  transform: translateY(0);
  transition: opacity .7s ease, transform .7s ease;
}
#wwp-compare-root.wwp-compare-in-view .wwp-compare-display { transition-delay: .06s; }
#wwp-compare-root.wwp-compare-in-view .wwp-compare-title { transition-delay: .12s; }
#wwp-compare-root.wwp-compare-in-view .wwp-compare-support { transition-delay: .2s; }
#wwp-compare-root.wwp-compare-in-view .wwp-compare-badges { transition-delay: .28s; }

/* ---------------- Groups ---------------- */

#wwp-compare-root .wwp-compare-groups {
  display: flex;
  flex-direction: column;
  gap: 28vh;
}

#wwp-compare-root .wwp-compare-group {
  border-radius: 22px;
  border: 1px solid var(--wwp-compare-border);
  background: rgba(8, 18, 36, 0.55);
  box-shadow: 0 20px 50px rgba(2, 8, 20, .5);
  padding: 28px clamp(16px, 3vw, 34px) 12px;
}
#wwp-compare-root.wwp-compare-js .wwp-compare-group {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .6s ease, transform .6s ease;
}
#wwp-compare-root .wwp-compare-group.is-active {
  opacity: 1;
  transform: translateY(0);
}

#wwp-compare-root .wwp-compare-group-heading {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 18px;
}
#wwp-compare-root .wwp-compare-group-number {
  font-size: 13px;
  font-weight: 900;
  color: var(--wwp-compare-orange);
  letter-spacing: .08em;
  border: 1px solid rgba(255,122,31,.4);
  border-radius: 999px;
  padding: 4px 10px;
}
#wwp-compare-root .wwp-compare-group-heading h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--wwp-compare-text);
}

/* Desktop table */
#wwp-compare-root .wwp-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: transparent;
}
/* Defeat theme/plugin global table striping (tr:nth-child etc., observed
   leaking a light #f9f9f9 background into native <table> elements on this
   site) that would otherwise show through this table. !important is
   necessary here since the competing rule's exact selector/specificity is
   unknown and out of this component's control; .wwp-compare-whip/
   .wwp-compare-other still set their own intentional backgrounds below,
   each also on a class selector so they are unaffected by this reset. */
#wwp-compare-root .wwp-compare-table tr,
#wwp-compare-root .wwp-compare-table th:not(.wwp-compare-whip):not(.wwp-compare-other),
#wwp-compare-root .wwp-compare-table td:not(.wwp-compare-whip):not(.wwp-compare-other) {
  background-color: transparent !important;
}
#wwp-compare-root .wwp-compare-table thead th {
  text-align: left;
  font-size: 12.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--wwp-compare-text-muted);
  font-weight: 700;
  padding: 10px 16px;
  border-bottom: 1px solid var(--wwp-compare-border);
}
#wwp-compare-root .wwp-compare-table thead th:nth-child(2) { color: var(--wwp-compare-accent); text-align: center; }
#wwp-compare-root .wwp-compare-table thead th:nth-child(3) { text-align: center; }

#wwp-compare-root.wwp-compare-js .wwp-compare-row {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .45s ease, transform .45s ease;
  transition-delay: calc(var(--wwp-compare-row-index, 0) * 80ms);
}
#wwp-compare-root .wwp-compare-group.is-active .wwp-compare-row {
  opacity: 1;
  transform: translateY(0);
}

#wwp-compare-root .wwp-compare-row th[scope="row"] {
  text-align: left;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--wwp-compare-text);
  padding: 15px 16px;
  border-bottom: 1px solid rgba(90,148,255,.14);
}
#wwp-compare-root .wwp-compare-row td {
  padding: 15px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid rgba(90,148,255,.14);
  vertical-align: middle;
}
#wwp-compare-root .wwp-compare-row:last-child th,
#wwp-compare-root .wwp-compare-row:last-child td { border-bottom: none; }

#wwp-compare-root .wwp-compare-whip {
  position: relative;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(17,119,254,.32), rgba(17,119,254,.16));
}
#wwp-compare-root .wwp-compare-table thead th:nth-child(2),
#wwp-compare-root .wwp-compare-whip {
  box-shadow: inset 0 0 0 1px rgba(17,119,254,.35);
}
#wwp-compare-root .wwp-compare-cell-inner {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: center;
}
#wwp-compare-root .wwp-compare-icon { width: 15px; height: 15px; flex-shrink: 0; }
#wwp-compare-root .wwp-compare-whip .wwp-compare-icon { color: #ffffff; }
#wwp-compare-root .wwp-compare-other.is-negative .wwp-compare-icon { color: #ff6b6b; }
#wwp-compare-root .wwp-compare-other.is-warning .wwp-compare-icon { color: #ffb648; }
#wwp-compare-root .wwp-compare-other { color: #cbd6ea; }
#wwp-compare-root .wwp-compare-other.is-negative { color: #ffb4b4; }
#wwp-compare-root .wwp-compare-other.is-warning { color: #ffd9a3; }

/* Mobile cards (hidden on desktop) */
#wwp-compare-root .wwp-compare-mobile-cards { display: none; }

/* ---------------- Badges/proof + CTA ---------------- */

#wwp-compare-root .wwp-compare-cta-row {
  margin-top: 20vh;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}
#wwp-compare-root.wwp-compare-js .wwp-compare-cta-row {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
#wwp-compare-root.wwp-compare-cta-visible .wwp-compare-cta-row { opacity: 1; transform: translateY(0); }

#wwp-compare-root .wwp-compare-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14.5px;
  text-decoration: none !important;
  min-height: 44px;
}
#wwp-compare-root .wwp-compare-cta-primary { background: var(--wwp-compare-accent); color: #fff !important; }
#wwp-compare-root .wwp-compare-cta-secondary { background: transparent; border: 1px solid var(--wwp-compare-border); color: #fff !important; }
#wwp-compare-root .wwp-compare-cta:focus-visible { outline: 2px solid var(--wwp-compare-orange); outline-offset: 3px; }

/* ---------------- Reduced motion ---------------- */

@media (prefers-reduced-motion: reduce) {
  #wwp-compare-root .wwp-compare-eyebrow,
  #wwp-compare-root .wwp-compare-display,
  #wwp-compare-root .wwp-compare-title,
  #wwp-compare-root .wwp-compare-support,
  #wwp-compare-root .wwp-compare-badges,
  #wwp-compare-root .wwp-compare-group,
  #wwp-compare-root .wwp-compare-row,
  #wwp-compare-root .wwp-compare-cta-row {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  #wwp-compare-root .wwp-compare-bg img { opacity: .85 !important; transition: none !important; }
  #wwp-compare-root .wwp-compare-progress-rail { display: none; }
}

/* ---------------- Tablet ---------------- */

@media (max-width: 1024px) {
  #wwp-compare-root .wwp-compare-inner { padding: 70px 20px 60px; }
  #wwp-compare-root .wwp-compare-row th[scope="row"] { font-size: 13.5px; }
  #wwp-compare-root .wwp-compare-row td { font-size: 13px; padding: 13px 10px; }
  #wwp-compare-root .wwp-compare-groups { gap: 14vh; }
  #wwp-compare-root .wwp-compare-intro { margin-bottom: 10vh; }
  #wwp-compare-root .wwp-compare-cta-row { margin-top: 10vh; }
}

/* ---------------- Mobile ---------------- */

@media (max-width: 767px) {
  #wwp-compare-root .wwp-compare-inner { padding: 52px 16px 48px; }
  #wwp-compare-root .wwp-compare-progress-rail { top: var(--wwp-compare-header-offset); }
  #wwp-compare-root .wwp-compare-groups { gap: 28px; }
  #wwp-compare-root .wwp-compare-intro { margin-bottom: 32px; }
  #wwp-compare-root .wwp-compare-cta-row { margin-top: 28px; }

  #wwp-compare-root .wwp-compare-group { padding: 22px 16px 10px; border-radius: 18px; }

  #wwp-compare-root .wwp-compare-table { display: none; }
  #wwp-compare-root .wwp-compare-mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }
  #wwp-compare-root .wwp-compare-mobile-card {
    background: rgba(6,14,28,.7);
    border: 1px solid var(--wwp-compare-border);
    border-radius: 14px;
    padding: 14px 16px;
  }
  #wwp-compare-root.wwp-compare-js .wwp-compare-mobile-card {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .45s ease, transform .45s ease;
    transition-delay: calc(var(--wwp-compare-row-index, 0) * 70ms);
  }
  #wwp-compare-root .wwp-compare-group.is-active .wwp-compare-mobile-card {
    opacity: 1;
    transform: translateY(0);
  }
  #wwp-compare-root .wwp-compare-mobile-card h4 {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 800;
    color: var(--wwp-compare-text);
  }
  #wwp-compare-root .wwp-compare-mobile-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid rgba(90,148,255,.14);
    font-size: 13.5px;
  }
  #wwp-compare-root .wwp-compare-mobile-result span { color: var(--wwp-compare-text-muted); font-weight: 600; }
  #wwp-compare-root .wwp-compare-mobile-result strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    text-align: right;
  }
  #wwp-compare-root .wwp-compare-mobile-result.is-whip strong { color: #fff; }
  #wwp-compare-root .wwp-compare-mobile-result.is-whip { background: linear-gradient(90deg, rgba(17,119,254,.1), transparent); }
  #wwp-compare-root .wwp-compare-mobile-result.is-other.is-negative strong { color: #ffb4b4; }
  #wwp-compare-root .wwp-compare-mobile-result.is-other.is-warning strong { color: #ffd9a3; }
  #wwp-compare-root .wwp-compare-mobile-result .wwp-compare-icon { width: 13px; height: 13px; }

  #wwp-compare-root .wwp-compare-cta-row { flex-direction: column; }
  #wwp-compare-root .wwp-compare-cta { justify-content: center; }

  #wwp-compare-root .wwp-compare-bg img { opacity: .6; }
  #wwp-compare-root .wwp-compare-bg-gradient {
    background:
      linear-gradient(180deg, rgba(6,14,28,.55) 0%, rgba(6,14,28,.9) 55%, rgba(6,14,28,1) 100%);
  }
}
