/* ══════════════════════════════════════════════
   PRODUCT FINDER QUIZ MODAL
   templates/product-finder.php · assets/js/product-finder.js
   Figma: "Helix Sequens Labs web page" · section 8754-6132
   Panel 1142×585 (grows on the results step), radius 30,
   content column 1000, backdrop Primary/900 @ 50%.
══════════════════════════════════════════════ */

#helix-product-finder {
  --pf-navy: #2A5F7F;        /* Primary/700 */
  --pf-blue: #1B2F36;        /* Text/Main_blue · Primary/900 */
  --pf-gold: #B4892F;        /* Secondary/600 */
  --pf-gold-light: #D2A649;  /* Secondary/500 */
  --pf-gold-dark: #856728;   /* Secondary/700 */
  --pf-grey-700: #4D555B;    /* Neutrals/Dark/700 */
  --pf-grey-500: #818E97;    /* Neutrals/Dark/500 */
  --pf-grey-100: #EFF0F0;    /* Neutrals/Dark/100 */
  --pf-grey-50: #F7F7F8;     /* Neutrals/Dark/50 */
  --pf-primary-50: #F6F7F9;  /* Primary/50 */
  --pf-divider: #D8DEDD;     /* divider/300 */
  --pf-white: #FFFFFF;
  --pf-font-head: 'Plus Jakarta Sans', var(--e-global-typography-primary-font-family, 'DM Sans'), sans-serif;
  --pf-font-body: 'Inter', var(--e-global-typography-text-font-family, 'DM Sans'), sans-serif;
  --pf-font-mono: 'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;
  --pf-t: 0.2s ease;

  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: var(--pf-font-body);
  color: var(--pf-blue);
  -webkit-font-smoothing: antialiased;
}
#helix-product-finder[hidden] { display: none; }

#helix-product-finder *,
#helix-product-finder *::before,
#helix-product-finder *::after { box-sizing: border-box; }

#helix-product-finder :where(p, h2) {
  margin: 0;
  padding: 0;
  text-transform: none;
  letter-spacing: normal;
  text-shadow: none;
}
#helix-product-finder :where(span) { white-space: normal; }

#helix-product-finder :where(button),
#helix-product-finder :where(button):hover,
#helix-product-finder :where(button):focus {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
  text-transform: none;
  text-decoration: none;
  text-shadow: none;
  white-space: normal;
  cursor: pointer;
  transition: none;
}
#helix-product-finder :where(a),
#helix-product-finder :where(a):hover,
#helix-product-finder :where(a):focus {
  color: inherit;
  text-decoration: none;
  box-shadow: none;
}
#helix-product-finder :where(img) {
  max-width: none;
  height: auto;
  border: 0;
  box-shadow: none;
}
#helix-product-finder :where(section, div) { margin: 0; }
#helix-product-finder :where(button, a):focus-visible {
  outline: 2px solid var(--pf-gold-light);
  outline-offset: 2px;
}

#helix-product-finder .pf-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(27, 47, 54, 0.5);
  opacity: 0;
  transition: opacity var(--pf-t);
}

/* ── Panel (Rectangle 3937) ── */
#helix-product-finder .pf-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 1142px;
  max-width: 100%;
  min-height: 585px;
  max-height: calc(100vh - 48px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 41px 71px 31px;
  background: var(--pf-white);
  border-radius: 30px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--pf-t), transform var(--pf-t);
}
#helix-product-finder.is-open .pf-backdrop { opacity: 1; }
#helix-product-finder.is-open .pf-panel {
  opacity: 1;
  transform: none;
}

body.pf-modal-open { overflow: hidden; }

/* ── Progress (Frame 2147228478) ── */
#helix-product-finder .pf-progress {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex: none;
}
#helix-product-finder .pf-progress-seg {
  width: 89.33px;
  height: 3px;
  border-radius: 2px;
  background: var(--pf-grey-100);
  transition: background var(--pf-t);
}
#helix-product-finder[data-step="q1"] .pf-progress-seg:nth-child(1),
#helix-product-finder[data-step="q2"] .pf-progress-seg:nth-child(1) { background: var(--pf-gold); }
#helix-product-finder[data-step="q2"] .pf-progress-seg:nth-child(2),
#helix-product-finder[data-step="results"] .pf-progress-seg { background: var(--pf-gold-light); }

/* ── Close (Frame 2147228410) ── */
#helix-product-finder .pf-close {
  position: absolute;
  top: 32px;
  right: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: background var(--pf-t);
}
#helix-product-finder .pf-close img {
  display: block;
  width: 18px;
  height: 18px;
}
#helix-product-finder .pf-close:hover { background: var(--pf-grey-100); }

