/* Talk with Us Chatbot - dedicated styles */

.chatbot-widget .hidden,
.chatbot-widget .chatbot-form-wrap.hidden {
  display: none !important;
}

.chatbot-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #d8262f;
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(216, 38, 47, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.chatbot-fab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(216, 38, 47, 0.5);
}
.chatbot-fab svg,
.chatbot-fab img.chatbot-headset-icon,
.chatbot-fab .chatbot-headset-icon-inline {
  width: 28px;
  height: 28px;
  display: block;
}
.chatbot-fab img.chatbot-headset-icon {
  filter: brightness(0) invert(1);
}
.chatbot-fab .chatbot-headset-icon-inline svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: brightness(0) invert(1);
}

.chatbot-widget {
  position: fixed;
  bottom: 90px;
  right: 24px;
  z-index: 9999;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: inherit;
}
.chatbot-widget.hidden {
  display: none;
}

.chatbot-header {
  background: #fff;
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-shrink: 0;
}
.chatbot-header-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.chatbot-header-icon {
  width: 40px;
  height: 40px;
  color: #d8262f;
  flex-shrink: 0;
}
.chatbot-header-icon svg,
.chatbot-header-icon img.chatbot-headset-icon,
.chatbot-header-icon .chatbot-headset-icon-inline {
  width: 100%;
  height: 100%;
  display: block;
}
.chatbot-header-icon .chatbot-headset-icon-inline svg {
  width: 100%;
  height: 100%;
}
.chatbot-header-text h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
}
.chatbot-header-text p {
  margin: 4px 0 0;
  font-size: 0.8125rem;
  color: #6b7280;
}
.chatbot-header-actions {
  display: flex;
  gap: 8px;
}
.chatbot-header-actions button {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chatbot-header-actions button:hover {
  background: #f3f4f6;
  color: #374151;
}
.chatbot-header-actions button svg {
  width: 18px;
  height: 18px;
}

.chatbot-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  background: #fff;
}
.chatbot-body.chatbot-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px;
}
.chatbot-empty-icon {
  width: 80px;
  height: 80px;
  color: #d1d5db;
  margin-bottom: 16px;
}
.chatbot-empty-icon svg {
  width: 100%;
  height: 100%;
}
.chatbot-empty-text {
  font-size: 0.875rem;
  color: #9ca3af;
}

.chatbot-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chatbot-msg {
  max-width: 85%;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.875rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.chatbot-msg a {
  color: inherit;
  text-decoration: underline;
  overflow-wrap: anywhere;
  word-break: break-all;
}
.chatbot-msg.user {
  align-self: flex-end;
  background: #d8262f;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chatbot-msg.assistant {
  align-self: flex-start;
  background: #f3f4f6;
  color: #374151;
  border-bottom-left-radius: 4px;
}
.chatbot-msg.system {
  align-self: center;
  background: #fdecec;
  color: #b91d25;
  font-size: 0.8125rem;
}

.chatbot-msg-loading.chatbot-msg {
  padding: 12px 16px;
}
.chatbot-loading-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}
.chatbot-loading-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6b7280;
  animation: chatbot-loading-dot 1.4s ease-in-out infinite both;
}
.chatbot-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.chatbot-loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.chatbot-loading-dots span:nth-child(3) { animation-delay: 0s; }
@keyframes chatbot-loading-dot {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40% { transform: scale(1.2); opacity: 1; }
}

.chatbot-form-wrap {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  flex-shrink: 0;
}
.chatbot-pre-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chatbot-pre-form label {
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}
.chatbot-pre-form input[type="text"],
.chatbot-pre-form input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.875rem;
  box-sizing: border-box;
}
.chatbot-pre-form input:focus {
  outline: none;
  border-color: #d8262f;
  box-shadow: 0 0 0 2px rgba(216, 38, 47, 0.2);
}
.chatbot-pre-form .chatbot-submit-btn {
  padding: 10px 16px;
  background: #d8262f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
}
.chatbot-pre-form .chatbot-submit-btn:hover {
  background: #b91d25;
}
.chatbot-pre-form .chatbot-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.chatbot-input-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chatbot-input-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 0.875rem;
  min-width: 0;
}
.chatbot-input-bar input:focus {
  outline: none;
  border-color: #d8262f;
}
.chatbot-input-bar input::placeholder {
  color: #9ca3af;
}
.chatbot-input-bar .chatbot-send-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: #d8262f;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, opacity 0.2s;
}
.chatbot-input-bar .chatbot-send-btn svg {
  fill: #fff;
}
.chatbot-input-bar .chatbot-send-btn:hover:not(:disabled) {
  background: #b91d25;
}
.chatbot-input-bar .chatbot-send-btn:disabled {
  background: #d1d5db;
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: none;
}
.chatbot-input-bar .chatbot-send-btn:disabled svg {
  fill: #9ca3af;
}
.chatbot-input-bar .chatbot-voice-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: #d8262f;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chatbot-input-bar .chatbot-voice-btn svg {
  fill: #fff;
}
.chatbot-input-bar .chatbot-voice-btn:hover {
  background: #b91d25;
}
.chatbot-input-bar .chatbot-voice-btn.recording {
  background: #dc2626;
  animation: chatbot-pulse 1s ease-in-out infinite;
}
.chatbot-input-bar .chatbot-voice-btn.recording svg {
  fill: #fff;
}
@keyframes chatbot-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}
.chatbot-input-bar button svg {
  width: 20px;
  height: 20px;
}

.chatbot-limit-msg {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 6px;
}
.chatbot-limit-msg.at-limit {
  color: #dc2626;
}
.chatbot-disabled-overlay {
  font-size: 0.8125rem;
  color: #6b7280;
  padding: 8px 0;
}

/* Ürün öneri kartları (slide) */
.chatbot-cards {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  margin-top: 2px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.chatbot-cards::-webkit-scrollbar { height: 6px; }
.chatbot-cards::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.chatbot-card {
  flex: 0 0 150px;
  width: 150px;
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chatbot-card-img {
  width: 100%;
  height: 110px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chatbot-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.chatbot-card-body {
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.chatbot-card-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}
.chatbot-card-meta {
  font-size: 0.6875rem;
  color: #6b7280;
}
.chatbot-card-price {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #111827;
}
.chatbot-card-stock {
  font-size: 0.6875rem;
  color: #6b7280;
}
.chatbot-card-btn {
  margin-top: auto;
  border: none;
  background: #d8262f;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.chatbot-card-btn:hover { background: #b91d25; }

/* İkon yanı teaser popup (typewriter) */
.chatbot-popup {
  position: fixed;
  right: 92px;
  bottom: 28px;
  z-index: 9998;
  max-width: 300px;
  background: #fff;
  color: #111827;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16);
  padding: 16px 38px 16px 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: chatbot-popup-in 0.25s ease;
}
@keyframes chatbot-popup-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chatbot-popup-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 50%;
  color: #6b7280;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.chatbot-popup-close:hover { background: #f3f4f6; color: #374151; }
.chatbot-popup-text {
  min-height: 1.4em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.chatbot-popup-text::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1.05em;
  background: #d8262f;
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: chatbot-caret 0.8s steps(1) infinite;
}
@keyframes chatbot-caret { 50% { opacity: 0; } }

@media (max-width: 480px) {
  .chatbot-popup {
    right: 80px;
    max-width: calc(100vw - 100px);
    font-size: 0.85rem;
    padding: 12px 32px 12px 14px;
  }
}
