@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600&display=swap');

.chat-product-title {
  display: block;
  font-size: 13px;
  color: #222;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.4;
  max-width: 220px;  
  white-space: normal; 
  overflow: visible;   
}
.chat-product-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  font-family: 'Inter', sans-serif;
    margin-bottom: 12px; 
}
/*
.chat-product-card:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}
*/

.chat-product-img-wrap {
  flex-shrink: 0;
}

.chat-product-img {
  width: 65px;
  height: 65px;
  border-radius: 6px;
  object-fit: cover;
}

.chat-product-details {
  flex: 1;
  padding: 0 6px;  
  display: flex;
  flex-direction: column;
  gap: 0px;        
}

.chat-product-rating {
  font-size: 11px;
  color: #777;
}

.chat-product-reviews {
  margin-left: 4px;
}


.chat-product-price-new {
  font-size: 14px;
  font-weight: 700;
  color: #d32f2f;
}

.chat-product-price-old {
  font-size: 13px;
  color: #999;
  text-decoration: line-through;
}

.chat-cart-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #008000;
  transition: transform 0.2s ease;
}

.chat-cart-btn:hover {
  transform: scale(1.2);
}

.chat-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.chat-product-link:hover,
.chat-product-link:focus {
    color: inherit; 
    background: none; 
    transform: none;
}
#chat-widget {
  position: fixed;
  bottom: 20px;
  left: 20px; 
  z-index: 1119999;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
#chat-widget:before {
    content: '';
}

.chat-toggle {
    background-color: #ffffff;
    width: 90px;
    height: 90px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chat-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}

.chat-logo {

  width: 58px;
  height: 58px;
  object-fit: contain;
}

.chat-box {
  width: 420px;
  height: 600px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #ddd;
  transition: all 0.3s ease;
   margin: 0 0 15px 15px; 
}
.chat-box:hover {
  transform: translateY(-3px);
}

.hidden { display: none; }

.chat-header {
  background: #371b02;
  color: #fff;
  padding: 8px 16px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.chat-close {
  cursor: pointer;
  font-size: 20px;
}

.chat-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  background: #fafafa;
  background: #371b0217;
}

.chat-message {
  margin-bottom: 12px;
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.5;
  word-wrap: break-word;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-size: 14px;
}
.chat-message p {
    margin-bottom: .85em;
}
.chat-message.bot {
  background-color: #f2f2f2;
  background-color: #fff;
  color: #111;
  align-self: flex-start;
  border-top-left-radius: 0;
}

.chat-message.user {
    background-color: #371b02;
    color: #f2f2f2;
    align-self: flex-end;
    margin-left: auto;
    border-radius: 12px 0 12px 12px;
}

.chat-input {
  display: flex;
  align-items: center;
  padding: 10px;
  background: #fafafa;
  border-top: 1px solid #e0e0e0;
}

.chat-input input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 22px;
  padding: 12px 16px;
  outline: none;
  font-size: 15px;
  background: #fff;
  color: #333;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    margin: 0 !important;
    border-radius: 15px !important;  
}

.chat-input input::placeholder {
  color: #999;
  font-weight: 400;
  font-size: 14px;
}

.chat-input input:focus {
  border-color: #333;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.chat-input button {
    margin-left: 8px;
    background: #371b02;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.25s 
ease, transform 0.1s 
ease, box-shadow 0.25s 
ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    margin: 0 0 0 5px !important;
}

.chat-input button:hover {
  background: #211001;       
  transform: scale(1.1);     
}

.chat-input button:active {
  transform: scale(0.95);   
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}


.chat-product {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px;
  margin: 6px 0;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  align-items: flex-start; 
}

.chat-product-left {
  display: flex;
  flex-direction: column;
  justify-content: space-between; 
  gap: 6px;
  flex-shrink: 0;
  height: 100%; 
}

.chat-product-img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.chat-add-to-cart {
  padding: 4px 6px;
  border: none;
  border-radius: 4px;
  background: var(--fs-color-primary);
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.chat-add-to-cart:hover {
  background: #444;
  transform: scale(1.05);
}

.chat-add-to-cart img.chat-cart-icon {
  width: 18px;
  height: 18px;
  filter: invert(1);
  transition: transform 0.2s ease;
}

.chat-add-to-cart.added {
  background: #3cb371 !important;
}

.chat-add-to-cart.added img.chat-cart-icon {
  filter: invert(0);
  transform: scale(1.1);
}


.chat-product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}


.chat-product-desc {
  font-size: 12px;
  margin: 0 0 4px 0;
  color: #555;
}

.chat-product-price {
  font-size: 13px;
  text-align: right;
  color: #000;
  font-weight: bold;
  margin: 0;
}

