/* ===========================
   BOT WIDGET — GiChat
=========================== */

#gichat-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  background: #561C24;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 24px rgba(86,28,36,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
}

#gichat-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(86,28,36,0.7);
}

#gichat-btn svg {
  transition: opacity 0.2s, transform 0.2s;
}

#gichat-btn .icon-close {
  position: absolute;
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}

#gichat-btn.open .icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}

#gichat-btn.open .icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Notificación */
#gichat-btn .notif {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 12px;
  height: 12px;
  background: #E8D8C4;
  border-radius: 50%;
  border: 2px solid #561C24;
  animation: pulse-notif 1.8s infinite;
}

@keyframes pulse-notif {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

/* Ventana del chat */
#gichat-window {
  position: fixed;
  bottom: 96px;
  right: 28px;
  width: 340px;
  max-height: 500px;
  background: #1e0d0f;
  border: 1px solid rgba(199,183,163,0.15);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  z-index: 999;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(86,28,36,0.15);
  overflow: hidden;

  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#gichat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.gc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1rem 1.2rem;
  background: rgba(86,28,36,0.25);
  border-bottom: 1px solid rgba(199,183,163,0.1);
  flex-shrink: 0;
}

.gc-avatar {
  width: 36px;
  height: 36px;
  background: #561C24;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #E8D8C4;
  flex-shrink: 0;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 1rem;
}

.gc-header-info strong {
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #E8D8C4;
  letter-spacing: 0.01em;
}

.gc-header-info span {
  font-size: 0.68rem;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 4px;
}

.gc-header-info span::before {
  content: '';
  width: 5px;
  height: 5px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  animation: pulse-notif 1.8s infinite;
}

/* Mensajes */
.gc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  scroll-behavior: smooth;
}

.gc-messages::-webkit-scrollbar { width: 3px; }
.gc-messages::-webkit-scrollbar-thumb { background: rgba(199,183,163,0.2); border-radius: 4px; }

.gc-msg {
  max-width: 82%;
  animation: msgIn 0.25s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gc-msg p {
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.55;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
}

.gc-msg.bot p {
  background: rgba(199,183,163,0.08);
  border-radius: 4px 12px 12px 12px;
  color: #e8d8c4;
}

.gc-msg.user {
  align-self: flex-end;
}

.gc-msg.user p {
  background: #561C24;
  border-radius: 12px 12px 4px 12px;
  color: #E8D8C4;
}

/* Typing dots */
.gc-msg.typing p {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.65rem 0.9rem;
}

.gc-msg.typing p span {
  width: 6px;
  height: 6px;
  background: #C7B7A3;
  border-radius: 50%;
  animation: blink 1.2s infinite;
  display: inline-block;
}

.gc-msg.typing p span:nth-child(2) { animation-delay: 0.2s; }
.gc-msg.typing p span:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  0%, 60%, 100% { opacity: 0.3; transform: scale(1); }
  30% { opacity: 1; transform: scale(1.2); }
}

/* Sugerencias rápidas */
.gc-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0.5rem 1rem;
  flex-shrink: 0;
}

.gc-suggestions button {
  background: rgba(86,28,36,0.2);
  border: 1px solid rgba(86,28,36,0.45);
  color: #C7B7A3;
  font-size: 0.72rem;
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  padding: 0.35rem 0.75rem;
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.gc-suggestions button:hover {
  background: rgba(86,28,36,0.45);
  color: #E8D8C4;
}

/* Input */
.gc-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.8rem 1rem;
  border-top: 1px solid rgba(199,183,163,0.1);
  flex-shrink: 0;
}

.gc-input-bar input {
  flex: 1;
  background: rgba(199,183,163,0.06);
  border: 1px solid rgba(199,183,163,0.12);
  border-radius: 100px;
  padding: 0.5rem 1rem;
  color: #e8d8c4;
  font-size: 0.82rem;
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s;
}

.gc-input-bar input:focus {
  border-color: rgba(86,28,36,0.6);
}

.gc-input-bar input::placeholder {
  color: rgba(199,183,163,0.35);
}

.gc-input-bar button {
  width: 34px;
  height: 34px;
  background: #561C24;
  border: none;
  border-radius: 50%;
  color: #E8D8C4;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.gc-input-bar button:hover {
  background: #6D2932;
}

/* Responsive */
@media (max-width: 480px) {
  #gichat-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 88px;
  }

  #gichat-btn {
    right: 16px;
    bottom: 20px;
  }
}