:root {
  --woo-chat-primary: #0073aa;
  --woo-chat-icon-color: var(--woo-chat-primary);
  --woo-chat-light-bg: #ffffff;
  --woo-chat-light-surface: #f3f6f8;
  --woo-chat-light-text: #17212b;
  --woo-chat-dark-bg: #111920;
  --woo-chat-dark-surface: #1a242e;
  --woo-chat-dark-text: #f3f6f8;
}

.woo-chat-bubble {
  position: fixed;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: var(--woo-chat-primary);
  color: #ffffff;
  border: 0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  z-index: 100001;
  display: grid;
  place-items: center;
  font-weight: 700;
  justify-content: center;
  align-items: center;
}
.woo-chat-bubble:hover{
  background: var(--woo-chat-primary) !important;
}
.woo-chat-bubble:focus{
  background: var(--woo-chat-primary) !important;
}

.woo-chat-bubble.bottom-right {
  bottom: 20px;
  right: 20px;

}

.woo-chat-bubble.bottom-left {
  bottom: 20px;
  left: 20px;
}

.woo-chat-bubble em {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  font-style: normal;
  font-size: 11px;
  background: #e43037;
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0 4px;
}

.woo-chat-bubble-icon {
  width: 30px;
  height: 30px;
  display: block;
  fill: currentColor;
  stroke: currentColor;
}

.woo-chat-window {
  position: fixed;
  width: min(420px, calc(100vw - 24px));
  height: min(680px, calc(100vh - 110px));
  border-radius: 16px;
  overflow: hidden;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  animation: woo-chat-in 220ms ease-out;
}

.woo-chat-window[hidden] {
  display: none !important;
}

@keyframes woo-chat-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.woo-chat-window.bottom-right {
  bottom: 90px;
  right: 20px;
}

.woo-chat-window.bottom-left {
  bottom: 90px;
  left: 20px;
}

.woo-chat-window.light {
  background: var(--woo-chat-light-bg);
  color: var(--woo-chat-light-text);
}

.woo-chat-window.dark {
  background: var(--woo-chat-dark-bg);
  color: var(--woo-chat-dark-text);
}

/* Custom scrollbars for both vertical and horizontal chat areas */
.woo-chat-messages,
.woo-quick-replies,
.woo-product-list {
  scrollbar-width: thin;
}

.woo-chat-window.light .woo-chat-messages,
.woo-chat-window.light .woo-quick-replies,
.woo-chat-window.light .woo-product-list {
  scrollbar-color: rgba(0, 115, 170, 0.45) rgba(23, 33, 43, 0.1);
}

.woo-chat-window.dark .woo-chat-messages,
.woo-chat-window.dark .woo-quick-replies,
.woo-chat-window.dark .woo-product-list {
  scrollbar-color: rgba(79, 186, 226, 0.55) rgba(255, 255, 255, 0.1);
}

.woo-chat-messages::-webkit-scrollbar,
.woo-product-list::-webkit-scrollbar {
  width: 10px;
}

.woo-quick-replies::-webkit-scrollbar {
  height: 8px;
}

.woo-chat-messages::-webkit-scrollbar-track,
.woo-quick-replies::-webkit-scrollbar-track,
.woo-product-list::-webkit-scrollbar-track {
  background: rgba(23, 33, 43, 0.1);
  border-radius: 999px;
}

.woo-chat-messages::-webkit-scrollbar-thumb,
.woo-quick-replies::-webkit-scrollbar-thumb,
.woo-product-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 166, 217, 0.75), rgba(0, 115, 170, 0.85));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.woo-chat-messages::-webkit-scrollbar-thumb:hover,
.woo-quick-replies::-webkit-scrollbar-thumb:hover,
.woo-product-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(0, 166, 217, 0.9), rgba(0, 115, 170, 1));
}

.woo-chat-header {
  background: var(--woo-chat-primary);
  color: #fff;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.woo-header-actions {
  display: flex;
  gap: 6px;
}

