/* Utility */
.d-none {
  display: none !important;
}

/* Layout */
.offsearch-wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.offsearch-input-block {
  max-width: 600px;
  margin: 0 auto;
}

/* Search input */
.offsearch-search-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.offsearch-input-wrapper {
  position: relative;
}

.offsearch-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
  z-index: 1;
}

.offsearch-input {
  width: 100%;
  padding: 15px 16px 15px 48px !important;
  box-sizing: border-box;
}

.offsearch-input:focus {
  outline: none;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.25);
}

/* Autocomplete dropdown */
.offsearch-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1050;
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #fff;
  border: 1px solid #cacaca;
  border-top: 0;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: none;
  padding: 0;
  margin: 0;
}

.offsearch-autocomplete.show {
  display: block;
}

.offsearch-autocomplete .offsearch-ac-item {
  display: block;
  padding: 10px 16px;
  color: #333;
  text-decoration: none;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offsearch-autocomplete .offsearch-ac-item:last-child {
  border-bottom: 0;
}

.offsearch-autocomplete .offsearch-ac-item:hover,
.offsearch-autocomplete .offsearch-ac-item.active {
  background-color: #f0f4ff;
}

/* Bundle filters - shared */
.offsearch-filters-block {
  margin-bottom: 1rem;
}

/* Pills */
.offsearch-filters--pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.offsearch-filter-btn {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  color: #333;
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-radius: 2rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.offsearch-filter-btn:hover {
  background: #e8e8e8;
}

.offsearch-filter-btn.active {
  background: #333;
  color: #fff;
  border-color: #333;
}

/* Dropdown */
.offsearch-filters--dropdown {
  display: block;
}

.offsearch-filter-select {
  width: 100%;
  max-width: 300px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

/* Checkboxes */
.offsearch-filters--checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.offsearch-filter-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: #333;
  cursor: pointer;
}

.offsearch-filter-checkbox input {
  margin: 0;
}

.offsearch-filter-checkbox.active {
  font-weight: 600;
}

/* Reference field toggles */
.offsearch-ref-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.offsearch-ref-toggles:empty {
  display: none;
}

.offsearch-ref-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: #555;
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: background 0.15s, border-color 0.15s;
}

.offsearch-ref-toggle:hover {
  background: #eee;
}

.offsearch-ref-toggle input[type="checkbox"] {
  margin: 0;
}

/* Search results */
.offsearch-result-item {
  padding: 1.25rem;
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: box-shadow 0.15s ease;
}

.offsearch-result-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.offsearch-result-title {
  margin: 0 0 0.5rem;
}

.offsearch-result-title a {
  text-decoration: none;
  color: #1a0dab;
  font-size: 1.15rem;
  font-weight: 600;
}

.offsearch-result-title a:hover {
  text-decoration: underline;
}

.offsearch-result-excerpt {
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 0.25rem;
}

.offsearch-result-url {
  color: #006621;
  font-size: 0.85rem;
}

/* Keyword highlighting */
.offsearch-results mark,
.offsearch-autocomplete mark {
  background-color: #fff3cd;
  padding: 0.1em 0em;
  border-radius: 2px;
}

/* Results count */
.offsearch-results-count {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Loading state */
.offsearch-loading {
  text-align: center;
  padding: 2rem 0;
  color: #666;
}

/* No results */
.offsearch-no-results {
  text-align: center;
  padding: 2rem 0;
  color: #666;
}

/* Responsive */
@media (max-width: 576px) {
  .offsearch-wrapper {
    padding: 1rem 0.75rem;
  }

  .offsearch-autocomplete {
    max-height: 300px;
  }

  .offsearch-result-item {
    padding: 1rem;
  }
}
