/* ── Chat Widget ── */
.chat-widget {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 20000;
  font-family: inherit;
}

.chat-toggle {
  background: #1672E6;
  color: #fff;
  border: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(22, 114, 230, .35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 18px;
  font-weight: 600;
  position: relative;
}

.chat-toggle:hover {
  background: #0f63cc;
}

.chat-toggle:focus {
  outline: 2px solid rgba(22, 114, 230, .6);
  outline-offset: 2px;
}

.chat-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-block;
  width: 12px;
  height: 12px;
  background: #ff4242;
  border-radius: 50%;
  border: 2px solid #fff;
}

.chat-panel {
  position: fixed;
  bottom: 72px;
  right: 16px;
  width: 340px;
  max-height: 80vh;
  background: #fff;
  color: #0a2540;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, .06);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
  animation: chatIn .25s ease;
  font-size: 13px;
}

.chat-panel.is-chatting .chat-init {
  display: none;
}

.chat-panel:not(.is-chatting) .chat-main {
  display: none;
}

.chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 50vh;
  overflow-y: auto;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.chat-panel[hidden] {
  display: none !important;
}

@keyframes chatIn {
  from {
    transform: translateY(14px);
    opacity: 0;
  }

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

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f5f9fc;
  border-bottom: 1px solid #e2eef5;
}

.chat-head-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-user-mini {
  font-size: 11px;
  color: #526371;
}

.chat-head-actions {
  display: flex;
  gap: 4px;
}

.chat-min,
.chat-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  color: #4b5b67;
}

.chat-min:hover,
.chat-close:hover {
  background: #e5eef5;
}

.chat-init {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 16px;
}

.init-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #2f4656;
}

.chat-init input {
  border: 1px solid #c8d9e6;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.chat-init input:focus {
  outline: none;
  border-color: #1672E6;
  box-shadow: 0 0 0 2px rgba(22, 114, 230, .15);
}

.btn-init {
  background: #1672E6;
  color: #fff;
  border: 0;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
}

.btn-init:hover {
  background: #0f63cc;
}

.init-msg {
  margin: 0;
  min-height: 16px;
  color: #b33;
}

.chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

.chat-user-bar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #f6f9ff;
  border-bottom: 1px solid #e2eef5;
  color: #2f4656;
}

.chat-reset {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: #5a6b76;
}

.chat-reset:hover {
  color: #1d2e39;
}

.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #fff;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #c7d6e2;
  border-radius: 4px;
}

.chat-msg {
  margin: 6px 0;
  max-width: 85%;
  padding: 8px 10px;
  border-radius: 10px;
  line-height: 1.35;
  word-wrap: break-word;
  background: #eef5fb;
  color: #1d2e39;
  position: relative;
  font-size: 13px;
}

.chat-msg.user {
  background: #58a3f8;
  color: #fff;
  border-bottom-left-radius: 4px;
}

.chat-msg.support {
  align-self: flex-end;
  background: #f1f5fb;
  color: #0a2540;
  border-bottom-right-radius: 4px;
}

.msg-body {
  display: flex;
  flex-direction: column;
}

.msg-time {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
  text-align: right;
}

.chat-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #28a745;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
  }

  70% {
    box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
  }
}

.msg-sender {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #526371;
}

.chat-msg.user .msg-sender {
  display: block;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #eef3fb;
  background: #fafcfe;
}

.chat-form input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 22px;
  border: 1px solid #dfe8f5;
}

.btn-send {
  background: #1672E6;
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  transition: background-color 0.2s;
}

.btn-send svg {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

.btn-send:hover {
  background: #0f63cc;
}

.chat-hint {
  text-align: center;
  font-size: 11px;
  padding: 4px 8px 8px;
  color: #6a7c88;
}

@media (max-width:560px) {
  .chat-panel {
    width: 94vw;
    right: -4px;
  }
}

.dark .chat-panel {
  background: #132534;
  border-color: #1d3a4a;
}

.dark .chat-head {
  background: #183041;
  border-color: #23495c;
}

.dark .chat-user-bar {
  background: #183041;
  border-color: #23495c;
  color: #cfe2ec;
}

.dark .chat-msg {
  background: #1d3a4a;
  color: #e0eef5;
}

.dark .chat-msg.user {
  background: #1672E6;
}

.dark #chatInput {
  background: #0f212e;
  color: #e0eef5;
  border-color: #27485d;
}

.dark .chat-form {
  background: #142a39;
  border-color: #1d3a4a;
}

.dark .chat-min:hover,
.dark .chat-close:hover {
  background: #23495c;
}

/* ── WhatsApp Widget ── */
.whatsapp-widget {
  position: fixed;
  bottom: 86px;
  right: 20px;
  z-index: 998;
}

.whatsapp-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #25D366;
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease-out;
}

.whatsapp-toggle:hover {
  transform: scale(1.05);
}

.whatsapp-panel {
  position: absolute;
  bottom: 100%;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 10px;
  width: 240px;
  overflow: hidden;
  border: 1px solid #eee;
  transform-origin: bottom right;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.whatsapp-panel[hidden] {
  display: block !important;
  transform: scale(0.95);
  opacity: 0;
  pointer-events: none;
}

.whatsapp-head {
  background: #f1f1f1;
  padding: 10px 15px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  border-bottom: 1px solid #ddd;
}

.whatsapp-options {
  display: flex;
  flex-direction: column;
}

.whatsapp-link {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  text-decoration: none;
  color: #111;
  font-size: 15px;
  transition: background-color 0.2s;
}

.designer-info {
  display: flex;
  align-items: center;
}

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #28a745;
  border-radius: 50%;
  margin-right: 8px;
  animation: pulse 1.5s infinite;
}

.whatsapp-link:hover {
  background-color: #f7f7f7;
}

.whatsapp-link i {
  color: #25D366;
  font-size: 22px;
  margin-right: 12px;
}