.woo-btn-small {
  border: 0;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  font-size: 12px;
}

.woo-btn-icon {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #ffffff;
  background: transparent;
  transition: transform 0.15s ease, opacity 0.15s ease;
  opacity: 0.95;
}



.woo-chat-window.dark .woo-btn-icon {
  color: #f3f6f8;
  background: transparent;
}



.woo-btn-icon-svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
  fill: currentColor;
  stroke: currentColor;
  pointer-events: none;
}

.woo-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.woo-chat-window.light .woo-chat-messages {
  background: var(--woo-chat-light-surface);
}

.woo-chat-window.dark .woo-chat-messages {
  background: var(--woo-chat-dark-surface);
}

.woo-message {
  max-width: 88%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  white-space: pre-wrap;
  line-height: 1.35;
}

.woo-message.user {
  background: var(--woo-chat-primary);
  color: #fff;
  margin-left: auto;
}

.woo-chat-window.light .woo-message.assistant {
  background: #e7edf2;
}

.woo-chat-window.dark .woo-message.assistant {
  background: #273543;
}

.woo-message-warning {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.35;
  border: 1px solid #f1c40f;
  background: rgba(241, 196, 15, 0.16);
  color: #6b4f00;
}

.woo-chat-window.dark .woo-message-warning {
  border-color: #e0b100;
  background: rgba(224, 177, 0, 0.18);
  color: #ffe8a3;
}

.woo-inline-products {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.woo-inline-products .woo-product-card {
  background: rgba(255, 255, 255, 0.55);
}

.woo-chat-window.dark .woo-inline-products .woo-product-card {
  background: rgba(0, 0, 0, 0.24);
  border-color: rgba(255, 255, 255, 0.12);
}

.woo-inline-more {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

.woo-show-more-link {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--woo-chat-primary);
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid var(--woo-chat-primary);
}

.woo-show-more-link:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.woo-show-more-link:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.woo-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.woo-typing span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #9aa7b3;
  animation: woo-dot 1s infinite ease-in-out;
}

.woo-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.woo-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes woo-dot {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.6;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.woo-product-list {
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.woo-chat-window.light .woo-product-list {
  background: #fff;
}

.woo-chat-window.dark .woo-product-list {
  background: #1b2630;
}

.woo-product-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  padding: 8px;
  text-decoration: none;
  color: inherit;
}

.woo-product-card img,
.woo-product-image-placeholder {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: #d9e1e8;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #2c3e50;
}

.woo-product-content h4 {
  margin: 0 0 4px;
  font-size: 13px;
}

.woo-product-content p {
  margin: 0 0 6px;
  font-size: 12px;
  opacity: 0.85;
}

.woo-product-rating {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11px;
  color: #374151;
}

.woo-product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 11px;
}

.woo-product-price {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}

.woo-product-price em {
  text-decoration: line-through;
  opacity: 0.7;
}

.woo-add-to-cart {
  font-size: 12px;
  color: #fff;
  background: var(--woo-chat-primary);
  padding: 4px 8px;
  border-radius: 999px;
  display: inline-block;
}

.woo-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  background: inherit;
  align-items: center;
}

