@font-face {
  font-family: 'Avenir';
  src: url('/fonts/Avenir.ttc') format('truetype');
  font-weight: 400;
  font-style: normal;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Avenir', sans-serif;
  background: transparent;
}

/* Floating bubble */
.chat-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #E12490;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(227, 29, 147, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 9999;
}

.chat-bubble:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(227, 29, 147, 0.5);
}

.bubble-icon { 
  display: block;
  margin-top: 9px;
}

.bubble-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: white;
  color: #E12490;
  font-size: 10px;
  font-weight: 600;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #E12490;
}

.bubble-badge.hidden { display: none; }

.header-avatar img {
  display: block;
  margin-top: 8px;
}

/* Chat widget */
.chat-widget {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 380px;
  max-height: 600px;
  background: #fdf5ef;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.chat-widget.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* Header */
.chat-header {
  background: #E12490;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: 2px solid rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.header-name {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  color: white;
  letter-spacing: 0.3px;
}

.header-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.header-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.header-close:hover { color: white; }

.header-restart {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.15s;
}

.header-restart:hover { color: white; }

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(227,29,147,0.2); border-radius: 2px; }

/* Message bubbles */
.message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: fadeInUp 0.2s ease;
}

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

.message.rosita { align-self: flex-start; }

.message.guest {
  align-self: flex-end;
  max-width: 85%;
  align-items: flex-end;
}

.message-bubble {
  padding: 10px 13px;
  font-size: 13px;
  line-height: 1.55;
  border-radius: 4px 14px 14px 14px;
  width: fit-content;
  max-width: 100%;
}

.message.rosita .message-bubble {
  background: white;
  color: #2a1a1a;
  border: 0.5px solid rgba(227,29,147,0.1);
  border-radius: 4px 14px 14px 14px;
}

.message.guest .message-bubble {
  background: #00263E;
  color: white;
  border-radius: 14px 4px 14px 14px;
  display: table;
}

.message-time {
  font-size: 10px;
  color: #2a1a1a;
  flex-shrink: 0;
}

.message.guest .message-time {
  text-align: right;
  padding: 3px 4px 0;
  font-size: 10px;
  color: #2a1a1a;
}

/* Message meta row */
.message-meta {
  display: flex;
  align-items: center;
  margin-top: 4px;
  padding: 0 4px;
  gap: 6px;
}

.message.guest .message-meta { justify-content: flex-end; }

.meta-spacer { flex: 1; }

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 3px;
  color: #444;
  font-size: 13px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.copy-btn:hover { color: #E12490; background: rgba(227,29,147,0.08); }

.feedback-btns { display: flex; gap: 2px; align-items: center; }

.feedback-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 1px 3px;
  border-radius: 3px;
  color: #444;
  font-size: 13px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}

.feedback-btn:hover { color: #E12490; background: rgba(227,29,147,0.08); }
.feedback-btn.active { color: #E12490; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 13px;
  background: white;
  border-radius: 4px 14px 14px 14px;
  width: fit-content;
  border: 0.5px solid rgba(227,29,147,0.1);
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #E12490;
  opacity: 0.4;
  animation: typingBounce 1.2s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Quick replies */
.quick-replies {
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  border-top: 0.5px solid rgba(227,29,147,0.1);
}

.quick-replies.hidden { display: none; }

.qr-btn {
  background: white;
  border: 1.5px solid #00263E;
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-family: 'Avenir', sans-serif;
  color: #00263E;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.qr-btn:hover {
  background: #00263E;
  color: white;
}

/* Input row */
.chat-input-row {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border-top: 0.5px solid rgba(227,29,147,0.12);
  flex-shrink: 0;
}

.chat-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
}

.char-counter {
  position: absolute;
  bottom: 6px;
  right: 12px;
  font-size: 9px;
  color: #b09090;
  pointer-events: none;
  transition: color 0.15s;
}

.char-counter.warning { color: #E12490; }

.chat-input {
  flex: 1;
  width: 100%;
  border: 0.5px solid rgba(227,29,147,0.25);
  border-radius: 20px;
  padding: 8px 48px 8px 14px;
  font-size: 13px;
  font-family: 'Avenir', sans-serif;
  color: #2a1a1a;
  background: #fdf5ef;
  outline: none;
  transition: border-color 0.15s;
}

.chat-input:focus { border-color: #E12490; }
.chat-input::placeholder { color: #b09090; }

.send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #E12490;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}

.send-btn:hover { background: #c0187a; }
.send-btn:active { transform: scale(0.94); }
.send-btn:disabled { background: #ccc; cursor: not-allowed; }

/* Mobile */
@media (max-width: 480px) {
  .chat-widget {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }

  .chat-bubble {
    bottom: 20px;
    right: 20px;
  }
}