/* Compact catalogue search with scoped refinements and a fixed search field. */
.storefront-search-workspace {
  max-height: var(--store-search-workspace-height, calc(100dvh - var(--store-search-workspace-top, 0px)));
}

.storefront-search-workspace-bar {
  grid-template-columns: minmax(0, 1040px) auto;
  gap: 12px 18px;
  padding: 18px max(20px, calc((100vw - 1200px) / 2)) 12px;
}

.storefront-search-workspace-form { min-width: 0; }
.storefront-search-workspace-form > input { font-size: 1rem; font-weight: 500; }
.storefront-search-workspace-form > input:focus-visible {
  outline: 2px solid var(--store-brand-primary, #6b5bd6);
  outline-offset: 2px;
}

.storefront-search-hint {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--store-search-overlay-muted);
  font-size: .78rem;
  line-height: 1.5;
}

.storefront-search-workspace-results {
  width: min(calc(100% - 40px), 1200px);
  padding: 0 8px 24px 0;
  scroll-padding-block: 12px;
}

.storefront-search-tools { display: grid; gap: 12px; padding: 18px 0 8px; }
.storefront-search-tools:empty, .storefront-search-tools[hidden] { display: none; }
.storefront-search-summary { margin: 0; color: var(--store-search-overlay-text); font-size: .86rem; line-height: 1.5; }
.storefront-search-summary strong { font-weight: 600; }
.storefront-search-refinements, .storefront-search-suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.storefront-search-refinement-group { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-width: 0; }
.storefront-search-refinement-group > span, .storefront-search-refinement-label {
  color: var(--store-search-overlay-muted); font-size: .74rem; font-weight: 500;
}

