/* ============================================================
   Comparison Page Theme — Sleep Foundation Adapted
   Brand: Unbreakable (#5a4a78 purple)
   ============================================================ */

:root {
  --color-primary: #5a4a78;
  --color-primary-rgb: 90, 74, 120;
  --color-primary-light: #7b6b9a;
  --color-primary-bright: #c4b8d9;
  --color-primary-brighter: #f5f2f9;
  --color-primary-dark: #3d3254;
  --color-secondary: #5a4a78;
  --color-secondary-rgb: 90, 74, 120;
  --color-secondary-light: #f5f2f9;
  --color-secondary-dark: #3d3254;
  --color-tertiary: #FADF63;
  --color-tertiary-rgb: 250, 223, 99;
  --color-gray-lightest: #f8f7fa;
  --color-gray-lighter: #E5E5E5;
  --color-gray-light: #dfe0e6;
  --color-gray-medium: #6e7480;
  --color-gray-dark: #444850;
  --color-gray-darker: #333333;
  --color-gray-darkest: #151515;
  --color-neutral-light: #ffffff;
  --color-neutral-dark: #1a1b1f;
  --color-header-bg: #ffffff;
  --color-body-bg: #ffffff;
  --color-footer-bg: #3d3254;
  --color-headings-text: #3d3254;
  --color-body-text: #1a1b1f;
  --color-links: #5a4a78;
  --color-links-hover: #7b6b9a;
  --color-footer-text: #FFFFFF;
  --font-family-body: Arial, Helvetica, "Helvetica Neue", Roboto, system-ui, sans-serif;
  --font-family-headings: Arial, Helvetica, "Helvetica Neue", Roboto, system-ui, sans-serif;
  --font-size-h1: 42px;
  --font-size-h2: 30px;
  --font-size-h3: 22px;
  --font-size-h4: 18px;
  --font-size-body: 16px;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-md: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-xxl: 24px;
  --border-radius: 22px;
  --border-radius-sm: 12px;
  --border-radius-lg: 48px;
  --shadow-card: rgba(26,27,31,0.08) 0px 8px 24px 0px, rgba(26,27,31,0.04) 0px 0px 12px 0px;
  --shadow-container: rgba(26,27,31,0.15) 0px 8px 16px -4px, rgba(26,27,31,0.08) 0px 0px 8px 0px;
  --transition: 0.2s ease-out;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-family-body);
  font-size: var(--font-size-body);
  line-height: 1.75;
  color: var(--color-body-text);
  background: var(--color-body-bg);
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden;
  z-index: 999; padding: 8px 16px; background: var(--color-primary); color: #fff; text-decoration: none;
}
.skip-link:focus { left: 0; width: auto; height: auto; }

/* Layout */
.container-lander { max-width: 852px; margin: 0 auto; padding: 0 0.75rem; }
.wrapper { max-width: 1474px; margin: 0 auto; padding: 0 0.75rem; }

/* Flex utilities */
.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.w-100 { width: 100%; }
.h-100 { height: 100%; }
.m-0 { margin: 0; }
.p-0 { padding: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 1rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-3 { padding-bottom: 1rem; }
.px-0 { padding-left: 0; padding-right: 0; }
.me-0 { margin-right: 0; }
.me-2 { margin-right: 0.5rem; }

/* Typography */
.text-primary-dark { color: var(--color-headings-text); }
.text-neutral-dark { color: var(--color-neutral-dark); }
.text-gray-medium { color: var(--color-gray-medium); }
.text-gray-dark { color: var(--color-gray-dark); }
.font-weight-bold { font-weight: 700; }
.font-weight-normal { font-weight: 400; }
.font-size-xs { font-size: var(--font-size-xs); }
.font-size-sm { font-size: var(--font-size-sm); }
.font-size-md { font-size: var(--font-size-md); }
.font-size-lg { font-size: var(--font-size-lg); }
.font-size-xl { font-size: var(--font-size-xl); }
.font-size-xxl { font-size: var(--font-size-xxl); }
.font-size-h3 { font-size: var(--font-size-h3); }
.font-size-subscript { font-size: 10px; }
.line-height-xs { line-height: 1.2; }
.line-height-md { line-height: 1.75; }
.text-uppercase { text-transform: uppercase; }
.text-center { text-align: center; }
.list-unstyle { list-style: none; }

h1, h2, h3, h4 { font-family: var(--font-family-headings); color: var(--color-headings-text); line-height: 1.2; }
h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); margin-bottom: 1rem; }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }

a { color: var(--color-links); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-links-hover); }

strong { font-weight: 700; }

/* Header */
.header {
  background: var(--color-header-bg);
  border-bottom: 1px solid var(--color-gray-light);
  height: 60px;
  position: sticky; top: 0; z-index: 25;
}
.hdr-logo-text {
  font-size: 20px; font-weight: 700; color: var(--color-primary);
  letter-spacing: -0.02em;
}

