/* Floating contact dock: kompakt dairesel butonlar (WhatsApp + Mesaj) */
.rm-contact-dock {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1042;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  font-family: 'Open Sans', system-ui, sans-serif;
}

.rm-contact-dock__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
  border: 0;
  background: transparent;
  padding: 0;
  text-decoration: none;
  cursor: pointer;
}

.rm-contact-dock__icon {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.4rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rm-contact-dock__btn--wa .rm-contact-dock__icon {
  background: #25d366;
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.35);
}

.rm-contact-dock__btn--chat .rm-contact-dock__icon {
  background: linear-gradient(135deg, var(--rm-primary), #0d1b2a);
  box-shadow: 0 10px 26px rgba(13, 27, 42, 0.22);
}

.rm-contact-dock__btn:hover .rm-contact-dock__icon {
  transform: translateY(-2px);
}

.rm-contact-dock__cap {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #0d1b2a;
  background: #fff;
  border: 1px solid rgba(13, 27, 42, 0.08);
  box-shadow: 0 6px 16px rgba(13, 27, 42, 0.1);
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.rm-contact-dock__badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc3545;
  color: #fff;
  border: 2px solid #fff;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1;
}

.rm-contact-dock--chat.is-open .rm-contact-dock__btn--chat .rm-contact-dock__icon {
  box-shadow: 0 14px 34px rgba(28, 197, 204, 0.34);
}

/* Chat panel */
.rm-chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(380px, calc(100vw - 2rem));
  max-height: min(560px, calc(100vh - 8rem));
  background: #fff;
  border-radius: 18px;
  border: 1px solid rgba(13, 27, 42, 0.08);
  box-shadow: 0 22px 60px rgba(13, 27, 42, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rm-chat-panel__head,
.rm-chat-panel__thread-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(13, 27, 42, 0.08);
  background: #f8fafc;
}

.rm-chat-panel__head strong,
.rm-chat-panel__thread-meta strong {
  display: block;
  color: #0d1b2a;
  font-size: 0.95rem;
}

.rm-chat-panel__head span,
.rm-chat-panel__thread-meta span {
  display: block;
  color: #64748b;
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.rm-chat-panel__close,
.rm-chat-panel__back {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0d1b2a;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.rm-chat-panel__thread-head {
  align-items: center;
}

.rm-chat-panel__thread-meta {
  flex: 1;
  min-width: 0;
}

.rm-chat-panel__list,
.rm-chat-panel__thread {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.rm-chat-panel__list {
  overflow-y: auto;
  padding: 0.5rem;
}

.rm-chat-panel__loading,
.rm-chat-panel__empty {
  padding: 1rem;
  color: #64748b;
  font-size: 0.85rem;
  text-align: center;
}

.rm-chat-panel__item {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0.75rem;
  background: #fff;
  text-align: left;
  display: block;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 0.35rem;
}

.rm-chat-panel__item:hover {
  background: #f1f5f9;
  border-color: rgba(28, 197, 204, 0.25);
}

.rm-chat-panel__item strong {
  display: block;
  color: #0d1b2a;
  font-size: 0.88rem;
}

.rm-chat-panel__item small {
  display: block;
  color: #64748b;
  font-size: 0.74rem;
  margin-top: 0.15rem;
}

.rm-chat-panel__item p {
  margin: 0.35rem 0 0;
  color: #475569;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-chat-panel__item.is-closed {
  opacity: 0.72;
}

.rm-chat-panel__notice {
  margin: 0.5rem 0.75rem 0;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.78rem;
}

.rm-chat-panel__messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 180px;
  max-height: 320px;
  background: #f8fafc;
}

.rm-chat-bubble {
  max-width: 88%;
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  background: #fff;
  border: 1px solid rgba(13, 27, 42, 0.06);
}

.rm-chat-bubble.is-mine {
  align-self: flex-end;
  background: rgba(28, 197, 204, 0.14);
  border-color: rgba(28, 197, 204, 0.25);
}

.rm-chat-bubble.is-admin {
  background: rgba(13, 110, 253, 0.08);
}

.rm-chat-bubble.is-system {
  align-self: center;
  max-width: 96%;
  background: #eef2ff;
  font-size: 0.78rem;
  color: #475569;
}

.rm-chat-bubble__meta {
  font-size: 0.7rem;
  color: #64748b;
  margin-bottom: 0.2rem;
}

.rm-chat-bubble__body {
  white-space: pre-wrap;
  font-size: 0.88rem;
  color: #0a1628;
  line-height: 1.45;
}

.rm-chat-panel__composer {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid rgba(13, 27, 42, 0.08);
  background: #fff;
}

.rm-chat-panel__composer textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  font-size: 0.92rem;
}

.rm-chat-panel__composer .btn {
  align-self: flex-end;
  min-width: 48px;
  min-height: 44px;
}

.rm-chat-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 0.75rem 0.75rem;
  background: #fff;
}

/* Öneri widget'ı ile çakışmayı önle */
body.has-rm-contact-dock .rm-rec-float {
  bottom: 11.5rem;
}

@media (max-width: 575.98px) {
  .rm-contact-dock {
    right: 0.75rem;
    bottom: 0.75rem;
    gap: 0.5rem;
  }

  .rm-contact-dock__icon {
    width: 46px;
    height: 46px;
    font-size: 1.3rem;
  }

  .rm-chat-panel {
    width: calc(100vw - 1.7rem);
    max-height: calc(100vh - 6rem);
  }

  body.has-rm-contact-dock .rm-rec-float {
    bottom: 10.5rem;
  }
}
