/* Virtual chat assistant widget */
.chat-assistant-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9990;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #c9a227, #b8860b);
  color: #1a1a1a;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.chat-assistant-fab:hover {
  transform: scale(1.05);
}

.chat-assistant-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.25rem;
  z-index: 9989;
  width: min(480px, calc(100vw - 1.5rem));
  height: min(720px, calc(100vh - 6.5rem));
  max-height: min(720px, calc(100vh - 6.5rem));
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.chat-assistant-panel--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chat-assistant-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #2c1810, #4a2c1a);
  color: #f5e6c8;
}

.chat-assistant-panel__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.chat-assistant-panel__actions button {
  background: transparent;
  border: none;
  color: #f5e6c8;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  font-size: 1.1rem;
  line-height: 1;
}

.chat-assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: 320px;
}

.chat-bubble {
  max-width: 92%;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 1rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble--user {
  align-self: flex-end;
  background: #2c1810;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.chat-bubble--assistant {
  align-self: flex-start;
  background: #f4f0eb;
  color: #333;
  border-bottom-left-radius: 4px;
}

.chat-bubble--error {
  background: #fdecea;
  color: #c0392b;
}

.chat-typing {
  align-self: flex-start;
  font-size: 0.95rem;
  color: #888;
  font-style: italic;
}

.chat-assistant-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.chat-product-card,
.chat-order-card,
.chat-confirm-card {
  border: 1px solid #e8e0d5;
  border-radius: 8px;
  padding: 0.75rem;
  background: #fff;
  font-size: 0.9rem;
  line-height: 1.5;
}

.chat-product-card__row {
  display: flex;
  gap: 0.65rem;
}

.chat-product-card__img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  background: #f0ebe3;
}

.chat-product-card__name {
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.chat-product-card__meta {
  color: #666;
  margin: 0 0 0.25rem;
}

.chat-product-card__price {
  font-weight: 600;
  color: #b8860b;
}

.chat-suggested-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.chat-action-btn {
  font-size: 0.85rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #c9a227;
  background: #fff;
  color: #4a2c1a;
  cursor: pointer;
}

.chat-action-btn:hover {
  background: #faf6ee;
}

.chat-filter-chips {
  margin-top: 0.35rem;
}

.chat-filter-chips__label {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  color: #666;
}

.chat-action-btn--filter {
  border-color: #4a2c1a;
  color: #4a2c1a;
}

.chat-assistant-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #eee;
}

.chat-assistant-form input {
  flex: 1;
  padding: 0.65rem 0.85rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}

.chat-assistant-form button[type='submit'] {
  padding: 0.65rem 1.15rem;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  background: #c9a227;
  color: #1a1a1a;
  font-weight: 600;
  cursor: pointer;
}

.chat-assistant-form button[type='submit']:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chat-applied-filters {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  color: #5c5346;
  line-height: 1.4;
}

.chat-applied-filters__label {
  font-weight: 600;
  color: #3d3629;
}

@media (max-width: 480px) {
  .chat-assistant-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    bottom: 5rem;
    height: min(85vh, calc(100vh - 5.5rem));
    max-height: min(85vh, calc(100vh - 5.5rem));
  }

  .chat-assistant-messages {
    min-height: 50vh;
  }
  .chat-assistant-fab {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}
