/* Scout homepage demo — a small framed window that replays the real Stone
 * Scout flow using the member app's exact component classes and CSS rules.
 * Every component rule below is copied verbatim from the app (stone-scout
 * inline styles + ScoutAffiliate injected styles), scoped under .sdemo so the
 * marketing page styles never bleed in or out. Same fonts, colors, spacing.
 */

.sdemo { max-width: 720px; margin: 0 auto; width: 100%; }
.sdemo-cap {
  text-align: center; font-size: 14px; font-weight: 700; color: var(--teal-700);
  min-height: 40px; display: flex; align-items: flex-end; justify-content: center;
  padding: 0 8px 10px; line-height: 1.35; transition: opacity 0.25s;
}
.sdemo-cap.fade { opacity: 0; }
.sdemo-win {
  position: relative; background: #f6fbfa; border: 1px solid var(--gray-200, #e2e8f0);
  border-radius: 16px; box-shadow: 0 12px 32px rgba(13, 148, 136, 0.12);
  overflow: hidden; cursor: pointer;
}
.sdemo-bar {
  display: flex; align-items: center; gap: 6px; padding: 9px 12px;
  background: white; border-bottom: 1px solid var(--gray-100, #f1f5f9);
}
.sdemo-bar span { width: 10px; height: 10px; border-radius: 50%; }
.sdemo-bar .d1 { background: #fca5a5; } .sdemo-bar .d2 { background: #fcd34d; } .sdemo-bar .d3 { background: #86efac; }
.sdemo-bar b { margin-left: 8px; font-size: 11px; font-weight: 700; color: var(--gray-500, #64748b); letter-spacing: 0.4px; }
.sdemo-body { position: relative; overflow: hidden; }
.sdemo-stage { position: absolute; top: 0; left: 0; width: 780px; transform-origin: top left; }
.sdemo-screen { position: absolute; top: 0; left: 0; width: 100%; padding: 14px; opacity: 0; visibility: hidden; transition: opacity 0.3s; }
.sdemo-screen.on { opacity: 1; visibility: visible; }

/* Animated cursor dot */
.sdemo-cursor {
  position: absolute; z-index: 30; width: 18px; height: 18px; border-radius: 50%;
  background: var(--teal-600, #0d9488); border: 3px solid white;
  box-shadow: 0 2px 10px rgba(13, 148, 136, 0.5); pointer-events: none;
  transition: left 0.7s cubic-bezier(0.45, 0, 0.25, 1), top 0.7s cubic-bezier(0.45, 0, 0.25, 1);
  margin: -9px 0 0 -9px;
}
.sdemo-cursor.tap { animation: sdemoTap 0.4s ease; }
@keyframes sdemoTap { 40% { transform: scale(0.62); } 100% { transform: scale(1); } }
.sdemo-cursor::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  border: 2px solid var(--teal-500, #14b8a6); opacity: 0; transform: scale(0.4);
}
.sdemo-cursor.tap::after { animation: sdemoRipple 0.45s ease-out; }
@keyframes sdemoRipple { 0% { opacity: 0.8; transform: scale(0.4); } 100% { opacity: 0; transform: scale(1.4); } }

/* Replay rest state */
.sdemo-replay {
  position: absolute; inset: 0; z-index: 40; display: none; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.55); backdrop-filter: blur(1px);
}
.sdemo-win.rested .sdemo-replay { display: flex; }
.sdemo-replay button {
  font-family: inherit; font-size: 14px; font-weight: 700; color: white;
  background: var(--teal-600, #0d9488); border: none; border-radius: 100px;
  padding: 12px 26px; cursor: pointer; box-shadow: 0 6px 18px rgba(13, 148, 136, 0.35);
}
.sdemo-replay button:hover { background: var(--teal-700, #0f766e); }

/* Demo-only cheapest row highlight */
.sdemo .sc-table tr.sdemo-best td { background: var(--teal-50, #f0fdfa); }
.sdemo .sc-table tr.sdemo-best td:first-child { box-shadow: inset 3px 0 0 var(--teal-500, #14b8a6); }
.sdemo .sc-table tbody tr { opacity: 0; transform: translateY(6px); transition: opacity 0.3s, transform 0.3s; }
.sdemo .sc-table tbody tr.show { opacity: 1; transform: none; }
.sdemo.static .sc-table tbody tr { opacity: 1; transform: none; transition: none; }

/* ── Copied app component rules (scoped) ─────────────────────────── */
.sdemo .sc-card { background: white; border: 1px solid var(--gray-100); border-radius: 16px; padding: 18px; margin-bottom: 16px; }
.sdemo .sc-step-label { font-size: 13px; font-weight: 800; color: var(--teal-700); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }

.sdemo .cg-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.sdemo .cg-btn { display: flex; flex-direction: column; align-items: center; gap: 5px; background: transparent; border: none; cursor: pointer; padding: 6px; border-radius: 12px; transition: all 0.15s; font-family: inherit; }
.sdemo .cg-btn.active { background: var(--teal-100); transform: scale(1.06); }
.sdemo .cg-swatch { width: 46px; height: 46px; border-radius: 50%; border: 3px solid; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.sdemo .cg-btn.active .cg-swatch { box-shadow: 0 0 0 2px white, 0 0 0 4px var(--teal-500); }
.sdemo .cg-label { font-size: 12px; font-weight: 600; color: var(--gray-600); }
.sdemo .cg-btn.active .cg-label { color: var(--teal-700); }
.sdemo .cg-count { font-size: 10px; color: var(--gray-400); }

.sdemo .color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; max-height: 235px; overflow-y: auto; scrollbar-width: thin; }
.sdemo .color-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 8px; border-radius: 14px; border: none; cursor: pointer; background: transparent; transition: all 0.15s; font-family: inherit; }
.sdemo .color-card.active { background: var(--teal-600); }
.sdemo .color-img { width: 92px; height: 92px; border-radius: 12px; object-fit: cover; box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.sdemo .color-img-empty { display: flex; align-items: center; justify-content: center; background: var(--gray-100); color: var(--gray-300); font-size: 26px; }
.sdemo .color-name { font-size: 12px; font-weight: 600; color: var(--gray-700); line-height: 1.2; }
.sdemo .color-card.active .color-name { color: white; }
.sdemo .color-sellers { font-size: 10px; color: var(--gray-400); }
.sdemo .color-sellers.mid { color: var(--teal-600); }
.sdemo .color-sellers.strong { color: var(--teal-700); font-weight: 700; }
.sdemo .color-card.active .color-sellers { color: rgba(255,255,255,0.8); }

.sdemo .size-row { display: flex; flex-wrap: wrap; gap: 8px; }
.sdemo .size-btn { padding: 10px 20px; border-radius: 100px; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; background: white; border: 2px solid var(--teal-200); color: var(--teal-700); transition: all 0.15s; }
.sdemo .size-btn.active { background: var(--teal-600); color: white; border-color: var(--teal-600); }

.sdemo .sc-result-head { margin-bottom: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; padding: 12px 18px; }
.sdemo .sc-result-head h2 { font-size: 18px; font-weight: 800; color: var(--teal-800); margin: 0; }
.sdemo .sc-result-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.sdemo .sc-result-head p.muted { font-size: 12px; margin: 2px 0 0; }
.sdemo .sc-table-wrap { border-top-left-radius: 0; border-top-right-radius: 0; padding: 0; overflow: hidden; margin-bottom: 0; }
.sdemo .sc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sdemo .sc-table thead tr { background: var(--teal-100); border-bottom: 2px solid var(--teal-200); }
.sdemo .sc-table th { padding: 10px 12px; color: var(--teal-800); font-weight: 700; font-size: 12px; }
.sdemo .sc-table th.sortable { cursor: pointer; user-select: none; }
.sdemo .sc-table th.sortable:hover { background: var(--teal-200); }
.sdemo .th-inner { display: inline-flex; align-items: center; gap: 4px; }
.sdemo .sort-arrow { font-size: 10px; color: var(--gray-300); }
.sdemo .sort-arrow.on { color: var(--teal-600); }
.sdemo .ta-left { text-align: left; } .sdemo .ta-right { text-align: right; } .sdemo .ta-center { text-align: center; }
.sdemo .sc-table td { padding: 8px 12px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); vertical-align: middle; }
.sdemo .sc-table tr:hover td { background: var(--teal-50, #f0fdfa); }
.sdemo .row-img { width: 52px; height: 52px; min-width: 52px; max-width: none; border-radius: 8px; object-fit: cover; display: block; margin: 0 auto; }
.sdemo .row-img-empty { width: 52px; height: 52px; min-width: 52px; border-radius: 8px; background: var(--gray-100); display: inline-block; }
.sdemo .sc-table td.ta-center:first-child { width: 64px; }
.sdemo .col-supplier { font-weight: 600; }
.sdemo .col-supplier .seller-name { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; overflow-wrap: anywhere; max-width: 120px; line-height: 1.25; }
.sdemo .col-altname { color: var(--gray-400); font-size: 12px; font-style: italic; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; overflow-wrap: anywhere; max-width: 150px; line-height: 1.3; }
.sdemo .pack-note { display: block; font-weight: 400; font-size: 10px; color: var(--gray-400); margin-top: 2px; }
.sdemo .cps { font-weight: 800; color: var(--teal-700); }
.sdemo .muted { color: var(--gray-500); }
.sdemo .ret-dot { display: inline-flex; align-items: center; justify-content: center; margin-right: 6px; cursor: help; vertical-align: middle; line-height: 0; }
.sdemo .ret-dot svg { width: 30px; height: 30px; }
.sdemo .ret-dot.good { color: var(--teal-700); } .sdemo .ret-dot.bad { color: var(--gray-400); }
.sdemo .stock-cell { display: inline-flex; align-items: center; gap: 6px; }
.sdemo .stock-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.sdemo .stock-dot.in { background: var(--teal-500); } .sdemo .stock-dot.out { background: #dc2626; }
.sdemo .stock-dot.unknown { background: var(--gray-300, #cbd5e1); }
.sdemo .stock-dot.checking { background: var(--gray-300, #cbd5e1); animation: sdemoStockPulse 1s ease-in-out infinite; }
@keyframes sdemoStockPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.sdemo .check-btn { font-size: 11px; background: var(--teal-100); color: var(--teal-700); border: none; padding: 3px 10px; border-radius: 100px; font-family: inherit; font-weight: 600; cursor: pointer; }
.sdemo .check-btn.in { background: #dcfce7; color: #15803d; }
.sdemo .view-link { color: var(--teal-700); font-size: 12px; font-weight: 700; text-decoration: underline; }
.sdemo .aff-note-trigger { display: inline-block; background: none; border: none; padding: 0; margin: 0; font: inherit; color: inherit; line-height: inherit; text-align: inherit; cursor: help; }
.sdemo .aff-note-i { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; margin-right: 4px; border-radius: 50%; background: var(--teal-100, #ccfbf1); color: var(--teal-700, #0f766e); font-size: 9px; font-weight: 800; font-style: normal; line-height: 1; vertical-align: middle; }
.sdemo .aff-note-trigger:hover .aff-note-i, .sdemo .aff-note-trigger:focus .aff-note-i { background: var(--teal-500, #14b8a6); color: #fff; }

/* Affiliate badge + popover, copied from the app's injected ScoutAffiliate CSS */
.sdemo .aff-badge { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer; padding: 0; background: var(--gray-100, #f1f5f9); color: var(--gray-400, #94a3b8); transition: transform 0.15s; vertical-align: middle; }
.sdemo .aff-badge svg { width: 17px; height: 17px; }
.sdemo .aff-badge.tier-all { background: linear-gradient(135deg, #6ee7b7, #10b981); color: #064e3b; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35); }
.sdemo .aff-pop { position: absolute; z-index: 35; max-width: 250px; background: white; border: 1px solid var(--gray-200, #e2e8f0); border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18); padding: 14px 16px; text-align: left; opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s; }
.sdemo .aff-pop.on { opacity: 1; visibility: visible; transform: none; }
.sdemo .aff-pop-head { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: #059669; margin-bottom: 6px; }
.sdemo .aff-pop-head svg { width: 15px; height: 15px; flex: 0 0 auto; }
.sdemo .aff-pop-offer { font-size: 13px; line-height: 1.45; color: var(--gray-700, #334155); }
.sdemo .aff-pop-code { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.sdemo .aff-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 700; color: var(--gray-700, #334155); background: var(--gray-50, #f8fafc); border: 1.5px dashed var(--gray-300, #cbd5e1); border-radius: 8px; padding: 6px 10px; }
.sdemo .aff-copy { font-family: inherit; font-size: 12px; font-weight: 700; color: white; background: linear-gradient(135deg, var(--teal-500, #14b8a6), var(--teal-600, #0d9488)); border: none; border-radius: 8px; padding: 7px 14px; cursor: pointer; }

/* Mini variant sizing */
.sdemo-mini { max-width: 560px; }
.sdemo-mini .sdemo-cap { display: none; }

@media (prefers-reduced-motion: reduce) {
  .sdemo .stock-dot.checking { animation: none; }
  .sdemo-cursor { display: none !important; }
}

/* Standalone demo section right under the hero supplier strip */
.demo-section {
  padding: clamp(56px, 7vw, 100px) clamp(20px, 2vw, 24px);
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}
.demo-section .section-header { max-width: 1120px; margin: 0 auto 40px; }

/* ── Sizer and calculator demo component rules, copied from the app's
     app-styles.css and scoped under .sdemo ─────────────────────────── */
.sdemo .app-card { background: white; border: 1px solid var(--gray-100); border-radius: 20px; padding: 28px; margin-bottom: 22px; box-shadow: 0 2px 12px rgba(15, 23, 42, 0.03); }
.sdemo .app-card-title { font-size: 13px; font-weight: 700; color: var(--teal-700); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 4px; }
.sdemo .app-card-h { font-size: 20px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.02em; margin-bottom: 18px; }
.sdemo .form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.sdemo .form-row label { font-size: 13px; font-weight: 700; color: var(--gray-700); }
.sdemo .form-row input, .sdemo .form-row select { font-family: inherit; font-size: 15px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--gray-200); background: white; color: var(--gray-900); transition: border-color 0.18s ease, box-shadow 0.18s ease; pointer-events: none; }
.sdemo .form-row input.focus, .sdemo .form-row select.focus { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18); }
.sdemo .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.sdemo .pattern-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.sdemo .pattern-option { background: white; border: 2px solid var(--gray-200); border-radius: 14px; padding: 18px; cursor: default; transition: border-color 0.18s, background 0.18s; text-align: left; font-family: inherit; }
.sdemo .pattern-option.active { border-color: var(--teal-500); background: linear-gradient(135deg, var(--teal-100), #fff); }
.sdemo .pattern-option h4 { font-size: 15px; font-weight: 800; color: var(--gray-900); margin: 0 0 4px; }
.sdemo .pattern-option p { font-size: 12px; color: var(--gray-500); line-height: 1.4; margin: 0; }
.sdemo .pattern-option-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; background: var(--teal-100); border-radius: 10px; }
.sdemo .result-card { background: linear-gradient(135deg, var(--teal-100), #fff); border: 2px solid var(--teal-300); border-radius: 18px; padding: 24px; position: relative; overflow: hidden; }
.sdemo .result-card::before { content: ''; position: absolute; top: -40px; right: -40px; width: 140px; height: 140px; background: radial-gradient(circle, rgba(20, 184, 166, 0.18), transparent); pointer-events: none; }
.sdemo .result-card-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--teal-700); text-transform: uppercase; letter-spacing: 1.4px; margin-bottom: 6px; }
.sdemo .result-card-label-paw { width: 18px; height: 18px; }
.sdemo .result-card-label-paw img { width: 100%; height: 100%; object-fit: contain; }
.sdemo .result-card-value { font-size: 38px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.04em; line-height: 1.1; }
.sdemo .result-card-meta { font-size: 13px; color: var(--gray-600); margin-top: 6px; }
.sdemo .result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

/* Demo-only reveal helpers used by the calculator demo */
.sdemo .sdemo-reveal { opacity: 0; transform: translateY(8px); transition: opacity 0.35s, transform 0.35s; }
.sdemo .sdemo-reveal.show { opacity: 1; transform: none; }
.sdemo.static .sdemo-reveal { opacity: 1; transform: none; transition: none; }
.sdemo .form-row input.pop { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.18); }


/* Inline demo blocks inside the how-it-works and features sections */
.sdemo-inline {
  max-width: 760px;
  margin: 42px auto 0;
}
.sdemo-inline .sdemo { max-width: none; }

/* ── Sparkle Sizer demo (data-sdemo="sizer") ─────────────────────
   Every .sz-* rule comes from /app/sparkle-sizer.css, the member tool's own
   stylesheet, loaded alongside this file. Only demo chrome lives here. */
.sdemo-sizer .sdemo-cap-line { display: block; max-width: 100%; overflow-wrap: anywhere; }
.sdemo-sizer .sz-row { cursor: default; }
.sdemo-cursor.wheel { animation: sdemoWheel 0.45s ease; }
@keyframes sdemoWheel { 0% { transform: translateY(0); } 45% { transform: translateY(7px); } 100% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .sdemo-cursor.wheel { animation: none; }
}
