@media (max-width: 767px) {
  .mvcb-chat-popup { width: 97% !important; }
  .mvcb-chat-box { height: 250px !important; }
}

.mvcb-chat-icon {
  position: fixed !important;
  right: max(20px, env(safe-area-inset-right)) !important;
  bottom: max(20px, env(safe-area-inset-bottom)) !important;
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 999999 !important;
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

.mvcb-chat-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.mvcb-chat-bubble {
  position: absolute;
  bottom: 60px;
  right: -10px;
  background-color: var(--mvcb-main-color, #eb000f);
  color: #fff;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  z-index: 1000;
  width: 170px;
}

.mvcb-chat-bubble span { margin-right: 10px; }

.mvcb-chat-bubble::before {
  content: "";
  position: absolute;
  bottom: -10px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--mvcb-main-color, #eb000f);
}

.mvcb-close-bubble {
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.mvcb-chat-popup {
  display: none;
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom)) !important;
  right: max(5px, env(safe-area-inset-right)) !important;
  width: 380px;
  max-width: 100%;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 999999 !important;
  transition: transform .3s ease, opacity .3s ease;
  opacity: 0;
  transform: translateY(100%);
}

.mvcb-chat-popup.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.mvcb-chat-container { padding: 20px; }

.mvcb-close-popup {
  background: var(--mvcb-main-color, #eb000f);
  border: none;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: background-color .3s ease;
}

.mvcb-close-popup:hover,
.mvcb-chat-button:hover {
  background: var(--mvcb-main-color-hover, #b20026);
}

.mvcb-chat-box {
  height: 550px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 15px;
  background-color: #fff;
  margin-bottom: 15px;
}

.mvcb-chat-input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #ccc;
  padding: 10px;
  font-size: 16px;
  resize: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mvcb-chat-button {
  width: 100%;
  padding: 10px;
  background-color: var(--mvcb-main-color, #eb000f);
  color: #fff;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color .3s ease;
  margin-top: 10px;
}

.mvcb-chat-footer-text {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
  line-height: 1.2;
}

.mvcb-chat-box p {
  margin: 10px 0;
  padding: 10px;
  border-radius: 8px;
  white-space: pre-wrap;
}

.mvcb-chat-box p strong {
  display: block;
  margin-bottom: 5px;
}

.mvcb-chat-box p.user {
  background-color: #d1ecf1;
  color: #0c5460;
  text-align: right;
}

.mvcb-chat-box p.chatbot {
  background-color: #e2e3e5;
  color: #383d41;
  text-align: left;
}

.mvcb-chat-box::-webkit-scrollbar { width: 8px; }
.mvcb-chat-box::-webkit-scrollbar-thumb { background-color: #ccc; border-radius: 10px; }
.mvcb-chat-box::-webkit-scrollbar-thumb:hover { background-color: #999; }
