/* DZPayConnect support widget — matches site tokens, small & mobile-fit. */

.dzp-chat {
  --c-green: #0e241e;
  --c-green2: #1d5c4e;
  --c-gold: #f5b94f;
  --c-cream: #faf6ef;
  --c-wa: #1faa55;
  --c-ink: #152b26;
  --c-muted: #3f565e;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  position: fixed;
  inset-inline-end: 1rem;
  bottom: 1rem;
  z-index: 90;
  font-family: "Cairo", "Manrope", system-ui, sans-serif;
}

/* Floating button */
.dzp-chat-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid rgb(245 185 79 / 0.5);
  background: var(--c-green);
  color: var(--c-gold);
  font-size: 1.5rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px -10px rgb(0 0 0 / 0.55);
  transition-property: transform, scale, background-color;
  transition-duration: 150ms;
  transition-timing-function: var(--ease);
  position: relative;
}
.dzp-chat-btn:hover { transform: translateY(-2px); }
.dzp-chat-btn:active { scale: 0.96; }
.dzp-chat-btn .dot {
  position: absolute;
  top: 2px;
  inset-inline-end: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--c-wa);
  border: 2px solid var(--c-green);
}

/* Teaser bubbles — small, quiet, dismissible */
.dzp-teasers {
  position: absolute;
  bottom: 66px;
  inset-inline-end: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-end;
  width: max-content;
  max-width: 230px;
}
[dir="ltr"] .dzp-teasers { align-items: flex-start; }
.dzp-teaser {
  background: #fff;
  border: 1px solid #e7ddcc;
  border-radius: 14px;
  padding: 0.45rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c-ink);
  box-shadow: 0 8px 20px -12px rgb(0 0 0 / 0.4);
  cursor: pointer;
  text-align: start;
  animation: dzp-pop 300ms var(--ease);
}
.dzp-teaser small { display: block; font-weight: 600; color: var(--c-muted); font-size: 0.72rem; }
@keyframes dzp-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* Panel */
.dzp-panel {
  position: absolute;
  bottom: 66px;
  inset-inline-end: 0;
  width: min(350px, calc(100vw - 2rem));
  height: min(500px, calc(100dvh - 7rem));
  min-height: 320px;
  background: var(--c-cream);
  border: 1px solid #e2d7c2;
  border-radius: 20px;
  box-shadow: 0 24px 60px -20px rgb(0 0 0 / 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dzp-panel[hidden] { display: none; }

.dzp-head {
  background: var(--c-green);
  color: #fffaf1;
  padding: 0.7rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.dzp-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--c-gold);
  color: var(--c-green);
  font-weight: 800;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.dzp-head b { font-size: 0.92rem; display: block; line-height: 1.3; }
.dzp-head span { font-size: 0.72rem; color: #9fd8b8; display: flex; align-items: center; gap: 0.3rem; }
.dzp-head span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--c-wa);
}
.dzp-close {
  margin-inline-start: auto;
  background: transparent;
  border: 0;
  color: rgb(255 250 241 / 0.7);
  font-size: 1.2rem;
  cursor: pointer;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
}

.dzp-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dzp-msg {
  max-width: 85%;
  padding: 0.5rem 0.8rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}
.dzp-msg.bot {
  background: #fff;
  border: 1px solid #e7ddcc;
  border-start-start-radius: 4px;
  align-self: flex-start;
  color: var(--c-ink);
}
[dir="rtl"] .dzp-msg.bot { align-self: flex-end; }
.dzp-msg.user {
  background: var(--c-green2);
  color: #fff;
  border-start-end-radius: 4px;
  align-self: flex-end;
}
[dir="rtl"] .dzp-msg.user { align-self: flex-start; }
.dzp-msg.typing { display: flex; gap: 4px; padding: 0.7rem 0.9rem; }
.dzp-msg.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9db3ac;
  animation: dzp-blink 1s infinite;
}
.dzp-msg.typing i:nth-child(2) { animation-delay: 0.15s; }
.dzp-msg.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dzp-blink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.dzp-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--c-wa);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.5rem 1rem;
  margin-top: 0.5rem;
}

/* Quick chips */
.dzp-chips {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 0.8rem;
  overflow-x: auto;
  border-top: 1px solid #e7ddcc;
  background: rgb(255 255 255 / 0.6);
}
.dzp-chip {
  flex-shrink: 0;
  border: 1px solid var(--c-green2);
  background: transparent;
  color: var(--c-green2);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  transition-property: background-color, color, scale;
  transition-duration: 150ms;
  transition-timing-function: var(--ease);
}
.dzp-chip:hover { background: var(--c-green2); color: #fff; }
.dzp-chip:active { scale: 0.96; }

/* Input */
.dzp-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem 0.8rem;
  background: rgb(255 255 255 / 0.6);
}
.dzp-input input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.88rem;
  border: 1px solid #d9cdae;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  background: #fff;
  color: var(--c-ink);
}
.dzp-input input:focus { outline: 2px solid var(--c-gold); outline-offset: 1px; }
.dzp-send {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 0;
  background: var(--c-gold);
  color: var(--c-green);
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition-property: scale;
  transition-duration: 150ms;
  transition-timing-function: var(--ease);
}
.dzp-send:active { scale: 0.96; }

@media (prefers-reduced-motion: reduce) {
  .dzp-chat *, .dzp-chat *::before, .dzp-chat *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
