/* Premium live search suggestions */
.site-search-form {
  position: relative;
  z-index: 1260;
}

/* Mobile search stability: suggestions must overlay, not resize or nudge the header. */
@media (max-width: 900px) {
  .mobile-search-row {
    height: 76px !important;
    max-height: 0 !important;
    padding: 0 16px !important;
    overflow: hidden !important;
    transform: translateY(-8px);
  }

  .mobile-search-row.is-open,
  body.mobile-search-open .mobile-search-row.is-open {
    height: 76px !important;
    max-height: 76px !important;
    padding-top: 10px !important;
    padding-bottom: 12px !important;
    overflow: visible !important;
    transform: translateY(0) !important;
  }

  .mobile-search-box,
  .mobile-search-box.site-search-form,
  .mobile-search-box.site-search-form.has-suggestions,
  .mobile-search-box:focus-within {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    transform: none !important;
    transition: background .18s ease, border-color .18s ease, box-shadow .18s ease !important;
  }

  .mobile-search-box .search-suggest-panel {
    position: absolute !important;
    top: calc(100% + 8px) !important;
    display: none;
  }

  .mobile-search-box.has-suggestions .search-suggest-panel,
  .mobile-search-box.site-search-form.has-suggestions .search-suggest-panel {
    display: grid !important;
  }
}

.search-box.site-search-form.has-suggestions,
.mobile-search-box.site-search-form.has-suggestions {
  overflow: visible;
  z-index: 1286;
}

.search-suggest-overlay {
  position: fixed;
  inset: 0;
  z-index: 1180;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}

body.search-suggestions-open .search-suggest-overlay {
  opacity: 1;
  pointer-events: none;
}

body.search-suggestions-open {
  overflow: visible;
}

.search-cat {
  position: relative;
  min-width: 178px;
}

.search-cat select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.search-cat-fallback {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.search-suggest-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  max-width: min(860px, 78vw);
  margin: 0 auto;
  z-index: 1285;
  display: none;
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 20px 48px rgba(5, 14, 26, .18);
  user-select: text;
}

.site-search-form.has-suggestions .search-suggest-panel {
  display: grid;
  gap: 10px;
}

.search-suggest-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 2px 0;
}

.search-suggest-head,
.search-suggest-empty {
  padding: 6px 8px;
  color: #607491;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.search-suggest-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(8, 23, 43, .06);
  color: #42556f;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.search-suggest-results {
  display: grid;
  gap: 8px;
  max-height: min(52vh, 440px);
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(82, 99, 124, .0) transparent;
}

.search-suggest-results:hover {
  scrollbar-color: rgba(82, 99, 124, .38) transparent;
}

.search-suggest-results::-webkit-scrollbar {
  width: 10px;
}

.search-suggest-results::-webkit-scrollbar-track {
  background: transparent;
}

.search-suggest-results::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
  background: rgba(82, 99, 124, 0);
}

.search-suggest-results:hover::-webkit-scrollbar-thumb {
  background: rgba(82, 99, 124, .34);
}

.search-suggest-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) minmax(116px, 144px);
  gap: 12px;
  align-items: start;
  min-height: 70px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #071421;
  text-decoration: none;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
  min-width: 0;
  user-select: text;
}

.search-suggest-item:hover,
.search-suggest-item.is-active {
  transform: translateY(-1px);
  border-color: rgba(232, 103, 14, .26);
  background: linear-gradient(135deg, #fffaf6 0%, #f7fbff 100%);
  box-shadow: 0 10px 24px rgba(5, 14, 26, .06);
}

.search-suggest-item img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #eef4fb;
}

.search-suggest-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.search-suggest-brand {
  color: #e8670e;
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.search-suggest-name {
  overflow: hidden;
  color: #071421;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.search-suggest-meta {
  color: #607491;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.3;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.search-suggest-price {
  color: #071421;
  font-size: 12px;
  font-weight: 900;
  white-space: normal;
  max-width: none;
  text-align: right;
  align-self: center;
  justify-self: end;
  line-height: 1.3;
  padding-left: 8px;
}

.search-suggest-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 4px;
  padding: 14px 16px;
  border: 1px solid rgba(232, 103, 14, .22);
  border-radius: 16px;
  background: linear-gradient(135deg, #fff8f2 0%, #f7fbff 100%);
  color: #071421;
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.search-suggest-all:hover {
  transform: translateY(-1px);
  border-color: rgba(232, 103, 14, .45);
  box-shadow: 0 14px 30px rgba(232, 103, 14, .12);
}

.search-suggest-all .search-suggest-name,
.search-suggest-all .search-suggest-meta {
  white-space: normal;
}

.search-suggest-all-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #071421;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

@media (max-width: 900px) {
  body.mobile-search-open .mobile-search-row.is-open {
    overflow: visible !important;
    z-index: 1300 !important;
  }

  body.mobile-nav-open .mobile-search-row {
    max-height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .mobile-search-box.site-search-form {
    position: relative;
  }

  .mobile-search-box .search-suggest-panel {
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: min(62vh, 420px);
    z-index: 1500;
    border-radius: 18px;
    box-shadow: 0 24px 48px rgba(5, 14, 26, .38);
  }

  .mobile-search-box .search-suggest-results {
    max-height: min(52vh, 360px);
  }

  .search-suggest-item {
    grid-template-columns: 52px minmax(0, 1fr);
    min-height: 68px;
  }

  .search-suggest-item img {
    width: 52px;
    height: 52px;
  }

  .search-suggest-price {
    grid-column: 2;
    justify-self: start;
    margin-top: 0;
    color: #e8670e;
    max-width: 100%;
    text-align: left;
    white-space: normal;
  }

  .search-suggest-all {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .search-suggest-all-action {
    width: 100%;
  }
}
