/* Search Autocomplete Styles - AGGRESSIVE FIX to prevent layout shift */

/* Force the search bar to not expand */
.search-bar,
.mobile-search-bar {
  position: relative !important;
  overflow: visible !important;
}

/* Force the suggestions to overlay absolutely */
.search-suggestions,
#search-suggestions,
#mobile-search-suggestions {
  position: absolute !important;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  background: white !important;
  border: 1px solid #ddd !important;
  border-top: none !important;
  border-radius: 0 0 8px 8px !important;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2) !important;
  max-height: 500px !important;
  overflow-y: auto !important;
  z-index: 999999 !important;
  margin: 0 !important;
  padding: 0 !important;
  display: none !important;
  /* CRITICAL: Remove from document flow */
  float: none !important;
  clear: none !important;
}

/* When visible */
.search-suggestions[style*="display: block"],
#search-suggestions[style*="display: block"],
#mobile-search-suggestions[style*="display: block"] {
  display: block !important;
}

.suggestions-list {
  padding: 8px 0 !important;
  background: white !important;
  margin: 0 !important;
}

.suggestion-item {
  display: flex !important;
  align-items: center !important;
  padding: 12px 16px !important;
  cursor: pointer !important;
  transition: background-color 0.2s !important;
  gap: 12px !important;
  background: white !important;
  margin: 0 !important;
  border: none !important;
  position: relative !important;
}

.suggestion-item:hover,
.suggestion-item.active {
  background-color: #f5f5f5 !important;
}

.suggestion-image {
  width: 40px !important;
  height: 40px !important;
  object-fit: cover !important;
  border-radius: 4px !important;
  flex-shrink: 0 !important;
}

.suggestion-icon {
  font-size: 20px !important;
  flex-shrink: 0 !important;
  width: 24px !important;
  text-align: center !important;
}

.suggestion-content {
  flex: 1 !important;
  min-width: 0 !important;
}

.suggestion-text {
  font-size: 14px !important;
  color: #333 !important;
  margin-bottom: 2px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.suggestion-text strong {
  font-weight: 600 !important;
  color: #8c53fe !important;
}

.suggestion-subtitle {
  font-size: 12px !important;
  color: #666 !important;
}

.suggestion-type {
  font-size: 11px !important;
  color: #999 !important;
  text-transform: uppercase !important;
  padding: 2px 8px !important;
  background: #f0f0f0 !important;
  border-radius: 12px !important;
  flex-shrink: 0 !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .search-suggestions,
  #search-suggestions,
  #mobile-search-suggestions {
    position: fixed !important;
    top: 60px !important;
    left: 0 !important;
    right: 0 !important;
    max-height: calc(100vh - 60px) !important;
    border-radius: 0 !important;
    z-index: 999999 !important;
  }
}

/* Scrollbar styling */
.search-suggestions::-webkit-scrollbar,
#search-suggestions::-webkit-scrollbar,
#mobile-search-suggestions::-webkit-scrollbar {
  width: 6px !important;
}

.search-suggestions::-webkit-scrollbar-track,
#search-suggestions::-webkit-scrollbar-track,
#mobile-search-suggestions::-webkit-scrollbar-track {
  background: #f1f1f1 !important;
}

.search-suggestions::-webkit-scrollbar-thumb,
#search-suggestions::-webkit-scrollbar-thumb,
#mobile-search-suggestions::-webkit-scrollbar-thumb {
  background: #888 !important;
  border-radius: 3px !important;
}

.search-suggestions::-webkit-scrollbar-thumb:hover,
#search-suggestions::-webkit-scrollbar-thumb:hover,
#mobile-search-suggestions::-webkit-scrollbar-thumb:hover {
  background: #555 !important;
}

/* Prevent any parent from affecting the dropdown */
.header,
.main-header,
.header-container {
  overflow: visible !important;
}
