/* ── DK CHAT WIDGET ──────────────────────────────────────── */
#dk-chat-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── BOTÓN FLOTANTE ──────────────────────────────────────── */
#dk-chat-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a6b3c 0%, #27a659 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(26,107,60,.5);
  transition: transform .2s, box-shadow .2s;
  color: #fff;
  margin-left: auto;
}

#dk-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(26,107,60,.6);
}

#dk-chat-btn svg {
  width: 26px;
  height: 26px;
}

/* ── VENTANA ─────────────────────────────────────────────── */
#dk-chat-window {
  display: none;
  flex-direction: column;
  position: absolute;
  bottom: 72px;
  right: 0;
  width: 360px;
  max-height: 540px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 16px 56px rgba(0,0,0,.18);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

/* ── HEADER ──────────────────────────────────────────────── */
#dk-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, #155e32 0%, #27a659 100%);
  color: #fff;
  flex-shrink: 0;
}

#dk-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

#dk-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.22);
  border: 2px solid rgba(255,255,255,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: -.5px;
  flex-shrink: 0;
}

#dk-chat-header-info strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

#dk-chat-header-info span {
  font-size: 11.5px;
  opacity: .82;
}

#dk-chat-close {
  background: rgba(255,255,255,.18);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
  flex-shrink: 0;
}

#dk-chat-close:hover { background: rgba(255,255,255,.35); }

/* ── MENSAJES ────────────────────────────────────────────── */
#dk-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f5faf6;
  scroll-behavior: smooth;
  min-height: 0;
}

#dk-chat-messages::-webkit-scrollbar { width: 4px; }
#dk-chat-messages::-webkit-scrollbar-track { background: transparent; }
#dk-chat-messages::-webkit-scrollbar-thumb { background: #c8d8cc; border-radius: 4px; }

.dk-msg {
  display: flex;
  max-width: 85%;
}

.dk-msg--user { align-self: flex-end; }
.dk-msg--bot  { align-self: flex-start; }

.dk-bubble {
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
}

.dk-msg--bot .dk-bubble {
  background: #ffffff;
  color: #1a2e1e;
  border: 1px solid #dde8de;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.dk-msg--user .dk-bubble {
  background: linear-gradient(135deg, #155e32, #27a659);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

/* ── TYPING INDICATOR ────────────────────────────────────── */
.dk-typing .dk-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 13px 16px;
}

.dk-typing .dk-bubble span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6dae82;
  animation: dk-pulse .9s infinite;
}

.dk-typing .dk-bubble span:nth-child(2) { animation-delay: .18s; }
.dk-typing .dk-bubble span:nth-child(3) { animation-delay: .36s; }

@keyframes dk-pulse {
  0%, 60%, 100% { transform: translateY(0); opacity: .7; }
  30%           { transform: translateY(-7px); opacity: 1; }
}

/* ── CHIPS ───────────────────────────────────────────────── */
#dk-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: #f5faf6;
  border-top: 1px solid #e8f0e9;
  flex-shrink: 0;
}

.dk-chip {
  padding: 6px 12px;
  background: #fff;
  border: 1.5px solid #b6ddc0;
  border-radius: 20px;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 600;
  color: #1a6b3c;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
  line-height: 1.4;
}

.dk-chip:hover {
  background: #d4f0de;
  border-color: #6dae82;
}

/* ── ÁREA DE INPUT ───────────────────────────────────────── */
#dk-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
}

#dk-chat-input {
  flex: 1;
  border: 1.5px solid #dde8de;
  border-radius: 22px;
  padding: 9px 15px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: #f5faf6;
  color: #1a2e1e;
  transition: border-color .15s, background .15s;
  min-width: 0;
}

#dk-chat-input:focus {
  border-color: #27a659;
  background: #fff;
}

#dk-chat-input::placeholder { color: #9cb8a3; }

#dk-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #155e32, #27a659);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
  transition: transform .15s, opacity .15s;
}

#dk-chat-send:hover   { transform: scale(1.1); }
#dk-chat-send:disabled { opacity: .45; cursor: not-allowed; transform: none; }

#dk-chat-send svg {
  width: 17px;
  height: 17px;
}

/* ── PÁRRAFOS DENTRO DE BUBBLE ───────────────────────────── */
.dk-para {
  margin: 0 0 9px;
  line-height: 1.55;
}
.dk-para:last-child { margin-bottom: 0; }

/* ── LINKS EN BUBBLE ─────────────────────────────────────── */
.dk-plink {
  color: inherit;
  text-decoration: none;
  font-weight: 600;
}
.dk-plink:hover { opacity: .75; }

/* ── PRODUCT CARDS ───────────────────────────────────────── */
.dk-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 0 2px;
}

.dk-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid #dde8de;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

.dk-card-img {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}

.dk-card-info {
  flex: 1;
  min-width: 0;
}

.dk-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #1a2e1e;
  line-height: 1.3;
  margin-bottom: 2px;
}

.dk-card-price {
  font-size: 13px;
  color: #27a659;
  font-weight: 700;
  margin-bottom: 6px;
}

.dk-card-btn {
  display: inline-block;
  background: linear-gradient(135deg, #155e32, #27a659);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  text-decoration: none;
  transition: opacity .15s;
}

.dk-card-btn:hover { opacity: .88; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 420px) {
  #dk-chat-wrap   { bottom: 16px; right: 14px; }
  #dk-chat-window { width: calc(100vw - 28px); bottom: 76px; right: -2px; }
}
