/* Floating Sales Chat Widget Styles */
.sales-chat-container {
  position: fixed;
  z-index: 999;
  right: 24px;
  bottom: 24px;
  font-family: var(--sans);
  color: var(--porcelain);
}

/* Floating Bubble */
.sales-chat-bubble {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 20px;
  background: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(16, 20, 19, 0.25);
  transition: transform 0.25s, background-color 0.25s, border-color 0.25s;
}
.sales-chat-bubble:hover {
  background: var(--champagne);
  border-color: var(--champagne);
  transform: translateY(-2px);
}
.sales-chat-bubble-icon {
  display: grid;
  width: 26px;
  height: 26px;
  color: var(--teal);
  background: var(--porcelain);
  border-radius: 50%;
  place-items: center;
  font-size: 8px;
  font-weight: 700;
  font-family: var(--mono);
}
.sales-chat-bubble-text {
  font: 8px/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--porcelain);
}

/* Chat Window */
.sales-chat-window {
  position: absolute;
  right: 0;
  bottom: 64px;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  height: min(600px, calc(100vh - 120px));
  background: rgba(16, 20, 19, 0.96);
  border: 1px solid rgba(242, 240, 234, 0.2);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(16, 20, 19, 0.4);
  backdrop-filter: blur(16px);
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
.sales-chat-window.open {
  opacity: 1;
  transform: none;
  pointer-events: all;
}

/* Header */
.sales-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(242, 240, 234, 0.12);
}
.sales-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sales-chat-header-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  color: var(--champagne);
  border: 1px solid var(--champagne);
  border-radius: 50%;
  place-items: center;
  font: 8px/1 var(--mono);
}
.sales-chat-header-text {
  display: grid;
  gap: 2px;
}
.sales-chat-header-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.sales-chat-header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(242, 240, 234, 0.5);
  font: 7px var(--mono);
  text-transform: uppercase;
}
.sales-chat-header-status-dot {
  width: 5px;
  height: 5px;
  background: #39b54a;
  border-radius: 50%;
  animation: pulseGreen 2s infinite;
}
.sales-chat-close {
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: rgba(242, 240, 234, 0.5);
  font-size: 20px;
  cursor: pointer;
  transition: color 0.2s;
}
.sales-chat-close:hover {
  color: var(--porcelain);
}

/* Conversation Body */
.sales-chat-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.sales-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Message Bubbles */
.sales-message {
  display: flex;
  max-width: 88%;
  gap: 8px;
  animation: messageEnter 0.25s ease-out;
}
.sales-message.assistant {
  align-self: flex-start;
}
.sales-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.sales-message-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--champagne);
  border: 1px solid rgba(178, 154, 113, 0.4);
  border-radius: 50%;
  font: 6px/1 var(--mono);
  place-items: center;
}
.sales-message.user .sales-message-avatar {
  color: var(--teal);
  background: var(--porcelain);
  border-color: var(--porcelain);
}
.sales-message p {
  margin: 0;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  border-radius: 16px;
  color: rgba(242, 240, 234, 0.88);
  background: rgba(242, 240, 234, 0.08);
  border: 1px solid rgba(242, 240, 234, 0.1);
  word-break: break-word;
}
.sales-message.user p {
  color: var(--graphite);
  background: var(--porcelain);
  border-color: var(--porcelain);
}

/* Typing Indicator */
.sales-chat-typing {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(242, 240, 234, 0.06);
  border-radius: 16px;
}
.sales-chat-typing span {
  width: 5px;
  height: 5px;
  background: var(--steel);
  border-radius: 50%;
  animation: typingDot 1.4s infinite both;
}
.sales-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.sales-chat-typing span:nth-child(3) { animation-delay: 0.4s; }

/* Suggestions */
.sales-chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 14px;
}
.sales-chat-suggestions button {
  padding: 8px 12px;
  border: 1px solid rgba(242, 240, 234, 0.18);
  border-radius: 8px;
  background: transparent;
  color: rgba(242, 240, 234, 0.76);
  font: 7px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
.sales-chat-suggestions button:hover {
  color: var(--dark);
  background: var(--champagne);
  border-color: var(--champagne);
}

/* Footer Form */
.sales-chat-footer {
  padding: 0 20px 16px;
}
.sales-chat-input-form {
  display: flex;
  border: 1px solid rgba(242, 240, 234, 0.2);
  border-radius: 10px;
  overflow: hidden;
}
.sales-chat-input-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  outline: 0;
  color: var(--porcelain);
  background: transparent;
  font-size: 11px;
}
.sales-chat-input-form input::placeholder {
  color: rgba(242, 240, 234, 0.35);
}
.sales-chat-input-form button {
  width: 36px;
  border: 0;
  background: var(--champagne);
  color: var(--graphite);
  cursor: pointer;
  transition: opacity 0.2s;
}
.sales-chat-input-form button:hover {
  opacity: 0.9;
}
.sales-chat-input-form button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Capture Form Panel */
.sales-chat-capture {
  padding: 18px;
  background: rgba(242, 240, 234, 0.05);
  border-top: 1px solid rgba(242, 240, 234, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sales-chat-capture-title {
  margin: 0 0 6px;
  font: 400 20px var(--serif);
  color: var(--champagne);
}
.sales-chat-capture-subtitle {
  margin: -6px 0 10px;
  font-size: 10px;
  color: rgba(242, 240, 234, 0.55);
  line-height: 1.4;
}
.sales-chat-capture-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sales-chat-capture-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sales-chat-capture-field.full {
  grid-column: span 2;
}
.sales-chat-capture-field label {
  font: 6px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(242, 240, 234, 0.5);
}
.sales-chat-capture-field input, .sales-chat-capture-field select {
  padding: 8px;
  border: 0;
  border-bottom: 1px solid rgba(242, 240, 234, 0.2);
  border-radius: 4px;
  color: var(--porcelain);
  background: rgba(242, 240, 234, 0.04);
  font-size: 11px;
  outline: 0;
}
.sales-chat-capture-field input:focus, .sales-chat-capture-field select:focus {
  border-color: var(--teal);
}
.sales-chat-capture-field select option {
  background: var(--dark);
}
.sales-chat-consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 6px;
}
.sales-chat-consent-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--teal);
  margin-top: 2px;
}
.sales-chat-consent-row span {
  font-size: 9px;
  color: rgba(242, 240, 234, 0.65);
  line-height: 1.4;
}
.sales-chat-capture .button-primary {
  width: 100%;
  margin-top: 10px;
  min-height: 38px;
}

/* Booking Handoff Panel */
.sales-chat-booking {
  padding: 24px 20px;
  text-align: center;
  background: rgba(14, 91, 85, 0.15);
  border-top: 1px solid var(--teal);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.sales-chat-booking h4 {
  margin: 0;
  font: 400 24px var(--serif);
  color: var(--champagne);
}
.sales-chat-booking p {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(242, 240, 234, 0.7);
}
.sales-chat-booking .button-primary {
  width: 100%;
  min-height: 42px;
}

/* RTL Layout support */
html[dir="rtl"] .sales-chat-container {
  right: auto;
  left: 24px;
}
html[dir="rtl"] .sales-chat-window {
  right: auto;
  left: 0;
}
html[dir="rtl"] .sales-message.user {
  flex-direction: row;
}
html[dir="rtl"] .sales-chat-consent-row {
  text-align: right;
}

/* Animations */
@keyframes pulseGreen {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(57, 181, 74, 0.6); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(57, 181, 74, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(57, 181, 74, 0); }
}

@keyframes messageEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes typingDot {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