.storefront-search-chip, .storefront-search-suggestion, .storefront-search-clear, .storefront-search-help {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 0; min-height: 36px; max-width: 100%; padding: 7px 12px;
  border: 1px solid var(--store-search-overlay-line); border-radius: 6px;
  color: var(--store-search-overlay-text); background: var(--store-search-overlay-card);
  font: inherit; font-size: .78rem; line-height: 1.35; font-weight: 500;
  white-space: normal; text-align: left; cursor: pointer; text-decoration: none;
}
.storefront-search-chip img { width: 28px; height: 22px; padding: 2px; object-fit: contain; background: #fff; border-radius: 3px; }
.storefront-search-chip[aria-pressed="true"] {
  border-color: var(--store-brand-primary, #6b5bd6);
  background: color-mix(in srgb, var(--store-brand-primary, #6b5bd6) 15%, var(--store-search-overlay-card));
}
.storefront-search-chip[aria-pressed="true"]::before { content: "\2713"; font-weight: 600; }
.storefront-search-help {
  border-color: var(--store-brand-primary, #6b5bd6);
  color: var(--store-search-overlay-text);
  background: color-mix(in srgb, var(--store-brand-primary, #6b5bd6) 12%, var(--store-search-overlay-card));
}
.storefront-search-clear { border-color: transparent; color: var(--store-search-overlay-muted); background: transparent; }
.storefront-search-tools button:focus-visible, .storefront-search-workspace-results a:focus-visible {
  outline: 2px solid var(--store-brand-primary, #6b5bd6); outline-offset: 2px;
}

.storefront-search-workspace-results .storefront-nav-search-list { gap: 20px; padding: 12px 0 24px; }
.storefront-search-workspace-results .storefront-nav-search-group { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.storefront-search-workspace-results .storefront-nav-search-group-head { justify-content: space-between; gap: 12px; padding: 0; }
.storefront-search-workspace-results .storefront-nav-search-group-head span { font-size: .78rem; letter-spacing: .03em; text-transform: none; }

.storefront-search-workspace-results .storefront-nav-search-item {
  grid-template-columns: 68px minmax(0, 1fr) auto;
  grid-template-rows: auto;
  align-items: center; align-content: center; justify-items: stretch;
  gap: 16px; min-height: 94px; padding: 12px 16px;
  text-align: left; box-shadow: none;
}
.storefront-search-workspace-results .storefront-nav-search-item:focus-visible,
.storefront-search-workspace-results .storefront-nav-search-item.is-active {
  outline: 2px solid var(--store-brand-primary, #6b5bd6); outline-offset: -2px;
}
.storefront-search-workspace-results .storefront-nav-search-thumb {
  width: 68px; height: 64px; padding: 5px; border-radius: 5px;
}
.storefront-search-workspace-results .storefront-nav-search-thumb img { width: 100%; height: 100%; max-width: 58px; max-height: 54px; object-fit: contain; }
.storefront-search-workspace-results .storefront-nav-search-copy { display: grid; gap: 5px; align-content: center; justify-items: start; min-width: 0; width: 100%; text-align: left; }
.storefront-search-workspace-results .storefront-nav-search-copy strong {
  min-height: 0; font-size: .91rem; line-height: 1.4; font-weight: 600; overflow-wrap: anywhere;
}
.storefront-search-workspace-results .storefront-nav-search-copy span {
  min-height: 0; font-size: .77rem; line-height: 1.4; text-align: left; overflow-wrap: anywhere;
}
.storefront-nav-search-meta { color: var(--store-search-overlay-muted); }
.storefront-search-workspace-results .storefront-nav-search-price {
  display: grid; grid-column: 3; grid-row: 1; align-self: center; justify-self: end; gap: 6px;
  max-width: 170px; color: var(--store-search-overlay-price); font-size: .9rem; text-align: right; white-space: nowrap;
}
.storefront-search-workspace-results .storefront-nav-search-copy .storefront-nav-search-stock { font-size: .7rem; line-height: 1.3; color: var(--store-search-overlay-muted); font-weight: 500; white-space: normal; }
.storefront-search-workspace-results .storefront-nav-search-copy .storefront-nav-search-stock.is-in-stock { color: #15803d; }
html[data-storefront-appearance="dark"] .storefront-search-workspace-results .storefront-nav-search-copy .storefront-nav-search-stock.is-in-stock { color: #86efac; }
.storefront-search-workspace-results mark { border-radius: 2px; padding: 0; color: inherit; background: color-mix(in srgb, var(--store-brand-primary, #6b5bd6) 24%, transparent); }
.storefront-nav-search-group--similar .storefront-nav-search-item { border-style: dashed; }

.storefront-search-workspace-results .storefront-nav-search-empty { padding: 20px 4px; font-size: .9rem; line-height: 1.6; }
.storefront-search-workspace-results .storefront-nav-search-skeleton { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 0; }
.storefront-search-workspace-results .storefront-nav-search-skeleton span { grid-template-columns: 68px minmax(0, 1fr); align-items: center; gap: 16px; min-height: 88px; padding: 12px; border: 1px solid var(--store-search-overlay-line); border-radius: 4px; }
.storefront-search-workspace-results .storefront-nav-search-skeleton span::before { width: 68px; height: 62px; aspect-ratio: auto; }
.storefront-search-workspace-results .storefront-nav-search-skeleton span::after { width: min(76%, 480px); height: 38px; margin: 0; }

@media (max-width: 760px) {
  .storefront-search-workspace-bar { grid-template-columns: minmax(0, 1fr) 42px; gap: 8px; padding: 12px; }
  .storefront-search-workspace-form { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .storefront-search-workspace-form > input { height: 44px; min-height: 44px; padding-inline: 12px; font-size: 1rem; }
  .storefront-search-workspace-form > button { min-height: 34px; height: 34px; padding: 4px 10px; font-size: .72rem; }
  .storefront-search-workspace-close { grid-template-columns: 1fr; order: 0; align-self: start; justify-self: end; width: 42px; min-width: 42px; min-height: 44px; height: 44px; padding: 0; }
  .storefront-search-workspace-close span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .storefront-search-hint { font-size: .73rem; }
  .storefront-search-workspace-results { width: calc(100% - 24px); padding-right: 2px; }
  .storefront-search-tools { padding-top: 12px; gap: 10px; }
  .storefront-search-chip, .storefront-search-suggestion, .storefront-search-clear, .storefront-search-help { min-height: 40px; padding: 8px 10px; font-size: .74rem; }
  .storefront-search-workspace-results .storefront-nav-search-list { gap: 16px; }
  .storefront-search-workspace-results .storefront-nav-search-item { grid-template-columns: 52px minmax(0, 1fr) auto; min-height: 96px; gap: 10px; padding: 10px; }
  .storefront-search-workspace-results .storefront-nav-search-thumb { width: 52px; height: 54px; padding: 4px; }
  .storefront-search-workspace-results .storefront-nav-search-thumb img { max-width: 46px; max-height: 46px; }
  .storefront-search-workspace-results .storefront-nav-search-copy strong { font-size: .8rem; -webkit-line-clamp: 3; }
  .storefront-search-workspace-results .storefront-nav-search-copy span { font-size: .69rem; -webkit-line-clamp: 2; }
  .storefront-search-workspace-results .storefront-nav-search-price { max-width: 95px; font-size: .79rem; }
  .storefront-nav-search-stock { font-size: .65rem; }
}
@media (prefers-reduced-motion: reduce) { .storefront-search-workspace { transition: none; } }

.storefront-search-similar-note { margin: 0 0 4px; color: var(--store-search-overlay-muted); font-size: .78rem; line-height: 1.5; }
.storefront-search-workspace-results .storefront-nav-search-copy .storefront-nav-search-exact {
  display: inline-block; width: auto; padding: 2px 7px; border-radius: 4px;
  color: var(--store-search-overlay-text); background: color-mix(in srgb, var(--store-brand-primary, #6b5bd6) 16%, transparent);
  font-size: .65rem; font-weight: 600; letter-spacing: .02em;
}
