.scharrsearch-trigger-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.scharrsearch-trigger-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  transform: translateY(-50%);
  pointer-events: none;
}

.scharrsearch-trigger {
  padding-left: 52px !important;
  padding-right: 20px !important;
}

.scharrsearch-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
}

.scharrsearch-overlay[hidden] {
  display: none !important;
}

.scharrsearch-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.scharrsearch-overlay-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 1680px);
  min-height: 780px;
  height: auto;
  max-height: calc(100dvh - 24px);
  margin: 0 auto;
  padding: 32px 48px 48px;
  background: #fff;
  overflow-y: auto;
  overflow-x: visible;
}

.scharrsearch-overlay-form {
  display: flex;
  flex-direction: column;
  height: auto;
}

.scharrsearch-field {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  border-bottom: 2px solid var(--scharr-green);
}

.scharrsearch-field-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #4b5563;
  flex: 0 0 auto;
}

.scharrsearch-overlay-input {
  width: 100%;
  height: 56px;
  padding: 0 52px 0 16px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.scharrsearch-overlay-input::placeholder {
  color: #6b7280;
}

.scharrsearch-field-close {
  position: absolute;
  top: 50%;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.scharrsearch-overlay-dynamic-content {
  flex: 1 1 auto;
  min-height: 0;
  min-height: 320px;
  padding-top: 24px;
  overflow-y: visible;
  overflow-x: visible;
  max-height: none;
  transition: opacity 0.2s ease;
}

#search-overlay-dynamic-content.htmx-swapping,
#search-overlay-dynamic-content.htmx-settling {
  opacity: 0.72;
}

.scharrsearch-discovery {
  display: grid;
  gap: 28px;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow-y: visible;
}

.scharrsearch-recent {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
}

.scharrsearch-recent-head,
.scharrsearch-live-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.scharrsearch-section-title {
  margin: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
}

.scharrsearch-recent-clear {
  border: 0;
  background: transparent;
  color: #475467;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.scharrsearch-recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 0;
  height: auto;
  padding: 0;
  margin-top: 8px;
}

.scharrsearch-recent-empty {
  margin: 0;
  padding: 0;
  line-height: 1.4;
  color: #667085;
  font-size: 14px;
}

.scharrsearch-recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid #aaa;
  border-radius: 999px;
  background: #fff;
}

.scharrsearch-recent-chip-label,
.scharrsearch-recent-chip-remove {
  border: 0;
  background: transparent;
  padding: 0;
  color: #111827;
  cursor: pointer;
}

.scharrsearch-recent-chip-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 500;
}

.scharrsearch-recent-chip-remove {
  color: #667085;
  font-size: 16px;
  line-height: 1;
}

.scharrsearch-discovery-grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  margin-top: 0;
  min-height: 0;
}

.scharrsearch-discovery-sidebar {
  min-width: 0;
}

.scharrsearch-popular-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.scharrsearch-popular-link {
  border: 0;
  background: transparent;
  padding: 4px 0;
  color: #111827;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.scharrsearch-popular-link:hover,
.scharrsearch-popular-link:focus-visible {
  color: var(--scharr-green);
  outline: none;
}

.scharrsearch-discovery-main {
  min-width: 0;
}

.scharrsearch-discovery-section-title,
.scharrsearch-live-header,
.scharrsearch-highlights-title {
  margin-bottom: 16px;
  position: relative;
  z-index: 2;
}

.scharrsearch-highlight-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
  overflow: visible;
}

.scharrsearch-product-card,
.scharrsearch-highlight-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  width: auto;
  min-width: 0;
  min-height: 340px;
  max-height: none;
  height: auto;
  box-sizing: border-box;
  padding: 12px;
  border: 1px solid #ddd;
  background: #fff;
}

.scharrsearch-highlight-media {
  color: inherit;
  text-decoration: none;
}

.scharrsearch-highlight-image-wrap,
.scharrsearch-product-image-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 180px;
  max-height: 180px;
  overflow: visible;
  padding: 10px;
  box-sizing: border-box;
}

.scharrsearch-highlight-image-wrap picture,
.scharrsearch-product-image-wrap picture,
.scharrsearch-highlight-image-wrap img,
.scharrsearch-product-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.scharrsearch-highlight-image {
  width: auto;
  height: auto;
  object-fit: contain;
}

