/* Sales-page live demo. Self-contained: never depends on abst-design-system being loaded. */
.abst-sd-ui {
  --sd-teal: #009688; --sd-teal-ink: #00695c; --sd-navy: #365187; --sd-navy-dark: #0d1a35;
  --sd-ink: #1d2327; --sd-text: #494949; --sd-muted: #767676; --sd-paper: #f7f6f4;
  --sd-line: rgba(0, 0, 0, 0.12); --sd-wash: rgba(54, 81, 135, 0.06);
  --sd-font: "Cabin", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sd-head: "Funnel Display", "Cabin", system-ui, sans-serif;
  font-family: var(--sd-font); box-sizing: border-box;
}
.abst-sd-ui *, .abst-sd-ui *::before, .abst-sd-ui *::after { box-sizing: border-box; }
.abst-sd-ui button { font-family: inherit; cursor: pointer; }

/* ---------- launchers */
.abst-sd-launchwrap { margin: 14px 0 6px; }
.abst-sd-launch {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 16px; min-height: 40px;
  border: 1.5px solid var(--sd-teal); border-radius: 999px; background: #fff; color: var(--sd-teal-ink);
  font: 600 15px/1.2 var(--sd-font); transition: background .15s, color .15s, transform .15s;
}
.abst-sd-launch:hover, .abst-sd-launch:focus-visible { background: var(--sd-teal); color: #fff; }
.abst-sd-launch:focus-visible { outline: 3px solid rgba(0, 150, 136, .35); outline-offset: 2px; }
.abst-sd-dot { width: 12px; height: 12px; border-radius: 50%; background: radial-gradient(circle, #eb3228 0 30%, #ffbe28 55%, rgba(56, 215, 211, .6) 80%, transparent 82%); }
.abst-sd-spark { color: var(--sd-teal); font-size: 1.05em; line-height: 1; }
.abst-sd-launch:hover .abst-sd-spark { color: #fff; }
.abst-sd-launch.is-pulse { animation: abst-sd-pulse 1.6s ease-out 3; }
@keyframes abst-sd-pulse { 0% { box-shadow: 0 0 0 0 rgba(0, 150, 136, .5); } 100% { box-shadow: 0 0 0 16px rgba(0, 150, 136, 0); } }

/* ---------- heatmap layer */
.abst-sd-layer { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 99990; opacity: 0; transition: opacity .45s; overflow: hidden; }
.abst-sd-layer.is-on { opacity: 1; }
/* Two parts crossfade: click (dim + badges; the heat itself is the fixed viewport canvas) and scroll */
.abst-sd-part { position: absolute; inset: 0; transition: opacity .6s ease; }
.abst-sd-part-click { background: rgba(13, 26, 53, .22); }
.abst-sd-layer.is-tease .abst-sd-part-click { background: rgba(13, 26, 53, .12); }
.abst-sd-layer[data-mode="click"] .abst-sd-part-scroll,
.abst-sd-layer[data-mode="scroll"] .abst-sd-part-click { opacity: 0; }
.abst-sd-viewcanvas { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 99991; opacity: 0; transition: opacity .6s ease; }
.abst-sd-viewcanvas.is-on { opacity: 1; }
.abst-sd-viewcanvas.is-on.is-hidden { opacity: 0; }
.abst-sd-badge {
  position: absolute; padding: 3px 8px; border-radius: 4px; background: var(--sd-navy-dark); color: #fff;
  font: 600 12px/1.3 var(--sd-font); white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}
.abst-sd-badge.is-rage { background: #b3261e; }
.abst-sd-layer.is-tease .abst-sd-badge { display: none; }
.abst-sd-scrollwash { position: absolute; inset: 0; } /* no blend mode: blending a page-tall layer is slow on phones */
.abst-sd-reach, .abst-sd-fold { position: absolute; left: 0; right: 0; border-top: 2px dashed rgba(13, 26, 53, .55); }
.abst-sd-fold { border-top: 2px solid #fff; }
.abst-sd-reach span, .abst-sd-fold span {
  position: absolute; left: 16px; top: -14px; padding: 4px 10px; border-radius: 999px;
  background: var(--sd-navy-dark); color: #fff; font: 600 13px/1.2 var(--sd-font); white-space: nowrap;
}
.abst-sd-fold span { background: #fff; color: var(--sd-navy-dark); left: auto; right: 16px; }

/* ---------- heatmap bar */
.abst-sd-bar {
  position: fixed; left: 50%; bottom: 18px; z-index: 99999; display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 8px; max-width: calc(100vw - 24px); border-radius: 12px; background: var(--sd-navy-dark); color: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3); transform: translate(-50%, 140%); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.abst-sd-bar.is-on { transform: translate(-50%, 0); }
.abst-sd-seg { display: flex; padding: 3px; border-radius: 8px; background: rgba(255, 255, 255, .1); }
.abst-sd-seg button { padding: 7px 12px; border: 0; border-radius: 6px; background: none; color: #d8dde8; font: 600 14px/1 var(--sd-font); white-space: nowrap; }
.abst-sd-seg button[aria-selected="true"] { background: #fff; color: var(--sd-navy-dark); }
.abst-sd-bar-meta { font-size: 13px; color: #c4cbd9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.abst-sd-cta {
  padding: 10px 16px; border: 0; border-radius: 4px; background: var(--sd-teal); color: #fff;
  font: 700 14px/1.1 var(--sd-font); white-space: nowrap;
}
.abst-sd-cta:hover { background: var(--sd-teal-ink); }
.abst-sd-x { width: 34px; height: 34px; flex: none; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 24px; line-height: 1; opacity: .75; }
.abst-sd-x:hover { opacity: 1; background: rgba(127, 127, 127, .15); }

/* ---------- toast */
.abst-sd-toast {
  position: fixed; left: 50%; top: 18px; z-index: 100001; max-width: min(460px, calc(100vw - 32px)); padding: 11px 16px;
  border-radius: 8px; background: var(--sd-ink); color: #fff; font-size: 14px; line-height: 1.4; text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transform: translate(-50%, -160%); transition: transform .3s; pointer-events: none;
}
.abst-sd-toast.is-on { transform: translate(-50%, 0); }

/* ---------- phones: bottom sheet */
@media (max-width: 767px) {
  .abst-sd-bar { left: 12px; right: 12px; bottom: 12px; transform: translateY(140%); flex-wrap: wrap; gap: 8px; }
  .abst-sd-bar.is-on { transform: none; }
  .abst-sd-bar { flex-wrap: wrap; }
  .abst-sd-bar-meta { order: 4; flex-basis: 100%; white-space: normal; padding: 0 4px 2px; font-size: 12px; }
  .abst-sd-bar .abst-sd-x { order: 3; width: 30px; }
  .abst-sd-seg button { padding: 7px 10px; font-size: 13px; }
  .abst-sd-bar .abst-sd-cta { margin-left: auto; padding: 9px 12px; }
  .abst-sd-reach span { font-size: 12px; left: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .abst-sd-bar, .abst-sd-toast, .abst-sd-layer, .abst-sd-part, .abst-sd-viewcanvas { transition: none; }
  .abst-sd-launch.is-pulse { animation: none; }
}

.abst-sd-link { padding: 2px 0; border: 0; background: none; color: var(--sd-navy); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.abst-sd-launch[disabled] { opacity: .7; cursor: progress; }

/* ---------- demo gate: limits reached / launch pressed (sits above the Magic bar) */
.abst-sd-gate { position: fixed; inset: 0; z-index: 2147483600; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(13, 26, 53, .55); }
.abst-sd-gate-card {
  position: relative; width: 100%; max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 30px 26px 24px; border-radius: 12px; background: #fff; color: var(--sd-text); text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.abst-sd-gate-card strong { font: 700 21px/1.25 var(--sd-head); color: var(--sd-ink); }
.abst-sd-gate-card p { margin: 0; font-size: 16px; line-height: 1.5; }
.abst-sd-gate-card .abst-sd-cta { padding: 13px 22px; font-size: 16px; }
.abst-sd-gate-card .abst-sd-x { position: absolute; top: 8px; right: 8px; color: var(--sd-muted); }

/* ---------- demo media library (stand-in for wp.media) */
.abst-sd-lib { position: fixed; inset: 0; z-index: 2147483600; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(13, 26, 53, .55); }
.abst-sd-lib-card { width: 100%; max-width: 760px; max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 20px 20px; border-radius: 12px; background: #fff; color: var(--sd-text); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.abst-sd-lib-head { display: flex; align-items: center; justify-content: space-between; }
.abst-sd-lib-head strong { font: 700 18px/1.3 var(--sd-head); color: var(--sd-ink); }
.abst-sd-lib-head .abst-sd-x { color: var(--sd-muted); }
.abst-sd-lib-note { margin: 2px 0 14px; font-size: 13px; color: var(--sd-muted); }
.abst-sd-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.abst-sd-lib-item { display: flex; flex-direction: column; gap: 6px; padding: 6px; border: 1.5px solid var(--sd-line); border-radius: 8px; background: #fff; text-align: left; }
.abst-sd-lib-item:hover, .abst-sd-lib-item:focus-visible { border-color: var(--sd-teal); outline: none; box-shadow: 0 0 0 3px rgba(0, 150, 136, .18); }
.abst-sd-lib-item img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border-radius: 4px; background: var(--sd-paper); }
.abst-sd-lib-item span { font-size: 12px; line-height: 1.3; color: var(--sd-ink); }
.abst-sd-lib-own { position: relative; display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border: 1.5px dashed var(--sd-line); border-radius: 8px; cursor: pointer; }
.abst-sd-lib-own:hover { border-color: var(--sd-teal); }
.abst-sd-lib-own span { font-weight: 700; color: var(--sd-teal-ink); }
.abst-sd-lib-own small { color: var(--sd-muted); }
.abst-sd-lib-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
/* Theme button/label styles leak in (BB paints buttons blue on hover/focus) */
.abst-sd-lib .abst-sd-lib-item, .abst-sd-lib .abst-sd-lib-item:hover, .abst-sd-lib .abst-sd-lib-item:focus, .abst-sd-lib .abst-sd-lib-item:focus-visible { background: #fff !important; color: var(--sd-ink) !important; text-transform: none; letter-spacing: normal; }
.abst-sd-lib .abst-sd-lib-item span { font: 500 12px/1.3 var(--sd-font) !important; color: var(--sd-ink) !important; }
.abst-sd-lib .abst-sd-lib-own span { font: 700 14px/1.3 var(--sd-font) !important; }
.abst-sd-lib .abst-sd-lib-own small { font: 400 12px/1.3 var(--sd-font) !important; }

/* ---------- demo editor: one "Try on my website" button, no Save Draft */
.abst-sd-demo #abst-magic-bar-save-draft { display: none !important; }
/* Phones: the drawer is small, so the demo shows only the variation editor. No test
   name, no Element selector row, no "add element" link, and no Hide / Move element
   controls (bar row, element popover and the marker tabs, plus the divider before them). */
@media (max-width: 767px) {
  .abst-sd-demo .magic-test-name,
  .abst-sd-demo #variation-editor-container .abst-selector-row,
  .abst-sd-demo #abst-element-actions-row,
  .abst-sd-demo #abst-action-add-element,
  .abst-sd-demo .abst-element-actions,
  .abst-sd-demo .abst-magic-tab .abst-tab-act,
  .abst-sd-demo .abst-magic-tab .abst-tab-sep:has(+ .abst-tab-act) { display: none !important; }
}

/* ---------- admin switch: visitor demo vs real editor */
.abst-sd-adminswitch {
  position: fixed; left: 16px; bottom: 16px; z-index: 100000; display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px; border: 1.5px solid var(--sd-teal); border-radius: 999px; background: #fff; color: var(--sd-teal-ink);
  font: 600 13px/1.2 var(--sd-font); box-shadow: 0 2px 10px rgba(13, 26, 53, .15);
}
.abst-sd-adminswitch-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sd-teal); }
.abst-sd-adminswitch.is-real { border-color: #b32d2e; color: #8a2424; }
.abst-sd-adminswitch.is-real .abst-sd-adminswitch-dot { background: #b32d2e; }
.abst-sd-adminswitch:focus-visible { outline: 3px solid rgba(0, 150, 136, .35); outline-offset: 2px; }
