#swd-chat-widget {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  box-sizing: border-box;
}
#swd-chat-widget *,
#swd-chat-widget *::before,
#swd-chat-widget *::after {
  box-sizing: border-box;
}

.swd-chat-bubble {
  position: fixed;
  bottom: 80px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D9B310 0%, #8a3a44 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(114, 47, 55, 0.45);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
}
@media (max-width: 767.98px) {
  .swd-chat-bubble {
    display: none;
  }
  .swd-chat-bubble.visible {
    display: flex;
  }
}
.swd-chat-bubble::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(114, 47, 55, 0.15);
  animation: swdRipple 2s infinite;
}
@keyframes swdRipple {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(1.3); opacity: 0; }
}
.swd-chat-bubble:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 32px rgba(114, 47, 55, 0.55);
}
.swd-chat-bubble svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.swd-chat-panel {
  position: fixed;
  bottom: 160px;
  right: 24px;
  width: 380px;
  height: 580px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 12px 60px rgba(0,0,0,0.2);
  z-index: 999998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: swdSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.swd-chat-panel.open {
  display: flex;
}

@keyframes swdSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.swd-chat-header {
  background: linear-gradient(135deg, #D9B310 0%, #5a252c 100%);
  color: #fff;
  padding: 20px 20px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  overflow: hidden;
}
.swd-chat-header::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 140%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.swd-chat-header .swd-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  letter-spacing: 0.5px;
}
.swd-chat-header .swd-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}
.swd-chat-header .swd-info h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.2px;
}
.swd-chat-header .swd-info .swd-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  font-size: 12px;
  opacity: 0.85;
}
.swd-chat-header .swd-info .swd-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  animation: swdPulse 2s infinite;
}
@keyframes swdPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.swd-chat-header .swd-close {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  opacity: 0.8;
  transition: all 0.2s;
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.swd-chat-header .swd-close:hover {
  opacity: 1;
  background: rgba(255,255,255,0.2);
}
.swd-chat-header .swd-close svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.swd-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 12px;
  background: #f5f6fa;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.swd-chat-messages::-webkit-scrollbar { width: 4px; }
.swd-chat-messages::-webkit-scrollbar-track { background: transparent; }
.swd-chat-messages::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 4px; }

.swd-msg {
  max-width: 88%;
  padding: 10px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: swdMsgIn 0.3s ease;
  position: relative;
}
@keyframes swdMsgIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.swd-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #2d3436;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.swd-msg.bot .swd-msg-label {
  font-size: 10px;
  font-weight: 600;
  color: #D9B310;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 3px;
}
.swd-msg.visitor {
  align-self: flex-end;
  background: linear-gradient(135deg, #D9B310 0%, #8a3a44 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.swd-msg.admin {
  align-self: flex-start;
  background: #eef2ff;
  color: #4338ca;
  border-bottom-left-radius: 4px;
}
.swd-msg.admin .swd-msg-label {
  font-size: 10px;
  font-weight: 600;
  color: #4338ca;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 3px;
}
.swd-msg .swd-msg-time {
  font-size: 10px;
  margin-top: 5px;
  opacity: 0.5;
  display: block;
}

.swd-msg-greeting {
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px;
  margin-bottom: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.swd-msg-greeting .swd-greeting-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 6px;
}
.swd-msg-greeting .swd-greeting-text {
  font-size: 13.5px;
  color: #555;
  line-height: 1.6;
  margin: 0;
}

.swd-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 12px;
  background: #f5f6fa;
}
.swd-suggestion-btn {
  background: #fff;
  border: 1.5px solid #e8e8ec;
  color: #444;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.swd-suggestion-btn:hover {
  background: #D9B310;
  border-color: #D9B310;
  color: #fff;
  box-shadow: 0 2px 8px rgba(114, 47, 55, 0.25);
}

.swd-whatsapp-msg {
  text-align: center;
  padding: 16px 20px;
  margin: 4px 0;
  background: #f0faf4;
  border-radius: 16px;
}
.swd-whatsapp-msg p {
  font-size: 13px;
  color: #555;
  margin: 0 0 12px;
  line-height: 1.5;
}
.swd-whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #25d366;
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.3);
}
.swd-whatsapp-btn:hover {
  background: #1ebe5d;
  color: #fff;
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.4);
  transform: translateY(-1px);
}
.swd-whatsapp-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.swd-chat-input-area {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 16px;
  border-top: 1px solid #f0f0f0;
  background: #fff;
}
.swd-chat-input-area input {
  flex: 1;
  border: 1.5px solid #e8e8ec;
  border-radius: 24px;
  padding: 11px 18px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #f8f9fc;
}
.swd-chat-input-area input:focus {
  border-color: #D9B310;
  box-shadow: 0 0 0 3px rgba(114, 47, 55, 0.1);
  background: #fff;
}
.swd-chat-input-area input::placeholder {
  color: #aaa;
}
.swd-chat-input-area button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D9B310 0%, #8a3a44 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(114, 47, 55, 0.25);
}
.swd-chat-input-area button:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(114, 47, 55, 0.35);
}
.swd-chat-input-area button:disabled {
  background: #d0d0d0;
  cursor: not-allowed;
  box-shadow: none;
}
.swd-chat-input-area button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.swd-chat-footer {
  padding: 8px 16px 10px;
  text-align: center;
  font-size: 10px;
  color: #bbb;
  background: #fff;
  border-top: 1px solid #f5f5f5;
  letter-spacing: 0.3px;
}

.swd-typing {
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.swd-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D9B310;
  animation: swdTyping 1.2s infinite;
}
.swd-typing span:nth-child(2) { animation-delay: 0.2s; }
.swd-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes swdTyping {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-6px); }
}

@media (max-width: 480px) {
  .swd-chat-panel {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 50vh;
    border-radius: 16px 16px 0 0;
  }
  .swd-chat-bubble {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }
}
