/* Honest social proof — sales strip + quiet corner toasts. */

.sunpal-sales-proof {
  --sp-ink: #1a2420;
  --sp-muted: #66756c;
  --sp-line: #e4ebe6;
  --sp-green: #1f8a4c;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: -2px 0 14px;
  padding: 0;
  opacity: 0;
  transform: translateY(6px);
  animation: sunpal-sales-proof-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) 0.08s forwards;
}

.sunpal-sales-proof__stat {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  padding: 2px 0 0;
}

.sunpal-sales-proof__copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sunpal-sales-proof__value {
  color: var(--sp-ink);
  font: 800 22px/1.05 inherit;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.sunpal-sales-proof__stat.is-live .sunpal-sales-proof__value {
  color: var(--sp-green);
}

.sunpal-sales-proof__label {
  color: var(--sp-muted);
  font: 500 12px/1.25 inherit;
  letter-spacing: 0.01em;
}

.sunpal-sales-proof__sep {
  width: 1px;
  align-self: stretch;
  margin: 4px 18px;
  background: linear-gradient(180deg, transparent, var(--sp-line) 18%, var(--sp-line) 82%, transparent);
}

.sunpal-sales-proof__live {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--sp-green);
  box-shadow: 0 0 0 0 rgba(31, 138, 76, 0.45);
  animation: sunpal-sales-proof-pulse 2.4s ease-out infinite;
}

@keyframes sunpal-sales-proof-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sunpal-sales-proof-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(31, 138, 76, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(31, 138, 76, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 138, 76, 0);
  }
}

@media (max-width: 560px) {
  .sunpal-sales-proof {
    margin-bottom: 12px;
  }

  .sunpal-sales-proof__value {
    font-size: 20px;
  }

  .sunpal-sales-proof__sep {
    margin: 4px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sunpal-sales-proof {
    opacity: 1;
    transform: none;
    animation: none;
  }

  .sunpal-sales-proof__live {
    animation: none;
    box-shadow: none;
  }
}

.sunpal-social-toast-host {
  position: fixed;
  left: 18px;
  right: auto;
  bottom: 22px;
  z-index: 960;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
  max-width: min(300px, calc(100vw - 36px));
}

/*
 * PDP: chat docks left (clears Buy Now). Put toast on the free right corner.
 * Mobile PDP: chat returns to the right — keep toast left, lifted above buy bar.
 */
body.single-product .sunpal-social-toast-host {
  left: auto;
  right: 18px;
  align-items: flex-end;
  bottom: 22px;
}

body.single-product.has-sunpal-buy-bar .sunpal-social-toast-host {
  bottom: 108px;
}

/* Stay clear if chat teaser/panel expands in the toast’s corner */
body.sunpal-chat-open .sunpal-social-toast-host,
body:has(.sunpal-chat.teaser-visible) .sunpal-social-toast-host {
  bottom: 96px;
}

body.single-product.has-sunpal-buy-bar.sunpal-chat-open .sunpal-social-toast-host,
body.single-product.has-sunpal-buy-bar:has(.sunpal-chat.teaser-visible) .sunpal-social-toast-host {
  bottom: 168px;
}

.sunpal-social-toast {
  --toast-dwell: 6500ms;
  position: relative;
  pointer-events: auto;
  width: 100%;
  padding: 12px 14px 14px;
  border: 1px solid #e6ebe8;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  color: #24302a;
  box-shadow: 0 8px 24px rgba(9, 11, 13, 0.08);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  overflow: hidden;
}

.sunpal-social-toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #1f8a4c;
}

.sunpal-social-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.sunpal-social-toast__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 6px;
}

.sunpal-social-toast__eyebrow {
  display: block;
  margin: 0;
  color: #6a7a72;
  font: 500 11px/1.2 inherit;
  letter-spacing: 0.01em;
  text-transform: none;
}

.sunpal-social-toast__actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.sunpal-social-toast__mute {
  border: 0;
  background: transparent;
  color: #7a8a82;
  font: 650 11px/1 inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}

.sunpal-social-toast__mute:hover,
.sunpal-social-toast__mute:focus-visible,
.sunpal-social-toast__mute[aria-pressed="true"] {
  color: #1f8a4c;
  background: #f2f5f3;
}

.sunpal-social-toast__who {
  margin: 0;
  font: 650 14px/1.35 inherit;
  letter-spacing: -0.015em;
  color: #1c2822;
}

.sunpal-social-toast__product {
  margin: 3px 0 0;
  color: #5a6b62;
  font: 500 12.5px/1.4 inherit;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.sunpal-social-toast__meta {
  margin: 6px 0 0;
  color: #7a8a82;
  font: 500 11.5px/1.3 inherit;
}

.sunpal-social-toast__dismiss {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9aa89f;
  font: 500 18px/1 inherit;
  cursor: pointer;
}

.sunpal-social-toast__dismiss:hover,
.sunpal-social-toast__dismiss:focus-visible {
  background: #f2f5f3;
  color: #24302a;
}

/* Quiet dwell rail — shows how long the toast stays */
.sunpal-social-toast__rail {
  position: absolute;
  left: 3px;
  right: 0;
  bottom: 0;
  height: 2px;
  background: transparent;
  overflow: hidden;
}

.sunpal-social-toast__rail::after {
  content: "";
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  background: linear-gradient(90deg, rgba(31, 138, 76, 0.55), rgba(31, 138, 76, 0.15));
}

.sunpal-social-toast__rail.is-running::after {
  animation: sunpal-toast-rail var(--toast-dwell) linear forwards;
}

@keyframes sunpal-toast-rail {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 560px) {
  .sunpal-social-toast-host {
    left: 12px;
    right: auto;
    bottom: 88px;
    align-items: flex-start;
    max-width: min(280px, calc(100vw - 88px));
  }

  /* Mobile PDP: chat is bottom-right — toast stays left, clear sticky buy bar */
  body.single-product .sunpal-social-toast-host {
    left: 12px;
    right: auto;
    align-items: flex-start;
    bottom: 118px;
  }

  body.single-product.has-sunpal-buy-bar .sunpal-social-toast-host {
    bottom: 128px;
  }

  body.sunpal-chat-open .sunpal-social-toast-host,
  body:has(.sunpal-chat.teaser-visible) .sunpal-social-toast-host {
    bottom: 118px;
  }

  body.single-product.has-sunpal-buy-bar.sunpal-chat-open .sunpal-social-toast-host,
  body.single-product.has-sunpal-buy-bar:has(.sunpal-chat.teaser-visible) .sunpal-social-toast-host {
    bottom: 148px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sunpal-social-toast {
    transition: none;
  }

  .sunpal-social-toast__rail.is-running::after {
    animation: none;
  }
}
