/**
 * Catalog Toolbar Fixes
 *
 * This file contains important overrides to fix styling issues
 * with the search bar and filter dropdowns.
 */

/* Force correct search input styling */
#store-search-input,
.store-search input[type="search"],
.store-search input {
  width: 100% !important;
  padding: 0.75rem 1rem 0.75rem 2.75rem !important;
  font-size: 0.875rem !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  background: #fff !important;
  background-color: #fff !important;
  color: #111827 !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%236b7280" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>') !important;
  background-repeat: no-repeat !important;
  background-position: 0.75rem center !important;
  background-size: 20px 20px !important;
}

#store-search-input:focus,
.store-search input[type="search"]:focus,
.store-search input:focus {
  outline: none !important;
  border-color: #111827 !important;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1) !important;
  background: #fff !important;
  background-color: #fff !important;
}

#store-search-input::placeholder,
.store-search input[type="search"]::placeholder,
.store-search input::placeholder {
  color: #9ca3af !important;
  opacity: 1 !important;
}

/* Force correct dropdown styling */
#store-category-filter,
#store-sort,
.store-filters select {
  padding: 0.75rem 2.5rem 0.75rem 1rem !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  background: #fff !important;
  background-color: #fff !important;
  color: #111827 !important;
  cursor: pointer !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%23111827" stroke-width="2"><path d="m6 9 6 6 6-6"/></svg>') !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 20px 20px !important;
  min-width: 180px !important;
}

#store-category-filter:hover,
#store-sort:hover,
.store-filters select:hover {
  border-color: #9ca3af !important;
  background-color: #f9fafb !important;
}

#store-category-filter:focus,
#store-sort:focus,
.store-filters select:focus {
  outline: none !important;
  border-color: #111827 !important;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1) !important;
  background-color: #fff !important;
}

/* Ensure toolbar layout is correct */
.store-toolbar {
  display: flex !important;
  gap: 1rem !important;
  margin-bottom: 2rem !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  background: transparent !important;
  padding: 0 !important;
}

.store-search {
  flex: 1 !important;
  min-width: 250px !important;
  background: transparent !important;
}

.store-filters {
  display: flex !important;
  gap: 0.75rem !important;
  background: transparent !important;
}

/* Remove any dark backgrounds */
.store-toolbar,
.store-search,
.store-filters,
.store-toolbar *,
.store-search *,
.store-filters * {
  background-color: transparent;
}

/* Re-apply correct backgrounds to inputs */
#store-search-input,
.store-search input[type="search"],
.store-search input,
#store-category-filter,
#store-sort,
.store-filters select {
  background-color: #fff !important;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .store-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .store-filters {
    width: 100% !important;
    flex-direction: column !important;
  }

  .store-filters select,
  #store-category-filter,
  #store-sort {
    width: 100% !important;
  }
}

/* Remove any inherited dark theme styles */
.store-page .store-toolbar,
.store-catalog-page .store-toolbar {
  background: transparent !important;
}

.store-page .store-search input,
.store-catalog-page .store-search input {
  background: #fff !important;
  background-color: #fff !important;
}

.store-page .store-filters select,
.store-catalog-page .store-filters select {
  background: #fff !important;
  background-color: #fff !important;
}
