/* Chat Bubble Styles */
.chat-bubble {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #000;
  border: none;
  border-radius: 20px 20px 20px 5px;
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 999;
  transition: all 0.3s ease;
  opacity: 0.95;
  overflow: hidden;
}

.chat-bubble:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  opacity: 1;
}

.chat-bubble-icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  transition: all 0.3s ease;
  opacity: 1;
  position: absolute;
}

.chat-bubble-icon.typing {
  opacity: 0;
}

.chat-bubble:hover .chat-bubble-icon {
  transform: scale(1.1);
}

/* Typing Dots */
.typing-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  position: absolute;
  height: 17px;
}

.typing-dots.active {
  opacity: 1;
}

.typing-dot {
  width: 4px;
  height: 4px;
  background: #90949c;
  border-radius: 2px;
  display: inline-block;
  margin-right: 2px;
  animation: mercuryTypingAnimation 1.5s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 200ms;
}

.typing-dot:nth-child(2) {
  animation-delay: 300ms;
}

.typing-dot:nth-child(3) {
  animation-delay: 400ms;
}

@keyframes mercuryTypingAnimation {
  0% {
    transform: translateY(0px);
  }
  28% {
    transform: translateY(-5px);
  }
  44% {
    transform: translateY(0px);
  }
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Mobile: 320px - 767px */
@media (max-width: 767px) {
  .chat-bubble {
    width: 3rem;
    height: 3rem;
    border-radius: 16px 16px 16px 4px;
    bottom: 0.75rem;
    right: 0.75rem;
  }

  .chat-bubble-icon {
    width: 1.75rem;
    height: 1.75rem;
  }

  .typing-dots {
    gap: 0.2rem;
  }

  .typing-dot {
    width: 3px;
    height: 3px;
    margin-right: 1px;
  }
}

/* Small Tablet: 768px - 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
  .chat-bubble {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 18px 18px 18px 4px;
    bottom: 0.75rem;
    right: 0.75rem;
  }

  .chat-bubble-icon {
    width: 2rem;
    height: 2rem;
  }

  .typing-dots {
    gap: 0.25rem;
  }

  .typing-dot {
    width: 4px;
    height: 4px;
    margin-right: 2px;
  }
} 

/* Chat Window Styles */
.chat-window {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 350px;
  height: 500px;
  background: #fff;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: none;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-bottom: none;
}

.chat-window.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chat-bubble.chat-open {
  opacity: 0;
  pointer-events: none;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: #000;
  color: #fff;
  border-radius: 12px 12px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-header-icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.chat-header-text h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.chat-status {
  font-size: 0.75rem;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chat-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background 0.2s ease;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
}

.user-message {
  align-self: flex-end;
}

.bot-message {
  align-self: flex-start;
}

.message-content {
  padding: 0.75rem 1rem;
  border-radius: 18px;
  font-size: 0.875rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.user-message .message-content {
  background: #000;
  color: #fff;
  border-radius: 18px 18px 4px 18px;
}

.bot-message .message-content {
  background: #f1f5f9;
  color: #1e293b;
  border-radius: 18px 18px 18px 4px;
}

/* Typing indicator in chat messages */
.typing-indicator .message-content {
  background: #f1f5f9;
  color: #1e293b;
  border-radius: 18px 18px 18px 4px;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.typing-dots-inline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.25rem;
}

.typing-dots-inline .typing-dot {
  width: 6px;
  height: 6px;
  background: #64748b;
  border-radius: 50%;
  display: inline-block;
  animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dots-inline .typing-dot:nth-child(1) {
  animation-delay: 200ms;
}

.typing-dots-inline .typing-dot:nth-child(2) {
  animation-delay: 300ms;
}

.typing-dots-inline .typing-dot:nth-child(3) {
  animation-delay: 400ms;
}

@keyframes typingAnimation {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.message-time {
  font-size: 0.7rem;
  color: #64748b;
  margin-top: 0.25rem;
  align-self: flex-end;
}

.user-message .message-time {
  align-self: flex-end;
}

.bot-message .message-time {
  align-self: flex-start;
}

/* Question Buttons */
.question-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
  align-self: flex-start;
  max-width: 85%;
}

.question-button {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #1e293b;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.question-button:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.question-button:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Chat Input */
.chat-input-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 0 0 12px 12px;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  border-color: #000;
}

.chat-send {
  background: #000;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-send:hover {
  background: #1f2937;
  transform: scale(1.05);
}

/* Responsive Chat Window */
@media (max-width: 767px) {
  .chat-window {
    width: 100%;
    height: 70vh;
    bottom: 0;
    right: 0;
    left: 0;
    border-radius: 12px 12px 0 0;
    max-width: 100vw;
    overflow: hidden;
  }
  
  .chat-header {
    padding: 0.75rem;
  }
  
  .chat-header-icon {
    width: 1.75rem;
    height: 1.75rem;
  }
  
  .chat-header-text h3 {
    font-size: 0.85rem;
  }
  
  .chat-status {
    font-size: 0.7rem;
  }
  
  .chat-messages {
    padding: 0.75rem;
  }
  
  .message-content {
    padding: 0.625rem 0.875rem;
    font-size: 0.8rem;
    max-width: 85%;
  }
  
  .typing-indicator .message-content {
    min-height: 2.25rem;
  }
  
  .typing-dots-inline .typing-dot {
    width: 5px;
    height: 5px;
  }
  
  .chat-input-container {
    padding: 0.75rem;
  }
  
  .chat-input {
    padding: 0.625rem 0.875rem;
    font-size: 0.8rem;
  }
  
  .chat-send {
    width: 2.25rem;
    height: 2.25rem;
  }
  
  .question-buttons-container {
    max-width: 90%;
  }
  
  .question-button {
    padding: 0.625rem 0.875rem;
    font-size: 0.75rem;
  }
}

/* Chat bubble responsive fixes */
@media (max-width: 767px) {
  .chat-bubble {
    width: 3rem;
    height: 3rem;
    bottom: 0.75rem;
    right: 0.75rem;
    position: fixed;
    z-index: 999;
  }

  .chat-bubble-icon {
    width: 1.75rem;
    height: 1.75rem;
  }

  .typing-dots {
    gap: 0.2rem;
  }

  .typing-dot {
    width: 3px;
    height: 3px;
    margin-right: 1px;
  }
}

/* Prevent horizontal scroll on mobile */
@media (max-width: 767px) {
  body {
    overflow-x: hidden;
    width: 100%;
  }
  
  .footer-main {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .footer-bottom {
    padding-left: 1rem;
    padding-right: 1rem;
  }
} 
/* Keep the close control reachable in landscape and when the keyboard opens. */
.chat-window { max-width: 100vw; max-height: calc(var(--store-viewport, 100dvh) - env(safe-area-inset-top)); overflow: hidden; }
.chat-header, .chat-input-container { flex-shrink: 0; }
.chat-messages { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.chat-close { min-width: 44px; min-height: 44px; }
.chat-window .chat-input { font-size: 16px; }
.chat-footer-trigger { display: block; margin: 1rem auto; padding: 12px; border: 0; background: transparent; color: #fff; text-decoration: underline; font: inherit; font-size: 14px; }
body:has(.product-page, .product-view-page, .checkout-container, .auth-container) .chat-bubble { display: none; }

.chat-window { z-index: 10003; }
