* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family:-apple-system,BlinkMacSystemFont, "Segoe UI",Roboto,Arial,sans-serif;
  background: #f5f7fb;
}
#chat-root {
  position: relative;
}

.chat-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: #D9E1D9;
  color: #000000;
  font-size: 25px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.20);
  z-index: 9999;
}
.chat-button:hover {
  transform: translateY(-2px);
}

.chat-window {
  position: fixed;
  right: 24px;
  bottom: 94px;
  width: 400px;
  height: 620px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.20);
  border: 1px solid #e7eaf0;
  z-index: 9999;
}
.chat-header {
  min-height: 68px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #000000;
  /* background: linear-gradient(  135deg,   #a8aca8,  #d9E1D9 ); */
  background-color: #d9E1D9;
  box-shadow:0 3px 12px rgba(0, 0, 0, 0.08);
}
.chat-header h2 {
  font-size: 18px;
  font-weight: 700;
}
.close-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(161, 155, 155, 0.16);
  color: rgb(0, 0, 0);
  font-size: 21px;
  cursor: pointer;
}
.close-button:hover {
    background: rgba(255, 255, 255, 0.25);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: #f7f8fb;
}
.chat-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: #d4d9e2;
  border-radius: 10px;
}
.message {
  max-width: 88%;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.55;
}
.message p {
  margin: 0;
}
.message ul {
  margin: 6px 0;
  padding-left: 20px;
}
.user-message {
  margin-left: auto;
  background: #D9E1D9;
  color: #000000;
  border-bottom-right-radius: 4px;
}
.bot-message {
  color: #243047;
  background: #ffffff;
  border: 1px solid #e3e7ed;
  border-bottom-left-radius: 4px;
  box-shadow:0 2px 8px rgba(0, 0, 0, 0.03);
}
.bot-message a {
  color: #3477c8;
}
.error-message {
  padding: 11px 13px;
  color: #9d2b25;
  background: #fff0ee;
  border: 1px solid #f1c7c2;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

.loading-message {
  display: inline-block;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e3e7ed;
  border-radius: 12px;
  color: #7b8494;
  font-size: 13px;
}
.product-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}
.product-card {
  background: #ffffff;
  border: 1px solid #e1e5eb;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
}
.product-card-body {
  padding: 14px;
}
.product-name {
  color: #17243a;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
}
.product-price {
    background: #ffffff;
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 9px;
}
.product-meta {
  display: flex;
  gap: 5px;
  margin-top: 4px;
  color: #5f6878;
  font-size: 12px;
}
.product-meta span {
  font-weight: 700;
  color: #313c50;
}
.product-stock {
  margin-top: 8px;
  font-size: 12px;
  color: #3c7e21;
  font-weight: 600;
}
.product-category {
  margin-top: 9px;
  padding: 7px 8px;
 background: #f4f6f9;
   border-radius: 8px;
  color: #6f798d;
  font-size: 11px;
  line-height: 1.45;
}
.product-description {
  margin-top: 9px;
  color: #677184;
  font-size: 12px;
  line-height: 1.45;
}
.product-warning {
  margin-top: 9px;
  padding: 8px;
  background: #fff3e3;
  border-radius: 8px;
  color: #9b5b13;
  font-size: 12px;
}
.product-actions {
  display: flex;
  gap: 8px;
  margin-top: 13px;
  flex-wrap: wrap;
}
.product-view-button,
.category-view-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.product-view-button {
   background: #D9E1D9;
  color: #000000;
}
.product-view-button:hover {
  background: #f0f4f0;
}
.category-view-button {
  color: #344054;
  background: #f0f3f7;
  border: 1px solid #dce1e8;
}
.category-view-button:hover {
  background: #e6eaf0;
}

.category-results {
  display: grid;
  grid-template-columns:repeat(1, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.category-card {
  padding: 13px;
  background: #ffffff;
  border: 1px solid #e1e5eb;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.03);
}
.category-card-name {
  color: #17243a;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 5px;
}
.category-card-path {
  color: #7a8392;
  font-size: 11px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.input-area {
  display: flex;

  gap: 8px;

  padding: 11px;

  background: #ffffff;

  border-top:
    1px solid #e3e7ed;
}
.message-input {
  flex: 1;
  min-width: 0;
  padding: 11px 13px;
  border:1px solid #d8dde5;
  border-radius: 10px;
  outline: none;
  font-size: 14px;
}
.message-input:focus {
    border-color: #f0f4f0;
    box-shadow:0 0 0 3px  rgba(93, 156, 35, 0.10);
}
.send-button {
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
   background: #D9E1D9;
  color: #000000;
  font-weight: 700;
  cursor: pointer;
}
.send-button:hover {
  background: #d9e1d9;
}
.send-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
@media (max-width: 600px) {
  .chat-window {
    right:10px;
    bottom:80px;
    width:calc(100vw - 20px);
    height:calc(100vh - 100px);
    border-radius: 16px;
  }
  .chat-button {
    right: 16px;
    bottom: 16px;
  }
}