.scharrsearch-highlight-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0 0;
  min-width: 0;
}

.scharrsearch-highlight-brand {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.scharrsearch-highlight-title {
  color: #111827;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scharrsearch-highlight-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scharrsearch-highlight-price {
  margin-top: auto;
  font-size: 16px;
  font-weight: 700;
  color: #111827;
}

.scharrsearch-highlight-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  background: #eef7ee;
  color: #25663a;
  font-size: 12px;
  font-weight: 700;
}

.scharrsearch-live-results {
  display: grid;
  gap: 18px;
}

.scharrsearch-live-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.scharrsearch-live-all-link {
  color: var(--scharr-green);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.scharrsearch-live-all-link:hover,
.scharrsearch-live-all-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.scharrsearch-live-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.scharrsearch-product-card {
  color: #111827;
  text-decoration: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.scharrsearch-product-card:hover,
.scharrsearch-product-card:focus-visible,
.scharrsearch-product-card.is-active {
  border-color: #999;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
  outline: none;
}

.scharrsearch-product-image-wrap img {
  width: auto;
  height: auto;
  object-fit: contain;
}

.scharrsearch-product-brand {
  margin-bottom: 6px;
  color: #111827;
  font-size: 13px;
  font-weight: 700;
}

.scharrsearch-product-title {
  color: #111827;
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scharrsearch-suggest-highlight,
.scharrsearch-product-title mark {
  padding: 0;
  background: #e6f0ff;
  color: inherit;
  font-weight: 700;
}

.scharrsearch-product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
}

.scharrsearch-product-price {
  margin-top: auto;
  color: #111827;
  font-size: 16px;
  font-weight: 700;
}

.scharrsearch-product-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  background: #eef7ee;
  color: #25663a;
  font-size: 12px;
  font-weight: 700;
}

.scharrsearch-empty-state {
  padding: 8px 0 0;
  color: #667085;
  font-size: 15px;
}

.scharrsearch-overlay .scharr-office-supply-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
  padding: 14px 16px;
  border: 1px solid #d8dde3;
  border-left: 4px solid var(--scharr-green);
  border-radius: 8px;
  background: #f8faf7;
  color: #111827;
}

.scharrsearch-overlay .scharr-office-supply-hint__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.scharrsearch-overlay .scharr-office-supply-hint__title {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}

.scharrsearch-overlay .scharr-office-supply-hint__text {
  margin: 0;
  color: #475467;
  font-size: 14px;
  line-height: 1.45;
}

.scharrsearch-overlay .scharr-office-supply-hint__inline-link {
  color: #1f3a14;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.scharrsearch-overlay .scharr-office-supply-hint__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 6px;
  background: var(--scharr-green);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.scharrsearch-overlay .scharr-office-supply-hint__button:hover {
  background: #1f3a14;
}

body.search-overlay-open {
  overflow: hidden;
}

@media (max-width: 1024px) {
  .scharrsearch-overlay-panel {
    min-height: 680px;
    height: auto;
    max-height: calc(100dvh - 16px);
    padding: 24px 24px 32px;
  }

  .scharrsearch-overlay-input {
    font-size: 22px;
  }

  .scharrsearch-discovery-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .scharrsearch-live-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .scharrsearch-highlight-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .scharrsearch-trigger-wrap-mobile .scharrsearch-trigger {
    min-height: 48px;
    font-size: 16px;
  }

  .scharrsearch-overlay-panel {
    width: 100%;
    min-height: 680px;
    height: auto;
    max-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px 24px;
  }

  .scharrsearch-overlay-form {
    min-height: 0;
  }

  .scharrsearch-overlay-input {
    font-size: 18px;
  }

  .scharrsearch-overlay-dynamic-content {
    padding-top: 20px;
  }

  .scharrsearch-overlay .scharr-office-supply-hint {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
  }

  .scharrsearch-overlay .scharr-office-supply-hint__button {
    width: 100%;
  }

  .scharrsearch-live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scharrsearch-highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scharrsearch-highlight-media {
    height: 160px;
  }
}

@media (max-width: 560px) {
  .scharrsearch-highlight-grid,
  .scharrsearch-live-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
