/* =========================================================================
   SatyaTerra engagement widget + shared quiz styles
   Loaded on every storefront page (injected by main.js) and linked directly
   by pages/quiz.html. One source of truth so the standalone quiz page and the
   in-widget slide-over render identically.
   ========================================================================= */

/* ---------- Quiz (shared: full page + slide-over) ---------- */
.quiz { max-width: 720px; margin: 0 auto; }
.quiz-card { background: #fff; border-radius: 20px; box-shadow: var(--shadow-soft); padding: 40px 36px; }
@media (max-width: 560px){ .quiz-card { padding: 28px 20px; } }
.quiz-progress { height: 6px; background: var(--st-line); border-radius: 999px; overflow: hidden; margin-bottom: 28px; }
.quiz-progress__bar { height: 100%; background: var(--st-green); width: 0; transition: width .35s ease; }
.quiz-step__kicker { text-align: center; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--st-gold); margin-bottom: 8px; }
.quiz-step__q { font-family: var(--font-display); font-size: clamp(24px, 4.5vw, 32px); color: var(--st-green-deep); text-align: center; line-height: 1.2; margin-bottom: 26px; }
.quiz-opts { display: grid; gap: 12px; }
.quiz-opt { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1.5px solid var(--st-line); border-radius: 14px; background: #fff; cursor: pointer; text-align: left; font-size: 16px; color: var(--st-ink); font-family: inherit; transition: border-color .15s, background .15s, transform .1s; }
.quiz-opt:hover { border-color: var(--st-green); background: var(--st-green-soft, #EAF3EC); }
.quiz-opt:active { transform: scale(.99); }
.quiz-opt__emoji { font-size: 26px; flex: none; }
.quiz-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; }
.quiz-back { background: none; border: none; color: var(--st-muted); font-size: 14px; font-weight: 700; cursor: pointer; padding: 8px; }
.quiz-back:hover { color: var(--st-green-deep); }
.quiz-back[hidden] { visibility: hidden; }
/* Intro + result */
.quiz-hero { text-align: center; }
.quiz-hero h1 { font-family: var(--font-display); font-size: clamp(32px, 6vw, 48px); color: var(--st-green-deep); margin-bottom: 12px; }
.quiz-hero p { color: var(--st-muted); font-size: 17px; margin-bottom: 26px; line-height: 1.6; }
.result-match { text-align: center; }
.result-match__eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--st-gold); }
.result-match__name { font-family: var(--font-display); font-size: clamp(30px, 6vw, 44px); color: var(--st-green-deep); margin: 6px 0 4px; }
.result-match__cat { color: var(--st-muted); font-size: 14px; margin-bottom: 20px; }
.result-vis { width: 100%; max-width: 210px; height: 210px; margin: 0 auto 18px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.result-vis img, .result-vis svg { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 14px; }
.result-why { background: var(--st-green-soft, #EAF3EC); border-radius: 12px; padding: 16px 18px; font-size: 15px; color: var(--st-ink); line-height: 1.6; margin: 0 auto 22px; max-width: 520px; }
.result-price { font-size: 22px; font-weight: 800; color: var(--st-green-deep); margin-bottom: 18px; }
.result-price s { color: var(--st-muted); font-weight: 400; font-size: 16px; margin-left: 8px; }
.result-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.result-alt { margin-top: 34px; border-top: 1px solid var(--st-line); padding-top: 26px; }
.result-alt__title { text-align: center; font-size: 14px; color: var(--st-muted); margin-bottom: 16px; }
.result-alt__card { display: flex; align-items: center; gap: 14px; max-width: 460px; margin: 0 auto; border: 1px solid var(--st-line); border-radius: 14px; padding: 14px 16px; }
.result-alt__vis { width: 56px; height: 56px; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.result-alt__vis img, .result-alt__vis svg { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 8px; }
.result-alt__info { flex: 1; }
.result-alt__name { font-weight: 800; color: var(--st-green-deep); }
.result-alt__tag { font-size: 13px; color: var(--st-muted); }
/* Email capture / lead-gen */
.result-lead { margin-top: 30px; background: var(--st-cream, #F6F1E7); border-radius: 16px; padding: 22px 22px 24px; text-align: center; }
.result-lead__h { font-family: var(--font-display); font-size: 22px; color: var(--st-green-deep); margin-bottom: 4px; }
.result-lead__p { font-size: 14px; color: var(--st-muted); margin-bottom: 14px; }
.result-lead__row { display: flex; gap: 10px; max-width: 420px; margin: 0 auto; }
.result-lead__row input { flex: 1; min-width: 0; padding: 12px 14px; border: 1.5px solid var(--st-line); border-radius: 10px; font-size: 15px; font-family: inherit; }
.result-lead__row input:focus { outline: none; border-color: var(--st-green); }
.result-lead__msg { font-size: 13px; margin-top: 10px; min-height: 16px; }
.result-lead__code { display: inline-block; margin-top: 6px; font-weight: 800; letter-spacing: .08em; color: var(--st-green-deep); background: #fff; border: 1.5px dashed var(--st-green); border-radius: 8px; padding: 8px 16px; font-size: 16px; }

/* ---------- Quiz mounted inside the slide-over ---------- */
.stw-quiz .quiz-card { box-shadow: none; padding: 4px 2px 8px; border-radius: 0; }
.stw-quiz .quiz-hero h1 { font-size: clamp(26px, 8vw, 34px); }
.stw-quiz .quiz-hero p { font-size: 15px; }
.stw-quiz .result-match__name { font-size: clamp(26px, 8vw, 34px); }

/* ---------- Floating launcher (FAB + menu) ---------- */
.stw-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 940;
  width: 60px; height: 60px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--st-green, #2E6B41); color: #fff;
  display: flex; align-items: center; justify-content: center;
  /* White ring keeps the button legible over ANY background — including the
     green ingredient ticker it overlaps at the bottom of the page. */
  box-shadow: 0 0 0 3px #fff, 0 10px 28px rgba(20,60,30,.38);
  transition: transform .18s, box-shadow .18s;
}
.stw-fab:hover { transform: translateY(-2px); box-shadow: 0 0 0 3px #fff, 0 14px 34px rgba(20,60,30,.44); }
.stw-fab svg { width: 28px; height: 28px; position: absolute; transition: opacity .18s, transform .18s; }
.stw-fab .stw-fab__close { opacity: 0; transform: rotate(-45deg); }
.stw-fab.open .stw-fab__open { opacity: 0; transform: rotate(45deg); }
.stw-fab.open .stw-fab__close { opacity: 1; transform: rotate(0); }
/* gentle attention pulse, once */
.stw-fab__ping { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 0 rgba(46,107,65,.5); animation: stwPing 2.4s ease-out 1s 3; }
@keyframes stwPing { 0% { box-shadow: 0 0 0 0 rgba(46,107,65,.5); } 70%,100% { box-shadow: 0 0 0 16px rgba(46,107,65,0); } }
@media (prefers-reduced-motion: reduce) { .stw-fab__ping { animation: none; } }

.stw-menu {
  position: fixed; right: 20px; bottom: 92px; z-index: 941;
  width: 320px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(20,40,25,.28);
  opacity: 0; visibility: hidden; transform: translateY(12px) scale(.98);
  transform-origin: bottom right; transition: opacity .2s, transform .2s, visibility .2s;
}
.stw-menu.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
@media (max-width: 420px){ .stw-menu { left: 16px; right: 16px; width: auto; max-width: none; } }
.stw-menu__head {
  background: var(--st-green-deep, #1F4A2E); color: #fff;
  padding: 16px 18px; font-family: var(--font-display); font-size: 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.stw-menu__x { background: none; border: none; color: rgba(255,255,255,.85); font-size: 18px; cursor: pointer; line-height: 1; padding: 4px; }
.stw-menu__x:hover { color: #fff; }
.stw-menu__list { padding: 8px; }
.stw-row {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 13px 12px; border: none; border-radius: 12px; background: none;
  cursor: pointer; text-align: left; font-family: inherit; text-decoration: none;
  transition: background .15s;
}
.stw-row:hover { background: var(--st-green-soft, #EAF3EC); }
.stw-row[disabled] { cursor: default; opacity: .72; }
.stw-row[disabled]:hover { background: none; }
.stw-row__ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.stw-row__ic--wa { background: #25D366; }
.stw-row__ic--quiz { background: var(--st-gold-soft, #F6ECD2); }
.stw-row__ic--chat { background: var(--st-green-soft, #EAF3EC); }
.stw-row__tx { flex: 1; min-width: 0; }
.stw-row__t { font-weight: 800; color: var(--st-green-deep); font-size: 15px; display: flex; align-items: center; gap: 8px; }
.stw-row__s { font-size: 12.5px; color: var(--st-muted); margin-top: 1px; }
.stw-row__pill { font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--st-gold, #A9852F); background: var(--st-gold-soft, #F6ECD2); border-radius: 999px; padding: 2px 8px; }
.stw-row__arrow { color: var(--st-muted); font-size: 18px; flex: none; }

/* ---------- Slide-over (hosts the quiz) ---------- */
.stw-slide-overlay {
  position: fixed; inset: 0; background: rgba(20,40,25,.42); z-index: 1399;
  opacity: 0; visibility: hidden; transition: opacity .28s, visibility .28s;
}
.stw-slide-overlay.open { opacity: 1; visibility: visible; }
.stw-slide {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 1400;
  width: 440px; max-width: 100vw; background: #fff;
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s ease;
  box-shadow: -12px 0 40px rgba(20,40,25,.18);
}
.stw-slide.open { transform: translateX(0); }
.stw-slide__head {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 16px 18px; border-bottom: 1px solid var(--st-line);
}
.stw-slide__head button { background: none; border: none; cursor: pointer; color: var(--st-muted); font-size: 20px; line-height: 1; padding: 4px; }
.stw-slide__head button:hover { color: var(--st-green-deep); }
.stw-slide__ttl { flex: 1; font-family: var(--font-display); font-size: 18px; color: var(--st-green-deep); text-align: center; }
.stw-slide__body { flex: 1; overflow-y: auto; padding: 20px 20px 32px; }
@media (max-width: 480px){ .stw-slide__body { padding: 16px 16px 28px; } }