/* ── Steps ── */
#helix-product-finder .pf-step {
  display: none;
  flex-direction: column;
  align-items: center;
  flex: 1 0 auto;
  width: 100%;
}
#helix-product-finder .pf-step.is-active { display: flex; }

/* Shared type */
#helix-product-finder .pf-eyebrow {
  font-family: var(--pf-font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.55px;
  text-transform: uppercase;
  text-align: center;
  color: var(--pf-grey-500);
}
#helix-product-finder .pf-eyebrow--gold { color: var(--pf-gold); }
#helix-product-finder .pf-eyebrow--navy { color: var(--pf-navy); }
#helix-product-finder .pf-eyebrow--left { text-align: left; }

#helix-product-finder .pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 220px;
  padding: 13px 24px;
  border-radius: 999px;
  background: var(--pf-blue);
  color: var(--pf-white);
  font-family: var(--pf-font-body);
  font-size: 16px;
  font-weight: 500;
  line-height: normal;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--pf-t), color var(--pf-t);
}
#helix-product-finder .pf-btn:hover {
  background: var(--pf-navy);
  color: var(--pf-white);
}
#helix-product-finder .pf-btn--small {
  min-width: 0;
  height: 40px;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 12px;
  line-height: 1.5;
}

#helix-product-finder .pf-link {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--pf-navy);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--pf-t);
}
#helix-product-finder .pf-link:hover { color: var(--pf-blue); }

#helix-product-finder .pf-back {
  margin-top: auto;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  white-space: pre;
  color: var(--pf-blue);
  transition: color var(--pf-t);
}
#helix-product-finder .pf-back:hover { color: var(--pf-navy); }

/* ── Start step ── */
#helix-product-finder .pf-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
  margin-top: 98px;
  text-align: center;
}
#helix-product-finder .pf-hero-title {
  font-family: var(--pf-font-head);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--pf-blue);
}
#helix-product-finder .pf-hero-text {
  max-width: 560px;
  margin-top: -5px; /* title→text gap is 10, group gap is 15 */
  font-size: 16px;
  line-height: 1.5;
  color: var(--pf-grey-700);
}
#helix-product-finder .pf-hero-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 950px;
  margin-top: 60px;
}
#helix-product-finder .pf-hero-note {
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--pf-grey-500);
}
#helix-product-finder .pf-start-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
  width: calc(100% + 78px); /* divider is 1078 wide on a 1000 column */
  margin: auto -39px -8px;
  padding-top: 84px;
}
#helix-product-finder .pf-start-footer::before {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background: var(--pf-grey-100);
}
#helix-product-finder .pf-disclaimer {
  max-width: 950px;
  padding: 0 39px;
  font-family: var(--pf-font-mono);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
  color: var(--pf-grey-500);
}

/* ── Question steps ── */
#helix-product-finder .pf-question-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 64px;
  text-align: center;
}
#helix-product-finder .pf-question-title {
  font-family: var(--pf-font-head);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--pf-blue);
}
#helix-product-finder .pf-question-text {
  margin-top: -6px; /* title→text gap is 6, head gap is 12 */
  font-size: 16px;
  line-height: 1.5;
  color: var(--pf-grey-700);
}

#helix-product-finder .pf-options {
  display: grid;
  gap: 15px 14px;
  width: 100%;
  margin-top: 30px;
}
#helix-product-finder .pf-options--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#helix-product-finder .pf-options--2 {
  grid-template-columns: repeat(2, 324px);
  justify-content: center;
}

#helix-product-finder .pf-option {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 2px;
  min-height: 91px;
  padding: 18px 17px 17px 18px;
  border: 1px solid var(--pf-divider);
  border-radius: 12px;
  background: var(--pf-white);
  text-align: left;
  white-space: normal;
  width: 100%;
  transition: background var(--pf-t), border-color var(--pf-t), box-shadow var(--pf-t);
}
#helix-product-finder .pf-option--centered {
  justify-content: center;
  min-height: 92px;
  padding: 10px 20px;
}
#helix-product-finder .pf-option:hover { background: var(--pf-primary-50); }
#helix-product-finder .pf-option.is-selected,
#helix-product-finder .pf-option[aria-pressed="true"] {
  background: var(--pf-primary-50);
  border-color: var(--pf-blue);
  box-shadow: inset 0 0 0 0.5px var(--pf-blue); /* 1.5px border without shifting layout */
}
#helix-product-finder .pf-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#helix-product-finder .pf-option.is-disabled:hover { background: var(--pf-white); }
#helix-product-finder .pf-option-title {
  font-family: var(--pf-font-head);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--pf-blue);
}
#helix-product-finder .pf-option-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--pf-grey-700);
}

