/* Dkay Support: floating chat widget */
.dk-ai {
  --dk-ink: #17181a;
  --dk-soft: #4b5563;
  --dk-mute: #8a8f98;
  --dk-line: #e9eaec;
  --dk-softline: #f0f1f3;
  --dk-fill: #f4f5f7;
  --dk-accent: #f76502;
  position: relative;
  z-index: 90;
  font-family: Manrope;
}

/* Launcher */
.dk-ai-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f76502;
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 18px 34px -12px rgba(247, 101, 2, 0.6),
    0 6px 14px -6px rgba(15, 18, 23, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.dk-ai-fab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 22px 40px -12px rgba(247, 101, 2, 0.68),
    0 8px 18px -6px rgba(15, 18, 23, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.dk-ai-fab:active { transform: translateY(0) scale(0.97); }
.dk-ai-fab-ic { width: 27px; height: 27px; }

.dk-ai-fab-ping {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #24b47e;
  box-shadow: 0 0 0 2.5px #fff;
}

.dk-ai.open .dk-ai-fab {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9) translateY(6px);
}

/* Panel */
.dk-ai-panel {
  position: fixed;
  right: 24px;
  bottom: 94px;
  z-index: 91;
  width: 372px;
  height: min(520px, calc(100vh - 126px));
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e6e7ea;
  border-radius: 18px;
  box-shadow:
    0 32px 70px -22px rgba(15, 18, 23, 0.38),
    0 8px 20px -10px rgba(15, 18, 23, 0.12);
  overflow: hidden;
  transform-origin: bottom right;
  animation: dk-ai-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.dk-ai-panel[hidden] { display: none; }

@keyframes dk-ai-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* Header */
.dk-ai-top {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--dk-softline);
}

.dk-ai-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(150deg, #ff8a3d, #f76502);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(247, 101, 2, 0.6);
}

.dk-ai-mark svg { width: 21px; height: 21px; }

.dk-ai-who { flex: 1 1 auto; min-width: 0; display: block; }
.dk-ai-who b { display: block; font-size: 14px; font-weight: 800; letter-spacing: -0.01em; color: var(--dk-ink); }
.dk-ai-who span { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 11px; font-weight: 600; color: #6b7280; }
.dk-ai-who span i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.14);
}

.dk-ai-close {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--dk-fill);
  color: #6b7280;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dk-ai-close:hover { background: #e8eaed; color: var(--dk-ink); }
.dk-ai-close svg { width: 14px; height: 14px; }

/* Conversation */
.dk-ai-log {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #d6d9de transparent;
}

.dk-ai-log::-webkit-scrollbar { width: 5px; }
.dk-ai-log::-webkit-scrollbar-thumb { background: #d6d9de; border-radius: 999px; }

.dk-ai-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dk-ai-msg.bot {
  align-self: flex-start;
  background: var(--dk-fill);
  border-bottom-left-radius: 5px;
  color: var(--dk-ink);
}

.dk-ai-msg.me {
  align-self: flex-end;
  background: #f76502;
  border-bottom-right-radius: 5px;
  color: #fff;
  box-shadow: 0 8px 18px -12px rgba(247, 101, 2, 0.85);
}

.dk-ai-msg.err {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b42318;
}

.dk-ai-typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.dk-ai-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9ca3af;
  animation: dk-ai-dot 1s infinite ease-in-out;
}
.dk-ai-typing i:nth-child(2) { animation-delay: 0.15s; }
.dk-ai-typing i:nth-child(3) { animation-delay: 0.3s; }

@keyframes dk-ai-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-3px); opacity: 1; }
}

/* Social row where suggestions used to sit */
.dk-ai-social {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--dk-softline);
  background: #fafafb;
}

.dk-ai-social-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dk-mute);
  white-space: nowrap;
}

.dk-ai-social-row { display: flex; gap: 7px; margin-left: auto; }

.dk-ai-soc {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--dk-line);
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.dk-ai-soc svg { width: 16px; height: 16px; }
.dk-ai-soc:hover { transform: translateY(-1px); }

.dk-ai-soc.is-wa { color: #1da851; }
.dk-ai-soc.is-ig { color: #d62976; }
.dk-ai-soc.is-tt { color: #101114; }
.dk-ai-soc.is-fb { color: #1877f2; }

.dk-ai-soc.is-wa:hover { background: #eaf9f0; border-color: #c9eedb; }
.dk-ai-soc.is-ig:hover { background: #fdf1f7; border-color: #f6cfe2; }
.dk-ai-soc.is-tt:hover { background: #f4f5f7; border-color: #d9dce1; }
.dk-ai-soc.is-fb:hover { background: #eef4fe; border-color: #cfe1fd; }

/* Composer */
.dk-ai-form {
  padding: 12px 12px 10px;
  border-top: 1px solid var(--dk-softline);
}

.dk-ai-field {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 14px;
  background: var(--dk-fill);
  border: 1px solid transparent;
  border-radius: 14px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.dk-ai-field:focus-within {
  background: #fff;
  border-color: rgba(247, 101, 2, 0.65);
  box-shadow: 0 0 0 3px rgba(247, 101, 2, 0.12);
}

.dk-ai-field input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--dk-ink);
}

.dk-ai-field input::placeholder { color: var(--dk-mute); }

.dk-ai-send {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: #f76502;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, opacity 0.15s;
}

.dk-ai-send:hover { background: #e65c00; transform: translateY(-1px); }
.dk-ai-send:disabled { opacity: 0.45; cursor: default; transform: none; background: #f76502; }
.dk-ai-send svg { width: 17px; height: 17px; }

@media (max-width: 760px) {
  .dk-ai-fab {
    right: 16px;
    bottom: 86px;
    width: 54px;
    height: 54px;
  }

  .dk-ai-fab-ic { width: 25px; height: 25px; }
  body.has-cart .dk-ai-fab { bottom: 150px; }

  .dk-ai-panel {
    right: 10px;
    left: 10px;
    bottom: 78px;
    width: auto;
    max-height: min(76vh, 560px);
    border-radius: 18px;
    transform-origin: bottom center;
  }

  .dk-ai-top { padding: 12px 12px 10px; }
  .dk-ai-log { padding: 12px; }
  .dk-ai-msg { font-size: 13px; }
  .dk-ai-social { padding: 9px 12px; }
  .dk-ai-soc { width: 32px; height: 32px; }
  .dk-ai-form { padding: 11px 10px 9px; }
  .dk-ai-social { padding-bottom: 12px; }
}
