/* AMS Premium WhatsApp Widget */
:root {
  --ams-wa-green: #25d366;
  --ams-wa-green-dark: #1ebe5d;
  --ams-wa-text: #2f2a24;
  --ams-wa-muted: #6f675f;
  --ams-wa-card: rgba(255, 255, 255, 0.98);
}

.ams-wa-widget,
.ams-wa-widget * { box-sizing: border-box; }

.ams-wa-widget {
  position: fixed;
  right: 26px;
  bottom: 125px;
  z-index: 100000;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.ams-wa-button {
  position: relative;
  width: 66px;
  height: 66px;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #31e27c, var(--ams-wa-green));
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(37, 211, 102, .34), 0 5px 14px rgba(0, 0, 0, .18);
  transition: transform .25s ease, box-shadow .25s ease;
  isolation: isolate;
}

.ams-wa-button:hover {
  color: #fff;
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 18px 40px rgba(37, 211, 102, .4), 0 8px 20px rgba(0, 0, 0, .2);
}

.ams-wa-button:active { transform: scale(.97); }
.ams-wa-button svg { width: 36px; height: 36px; position: relative; z-index: 2; }

.ams-wa-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(37, 211, 102, .42);
  z-index: -1;
  animation: amsWaPulse 2.2s infinite;
}

@keyframes amsWaPulse {
  0% { transform: scale(1); opacity: .72; }
  70%, 100% { transform: scale(1.55); opacity: 0; }
}

.ams-wa-bubble {
  position: absolute;
  right: 0;
  bottom: 84px;
  width: min(340px, calc(100vw - 32px));
  padding: 20px;
  background: var(--ams-wa-card);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(127, 74, 30, .12);
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .17), 0 4px 16px rgba(0, 0, 0, .07);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px) scale(.96);
  transform-origin: bottom right;
  transition: opacity .38s ease, transform .38s cubic-bezier(.2,.8,.2,1), visibility .38s;
}

.ams-wa-bubble.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ams-wa-bubble::after {
  content: "";
  position: absolute;
  right: 23px;
  bottom: -8px;
  width: 18px;
  height: 18px;
  background: #fff;
  transform: rotate(45deg);
  border-right: 1px solid rgba(127, 74, 30, .08);
  border-bottom: 1px solid rgba(127, 74, 30, .08);
}

.ams-wa-bubble-content { display: flex; align-items: flex-start; gap: 13px; padding-right: 12px; }
.ams-wa-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--ams-wa-green);
  box-shadow: 0 5px 14px rgba(37, 211, 102, .22);
}
.ams-wa-avatar svg { width: 27px; height: 27px; }
.ams-wa-name { margin-bottom: 5px; color: var(--ams-wa-text); font-weight: 750; font-size: 15px; line-height: 1.25; }
.ams-wa-message { color: var(--ams-wa-muted); font-size: 14px; line-height: 1.55; }

.ams-wa-chat-link {
  margin-top: 18px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  color: #fff;
  background: var(--ams-wa-green);
  border-radius: 12px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  transition: background .2s ease, transform .2s ease;
}
.ams-wa-chat-link:hover { color: #fff; background: var(--ams-wa-green-dark); transform: translateY(-1px); }

.ams-wa-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #938b82;
  cursor: pointer;
  font: 400 23px/30px Arial, sans-serif;
  border-radius: 50%;
  transition: background .2s ease, color .2s ease;
}
.ams-wa-close:hover { background: #f4efe9; color: #5a5148; }

.ams-wa-button:focus-visible,
.ams-wa-chat-link:focus-visible,
.ams-wa-close:focus-visible { outline: 3px solid rgba(37, 211, 102, .38); outline-offset: 4px; }

@media (max-width: 600px) {
  .ams-wa-widget { right: 18px; bottom: 118px; }
  .ams-wa-button { width: 60px; height: 60px; }
  .ams-wa-button svg { width: 32px; height: 32px; }
  .ams-wa-bubble { position: fixed; left: 16px; right: 16px; bottom: 94px; width: auto; }
  .ams-wa-bubble::after { right: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  .ams-wa-pulse { animation: none; }
  .ams-wa-button, .ams-wa-bubble, .ams-wa-chat-link { transition: none; }
}