/* ── Results step ── */
#helix-product-finder .pf-step--results { align-items: stretch; }

#helix-product-finder .pf-results-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 35px;
}
#helix-product-finder .pf-results-kicker {
  font-family: var(--pf-font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--pf-grey-500);
}
#helix-product-finder .pf-results-title {
  font-family: var(--pf-font-head);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--pf-blue);
}

/* Primary Recommendation Card */
#helix-product-finder .pf-primary {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 22px;
  padding: 15px 19px;
  border-radius: 12px;
  background: var(--pf-grey-50);
}
#helix-product-finder .pf-primary-vial {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 46px;
  height: 63px;
}
#helix-product-finder .pf-primary-vial img {
  display: block;
  width: 46px;
  height: 63px;
  object-fit: contain;
}
#helix-product-finder .pf-primary-vial.is-fallback img {
  width: 40px;
  height: 59px;
  transform: rotate(6.8deg);
}
#helix-product-finder .pf-primary-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
#helix-product-finder .pf-primary-name {
  text-transform: uppercase;
  font-family: var(--pf-font-head);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--pf-blue);
}
#helix-product-finder .pf-primary-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--pf-grey-700);
}
#helix-product-finder .pf-primary-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: none;
  min-width: 167px;
  margin-left: 49px; /* 64 design gap minus the body's own 15 */
  margin-right: 15px;
}
#helix-product-finder .pf-primary-actions .pf-btn { width: 100%; }
#helix-product-finder .pf-primary-actions .pf-link { align-self: flex-start; }

/* Often Studied Alongside */
#helix-product-finder .pf-companions-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 21px;
}
#helix-product-finder .pf-companions-title {
  font-family: var(--pf-font-head);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--pf-blue);
}
#helix-product-finder .pf-companions-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--pf-grey-500);
}

#helix-product-finder .pf-companions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}
#helix-product-finder .pf-companion {
  border: 1px solid var(--pf-divider);
  border-radius: 12px;
  background: var(--pf-white);
  transition: border-color var(--pf-t), box-shadow var(--pf-t);
}
#helix-product-finder .pf-companion:hover { border-color: var(--pf-grey-500); }
#helix-product-finder .pf-companion.is-expanded {
  border-color: var(--pf-blue);
  box-shadow: inset 0 0 0 0.5px var(--pf-blue);
}
#helix-product-finder .pf-companion-toggle {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 14px 17px 16px;
  text-align: left;
}
#helix-product-finder .pf-companion-toggle:focus-visible { outline-offset: -2px; border-radius: 12px; }
#helix-product-finder .pf-companion-tag {
  font-family: var(--pf-font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.55px;
  text-transform: uppercase;
  color: var(--pf-gold-dark);
}
#helix-product-finder .pf-companion-name {
  margin-top: 2px;
  font-family: var(--pf-font-head);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--pf-blue);
}
#helix-product-finder .pf-companion-text {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--pf-grey-700);
}
#helix-product-finder .pf-companion-actions {
  display: none;
  align-items: center;
  gap: 25px;
  padding: 0 17px 15px;
  margin-top: -4px;
}
#helix-product-finder .pf-companion.is-expanded .pf-companion-actions { display: flex; }
#helix-product-finder .pf-btn--companion { width: 158px; }

/* Persona Note */
#helix-product-finder .pf-persona {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 56px;
  margin-top: 14px;
  padding: 8px 24px;
  border-radius: 12px;
  background: var(--pf-grey-50);
}
#helix-product-finder .pf-persona-text {
  max-width: 660px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--pf-grey-700);
}
#helix-product-finder .pf-persona-cta {
  flex: none;
  min-width: 201px;
}
#helix-product-finder .pf-persona-cta.is-busy {
  opacity: 0.7;
  pointer-events: none;
}
#helix-product-finder .pf-persona-cta.is-error { background: #9b2c2c; }
#helix-product-finder .pf-persona-cta[hidden] { display: none; }
/* companion open (8754-7184): note centred, no cart button */
#helix-product-finder .pf-step--results.is-companion-open .pf-persona { justify-content: center; }
#helix-product-finder .pf-step--results.is-companion-open .pf-persona-text { text-align: center; }
#helix-product-finder .pf-step--results.is-companion-open .pf-persona-cta { display: none; }