.chat-hint {
    position: absolute;
    bottom: 85px;   
    left: 130px;    
    width: 180px;
    max-width: 180px;
    min-width: 180px;
    padding: 14px 12px;
    background: #371b02;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    border-radius: 14px;
    text-align: left;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 9999;
}

        #chat-widget {
            position: fixed;
            bottom: 0;   
            left: 0;     
            z-index: 1119999;
        }

   
        #lottie-chat {
            width: 120px;
            height: 160px;
			transform: translateY(70px);
			margin-left: 40px;
        }
		#lottie-chat,
		#lottie-chat svg {
		cursor: pointer !important;
		}


/* Хвостик підказки */
.chat-hint::after {
  content: '';
  position: absolute;
  bottom: -8px;   
  left: 10px;     
  border-width: 8px 8px 0 0; 
  border-style: solid;
  border-color: #333 transparent transparent transparent;
}

/* Текст підказки */
.chat-hint-text {
  width: 100%;
  padding-right: 10px;   /* відстань до хрестика */
  word-break: break-word; 
  margin-bottom: 6px;    /* відстань між текстом і нижньою межею */
}

/* Хрестик */
.chat-hint-close {
  position: absolute;
  top: 6px;
  right: 12px;
  font-size: 18px;
  cursor: pointer;
  color: #aaa;
  transition: color 0.2s;
}

.chat-hint-close:hover {
  color: #fff;
}


.chat-hint.show {
  opacity: 1;
  transform: translateY(0);
}

.chat-hint-text p {
  margin: 4px 0;          
  line-height: 1.5;       
}
.typing {
    display: inline-flex;
    gap: 3px;
}
.typing span {
    width: 6px;
    height: 6px;
    background: #666;
    border-radius: 50%;
    display: inline-block;
    animation: blinke 1.4s infinite both;
}
.typing span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing span:nth-child(3) {
    animation-delay: 0.4s;
}
@keyframes blinke {
    0%, 80%, 100% { opacity: 0.2; }
    40% { opacity: 1; }
}



#scroll-to-bottom {
    position: absolute;       
    bottom: 95px;            
    right: 16px;             
    width: 44px;
    height: 44px;
    background: #371b02;      
    color: #fff;
    font-size: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, background 0.2s ease, opacity 0.3s ease;
    z-index: 999;
}

#scroll-to-bottom:hover {
    background: #000;
    transform: scale(1.1);
}

#scroll-to-bottom.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#scroll-to-bottom::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    animation: pulses 1.5s infinite;
    z-index: -1;
}

@keyframes pulses {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 0.2; }
    100% { transform: scale(0.8); opacity: 0.5; }
}


.fallback-form-wrapper {

  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  max-width: 400px;
  margin: 20px auto;
}

.fallback-form-wrapper p {
  margin-bottom: 15px;
  font-size: 14px;
  color: #333;
}

.fallback-form-wrapper input,
.fallback-form-wrapper textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s;
  margin-bottom: 0px;
}

.fallback-form-wrapper input:focus,
.fallback-form-wrapper textarea:focus {
  border-color: #371b02;
  outline: none;
}

.fallback-form-wrapper textarea {
  min-height: 100px;
  resize: vertical;
}

.fallback-form-wrapper button {
  background: #371b02;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.2s;
}

.fallback-form-wrapper button:hover {
  background: #333;
}

@media (max-width: 480px) {
  .fallback-form-wrapper {
    padding: 15px;
    margin: 15px;
  }

  .fallback-form-wrapper button {
    width: 100%;
  }
}


@media (max-width: 768px) {
    .chat-open-fht #chat-widget:before {
        position: absolute;
        width: 100%;
        height: 100%;
        background: #111111e6;
        z-index: -1;
        top: -10vh;   
    }
  #chat-widget.chat-open {
      position: fixed;
      inset: 0;
      width: 100vw;
      height: 90vh; 
      z-index: 100000;
      display: flex;
      flex-direction: column;
      background: #fff;
      overflow: hidden; 
  }

  .chat-box {
      display: flex;
      flex-direction: column;
      width: 100%;
      height: 90vh;
      background: #fff;
      border-radius: 0;
      box-shadow: none;
      margin: 0;
      overflow: hidden;
  }

  .chat-header {
      flex: 0 0 auto;
      color: #fff;
      font-size: 16px;
      padding: 14px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      z-index: 10;
  }

  .chat-messages {
      flex: 1 1 auto;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch; 
      padding: 12px;
      background: #f9f9f9;
  }

  .chat-input {
      flex: 0 0 auto;
      display: flex;
      align-items: center;
      padding: 10px;
      border-top: 1px solid #ddd;
      background: #fff;
      z-index: 10;
  }

  .chat-input input {
      flex: 1;
      font-size: 15px;
      padding: 10px 14px;
      border-radius: 25px;
      border: 1px solid #ccc;
      outline: none;
  }

  .chat-input button {
      width: 42px;
      height: 42px;
      font-size: 18px;
      margin-left: 8px;
      border: none;
      color: white;
      border-radius: 50%;
      cursor: pointer;
  }

  .chat-input button:active {
      opacity: 0.8;
  }

  /* Забороняємо скрол сайту */
  body.chat-open,
  html.chat-open {
      overflow: hidden !important;
      height: 100%;
  }
}
