/* nopShop SmartSearch storefront suggestions. One markup structure, section order via CSS only. */
.smart-search-panel {
  --ss-bg: #fff;
  --ss-fg: #333;
  --ss-muted: #6b6b6b;
  --ss-line: #e3e3e3;
  --ss-hover: #eee;
  --ss-accent: #c00;
  --ss-in: #2e7d32;
  --ss-order: #b26a00;
  --ss-gap: 10px;
  --ss-radius: 3px;
  --ss-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  --ss-z: 1080;
  --ss-touch: 44px;
  --ss-top: 0px;
  --ss-left: 0px;
  --ss-width: 100%;
  --ss-available: 60vh;

  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-height: var(--ss-available);
  border: 1px solid var(--ss-line);
  border-radius: var(--ss-radius);
  background: var(--ss-bg);
  box-shadow: var(--ss-shadow);
  color: var(--ss-fg);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
  text-align: start;
}

.smart-search-panel[hidden] {
  display: none;
}

.smart-search-list {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.smart-search-group[hidden] {
  display: none;
}

.smart-search-title {
  padding: 6px var(--ss-gap) 2px;
  color: var(--ss-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.smart-search-option {
  display: flex;
  align-items: center;
  gap: var(--ss-gap);
  padding: 6px var(--ss-gap);
  color: inherit;
  text-decoration: none;
}

.smart-search-option:hover {
  background: var(--ss-hover);
}

.smart-search-option--active {
  background: var(--ss-hover);
  outline: 2px solid var(--ss-accent);
  outline-offset: -2px;
}

.smart-search-option mark {
  background: none;
  color: var(--ss-accent);
  font-weight: 700;
}

.smart-search-thumb {
  flex: none;
  object-fit: contain;
}

.smart-search-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.smart-search-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.smart-search-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ss-muted);
}

.smart-search-price {
  color: var(--ss-fg);
  font-weight: 700;
}

.smart-search-old {
  margin-inline-start: 4px;
  color: var(--ss-muted);
  font-weight: 400;
  text-decoration: line-through;
}

.smart-search-avail {
  /* Own third row (name / SKU + price / availability); relies on .smart-search-meta's flex-wrap. */
  flex-basis: 100%;
}

.smart-search-avail--in {
  color: var(--ss-in);
}

.smart-search-avail--order {
  color: var(--ss-order);
}

.smart-search-group--categories .smart-search-items,
.smart-search-group--manufacturers .smart-search-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 var(--ss-gap) 6px;
}

.smart-search-chip {
  border: 1px solid var(--ss-line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}

.smart-search-status:empty {
  display: none;
}

.smart-search-status {
  padding: var(--ss-gap);
  color: var(--ss-muted);
}

.smart-search-all {
  position: sticky;
  bottom: 0;
  min-height: var(--ss-touch);
  box-sizing: border-box;
  flex: none;
  border-top: 1px solid var(--ss-line);
  padding: var(--ss-gap);
  background: var(--ss-bg);
  color: var(--ss-fg);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.smart-search-all:hover {
  background: var(--ss-hover);
}

.smart-search-all:focus-visible,
.smart-search-close:focus-visible {
  outline: 2px solid var(--ss-accent);
  outline-offset: -2px;
}

.smart-search-all[hidden] {
  display: none;
}

.smart-search-close {
  order: -1;
  align-self: flex-end;
  flex: none;
  width: var(--ss-touch);
  height: var(--ss-touch);
  border: 0;
  background: none;
  color: var(--ss-muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

/* Mobile first: a full width overlay under the live input position, with its own scrolling. */
.smart-search-panel {
  position: fixed;
  top: var(--ss-top);
  left: 0;
  right: 0;
  z-index: var(--ss-z);
  border-left: 0;
  border-right: 0;
  border-radius: 0;
}

.smart-search-group--products {
  order: 1;
}

.smart-search-group--categories {
  order: 2;
}

.smart-search-group--manufacturers {
  order: 3;
}

.smart-search-option {
  min-height: var(--ss-touch);
}

.smart-search-chip {
  display: inline-flex;
  align-items: center;
  min-height: var(--ss-touch);
}

.smart-search-form {
  position: relative;
}

.smart-search-marker {
  display: none;
}

.smart-search-host {
  position: absolute;
  top: 0;
  left: 0;
}

@media (min-width: 769px) {
  /* Anchored dropdown; taxonomy first, products below. */
  .smart-search-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    width: 100%;
    border-left: 1px solid var(--ss-line);
    border-right: 1px solid var(--ss-line);
    border-radius: var(--ss-radius);
  }

  .smart-search-panel--hosted {
    position: fixed;
    top: var(--ss-top);
    left: var(--ss-left);
    width: var(--ss-width);
  }

  .smart-search-group--categories {
    order: 1;
  }

  .smart-search-group--manufacturers {
    order: 2;
  }

  .smart-search-group--products {
    order: 3;
  }

  .smart-search-option,
  .smart-search-chip {
    min-height: 0;
  }

  .smart-search-close {
    display: none;
  }
}
