/* The website chat widget of the Santé storefront (public/assets/sante/js/chat-widget.js).

   Not one of the approved TWCinc files: written for this storefront (ClickUp z8uq9mfj12, G3 PR3) from the approved mockups w1 to w6
   (their sw.css). It carries its own colours so it does not depend on the page: light by default, and dark when the page is,
   which is html[data-theme="dark"] (set by pack-member-bar.js). The focus border is light blue, never gold. Under 641 px the panel
   is a full-screen sheet and the launcher is the icon alone. */
.sw-root {
  --sw-surface: #FFFFFF; --sw-text: #1F2933; --sw-text-2: #4A5568; --sw-text-3: #5B6779; --sw-border: #E2E8F0;
  --sw-green: #007A3D; --sw-green-dark: #005B2E; --sw-head: #005B2E; --sw-link: #005B2E; --sw-me: #00703A;
  --sw-store: #EEF3EF; --sw-store-text: #1F2933; --sw-note-bg: #EEF5EF; --sw-note-text: #34414d;
  --sw-input-bg: #FFFFFF; --sw-input-text: #1F2933; --sw-input-line: #8593A6; --sw-input-hint: #657389;
  --sw-alert-bg: #FDECEA; --sw-alert-line: #E5A29A; --sw-alert-text: #7A1B10; --sw-bad: #B3261E;
  --sw-tile: #EEF5EF; --sw-tile-text: #005B2E;
  font-family: var(--font, "Manrope", system-ui, sans-serif);
}
html[data-theme="dark"] .sw-root {
  --sw-surface: #17201B; --sw-text: #E6EDE9; --sw-text-2: #C4D0C9; --sw-text-3: #A9B8B0; --sw-border: #2C3A33;
  --sw-green: #00703A; --sw-head: #024a25; --sw-link: #5FD39B; --sw-me: #00703A;
  --sw-store: #1F2B25; --sw-store-text: #E6EDE9; --sw-note-bg: #1B261F; --sw-note-text: #C4D0C9;
  --sw-input-bg: #0f1512; --sw-input-text: #E6EDE9; --sw-input-line: #7A8A82; --sw-input-hint: #A9B8B0;
  --sw-alert-bg: #3A1B17; --sw-alert-line: #7A3A32; --sw-alert-text: #FFC2B8; --sw-bad: #FF8A7A;
  --sw-tile: #1B261F; --sw-tile-text: #5FD39B;
}
.sw-root .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.sw-root [hidden] { display: none !important; }

/* the footer text stays clear of the launcher */
body.sw-on .footer { padding-bottom: 104px; }
@media (max-width: 768px) { body.sw-on .footer { padding-bottom: 104px; } }