/* Trust Bar */
.trust-bar {
  padding: 16px 0; border-bottom: 1px solid var(--color-gray-light);
}
.trust-bar-inner {
  display: flex; align-items: center; justify-content: center;
  gap: 24px; flex-wrap: wrap;
}
.trust-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--color-gray-medium);
  white-space: nowrap;
}
.trust-badge svg { flex-shrink: 0; }

/* Page Header */
.page-header { padding: 32px 0 24px; }
.page-title {
  font-size: var(--font-size-h1); font-weight: 700;
  color: var(--color-headings-text); line-height: 1.15;
}
.page-title span { color: var(--color-gray-medium); }
.author-name { font-weight: 600; color: var(--color-neutral-dark); }

/* TOC */
.toc-wrapper { padding: 16px 0; }
.toc-heading {
  font-size: var(--font-size-h4); font-weight: 700;
  color: var(--color-headings-text); margin-bottom: 12px;
}
.toc-list { gap: 8px 24px; list-style: none; }
.toc-list-item a {
  font-size: var(--font-size-sm); font-weight: 700;
  color: var(--color-primary); text-decoration: none;
}
.toc-list-item a:hover { color: var(--color-primary-light); }
.toc-divider {
  border: none; border-top: 3px solid var(--color-primary-dark);
  border-radius: 2px; margin-top: 16px;
}

/* Content */
.content-wrapper {
  padding: 24px 0;
  border-bottom: 1px solid var(--color-gray-light);
}
.content-wrapper:last-of-type { border-bottom: none; }
.rich-text-body p { margin-bottom: 1rem; }
.rich-text-body ul { margin: 1rem 0; padding-left: 1.5rem; }
.rich-text-body ul li {
  margin-bottom: 0.5rem;
  list-style-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Ccircle cx='4' cy='4' r='4' fill='%235a4a78'/%3E%3C/svg%3E");
}
.rich-text-body h2 { margin-top: 0; margin-bottom: 1rem; }
.rich-text-body h3 { margin: 1.5rem 0 0.75rem; }

/* Winner Badge */
.winner-badge {
  display: inline-block; padding: 6px 16px;
  background: var(--color-primary-brighter);
  color: var(--color-primary); font-weight: 700;
  font-size: var(--font-size-sm); border-radius: 30px;
  margin-top: 8px;
}
.winner-badge-alt {
  background: var(--color-gray-lightest);
  color: var(--color-gray-medium);
}

/* Pick Finder / Product Grid */
.pick-finder { padding: 24px 0; }
.pf-container {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.product-grid-head {
  background: var(--color-primary-brighter);
  padding: 20px 24px;
}
.product-grid-item {
  padding: 16px 24px; border-bottom: 1px solid var(--color-gray-light);
  gap: 16px;
}
.product-grid-item:last-child { border-bottom: none; }
.product-grid-cta {
  white-space: nowrap; flex-shrink: 0;
}

/* Comparison Table */
.comparison-table-container {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden; margin: 24px 0;
}
.comparison-scroll-wrapper { overflow-x: auto; }
.comparison-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--font-size-sm);
}
.comparison-table thead { background: var(--color-primary-brighter); }
.comparison-table th {
  padding: 14px 16px; text-align: left;
  font-weight: 700; color: var(--color-headings-text);
  white-space: nowrap;
}
.comparison-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--color-gray-light);
  vertical-align: top;
}
.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table td:first-child { font-weight: 600; color: var(--color-headings-text); }
.winner-col { background: rgba(var(--color-primary-rgb), 0.04); }

/* CTA Sections */
.cta-section { padding: 32px 0; }
.cta-card {
  background: var(--color-primary-brighter);
  border-radius: var(--border-radius);
  padding: 40px 32px; text-align: center;
}
.cta-headline {
  font-size: var(--font-size-xxl); font-weight: 700;
  color: var(--color-headings-text); margin-bottom: 12px;
}
.cta-subtext { color: var(--color-gray-medium); margin-bottom: 20px; font-size: var(--font-size-md); }

/* Buttons */
.btn {
  display: inline-block; padding: 12px 28px;
  font-weight: 700; font-size: var(--font-size-sm);
  text-decoration: none; border-radius: 30px;
  transition: all var(--transition); cursor: pointer;
  border: none; text-align: center;
}
.btn-cta {
  background: var(--color-primary); color: #fff;
}
.btn-cta:hover {
  background: var(--color-primary-dark); color: #fff;
  transform: translateY(-1px); box-shadow: var(--shadow-container);
}
.btn-cta-large { padding: 16px 36px; font-size: var(--font-size-md); }

/* Testimonials */
.testimonials-section { padding: 32px 0; }
.testimonials-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 16px; margin-top: 20px;
}
.testimonial-card {
  background: var(--color-gray-lightest);
  border-radius: var(--border-radius-sm);
  padding: 24px;
}
.testimonial-stars { color: var(--color-tertiary); font-size: 20px; margin-bottom: 12px; }
.testimonial-quote {
  font-size: var(--font-size-md); line-height: 1.6;
  color: var(--color-neutral-dark); margin-bottom: 12px;
  font-style: normal;
}
.testimonial-author {
  font-size: var(--font-size-sm); font-weight: 600;
  color: var(--color-gray-medium); font-style: normal;
}

