/* kit v1.9.0 — generated by sync-kit; edit kit/ and re-sync */
/* kit/widgets/whatsapp — floating WhatsApp button with rotating orbit text.
 *
 * Extracted from tricholab-shopify-theme snippets/floating-whatsapp.liquid's <style> block
 * (a bare <style> inside the snippet, not a {% stylesheet %} — the drift manifest records the
 * region as style-tag for that reason). One-way; the theme keeps its snippet. The design
 * originated on the SL XERF PPC landing page, so this is a component coming home.
 *
 * All of THIS module's motion is pure CSS — no GSAP, no JS of its own. The round button is
 * NOT a deep link (operator, 2026-08-23): it is the <summary> of a ui/modal wearing
 * .lp-modal--chat, opening the brand-tokened composer below — which is why this module
 * `requires` ui/modal. With scripting off the same tap still opens the composer (the --chat
 * variant's fixed-anchored arm A) and its form still submits to WhatsApp natively.
 *
 * ⚠ THIS FILE IS THE KIT'S ONE LICENSED EXCEPTION TO HARD RULE 3.
 *
 * WhatsApp's mark and its greens are Meta's, not a SkinLab brand's. Recolouring the button to
 * --primary would make it a green-ish blob that no longer reads as "WhatsApp" — the entire
 * point of a third-party affordance is that it looks like the third party. So the literals
 * below are real literals, deliberately, and they are declared in kit.json as an
 * EXACT-STRING allowlist scoped to this module:
 *
 *     "widgets/whatsapp": { "literals": { "reason": "…", "allow": ["#25d366", …] } }
 *
 * scripts/check-kit-purity.mjs permits exactly those strings, in exactly this module, and
 * prints them in its success line so the exception stays visible rather than becoming a
 * precedent. Any other literal here still fails. Adding a colour means adding it to the
 * allowlist, which means someone has to write down why.
 *
 * The two places a brand DOES reach in: --font-body for the orbit text, and --primary for the
 * focus ring, since a focus indicator is our accessibility obligation rather than Meta's
 * styling. On second look even that is wrong on dark — see below.
 */

.lp-wa {
  position: fixed;
  z-index: 998;
  bottom: var(--wa-bottom, max(20px, env(safe-area-inset-bottom)));
  display: grid;
  place-items: center;
  width: var(--wa-size, 66px);
  height: var(--wa-size, 66px);
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #075e54 0%, #128c7e 30%, #25d366 62%, #1ebe5d 78%, #075e54 100%);
  background-position: 0% 50%;
  background-size: 280% 280%;
  box-shadow: 0 10px 28px rgba(7, 94, 84, 0.3);
  text-decoration: none;
  transform-origin: center;
  transition: box-shadow 0.28s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  animation:
    lp-wa-in 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s backwards,
    lp-wa-gradient 9s ease-in-out infinite alternate;
}

.lp-wa--bottom-right { right: var(--wa-inset, max(20px, env(safe-area-inset-right))); }
.lp-wa--bottom-left  { left:  var(--wa-inset, max(20px, env(safe-area-inset-left))); }

/* In-flow mode (kit 1.4.0) — the fix for gotcha 25. `position: fixed` made the widget
 * self-positioning, so it could not sit inside a page's own floating container: dropped into
 * XERF's .mobile-cta it collapsed the bar and moved the button. `--in-flow` makes the button a
 * normal grid/flex child — the PARENT owns where it floats (or doesn't). The offset properties
 * above are explicitly cleared, which is exactly right: a corner offset is a fixed-mode
 * concern. Everything else — gradient, orbit, motion, focus ring — is unchanged.
 *
 * `relative`, NOT `static` — fixed in kit 1.5.1, and the difference is not cosmetic. The
 * button has two absolutely-positioned children, `.lp-wa__text` (the orbiting label) and
 * `.lp-wa::before` (the glow), both `inset`-anchored to it. `static` is not a containing
 * block, so under 1.4.0/1.5.0 those two escaped the button and resolved against the nearest
 * POSITIONED ancestor instead — which, for the container `--in-flow` exists to be dropped
 * into, is the page's own fixed CTA bar. The orbiting label then stretched across the whole
 * bar and overlapped the primary CTA (measured on skinmatch-laser at 390px: the ring sat at
 * x=4 over the bar's left edge instead of over the 60px button at x=318). `.lp-wa`'s own
 * `overflow: hidden` could not clip them either, since a clip only applies to descendants it
 * actually contains. `relative` restores the containing block, so the children come home.
 *
 * `inset: auto` is load-bearing and is the second half of the same fix. `static` made this
 * rule's inherited `bottom` (and `--bottom-right`/`--bottom-left`'s `right`/`left`) inert for
 * free; `relative` makes them LIVE again, and a live `bottom: var(--wa-bottom)` shifts the
 * button UP by that amount out of the row it was supposed to sit in — measured at 12px above
 * its container on skinmatch-laser. Clearing all four offsets is what makes `relative` lay
 * out identically to `static` while still being a containing block. */
.lp-wa--in-flow {
  position: relative;
  inset: auto;
  z-index: auto;
}

.lp-wa::before {
  position: absolute;
  z-index: -1;
  inset: 4px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: inherit;
}

.lp-wa:hover {
  box-shadow: 0 14px 34px rgba(7, 94, 84, 0.4);
  transform: translateY(-2px) scale(1.025);
}

