/* AI Search Widget - Mobile-Optimized Modal */

/* =============================================================================
   PERFORMANCE-FIRST MODAL SYSTEM
   - Hardware acceleration with transform3d
   - Minimal reflows/repaints
   - Mobile-first responsive design
   - Industry standard accessibility
   ============================================================================= */

/* Modal Overlay - Hardware Accelerated */
.ai-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  
  
  z-index: 2;
  
  /* Hardware acceleration */
  transform: translate3d(0, 0, 0);
  will-change: opacity;
  
  /* Smooth entrance */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  border-radius: 25px 23px 0px 0px;
}

.ai-modal-overlay.ai-modal-open {
  opacity: 1;
  visibility: visible;
}

/* Modal Container - Optimized Layout */
.ai-modal-container {
  position: fixed;
  top: 58px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  
  /* Hardware acceleration */
  transform: translate3d(0, 0, 0);
  will-change: transform;
      align-items: flex-end;
  /* Pointer events only on container */
  pointer-events: none;
}

.ai-modal-container.ai-modal-open {
  pointer-events: auto;
}

/* Modal Content - Mobile First */
.ai-modal-content {
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  
  /* Hardware acceleration */
  transform: translate3d(0, 20px, 0) scale(0.95);
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Enable pointer events */
  pointer-events: auto;
  
  /* Safe area for mobile notch */
  padding-top: env(safe-area-inset-top);
  border-radius: 23px 23px 0px 0px !important;
  justify-content: flex-end;
}

.ai-modal-open .ai-modal-content {
  transform: translate3d(0, 0, 0) scale(1);
}

/* Modal Header - Minimal */
.ai-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0px 0px 9px 0px;
  flex-shrink: 0;
  background: white;
    border-radius: 20px 20px 0px 0px;
}

.ai-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.ai-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
width: 23px;
    height: 23px;
  border: none;
  background: none;
  border-radius: 8px;
  color: #666666;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  
  /* Touch target optimization */
  -webkit-tap-highlight-color: transparent;
}

.ai-modal-close:hover {
  background: #f5f5f5;
  color: #1a1a1a;
}

.ai-modal-close:active {
  background: #e8e8e8;
}

/* Modal Body - Scrollable */
.ai-modal-body {
  -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
  overscroll-behavior: contain; /* Prevent background scroll */
  overflow: hidden;
  display: flex;
    flex-direction: column-reverse;
  background: white !important;
}

/* Conversation Interface - Simplified */
.ai-conversation-messages {
padding: 20px 24px;
    overflow-y: auto;
    -webkit-overflow-scrolling: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
      max-height: 100%;
}

.ai-message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  
  /* Subtle animation */
  opacity: 0;
  transform: translateY(10px);
  animation: messageAppear 0.3s ease forwards;
}

@keyframes messageAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ai-message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.ai-message-user .ai-message-avatar {
  background: #1a1a1a;
  color: #ffffff;
}

.ai-message-ai .ai-message-avatar {
  background: #f0f0f0;
  color: #1a1a1a;
}

.ai-message-content {
  flex: 1;
  min-width: 0; /* Prevent flex item overflow */
}

.ai-message-text {
  background: #f8f9fa;
  color: #1a1a1a;
  padding: 8px 14px;
  border-radius: 16px;
  font-size: 12px;
  line-height: 1.4;
  word-wrap: break-word;
}

.ai-message-user .ai-message-text {
  background: #606060;
  color: #ffffff;
}

/* Product Grid - Optimized */
.ai-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.ai-product-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.ai-product-card:hover {
  border-color: #1a1a1a;
}

