/* ===========================================================
   HotelTI: Assistente (chat widget)
   Self-contained; navy + gold to match assets/css/styles.css.
   No inline styles used elsewhere on the site inject via JS,
   so this widget's rules live here instead of a CSS-in-JS string.
   =========================================================== */

#ht-chat-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b8882a, #e8c56a);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(161, 98, 7, 0.4);
  z-index: 9990;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
#ht-chat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(161, 98, 7, 0.55);
}
#ht-chat-btn.open {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.45);
}
#ht-chat-btn:focus-visible {
  outline: 2px solid #e8c56a;
  outline-offset: 3px;
}

#ht-chat-panel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 370px;
  height: 540px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 12px 56px rgba(0, 0, 0, 0.45);
  z-index: 9989;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  font-family: var(--font-body, 'Figtree', system-ui, sans-serif);
}
#ht-chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

#ht-chat-head {
  background: #0a1120;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.ht-head-l { display: flex; align-items: center; gap: 10px; }
.ht-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b8882a, #e8c56a);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ht-head-name {
  font-family: var(--font-heading, 'Newsreader', Georgia, serif);
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.ht-head-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.ht-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  display: inline-block;
  flex-shrink: 0;
}
#ht-chat-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 2px 6px;
  transition: color 0.15s;
  flex-shrink: 0;
}
#ht-chat-close:hover,
#ht-chat-close:focus-visible { color: #fff; }

#ht-chat-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
#ht-chat-msgs::-webkit-scrollbar { width: 3px; }
#ht-chat-msgs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 2px; }

.ht-msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 13px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #fff;
}
.ht-msg a { color: #e8c56a; }
.ht-msg strong { font-weight: 600; }
.ht-msg.ht-bot { background: rgba(255, 255, 255, 0.07); align-self: flex-start; border-bottom-left-radius: 3px; }
.ht-msg.ht-user {
  background: linear-gradient(135deg, #b8882a, #e8c56a);
  color: #0f172a;
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}

.ht-typing { display: flex; align-items: center; gap: 4px; padding: 12px 14px; }
.ht-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  animation: ht-bounce 0.9s infinite ease-in-out;
}
.ht-typing span:nth-child(2) { animation-delay: 0.15s; }
.ht-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes ht-bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); }
}

#ht-chat-chips {
  padding: 4px 14px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.ht-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.4;
}
.ht-chip:hover,
.ht-chip:focus-visible {
  background: rgba(184, 136, 42, 0.22);
  border-color: rgba(232, 197, 106, 0.55);
  color: #fff;
}

#ht-chat-foot {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
  flex-shrink: 0;
}
#ht-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
}
#ht-chat-input::placeholder { color: rgba(255, 255, 255, 0.28); }
#ht-chat-input:focus { border-color: rgba(232, 197, 106, 0.6); }
#ht-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #b8882a;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-end;
  transition: background 0.15s;
}
#ht-chat-send:hover,
#ht-chat-send:focus-visible { background: #a16207; }

@media (max-width: 480px) {
  #ht-chat-panel { width: calc(100vw - 24px); right: 12px; bottom: 86px; height: calc(100vh - 170px); height: calc(100dvh - 170px); max-height: 560px; }
  #ht-chat-btn { right: 12px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  #ht-chat-btn, #ht-chat-panel, .ht-typing span { transition: none; animation: none; }
}
