/* Search Container - Override for search results positioning */
.search-container {
  position: relative;
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  max-height: 400px;
  overflow-y: auto;
  margin-top: 4px;
}

.search-results-header {
  padding: 0.75rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid #e5e5e5;
  font-weight: 600;
  color: #333;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-query-display {
  font-weight: 400;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

.search-results-list {
  max-height: 300px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 0;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  transition: background-color 0.2s;
}

.search-result-item:hover,
.search-result-item.selected {
  background-color: #f8f9fa;
}

.search-result-item.selected {
  background-color: #e8f4ea;
  border-left: 3px solid #2c5530;
}

.search-result-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: inherit;
  flex: 1;
  min-width: 0;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-image {
  width: 50px;
  height: 50px;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.search-result-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

.search-result-content {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin: 0 0 0.25rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-name mark {
  background-color: #fff3cd;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 700;
  color: #856404;
}

.search-result-description {
  font-size: 0.8rem;
  color: #666;
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-result-description mark {
  background-color: #fff3cd;
  padding: 0 2px;
  border-radius: 2px;
  font-weight: 600;
  color: #856404;
}

.search-result-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-result-category {
  font-size: 0.7rem;
  color: #666;
  background: #e9ecef;
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
}

.search-result-type {
  font-size: 0.75rem;
  color: #888;
  background: #f0f0f0;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  font-weight: 500;
}

.search-result-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: #2c5530;
}

.search-loading {
  padding: 1rem;
  text-align: center;
  color: #666;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.search-loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e5e5;
  border-top-color: #2c5530;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.search-no-results {
  padding: 1.5rem 1rem;
  text-align: center;
}

.search-suggestions {
  margin-top: 1rem;
}

.search-suggestions-title {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.search-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.search-suggestion-tag {
  background: #f8f9fa;
  border: 1px solid #e5e5e5;
  border-radius: 16px;
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
}

.search-suggestion-tag:hover {
  background: #2c5530;
  color: white;
  border-color: #2c5530;
  transform: translateY(-1px);
}

.search-result-quick-add {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: #2c5530;
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0;
  z-index: 10;
}

.search-result-item:hover .search-result-quick-add,
.search-result-item.selected .search-result-quick-add {
  opacity: 1;
}

.search-result-quick-add:hover {
  background: #1e3d21;
  transform: translateY(-50%) scale(1.1);
}

.search-result-quick-add:active {
  transform: translateY(-50%) scale(0.95);
}

.search-result-quick-add:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.quick-add-loading {
  color: #4ade80;
  font-weight: bold;
  font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .search-results {
    left: -0.5rem;
    right: -0.5rem;
    max-height: 300px;
  }
  
  .search-result-item {
    padding: 0.5rem 0.75rem;
  }
  
  .search-result-image {
    width: 40px;
    height: 40px;
    margin-right: 0.5rem;
  }
  
  .search-result-name {
    font-size: 0.9rem;
  }
  
  .search-result-description {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .search-results {
    left: -0.25rem;
    right: -0.25rem;
    max-height: 250px;
  }
  
  .search-result-item {
    padding: 0.4rem 0.6rem;
  }
  
  .search-result-image {
    width: 35px;
    height: 35px;
    margin-right: 0.4rem;
  }
  
  .search-result-name {
    font-size: 0.85rem;
  }
  
  .search-result-description {
    font-size: 0.7rem;
  }
  
  .search-result-price {
    font-size: 0.8rem;
  }
}