.woo-quick-replies button {
  border: 1px solid rgba(var(--woo-chat-primary-rgb), 0.25);
  border-radius: 20px;
  padding: 8px 14px;
  background: rgba(var(--woo-chat-primary-rgb), 0.08);
  color: var(--woo-chat-primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  text-align: center;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.woo-quick-replies button:hover {
  background: rgba(var(--woo-chat-primary-rgb), 0.15);
  border-color: rgba(var(--woo-chat-primary-rgb), 0.4);
}

.woo-quick-replies button:active {
  transform: scale(0.95);
}

.woo-chat-window.light .woo-quick-replies button {
  background: rgba(var(--woo-chat-primary-rgb), 0.08);
  color: #333;
  border-color: rgba(var(--woo-chat-primary-rgb), 0.25);
}

.woo-chat-window.light .woo-quick-replies button:hover {
  background: rgba(var(--woo-chat-primary-rgb), 0.15);
  border-color: rgba(var(--woo-chat-primary-rgb), 0.4);
}

.woo-chat-window.dark .woo-quick-replies button {
  background: rgba(var(--woo-chat-primary-rgb), 0.12);
  color: #d8bfd8;
  border-color: rgba(var(--woo-chat-primary-rgb), 0.3);
}

.woo-chat-window.dark .woo-quick-replies button:hover {
  background: rgba(var(--woo-chat-primary-rgb), 0.2);
  border-color: rgba(var(--woo-chat-primary-rgb), 0.5);
}

/* Suggestions Toggle & Animation */
.woo-suggestions-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(var(--woo-chat-primary-rgb), 0.1);
  margin-bottom: 8px;
}

.woo-toggle-suggestions {
  border: none;
  background: transparent;
  color: rgba(var(--woo-chat-primary-rgb), 0.8);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  border-radius: 4px;
  line-height: 1;
}

.woo-toggle-suggestions:hover {
  background: rgba(var(--woo-chat-primary-rgb), 0.08);
  color: rgba(var(--woo-chat-primary-rgb), 1);
}

.woo-toggle-suggestions:active {
  background: rgba(var(--woo-chat-primary-rgb), 0.15);
}

.woo-toggle-icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
  display: block;
}

.woo-suggestions-visible .woo-toggle-icon {
  transform: rotate(0deg);
}

.woo-suggestions-hidden .woo-toggle-icon {
  transform: rotate(180deg);
}

.woo-suggestions-content {
  animation: woo-slide-down 0.3s ease-out forwards;
  overflow: hidden;
  padding: 0 14px 12px;
}

.woo-suggestions-hidden .woo-suggestions-content {
  animation: woo-slide-up 0.3s ease-in forwards;
  display: none;
}

.woo-chat-window.dark .woo-suggestions-header {
  border-bottom-color: rgba(var(--woo-chat-primary-rgb), 0.2);
}

.woo-chat-window.dark .woo-toggle-suggestions {
  color: rgba(var(--woo-chat-primary-rgb), 0.7);
}

.woo-chat-window.dark .woo-toggle-suggestions:hover {
  background: rgba(var(--woo-chat-primary-rgb), 0.15);
  color: rgba(var(--woo-chat-primary-rgb), 0.9);
}

.woo-chat-window.dark .woo-toggle-suggestions:active {
  background: rgba(var(--woo-chat-primary-rgb), 0.25);
}

@keyframes woo-slide-down {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 300px;
    transform: translateY(0);
  }
}

@keyframes woo-slide-up {
  from {
    opacity: 1;
    max-height: 300px;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
}

.woo-chat-input {
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  padding: 10px;
  display: flex;
  gap: 8px;
}

.woo-chat-input input {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
  background: #ffffff;
  color: #17212b;
}

.woo-chat-text {
  border-radius: 25px !important;
}

.woo-chat-window.light .woo-chat-input input {
  background: #ffffff;
  color: #17212b;
  border-color: rgba(23, 33, 43, 0.2);
  border-radius: 25px;
}

.woo-chat-window.dark .woo-chat-input input {
  background: #223241;
  color: #eef5fa;
  border-color: rgba(255, 255, 255, 0.2);
}

.woo-chat-window.light .woo-chat-input input::placeholder {
  color: #6b7280;
}

.woo-chat-window.dark .woo-chat-input input::placeholder {
  color: rgba(238, 245, 250, 0.72);
}

.woo-chat-input button {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
  color: #fff;
  background: var(--woo-chat-primary);
}

.woo-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 600px) {
  .woo-chat-window {
    width: calc(100vw - 12px);
    height: min(78vh, 700px);
    left: 6px;
    right: 6px;
    bottom: 86px;
  }

  .woo-chat-bubble.bottom-left,
  .woo-chat-bubble.bottom-right {
    right: 14px;
    left: auto;
    bottom: 14px;
  }
}
