/* ==============================================================================
   MATSUYA R&D VIETNAM - FLOATING QUICK CHAT WIDGET (TƯ VẤN VIÊN DAISY)
   ============================================================================== */

/* 1. NÚT KÍCH HOẠT DẠNG VIÊN NHỘNG (TRIGGER PILL BUTTON) */
.mrd-quickchat-trigger {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background: linear-gradient(135deg, #009fe3 0%, #0084c7 100%);
  color: #ffffff;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 159, 227, 0.45);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.mrd-quickchat-trigger::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50px;
  border: 2px solid rgba(0, 159, 227, 0.5);
  animation: mrdChatGlow 2.4s cubic-bezier(0, 0.2, 0.8, 1) infinite;
  pointer-events: none;
}

@keyframes mrdChatGlow {
  0% {
    transform: scale(0.95);
    opacity: 1;
  }
  100% {
    transform: scale(1.22);
    opacity: 0;
  }
}

.mrd-quickchat-trigger:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 32px rgba(0, 159, 227, 0.6);
  background: linear-gradient(135deg, #008cd0 0%, #0070aa 100%);
}

.mrd-quickchat-trigger:active {
  transform: translateY(-1px) scale(0.98);
}

.mrd-quickchat-trigger-icon {
  width: 20px;
  height: 20px;
  fill: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mrd-quickchat-trigger-text {
  letter-spacing: 0.3px;
}

/* DẤU ĐỎ THÔNG BÁO TIN NHẮN MỚI CHƯA ĐỌC */
.mrd-quickchat-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
  animation: mrdBadgeBounce 2.4s ease-in-out infinite;
  box-sizing: border-box;
}

@keyframes mrdBadgeBounce {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.7);
  }
}

/* 2. KHUNG CHAT MODAL (QUICK CHAT BOX) */
.mrd-quickchat-box {
  position: fixed;
  bottom: 86px;
  right: 28px;
  z-index: 9999;
  width: 350px;
  max-width: calc(100vw - 36px);
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.mrd-quickchat-box.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* HEADER KHUNG CHAT */
.mrd-quickchat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
}

.mrd-quickchat-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mrd-quickchat-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.mrd-quickchat-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mrd-quickchat-status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  background-color: #22c55e;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 4px #22c55e;
}

.mrd-quickchat-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mrd-quickchat-name {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.mrd-quickchat-status {
  font-size: 12.5px;
  font-weight: 600;
  color: #10b981;
  line-height: 1.2;
}

.mrd-quickchat-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
}

.mrd-quickchat-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.mrd-quickchat-close svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* THÂN TIN NHẮN (MESSAGE BODY) */
.mrd-quickchat-body {
  padding: 20px 18px;
  background: #f8fafc;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.mrd-quickchat-mini-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 4px;
}

.mrd-quickchat-bubble {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 4px 16px 16px 16px;
  padding: 14px 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.mrd-quickchat-text {
  font-size: 14px;
  color: #1e293b;
  line-height: 1.55;
  margin: 0;
}

.mrd-quickchat-text p {
  margin: 0 0 8px 0;
}

.mrd-quickchat-text p:last-child {
  margin-bottom: 0;
}

.mrd-quickchat-text strong {
  color: #004b87;
}

/* KHỐI 4 NÚT HÀNH ĐỘNG (ACTION BUTTONS) */
.mrd-quickchat-actions {
  padding: 14px 18px 18px 18px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Hàng 1: Call & Messenger (2 nút lớn nổi bật) */
.mrd-quickchat-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mrd-quickchat-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-sizing: border-box;
}

.mrd-quickchat-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

/* Nút 1: Call */
.mrd-quickchat-btn-call {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
}

.mrd-quickchat-btn-call:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.45);
  color: #ffffff;
}

/* Nút 2: Messenger */
.mrd-quickchat-btn-messenger {
  background: #0084ff;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 132, 255, 0.35);
}

.mrd-quickchat-btn-messenger:hover {
  background: #0073e6;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 132, 255, 0.45);
  color: #ffffff;
}

/* Nút 3: Tải Catalogue */
.mrd-quickchat-btn-catalogue {
  background: #f8fafc;
  color: #004b87;
  border: 1.5px solid #009fe3;
  box-shadow: 0 2px 6px rgba(0, 159, 227, 0.1);
}

.mrd-quickchat-btn-catalogue:hover {
  background: #009fe3;
  color: #ffffff;
  border-color: #009fe3;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 159, 227, 0.35);
}

/* Nút 4: Yêu Cầu Báo Giá */
.mrd-quickchat-btn-quote {
  background: linear-gradient(135deg, #009fe3 0%, #0077b6 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 159, 227, 0.35);
}

.mrd-quickchat-btn-quote:hover {
  background: linear-gradient(135deg, #008cd0 0%, #006097 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 159, 227, 0.48);
  color: #ffffff;
}

/* Responsive Mobile */
@media (max-width: 480px) {
  .mrd-quickchat-trigger {
    bottom: 20px;
    right: 18px;
    padding: 10px 18px;
    font-size: 14px;
  }

  .mrd-quickchat-box {
    bottom: 76px;
    right: 18px;
    width: calc(100vw - 36px);
  }
}