/* launcher: "Chat with us" and the icon, bottom right; the icon alone on a phone */
.sw-launcher { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 22px 0 18px; box-sizing: border-box; border: 2px solid #FFFFFF; border-radius: 999px; background: #007A3D; color: #fff; font: 700 15px/1 var(--font, system-ui, sans-serif); box-shadow: 0 0 0 1px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.28); cursor: pointer; }
.sw-launcher:hover { background: #005B2E; }
.sw-launcher svg { width: 24px; height: 24px; flex: none; }
.sw-launcher:focus-visible, .sw-close:focus-visible, .sw-send:focus-visible, .sw-link:focus-visible { outline: 3px solid #6C8CFF; outline-offset: 2px; }
html[data-theme="dark"] .sw-launcher { background: #00703A; border: 2px solid #FFFFFF; }
@media (max-width: 640px) { .sw-launcher { right: 16px; bottom: 16px; width: 56px; padding: 0; justify-content: center; } .sw-launcher .sw-lab { display: none; } }

/* the funnel's own bottom bars (the landing page's phone order bar, shown once the hero button has scrolled away) sits at the bottom of a
   phone screen: the launcher rides above it instead of covering its button. The checkout's total bar (.pp-co-totalbar) is always shown on a phone. */
@media (max-width: 640px) {
  body.sw-on:has(.pp-sticky:not(.pp-sticky-off)) .sw-launcher { bottom: 112px; }
  body.sw-on:has(.pp-co-totalbar) .sw-launcher { bottom: 84px; }
}

/* panel: a floating card on a computer, a full-screen sheet on a phone */
.sw-panel { position: fixed; right: 20px; bottom: 20px; z-index: 900; display: flex; flex-direction: column; width: 380px; max-height: min(660px, calc(100vh - 40px)); background: var(--sw-surface); color: var(--sw-text); border: 1px solid var(--sw-border); border-radius: 16px; box-shadow: 0 16px 48px rgba(0,0,0,.3); overflow: hidden; font-family: var(--font, system-ui, sans-serif); line-height: 1.4; }
.sw-panel *, .sw-panel *::before, .sw-panel *::after { box-sizing: border-box; }
.sw-head { display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 16px; background: var(--sw-head); color: #fff; }
.sw-av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.18); font-weight: 800; }
.sw-ht { flex: 1; min-width: 0; }
.sw-ht h2 { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.25; color: #fff; overflow-wrap: anywhere; }
.sw-ht p { margin: 2px 0 0; font-size: 13px; line-height: 1.35; color: rgba(255,255,255,.92); }
.sw-close { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; color: #fff; cursor: pointer; }
.sw-close:hover { background: rgba(255,255,255,.14); }
.sw-close svg { width: 22px; height: 22px; }
.sw-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.sw-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0; }
.sw-intro { margin: 0; font-size: 15px; line-height: 1.55; color: var(--sw-text); }
.sw-field { display: flex; flex-direction: column; gap: 5px; }
.sw-field label { font-size: 13px; font-weight: 700; color: var(--sw-text-2); }
.sw-field .opt { font-weight: 500; color: var(--sw-text-3); }
.sw-input { display: block; width: 100%; border: 1.5px solid var(--sw-input-line); border-radius: 12px; background: var(--sw-input-bg); color: var(--sw-input-text); padding: 11px 13px; font: inherit; font-size: 16px; line-height: 1.45; }
.sw-input::placeholder { color: var(--sw-input-hint); opacity: 1; }
textarea.sw-input { min-height: 96px; resize: vertical; }
.sw-input:focus, .sw-input:focus-visible { outline: none; border-color: #6C8CFF; box-shadow: 0 0 0 1px #6C8CFF; }
.sw-input.bad { border-color: var(--sw-bad); }
.sw-note { margin: 0; padding: 9px 12px; border-left: 3px solid #8CC63F; border-radius: 4px 10px 10px 4px; background: var(--sw-note-bg); color: var(--sw-note-text); font-size: 13px; line-height: 1.5; }
.sw-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.sw-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--sw-border); background: var(--sw-surface); }
.sw-count { font-size: 13px; color: var(--sw-text-3); font-variant-numeric: tabular-nums; }
.sw-send { min-height: 46px; padding: 0 26px; border: 0; border-radius: 10px; background: #007A3D; color: #fff; font: 800 15px var(--font, system-ui, sans-serif); cursor: pointer; }
.sw-send:hover { background: #005B2E; }
.sw-send[disabled] { opacity: .55; cursor: not-allowed; }
html[data-theme="dark"] .sw-send { background: #00703A; border: 1px solid #5FD39B; }
.sw-msgs { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.sw-m { display: flex; flex-direction: column; gap: 3px; max-width: 86%; }
.sw-m-me { align-self: flex-end; align-items: flex-end; }
.sw-m-store { align-self: flex-start; }
.sw-bub { margin: 0; padding: 10px 13px; border-radius: 16px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.sw-m-me .sw-bub { background: var(--sw-me); color: #fff; border-bottom-right-radius: 4px; }
.sw-m-store .sw-bub { background: var(--sw-store); color: var(--sw-store-text); border-bottom-left-radius: 4px; }
.sw-meta { font-size: 12px; color: var(--sw-text-3); }
.sw-who { font-weight: 700; }
.sw-day { align-self: center; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sw-text-3); }
.sw-status { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 16px; font-size: 13px; line-height: 1.4; color: var(--sw-text-2); border-top: 1px solid var(--sw-border); background: var(--sw-surface); }
.sw-status::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #1F8A5B; }
.sw-alert { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--sw-alert-line); background: var(--sw-alert-bg); color: var(--sw-alert-text); font-size: 14px; line-height: 1.45; }
.sw-alert svg { flex: none; width: 18px; height: 18px; margin-top: 2px; }
.sw-alert-pad { margin: 0 16px 8px; }
.sw-paused { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 32px 24px; }
.sw-paused .tile { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px; background: var(--sw-tile); color: var(--sw-tile-text); }
.sw-paused .tile svg { width: 26px; height: 26px; }
.sw-paused p { margin: 0; font-size: 16px; line-height: 1.55; color: var(--sw-text); max-width: 30ch; }
.sw-ask { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 0; padding: 14px; border: 1px solid var(--sw-border); border-radius: 14px; background: var(--sw-note-bg); }
.sw-ask-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--sw-text); }
.sw-ask-err { margin: 0; font-size: 13px; line-height: 1.45; font-weight: 600; color: var(--sw-bad); }
.sw-ask-row { display: flex; gap: 10px; align-items: center; }
.sw-ask-row .sw-send { min-height: 44px; padding: 0 22px; }
.sw-skip { min-height: 44px; padding: 0 18px; border: 1.5px solid var(--sw-input-line); border-radius: 10px; background: transparent; color: var(--sw-text); font: 700 15px var(--font, system-ui, sans-serif); cursor: pointer; }
.sw-skip:hover { background: var(--sw-surface); }
.sw-skip[disabled] { opacity: .55; cursor: not-allowed; }
.sw-skip:focus-visible { outline: 3px solid #6C8CFF; outline-offset: 2px; }
.sw-thanks { margin: 4px 0 0; padding: 9px 12px; border-left: 3px solid #8CC63F; border-radius: 4px 10px 10px 4px; background: var(--sw-note-bg); color: var(--sw-note-text); font-size: 13px; line-height: 1.5; }
.sw-link { color: var(--sw-link); font-weight: 700; text-decoration: underline; }
.sw-compose { flex: 0 0 auto; border-top: 1px solid var(--sw-border); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: flex-end; background: var(--sw-surface); }
.sw-compose .sw-input { min-height: 46px; height: 46px; resize: none; padding-top: 10px; padding-bottom: 10px; }

@media (max-width: 640px) {
  .sw-panel { inset: 0; width: auto; max-height: none; border: 0; border-radius: 0; box-shadow: none; height: 100vh; height: 100dvh; }
  .sw-head { padding-top: calc(12px + env(safe-area-inset-top)); }
  html.sw-lock, html.sw-lock body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .sw-root * { transition: none !important; scroll-behavior: auto !important; } }
