.header-search-trigger {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #253047;
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s;
}

.header-search-trigger:hover {
  color: var(--blue);
  background: var(--pale);
  transform: translateY(-1px);
}

.header-search-trigger svg {
  width: 24px;
  height: 24px;
}

.site-header.smart-search-open .nav-main,
.site-header.smart-search-open .mobile-head {
  display: none !important;
}

.smart-search-shell {
  position: relative;
  min-height: 78px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.98);
}

.smart-search-shell[hidden] {
  display: none;
}

.smart-search-form {
  position: relative;
  width: min(960px, calc(100% - 40px));
  height: 46px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  border: 1px solid #cfd8e6;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(0, 82, 255, 0.08);
}

.smart-search-icon {
  position: absolute;
  left: 16px;
  width: 20px;
  height: 20px;
  color: #64748b;
  pointer-events: none;
}

.smart-search-form input {
  width: 100%;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0 105px 0 49px;
  background: transparent;
  color: #111827;
  font-size: 0.84rem;
  font-weight: 600;
}

.smart-search-form input::placeholder {
  color: #8793a7;
  font-weight: 500;
}

.smart-search-form input::-webkit-search-cancel-button {
  display: none;
}

.smart-search-form kbd {
  position: absolute;
  right: 57px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid #d7deea;
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #f8fafc;
  color: #718096;
  font:
    700 0.66rem "Plus Jakarta Sans",
    sans-serif;
}

.smart-search-close {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  font-size: 1.45rem;
  line-height: 1;
}

.smart-search-close:hover {
  background: #eef2f7;
  color: #111827;
}

.smart-search-dropdown {
  position: absolute;
  z-index: 90;
  top: calc(100% - 5px);
  left: 50%;
  width: min(960px, calc(100% - 88px));
  max-height: min(610px, calc(100vh - 145px));
  overflow-y: auto;
  transform: translateX(-50%);
  border: 1px solid #dce4ef;
  border-radius: 0 0 18px 18px;
  background: #fff;
  box-shadow: 0 28px 65px rgba(15, 23, 42, 0.18);
  scrollbar-width: thin;
  scrollbar-color: #b7c4d7 transparent;
}

.smart-search-dropdown::-webkit-scrollbar {
  width: 5px;
}

.smart-search-dropdown::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: #b7c4d7;
}

.smart-search-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 15px 18px 10px;
}

.smart-search-summary strong {
  font:
    700 0.76rem "Space Grotesk",
    sans-serif;
}

.smart-search-summary span {
  color: #8290a5;
  font-size: 0.62rem;
  font-weight: 700;
}

.smart-search-list {
  display: grid;
  padding: 2px 8px 8px;
}

.smart-search-result {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 74px;
  padding: 8px 10px;
  border-radius: 12px;
  color: #182033;
  text-decoration: none;
  outline: 0;
}

.smart-search-result:hover,
.smart-search-result.active {
  background: #eef4ff;
}

.smart-search-result img {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  background: #f2f5f9;
}

.smart-result-copy {
  min-width: 0;
}

.smart-result-copy strong,
.smart-result-copy small {
  display: block;
}

.smart-result-copy strong {
  overflow: hidden;
  color: #172033;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-result-copy small {
  margin-top: 5px;
  overflow: hidden;
  color: #758298;
  font-size: 0.59rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-result-copy mark {
  border-radius: 3px;
  background: #dce8ff;
  color: #0048df;
}

.smart-result-price {
  color: #172033;
  font:
    700 0.72rem "Space Grotesk",
    sans-serif;
  white-space: nowrap;
}

.smart-search-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0 8px 8px;
  padding: 12px;
  border-radius: 11px;
  background: #f5f8fc;
  color: var(--blue);
  text-decoration: none;
  font-size: 0.66rem;
  font-weight: 800;
}

.smart-search-all:hover {
  background: #eaf1ff;
}

.smart-search-empty {
  padding: 44px 22px;
  text-align: center;
}

.smart-search-empty svg {
  width: 34px;
  color: #a2aec0;
}

.smart-search-empty strong,
.smart-search-empty span {
  display: block;
}

.smart-search-empty strong {
  margin: 11px 0 6px;
  font:
    700 0.82rem "Space Grotesk",
    sans-serif;
}

.smart-search-empty span {
  color: #7b879a;
  font-size: 0.64rem;
}

@media (max-width: 700px) {
  .smart-search-shell {
    min-height: 62px;
    padding: 8px 10px;
  }

  .smart-search-form {
    width: 100%;
    height: 46px;
    box-shadow: none;
  }

  .smart-search-form input {
    padding-right: 52px;
    font-size: 0.76rem;
  }

  .smart-search-form kbd {
    display: none;
  }

  .smart-search-dropdown {
    top: 100%;
    width: 100%;
    max-height: calc(100vh - 128px);
    border-right: 0;
    border-left: 0;
    border-radius: 0 0 16px 16px;
  }

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

  .smart-search-result img {
    width: 52px;
    height: 52px;
  }

  .smart-result-copy strong {
    font-size: 0.68rem;
  }

  .smart-result-price {
    font-size: 0.66rem;
  }
}

/* A 16px field prevents the iOS focus-zoom jump. */
@media (max-width: 1024px), (pointer: coarse) {
  .smart-search-form input {
    font-size: 16px !important;
  }
}