/* The ring is ours, not Meta's — a focus indicator is an accessibility obligation, and it
 * has to be visible against the PAGE the button floats over, which is --bg (or --bg-inverse
 * in a dark section). --btn-outline-border is the role for a control boundary and is the one
 * re-declared in both contexts; --primary is not, and would vanish on three of five brands.
 * Same finding as ui/before-after — ROLE-TIER.md §Findings 5. */
.lp-wa:focus-visible {
  outline: 2px solid var(--btn-outline-border);
  outline-offset: 4px;
}

.lp-wa__text {
  position: absolute;
  inset: 3px;
  width: calc(var(--wa-size, 66px) - 6px);
  height: calc(var(--wa-size, 66px) - 6px);
  overflow: visible;
  pointer-events: none;
  transform-origin: 50% 50%;
  animation: lp-wa-spin 18s linear infinite;
}

.lp-wa__text path { fill: none; }

.lp-wa__text text {
  fill: currentColor;
  font: 700 5.2px/1 var(--font-body);
  letter-spacing: 0.45px;
  text-transform: uppercase;
}

.lp-wa__icon {
  position: relative;
  width: 25px;
  height: 29px;
  fill: currentColor;
  filter: drop-shadow(0 2px 4px rgba(7, 94, 84, 0.24));
}

/* ---- the message composer (kit 1.4.0) --------------------------------------------------
 *
 * XERF's .whatsapp-chat__* dialog, brought into the kit as the widget's second half (operator,
 * 2026-08-23: reference XERF's button AND modal). The panel's colours are ENTIRELY the brand's
 * role tier — the Meta-greens licence above covers the button only, because the button must
 * read as WhatsApp while the composer must read as the brand talking. Every value below is a
 * token; nothing here needs (or gets) a literals entry.
 *
 * These classes style the CONTENT of a ui/modal dialog — behaviour (open/close, focus trap,
 * Esc, backdrop) is ui/modal's, and the anchored placement is its .lp-modal--chat variant.
 * The full assembled markup is docs/modal.md §Recipe; arm A is the same form opened inline,
 * still submitting to api.whatsapp.com with no script. */

.lp-wa-chat__header {
  position: relative;
  padding: 24px 62px 22px 24px;
  color: var(--text-inverse);
  background: var(--primary);
}

.lp-wa-chat__eyebrow {
  margin: 0;
  color: var(--bg-3);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lp-wa-chat__title {
  margin: 6px 0 0;
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* The close is ui/modal's control (data-modal-close, authored hidden) wearing the chat's
 * clothes — it sits on the --primary header, so it takes the inverse roles, not
 * .lp-modal__close's page-ground ones. */
.lp-wa-chat__close {
  position: absolute;
  top: 15px;
  right: 15px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border-inverse);
  color: var(--text-inverse);
  background: transparent;
  font-family: var(--font-body);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.lp-wa-chat__close:focus-visible {
  outline: 2px solid var(--text-inverse);
  outline-offset: 3px;
}

/* display: grid beats the UA's [hidden] rule — without this the authored-hidden close shows
 * in the no-JS arm, where the summary (the floating button) is the only honest close. */
.lp-wa-chat__close[hidden] {
  display: none;
}

.lp-wa-chat__body {
  padding: 24px;
  background: var(--bg-2);
}

.lp-wa-chat__message {
  width: fit-content;
  max-width: 88%;
  margin: 0;
  padding: 14px 16px;
  border-left: 2px solid var(--accent);
  color: var(--primary);
  background: var(--bg);
  font-size: 0.88rem;
  line-height: 1.5;
}

.lp-wa-chat__status {
  display: block;
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
}

.lp-wa-chat__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  min-height: 58px;
  border-top: 1px solid var(--border-strong);
  background: var(--bg);
}

.lp-wa-chat__input {
  min-width: 0;
  padding: 15px 16px;
  border: 0;
  outline: 0;
  color: var(--text-c);
  background: transparent;
  font: 500 0.82rem/1.4 var(--font-body);
}

.lp-wa-chat__input:focus {
  box-shadow: inset 0 0 0 2px var(--accent-strong);
}

.lp-wa-chat__send {
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--border-strong);
  color: var(--text-inverse);
  background: var(--primary);
  cursor: pointer;
  transition: background var(--dur-fast) ease;
}

.lp-wa-chat__send:hover {
  background: var(--accent-strong);
}

.lp-wa-chat__send:focus-visible {
  outline: 2px solid var(--btn-outline-border);
  outline-offset: -4px;
}

.lp-wa-chat__send svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: square;
  stroke-linejoin: miter;
  stroke-width: 1.8;
}

@keyframes lp-wa-spin {
  to { transform: rotate(360deg); }
}

@keyframes lp-wa-gradient {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}

@keyframes lp-wa-in {
  from { opacity: 0; transform: scale(0.86) rotate(-8deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}

@media screen and (max-width: 749px) {
  .lp-wa--desktop-only { display: none; }
  .lp-wa { --wa-size: 60px; }
}

/* Reduced motion kills the entry, the spin and the gradient drift. The button still appears
 * and still works — `opacity: 1` is required because lp-wa-in's `backwards` fill would
 * otherwise leave it at the keyframe's opacity: 0 with the animation switched off. */
@media (prefers-reduced-motion: reduce) {
  .lp-wa,
  .lp-wa__text {
    animation: none;
  }
  .lp-wa { opacity: 1; }
}
