/* FinalPack Live Chat Widget — RTL */
.fp-live-chat {
  --fp-chat-accent: #98be1c;
  --fp-chat-bg: #ffffff;
  --fp-chat-surface: #f4f6f8;
  --fp-chat-text: #1a1d21;
  --fp-chat-muted: #6b7280;
  --fp-chat-border: #e5e7eb;
  --fp-chat-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  position: fixed;
  z-index: 99990;
  bottom: 20px;
  left: 20px;
  font-family: inherit;
  direction: rtl;
}

.fp-live-chat[data-theme="dark"] {
  --fp-chat-bg: #1e2228;
  --fp-chat-surface: #2a3038;
  --fp-chat-text: #f3f4f6;
  --fp-chat-muted: #9ca3af;
  --fp-chat-border: #3b4250;
}

.fp-live-chat__bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: var(--fp-chat-accent);
  color: #0f1211;
  box-shadow: var(--fp-chat-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.fp-live-chat__bubble:hover {
  transform: scale(1.05);
}

.fp-live-chat__bubble svg {
  width: 28px;
  height: 28px;
}

.fp-live-chat__panel {
  display: none;
  position: absolute;
  bottom: 72px;
  left: 0;
  width: min(360px, calc(100vw - 32px));
  height: 520px;
  background: var(--fp-chat-bg);
  color: var(--fp-chat-text);
  border: 1px solid var(--fp-chat-border);
  border-radius: 16px;
  box-shadow: var(--fp-chat-shadow);
  overflow: hidden;
  flex-direction: column;
}

.fp-live-chat.is-open .fp-live-chat__panel {
  display: flex;
}

.fp-live-chat.is-open .fp-live-chat__bubble {
  display: none;
}

.fp-live-chat__header {
  background: var(--fp-chat-accent);
  color: #0f1211;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.fp-live-chat__header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.fp-live-chat__close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.fp-live-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: var(--fp-chat-surface);
}

.fp-live-chat__msg {
  max-width: 88%;
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.fp-live-chat__msg--visitor {
  margin-right: auto;
  margin-left: 0;
  background: var(--fp-chat-accent);
  color: #0f1211;
  border-bottom-right-radius: 4px;
}

.fp-live-chat__msg--bot,
.fp-live-chat__msg--admin {
  margin-left: auto;
  margin-right: 0;
  background: var(--fp-chat-bg);
  border: 1px solid var(--fp-chat-border);
  border-bottom-left-radius: 4px;
}

.fp-live-chat__msg--system {
  margin: 0 auto 10px;
  background: transparent;
  color: var(--fp-chat-muted);
  font-size: 12px;
  text-align: center;
  max-width: 100%;
}

.fp-live-chat__msg time {
  display: block;
  font-size: 10px;
  opacity: 0.65;
  margin-top: 4px;
}

.fp-live-chat__typing {
  display: none;
  padding: 0 12px 8px;
  font-size: 12px;
  color: var(--fp-chat-muted);
}

.fp-live-chat__typing.is-visible {
  display: block;
}

.fp-live-chat__lead {
  display: none;
  padding: 10px 12px;
  border-top: 1px solid var(--fp-chat-border);
  background: var(--fp-chat-bg);
}

.fp-live-chat__lead.is-visible {
  display: block;
}

.fp-live-chat__lead input {
  width: 100%;
  margin-bottom: 6px;
  padding: 8px 10px;
  border: 1px solid var(--fp-chat-border);
  border-radius: 8px;
  background: var(--fp-chat-surface);
  color: var(--fp-chat-text);
  font-size: 13px;
}

.fp-live-chat__lead button {
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: var(--fp-chat-accent);
  color: #0f1211;
  font-weight: 600;
  cursor: pointer;
}

.fp-live-chat__composer {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--fp-chat-border);
  background: var(--fp-chat-bg);
}

.fp-live-chat__composer input {
  flex: 1;
  border: 1px solid var(--fp-chat-border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--fp-chat-surface);
  color: var(--fp-chat-text);
  font-size: 13px;
}

.fp-live-chat__composer button {
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  background: var(--fp-chat-accent);
  color: #0f1211;
  font-weight: 600;
  cursor: pointer;
}

.fp-live-chat__composer button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .fp-live-chat {
    bottom: 12px;
    left: 12px;
  }
  .fp-live-chat__panel {
    width: calc(100vw - 24px);
    height: min(70vh, 520px);
  }
}
