/* ─────────────────────────────────────────────────────────
   Juel Haus Support Chat Widget
   ───────────────────────────────────────────────────────── */

/* Toggle button — fixed gold circle bottom-right */
#jh-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #B8922A;
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  box-shadow: 0 4px 16px rgba(184,146,42,0.45);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
#jh-chat-toggle:hover { transform: scale(1.06); box-shadow: 0 6px 22px rgba(184,146,42,0.55); }
#jh-chat-toggle.jh-hidden { display: none; }

/* Chat panel */
#jh-chat-panel {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 360px;
  height: 520px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
  z-index: 8001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
}
#jh-chat-panel.jh-hidden { display: none; }

/* Header */
.jh-chat-header {
  background: #1C1A16;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.jh-chat-hlogo {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 300;
  color: #B8922A;
  letter-spacing: 3px;
  flex-shrink: 0;
}
.jh-chat-htitle { flex: 1; color: #F7F4EF; font-size: 0.875rem; font-weight: 500; letter-spacing: 0.3px; }
.jh-chat-close {
  background: none;
  border: none;
  color: #6B6560;
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
  padding: 0 2px;
  transition: color 0.15s;
}
.jh-chat-close:hover { color: #F7F4EF; }

/* Message area */
.jh-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FAFAF9;
}
.jh-msgs::-webkit-scrollbar { width: 4px; }
.jh-msgs::-webkit-scrollbar-thumb { background: #E2DDD6; border-radius: 2px; }

/* Bubbles */
.jh-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.855rem;
  line-height: 1.55;
  word-break: break-word;
}
.jh-msg-bot  { background: #F7F4EF; color: #1C1A16; align-self: flex-start; border-bottom-left-radius: 4px; }
.jh-msg-user { background: #B8922A; color: #fff;    align-self: flex-end;   border-bottom-right-radius: 4px; }
.jh-msg a    { color: #B8922A; }
.jh-msg-user a { color: #fff; text-decoration: underline; }

/* Typing indicator */
.jh-typing {
  display: flex;
  gap: 5px;
  padding: 11px 14px;
  background: #F7F4EF;
  border-radius: 12px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  width: fit-content;
}
.jh-typing span {
  width: 7px; height: 7px;
  background: #B8922A;
  border-radius: 50%;
  animation: jh-bounce 1.1s infinite;
}
.jh-typing span:nth-child(2) { animation-delay: 0.18s; }
.jh-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes jh-bounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-6px); }
}

/* Quick reply chips */
.jh-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 8px 14px 10px;
  flex-shrink: 0;
  background: #fff;
  border-top: 1px solid #F0EDE8;
  min-height: 40px;
}
.jh-chip {
  padding: 7px 13px;
  border: 1.5px solid #B8922A;
  border-radius: 20px;
  background: #fff;
  color: #B8922A;
  font-size: 0.79rem;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.13s, color 0.13s;
  white-space: nowrap;
  line-height: 1.3;
}
.jh-chip:hover { background: #B8922A; color: #fff; }

/* Free-text input bar */
.jh-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid #E2DDD6;
  background: #fff;
  flex-shrink: 0;
}
.jh-input-bar input {
  flex: 1;
  padding: 9px 13px;
  border: 1px solid #E2DDD6;
  border-radius: 20px;
  font-size: 0.855rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  color: #1C1A16;
  background: #FAFAF9;
  transition: border-color 0.15s;
}
.jh-input-bar input:focus   { border-color: #B8922A; }
.jh-input-bar input:disabled { opacity: 0.45; cursor: not-allowed; }
.jh-input-bar button {
  padding: 9px 16px;
  background: #B8922A;
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.jh-input-bar button:hover     { opacity: 0.85; }
.jh-input-bar button:disabled  { opacity: 0.38; cursor: not-allowed; }

/* Order card inside chat */
.jh-order-card {
  background: #fff;
  border: 1px solid #E2DDD6;
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 0.8rem;
  color: #1C1A16;
  align-self: flex-start;
  max-width: 88%;
}
.jh-order-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 5px;
}

/* Mobile */
@media (max-width: 420px) {
  #jh-chat-panel  { right: 0; bottom: 76px; width: 100vw; height: 68vh; border-radius: 16px 16px 0 0; }
  #jh-chat-toggle { bottom: 14px; right: 14px; }
}