.ai-product-image {
  width: 100%;
  height: 100px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ai-product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-product-info {
  padding: 12px;
}

.ai-product-title {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  margin: 0 0 4px 0;
  line-height: 1.3;
  
  /* Truncate long titles */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ai-product-price {
  font-size: 12px;
  color: #444444;
  margin: 0;
}

/* Input Area - Touch Optimized */
.ai-modal-input-area {
  padding: 16px 24px;
  border-top: 1px solid #e8e8e8;
  flex-shrink: 0;
  
  /* Safe area for mobile keyboard */
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: white !important;
}

-wrapper {
    display: flex;
    align-items: flex-end;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 24px;
    padding: 4px;
    transition: border-color 0.15s ease;
    gap: 0px;
}

.ai-input-wrapper:focus-within {
  border-color: #1a1a1a;
}

.ai-input {
  flex: 1;
  border: none;
  background: none;
  color: #1a1a1a !important;
  font-size: 16px; /* Prevent zoom on iOS */
  outline: none;
  resize: none;
  max-height: 60px;
  min-height: 20px; /* Touch target optimization */
  line-height: 1.2;
  margin-right: 8px; /* Space from send button */
       /* enable vertical scrolling */
  -ms-overflow-style: none;   /* hide scrollbar in IE and Edge */
  scrollbar-width: none; 
  
}
::-webkit-scrollbar {
  display: none;              /* hide scrollbar in Chrome, Safari */
}
.ai-input::placeholder {
  color: #8a8a8a;
  font-size: 14px;
}

.ai-send-button {
  width: 31px;
  height: 31px;
  border: none;
  background: #141414c4;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s ease, background-color 0.15s ease;
  flex-shrink: 0;
  
  /* Touch optimization */
  -webkit-tap-highlight-color: transparent;
  margin: 0px 0px 0px 0px;
}

.ai-send-button:hover:not(:disabled) {
  background: #333333;
}

.ai-send-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .ai-modal-container {
    padding: 0;
    align-items: stretch;
  }
  
  .ai-modal-content {
    border-radius: 0;
    max-height: 100vh;
    /* Full screen on mobile */
    transform: translate3d(0, 100%, 0);
  }
  
  .ai-modal-open .ai-modal-content {
    transform: translate3d(0, 0, 0);
  }
  
  .ai-modal-header {
    padding: 0px 0px 0px 0px;
    
  }
  
  .ai-conversation-messages {
    padding: 16px 20px;
  }
  
  .ai-modal-input-area {
 padding: 8px 11px;
        padding-bottom: calc(4px + env(safe-area-inset-bottom));
        position: sticky;
        bottom: 0;
            background: white !important;
  }
  
  .ai-products-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
  }
  
  .ai-product-image {
    height: 80px;
  }
  
  .ai-product-info {
    padding: 8px;
  }
}

/* Light mode override for users who prefer light */
@media (prefers-color-scheme: light) {
  /* Keep dark theme even in light mode preference for consistency */
}

/* Contrast adjustments */
@media (prefers-contrast: high) {
  .ai-modal-content {
    border-color: #1a1a1a;
  }
  
  .ai-message-text {
    background: #f0f0f0;
    color: #000000;
  }
  
  .ai-input-wrapper {
    background: #f0f0f0;
    border-color: #1a1a1a;
  }
  
  .ai-product-card {
    background: #f0f0f0;
    border-color: #1a1a1a;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .ai-modal-overlay,
  .ai-modal-content,
  .ai-message,
  .ai-product-card {
    transition: none;
    animation: none;
  }
}

/* High contrast support */
@media (prefers-contrast: high) {
  .ai-modal-content {
    border: 2px solid #1a1a1a;
  }
  
  .ai-product-card {
    border-width: 2px;
  }
}

/* Focus management */
.ai-modal-content *:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

/* Loading animation */
.ai-loading-dots {
  display: inline-flex;
  gap: 4px;
}

.ai-loading-dots span {
  width: 4px;
  height: 4px;
  background: #666666;
  border-radius: 50%;
  animation: loadingBounce 1.4s ease-in-out infinite both;
}

.ai-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes loadingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
} 





.apple-watch-banner {
    background: linear-gradient(360deg, rgba(255, 255, 255, 1) 0%, rgb(222 222 222) 39%, rgb(172 172 172) 100%);
    border-radius: 20px 20px 0px 0px;
    padding: 8px 9px 5px 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-family: Arial, sans-serif;
    position: relative;
    max-width: 1000px;
    flex-direction: column;
    width: 100%;
}
.right-ban {
  display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    position: absolute;
    right: -4px;
    bottom: 3px;
}
.heading-ban {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
}

.footer-ban {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
  position: relative;
}

.heading-left-in h3 {
margin: 0 0 2px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.1;
}

.main-content p {
  margin: 1px 0;
  font-size: 8px;
  line-height: 1.2;
}

.offer-line {
  font-size: 14px;
  margin-top: 10px;
  line-height: 1.4;
}
.left-ban {
    line-height: 1.2;
  width: 90%
}
.marketed-line {
  margin-top: 12px;
  font-size: 9px;
  display: block;
}

.rating {
  color: #000;
  font-size: 8px;
}

.banner-right {
  text-align: center;
}

.right-ban p {
    margin: 1px 0;
    font-size: 8px;
    line-height: 0.7;
}

.whatsapp-icon img {
  width: 32px;
  height: 32px;
}

.close-btn {
background: red;
    color: white;
    font-weight: bold;
    padding: 7px 7px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 14px;
}

.ai-message.ai-message-ai:first-child {
  /* styles here */
  background-color: #red;
}
