/* Floating WhatsApp chat – Ernest · bottom right */

.wg-wa-float {
  position: fixed;
  right: clamp(0.85rem, 2.5vw, 1.65rem);
  left: auto;
  bottom: clamp(0.85rem, 2.5vw, 1.65rem);
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.65rem;
  pointer-events: none;
  transition: opacity 0.45s var(--wg-ease), transform 0.45s var(--wg-ease), visibility 0.45s;
}

.wg-wa-float > * {
  pointer-events: auto;
}

.wg-wa-float.is-over-hero {
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px) scale(0.92);
  pointer-events: none;
}

.wg-wa-float.is-over-hero > * {
  pointer-events: none;
}

/* Chat panel */
.wg-wa-float__panel {
  width: min(19.5rem, calc(100vw - 2rem));
  border-radius: 14px;
  overflow: hidden;
  background: #e5ddd5;
  border: 1px solid rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.96);
  transform-origin: right bottom;
  transition:
    opacity 0.32s var(--wg-ease),
    transform 0.38s cubic-bezier(0.22, 1.12, 0.36, 1),
    visibility 0.32s;
}

.wg-wa-float.is-open .wg-wa-float__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* WhatsApp header bar */
.wg-wa-chat__bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: #075e54;
  color: #fff;
}

.wg-wa-chat__avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.wg-wa-chat__meta {
  min-width: 0;
  flex: 1;
}

.wg-wa-chat__name {
  display: block;
  font-family: var(--wg-font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.wg-wa-chat__status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.12rem;
  font-size: 0.68rem;
  font-weight: 400;
  opacity: 0.88;
  line-height: 1.2;
}

.wg-wa-chat__dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #25d366;
  flex-shrink: 0;
}

/* Chat body */
.wg-wa-chat__body {
  padding: 0.75rem 0.65rem 0.85rem;
  min-height: 8.5rem;
  max-height: min(42vh, 16rem);
  overflow-y: auto;
  background-color: #e5ddd5;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23c8c0b8' fill-opacity='0.35'%3E%3Cpath d='M0 0h40v40H0V0zm40 40h40v40H40V40z'/%3E%3C/g%3E%3C/svg%3E");
}

.wg-wa-chat__time {
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(0, 0, 0, 0.38);
  margin: 0 0 0.55rem;
}

.wg-wa-chat__bubble {
  max-width: 92%;
  margin-bottom: 0.45rem;
  padding: 0.45rem 0.55rem 0.5rem;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #111;
  position: relative;
  opacity: 0;
  transform: translateY(8px);
}

.wg-wa-chat__bubble p {
  margin: 0;
}

.wg-wa-chat__bubble--in {
  background: #fff;
  border-top-left-radius: 2px;
  margin-right: auto;
}

.wg-wa-float.is-open .wg-wa-chat__bubble:nth-of-type(1) {
  animation: wgWaBubbleIn 0.42s var(--wg-ease) 0.12s forwards;
}

.wg-wa-float.is-open .wg-wa-chat__bubble:nth-of-type(2) {
  animation: wgWaBubbleIn 0.42s var(--wg-ease) 0.38s forwards;
}

@keyframes wgWaBubbleIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CTA – opens WhatsApp */
.wg-wa-chat__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.72rem 1rem;
  background: #25d366;
  color: #fff;
  text-decoration: none;
  font-family: var(--wg-font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  transition: background 0.22s, transform 0.22s var(--wg-ease);
}

.wg-wa-chat__cta:hover {
  background: #1fb855;
  transform: translateY(-1px);
}

.wg-wa-chat__cta .fa-whatsapp {
  font-size: 1.15rem;
}

.wg-wa-chat__cta-arrow {
  font-size: 0.65rem;
  opacity: 0.85;
}

/* Trigger button */
.wg-wa-float__trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.72rem 1.1rem 0.72rem 0.82rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, #25d366 0%, #1ebe57 55%, #128c3a 100%);
  color: #fff;
  font-family: var(--wg-font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.28s var(--wg-ease), filter 0.28s;
}

.wg-wa-float__trigger:hover {
  transform: translateY(-3px);
  filter: brightness(1.05);
}

.wg-wa-float.is-open .wg-wa-float__trigger {
  background: linear-gradient(135deg, #075e54 0%, #054a42 100%);
}

.wg-wa-float__icon-wrap {
  position: relative;
  flex-shrink: 0;
  width: 1.85rem;
  height: 1.85rem;
  display: grid;
  place-items: center;
}

.wg-wa-float__ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(37, 211, 102, 0.45);
  opacity: 0;
  animation: wgWaPulse 2.8s ease-out infinite;
  pointer-events: none;
}

.wg-wa-float__ring--2 {
  animation-delay: 1.4s;
}

.wg-wa-float.is-open .wg-wa-float__ring,
.wg-wa-float.is-over-hero .wg-wa-float__ring {
  animation: none;
  opacity: 0;
}

@keyframes wgWaPulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70% {
    transform: scale(1.28);
    opacity: 0;
  }
  100% {
    transform: scale(1.28);
    opacity: 0;
  }
}

.wg-wa-float__icon {
  position: relative;
  z-index: 1;
  width: 1.65rem;
  height: 1.65rem;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  animation: wgWaIconNudge 4.5s ease-in-out infinite;
}

.wg-wa-float.is-open .wg-wa-float__icon-wrap .wg-wa-float__icon {
  animation: none;
}

@keyframes wgWaIconNudge {
  0%, 88%, 100% { transform: rotate(0deg) scale(1); }
  92% { transform: rotate(-8deg) scale(1.06); }
  96% { transform: rotate(6deg) scale(1.04); }
}

.wg-wa-float__label {
  position: relative;
  z-index: 1;
  white-space: nowrap;
  font-weight: 600;
  opacity: 0.96;
}

.wg-wa-float__icon-wrap .wg-wa-float__close {
  display: none;
  position: relative;
  z-index: 1;
  font-size: 1.1rem;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
}

.wg-wa-float.is-open .wg-wa-float__icon-wrap .wg-wa-float__icon {
  display: none;
}

.wg-wa-float.is-open .wg-wa-float__icon-wrap .wg-wa-float__close {
  display: grid;
}

@media (max-width: 480px) {
  .wg-wa-float__label {
    display: none;
  }

  .wg-wa-float__trigger {
    width: 3.35rem;
    height: 3.35rem;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .wg-wa-float__icon-wrap {
    width: 100%;
    height: 100%;
  }

  .wg-wa-float__panel {
    width: min(18rem, calc(100vw - 1.25rem));
  }
}

@media (prefers-reduced-motion: reduce) {
  .wg-wa-float__ring,
  .wg-wa-float__icon,
  .wg-wa-chat__bubble,
  .wg-wa-float__label {
    animation: none !important;
    transition: none !important;
  }

  .wg-wa-float,
  .wg-wa-float__panel,
  .wg-wa-float__trigger,
  .wg-wa-chat__cta {
    transition: none !important;
  }
}

/* Legacy footer link – replaced by float widget */
.wg-footer__wa {
  display: none !important;
}
