/* Search Bar Styles */
.search-container {
  position: relative;
  margin-left: 20px;
  margin-right: 20px;
}

.search-form {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border-radius: 20px;
  padding: 5px 15px;
  border: 1px solid #e0e0e0;
  transition: all 0.3s;
}

.search-form:focus-within {
  border-color: #6B8E23;
  box-shadow: 0 0 0 2px rgba(107, 142, 35, 0.1);
  background: white;
}

.search-input {
  border: none;
  background: transparent;
  padding: 5px;
  font-size: 14px;
  width: 150px;
  outline: none;
  color: #333;
}

.search-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s;
}

.search-btn:hover {
  color: #6B8E23;
}

/* Autocomplete Dropdown */
.search-autocomplete-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  max-height: 500px;
  overflow-y: auto;
  z-index: 1000;
  border: 1px solid #e0e0e0;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
  transition: background 0.2s;
  cursor: pointer;
}

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

.autocomplete-item:hover {
  background: #f8f9fa;
}

.autocomplete-item-image {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.autocomplete-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.autocomplete-item-image i {
  font-size: 24px;
  color: #ccc;
}

.autocomplete-item-info {
  flex: 1;
  min-width: 0;
}

.autocomplete-item-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-item-name mark {
  background: #fff3cd;
  color: #856404;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 700;
}

.autocomplete-item-price {
  font-size: 13px;
  color: #6B8E23;
  font-weight: 600;
}

.autocomplete-item-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.autocomplete-item-badge.in-stock {
  background: #d4edda;
  color: #155724;
}

.autocomplete-item-badge.out-of-stock {
  background: #f8d7da;
  color: #721c24;
}

/* See All Results */
.autocomplete-item.see-all {
  justify-content: center;
  gap: 8px;
  background: #f8f9fa;
  color: #6B8E23;
  font-weight: 600;
  border-top: 2px solid #e0e0e0;
}

.autocomplete-item.see-all:hover {
  background: #e9ecef;
}

/* Loading State */
.autocomplete-loading {
  padding: 24px;
  text-align: center;
  color: #666;
}

.autocomplete-loading i {
  margin-right: 8px;
  color: #6B8E23;
}

/* No Results */
.autocomplete-no-results {
  padding: 32px 24px;
  text-align: center;
  color: #999;
}

.autocomplete-no-results i {
  font-size: 32px;
  margin-bottom: 12px;
  color: #ddd;
}

.autocomplete-no-results p {
  margin: 0;
  font-size: 14px;
}

/* Error State */
.autocomplete-error {
  padding: 24px;
  text-align: center;
  color: #dc3545;
}

.autocomplete-error i {
  margin-right: 8px;
}

/* Scrollbar Styling */
.search-autocomplete-results::-webkit-scrollbar {
  width: 6px;
}

.search-autocomplete-results::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.search-autocomplete-results::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

.search-autocomplete-results::-webkit-scrollbar-thumb:hover {
  background: #999;
}

@media (max-width: 992px) {
  .search-container {
    display: none; /* Hide on mobile for now or move to menu */
  }
}
