﻿.whatsapp-widget {
  position: fixed;
  right: 20px;
  bottom: 60px;
  z-index: 5000;
  font-family: Roboto, Arial, sans-serif;
}
.whatsapp-fab {
  border: 0;
  position: fixed;
  right: 20px;
  bottom: 72px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  z-index: 5001;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
}
.whatsapp-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}
.whatsapp-fab:focus-visible {
  outline: 3px solid #111827;
  outline-offset: 2px;
}
.wa-chat-panel {
  position: fixed;
  right: 20px;
  bottom: 128px;
  width: min(288px, calc(100vw - 24px));
  height: min(416px, calc(100vh - 120px));
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.28);
  border: 1px solid #d7dce4;
  z-index: 5002;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.whatsapp-widget.is-open .wa-chat-panel {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.wa-chat-head {
  background: #075e54;
  color: #fff;
  padding: 10px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wa-chat-profile { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wa-chat-avatar {
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: #dcf8c6;
  color: #075e54;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex: 0 0 27px;
}
.wa-chat-head strong { display: block; font-size: 12px; line-height: 1.2; }
.wa-chat-head small { display: block; opacity: .92; }
.wa-chat-close {
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.wa-prechat {
  padding: 10px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: grid;
  gap: 6px;
}
.wa-prechat-title {
  font-size: 10px;
  color: #374151;
  margin: 0;
}
.wa-prechat input {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
  width: 100%;
}
.wa-prechat button {
  border: 0;
  border-radius: 8px;
  background: #0a7a5d;
  color: #fff;
  font-weight: 700;
  padding: 8px 10px;
  font-size: 11px;
  cursor: pointer;
}
.wa-prechat-msg {
  color: #b91c1c;
  font-size: 10px;
  min-height: 15px;
}
.wa-chat-main {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}
.wa-chat-body {
  flex: 1 1 auto;
  padding: 10px;
  background-color: #e5ddd5;
  background-image:
    radial-gradient(circle at 20px 20px, rgba(255,255,255,0.35) 1.5px, transparent 1.5px),
    radial-gradient(circle at 70px 65px, rgba(255,255,255,0.28) 1.2px, transparent 1.2px),
    linear-gradient(0deg, rgba(255,255,255,0.08), rgba(255,255,255,0.08));
  background-size: 88px 88px, 120px 120px, auto;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wa-bubble {
  max-width: 85%;
  padding: 7px 9px;
  border-radius: 10px;
  line-height: 1.35;
  font-size: 11px;
  word-wrap: break-word;
  white-space: pre-wrap;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.07);
  position: relative;
}
.wa-bubble.in {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  color: #111827;
}
.wa-bubble.in:after {
  content: "";
  position: absolute;
  left: -6px;
  top: 8px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  transform: rotate(45deg);
}
.wa-bubble.out {
  align-self: flex-end;
  background: #dcf8c6;
  color: #111827;
}
.wa-bubble.out:after {
  content: "";
  position: absolute;
  right: -6px;
  top: 8px;
  width: 10px;
  height: 10px;
  background: #dcf8c6;
  transform: rotate(45deg);
}
.wa-bubble-text { display: block; margin-bottom: 2px; }
.wa-bubble-time {
  display: block;
  text-align: right;
  font-size: 9px;
  color: rgba(17, 24, 39, 0.58);
  line-height: 1.1;
}
.wa-chat-form {
  border-top: 1px solid #d7dce4;
  background: #fff;
  padding: 8px;
  display: flex;
  gap: 6px;
}
.wa-chat-input {
  flex: 1 1 auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px;
  font-size: 11px;
  resize: none;
  min-height: 34px;
  max-height: 88px;
  line-height: 1.35;
}
.wa-chat-send {
  border: 0;
  border-radius: 8px;
  background: #128c7e;
  color: #fff;
  font-weight: 700;
  padding: 0 11px;
  font-size: 11px;
  cursor: pointer;
}
.wa-chat-send:disabled {
  opacity: .6;
  cursor: not-allowed;
}
@media (max-width: 640px) {
  .whatsapp-widget, .whatsapp-fab {
    right: 14px;
    bottom: 53px;
  }
  .wa-chat-panel {
    right: 8px;
    bottom: 108px;
    width: calc(100vw - 16px);
    height: min(54vh, 416px);
  }
}