/* Footer links */
#helix-product-finder .pf-results-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin-top: 29px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
#helix-product-finder .pf-retake,
#helix-product-finder .pf-results-footer-spacer {
  flex: none;
  width: 220px;
}
#helix-product-finder .pf-retake {
  text-align: left;
  white-space: pre;
  color: var(--pf-grey-700);
  transition: color var(--pf-t);
}
#helix-product-finder .pf-retake:hover { color: var(--pf-blue); }
#helix-product-finder .pf-browse {
  flex: 1 1 auto;
  text-align: center;
  color: var(--pf-blue);
  text-decoration: none;
  transition: color var(--pf-t);
}
#helix-product-finder .pf-browse:hover { color: var(--pf-navy); }
#helix-product-finder .pf-step--results.is-companion-open .pf-results-footer-spacer { display: none; }
#helix-product-finder .pf-step--results.is-companion-open .pf-browse { text-align: right; }

/* ══════════════════════════════════════════════
   Responsive (design is desktop-only; these are sensible fallbacks)
══════════════════════════════════════════════ */
@media (max-width: 1199px) {
  #helix-product-finder .pf-panel {
    min-height: 0;
    padding: 32px 32px 28px;
  }
  #helix-product-finder .pf-close { top: 22px; right: 18px; }
  #helix-product-finder .pf-hero { margin-top: 56px; }
  #helix-product-finder .pf-hero-cta { margin-top: 40px; }
  #helix-product-finder .pf-start-footer {
    width: 100%;
    margin: 40px 0 0;
    padding-top: 40px;
  }
  #helix-product-finder .pf-disclaimer { padding: 0; }
  #helix-product-finder .pf-question-head { margin-top: 40px; }
  #helix-product-finder .pf-options--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #helix-product-finder .pf-back { margin-top: 40px; }
  #helix-product-finder .pf-primary-actions { margin-left: 0; margin-right: 0; }
}

@media (max-width: 767px) {
  #helix-product-finder { padding: 0; align-items: flex-end; }
  #helix-product-finder .pf-panel {
    max-height: calc(100vh - 24px);
    padding: 28px 16px 24px;
    border-radius: 20px 20px 0 0;
  }
  #helix-product-finder .pf-progress { gap: 8px; margin-right: 32px; }
  #helix-product-finder .pf-progress-seg { width: 56px; }
  #helix-product-finder .pf-close { top: 12px; right: 8px; }
  #helix-product-finder .pf-hero { margin-top: 32px; }
  #helix-product-finder .pf-hero-title { font-size: 24px; }
  #helix-product-finder .pf-hero-text { font-size: 15px; }
  #helix-product-finder .pf-hero-cta { margin-top: 28px; }
  #helix-product-finder .pf-btn { width: 100%; }
  #helix-product-finder .pf-question-head { margin-top: 28px; }
  #helix-product-finder .pf-question-title { font-size: 24px; }
  #helix-product-finder .pf-question-text { font-size: 15px; }
  #helix-product-finder .pf-options--3,
#helix-product-finder .pf-options--2 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #helix-product-finder .pf-option,
#helix-product-finder .pf-option--centered { min-height: 0; padding: 14px 16px; }
  #helix-product-finder .pf-back { margin-top: 28px; }
  #helix-product-finder .pf-results-head { margin-top: 24px; }
  #helix-product-finder .pf-results-title { font-size: 20px; }
  #helix-product-finder .pf-primary { flex-wrap: wrap; padding: 16px; }
  #helix-product-finder .pf-primary-body { flex-basis: calc(100% - 61px); }
  #helix-product-finder .pf-primary-actions {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    margin-top: 4px;
  }
  #helix-product-finder .pf-primary-actions .pf-btn { width: auto; }
  #helix-product-finder .pf-companions-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  #helix-product-finder .pf-companions { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #helix-product-finder .pf-companion-actions { flex-wrap: wrap; gap: 12px 20px; }
  #helix-product-finder .pf-persona { flex-direction: column; align-items: flex-start; padding: 16px; }
  #helix-product-finder .pf-persona-cta { width: 100%; }
  #helix-product-finder .pf-results-footer { flex-direction: column; align-items: flex-start; gap: 12px; margin-top: 24px; }
  #helix-product-finder .pf-retake { width: auto; }
  #helix-product-finder .pf-browse { text-align: left; }
  #helix-product-finder .pf-results-footer-spacer { display: none; }
}