/* Guarantee */
.guarantee-section { padding: 32px 0; }
.guarantee-card {
  background: var(--color-primary-brighter);
  border: 2px solid var(--color-primary-bright);
  border-radius: var(--border-radius);
  padding: 32px; text-align: center;
}
.guarantee-icon { margin-bottom: 16px; }
.guarantee-title {
  font-size: var(--font-size-xl); font-weight: 700;
  color: var(--color-headings-text); margin-bottom: 12px;
}
.guarantee-text { font-size: var(--font-size-md); color: var(--color-gray-medium); line-height: 1.65; }

/* FAQ */
.faq-wrapper {
  background: var(--color-gray-lightest);
  border-radius: var(--border-radius-lg) 240px var(--border-radius-lg) var(--border-radius-lg);
  padding: 40px 32px; margin: 32px 0;
}
.faq-heading {
  font-size: var(--font-size-h2); margin-bottom: 24px;
  padding-bottom: 16px; border-bottom: 2px solid #fff;
}
.faq-item {
  border-bottom: 1px solid var(--color-gray-light);
  padding: 16px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
  font-size: var(--font-size-lg); font-weight: 700;
  color: var(--color-headings-text); cursor: pointer;
  position: relative; padding-right: 32px;
  margin-bottom: 0; transition: color var(--transition);
}
.faq-question::after {
  content: '+'; position: absolute; right: 0; top: 50%;
  transform: translateY(-50%); font-size: 24px; font-weight: 400;
  color: var(--color-primary); transition: transform var(--transition);
}
.faq-question.active::after { content: '\2212'; }
.faq-answer {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  font-size: var(--font-size-md); color: var(--color-gray-dark);
}
.faq-answer.open {
  max-height: 500px; padding-top: 12px;
}

/* Footer */
.footer-shell {
  background: var(--color-footer-bg);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  margin-top: 48px; padding: 40px 0 24px;
  color: var(--color-footer-text);
}
.footer-content { text-align: center; }
.footer-logo-text {
  font-size: 24px; font-weight: 700; color: #fff;
  display: block; margin-bottom: 16px;
}
.footer-disclaimer {
  color: rgba(255,255,255,0.6); max-width: 600px;
  margin: 0 auto 20px; line-height: 1.5;
}
.footer-links { margin-bottom: 16px; }
.footer-link {
  color: rgba(255,255,255,0.8); margin: 0 12px;
  font-size: var(--font-size-sm); text-decoration: none;
}
.footer-link:hover { color: #fff; }
.footer-copyright { color: rgba(255,255,255,0.5); }

/* Sticky CTA */
.sticky-cta-bar {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(8px);
  padding: 12px 16px; text-align: center; z-index: 50;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  transform: translateY(100%); transition: transform 0.3s ease-out;
}
.sticky-cta-bar.visible { transform: translateY(0); }
.sticky-cta-btn { width: 100%; max-width: 400px; }

/* Scroll Reveal with CSS fallback */
@keyframes reveal-fallback { to { opacity: 1; transform: translateY(0); } }
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; animation: reveal-fallback 0.5s ease 1s forwards; }
.reveal.revealed { opacity: 1; transform: translateY(0); animation: none; }

/* Responsive */
@media (min-width: 768px) {
  .page-title { font-size: 38px; }
  .d-md-flex { display: flex; }
  .align-items-md-center { align-items: center; }
  .flex-md-row { flex-direction: row; }
  .toc-list { flex-direction: row; flex-wrap: wrap; }
  .testimonials-grid { grid-template-columns: 1fr 1fr 1fr; }
  .font-size-md-h2 { font-size: var(--font-size-h2); }
  .font-size-md-xs { font-size: var(--font-size-xs); }
  .pb-md-2 { padding-bottom: 0.5rem; }
  .mb-md-0 { margin-bottom: 0; }
  .mb-md-4 { margin-bottom: 1.5rem; }
  .me-md-3 { margin-right: 1rem; }
  .text-md-left { text-align: left; }
  .pb-md-3 { padding-bottom: 1rem; }
  .mt-md-3 { margin-top: 1rem; }
  .faq-wrapper { border-radius: 48px 240px 48px 48px; }
}

@media (max-width: 767px) {
  :root {
    --font-size-h1: 26px;
    --font-size-h2: 22px;
    --font-size-h3: 20px;
    --font-size-lg: 16px;
  }
  .header { height: 56px; }
  .trust-bar-inner { gap: 12px; }
  .trust-badge { font-size: 11px; }
  .page-header { padding: 20px 0 16px; }
  .cta-card { padding: 28px 20px; }
  .faq-wrapper { padding: 28px 20px; border-radius: 22px; }
  .comparison-table th, .comparison-table td { padding: 10px 12px; font-size: 13px; }
  .product-grid-item { flex-direction: column; align-items: flex-start; }
  .product-grid-cta { margin-top: 12px; }
}

@media (min-width: 992px) {
  .d-lg-flex { display: flex; }
  .sticky-cta-bar { display: none; }
}
