/* ===== CHAT WIDGET ===== */
.chat-bubble {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 56px;
  height: 56px;
  background: #BC2F2C;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  z-index: 9998;
  transition: transform .2s, box-shadow .2s;
  border: none;
  outline: none;
}
.chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(0,0,0,.3);
}
.chat-bubble svg { fill: #fff; width: 26px; height: 26px; }

/* Unread badge */
.chat-bubble-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid #BC2F2C;
  border-radius: 50%;
  display: none;
}

/* Panel */
.chat-panel {
  position: fixed;
  bottom: 158px;
  right: 24px;
  width: 360px;
  max-height: 500px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  display: none;
  flex-direction: column;
  z-index: 9999;
  font-family: 'DM Sans', sans-serif;
  overflow: hidden;
}
.chat-panel.open {
  display: flex;
}

/* Header */
.chat-header {
  background: #1D1D1B;
  color: #fff;
  padding: 14px 18px;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-header-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0 0 0 8px;
  opacity: .7;
  transition: opacity .15s;
}
.chat-header-close:hover { opacity: 1; }

/* Pre-chat form */
.chat-prechat {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-prechat p {
  margin: 0;
  font-size: 14px;
  color: #555;
}
.chat-prechat input {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.chat-prechat input:focus {
  border-color: #BC2F2C;
}
.chat-prechat button {
  padding: 10px 0;
  background: #BC2F2C;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .15s;
}
.chat-prechat button:hover {
  background: #a02825;
}

/* Messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  max-height: 320px;
}
.chat-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}
.chat-msg.visitor {
  align-self: flex-end;
  background: #BC2F2C;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.admin {
  align-self: flex-start;
  background: #f0f0f0;
  color: #1D1D1B;
  border-bottom-left-radius: 4px;
}
.chat-msg-time {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}
.chat-msg.visitor .chat-msg-time { color: rgba(255,255,255,.65); text-align: right; }
.chat-msg.admin .chat-msg-time { text-align: left; }

/* Input area */
.chat-input-area {
  display: flex;
  border-top: 1px solid #eee;
  flex-shrink: 0;
}
.chat-input-area input {
  flex: 1;
  border: none;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
}
.chat-input-area button {
  background: #BC2F2C;
  color: #fff;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 14px;
  transition: background .15s;
}
.chat-input-area button:hover {
  background: #a02825;
}

/* Empty state */
.chat-empty {
  text-align: center;
  color: #999;
  font-size: 13px;
  padding: 40px 0;
}

/* Mobile */
@media (max-width: 480px) {
  .chat-panel {
    right: 8px;
    left: 8px;
    bottom: 80px;
    width: auto;
    max-height: 70vh;
  }
  .chat-bubble {
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
  }
  .chat-bubble svg { width: 22px; height: 22px; }
}
