/* AsanWP Market — Smart AJAX Search */
.awp-smart-search {
  z-index: 90;
}

.awp-smart-search.is-smart-open {
  background: #fff;
  border-color: #d2d5d9;
  box-shadow: 0 0 0 3px rgba(255,204,0,.12);
}

.awp-smart-search-panel {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  left: 0;
  z-index: 170;
  overflow: hidden;
  min-width: min(680px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 150px));
  border: 1px solid var(--awp-border);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(18,22,30,.16);
  opacity: 0;
  visibility: hidden;
  transform: translateY(7px);
  transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.awp-smart-search-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.awp-smart-search-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid #eff0f2;
  background: #fafafa;
}

.awp-smart-search-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 78px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6f747a;
  font-family: inherit;
  font-size: 9.5px;
  font-weight: 850;
  cursor: pointer;
}

.awp-smart-search-tabs button:hover {
  background: #f0f1f2;
  color: #24282d;
}

.awp-smart-search-tabs button.is-active {
  background: #111318;
  color: #fff;
}

.awp-smart-search-tabs em {
  display: inline-flex;
  min-width: 15px;
  align-items: center;
  justify-content: center;
  color: #a2a6ab;
  font-size: 8px;
  font-style: normal;
}

.awp-smart-search-tabs button.is-active em { color: #c9cbd0; }

.awp-smart-search-body {
  max-height: min(480px, calc(100vh - 250px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.awp-smart-search-idle {
  padding: 17px;
}

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

.awp-smart-search-idle-title {
  display: block;
  margin-bottom: 9px;
  color: #777c82;
  font-size: 9.5px;
  font-weight: 800;
}

.awp-smart-search-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.awp-smart-search-suggestions button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #e7e9eb;
  border-radius: 999px;
  background: #fff;
  color: #555b61;
  font-family: inherit;
  font-size: 9px;
  cursor: pointer;
}

.awp-smart-search-suggestions button:hover {
  border-color: #d4d7da;
  background: #f7f8f8;
  color: #111318;
}

.awp-smart-search-status {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 74px;
  padding: 16px;
  color: #83888e;
  font-size: 10px;
  text-align: center;
}

.awp-smart-search-status.is-visible { display: flex; }

.awp-smart-search-loader {
  width: 17px;
  height: 17px;
  border: 2px solid #e5e7e9;
  border-top-color: #111318;
  border-radius: 50%;
  animation: awp-smart-search-spin .7s linear infinite;
}

@keyframes awp-smart-search-spin {
  to { transform: rotate(360deg); }
}

.awp-smart-result-section + .awp-smart-result-section {
  border-top: 8px solid #f7f7f8;
}

.awp-smart-result-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 0 13px;
  border-bottom: 1px solid #eff0f2;
  background: #fcfcfc;
}

.awp-smart-result-section > header strong {
  color: #5d6268;
  font-size: 9px;
  font-weight: 900;
}

.awp-smart-result-section > header span {
  display: inline-flex;
  min-width: 22px;
  min-height: 20px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #f0f1f2;
  color: #858a90;
  font-size: 8px;
  font-weight: 850;
}

.awp-smart-result {
  display: grid;
  grid-template-columns: 58px minmax(0,1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 70px;
  padding: 9px 12px;
  border-bottom: 1px solid #f0f1f2;
  color: inherit;
  text-decoration: none;
  outline: 0;
}

.awp-smart-result:last-child { border-bottom: 0; }

.awp-smart-result:hover,
.awp-smart-result:focus-visible {
  background: #fafafa;
}

.awp-smart-result:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(255,204,0,.55);
}

.awp-smart-result-thumb {
  display: grid;
  place-items: center;
  width: 58px;
  height: 44px;
  overflow: hidden;
  border-radius: 8px;
  background: #f0f1f2;
  color: #9ca1a7;
  font-size: 10px;
  font-weight: 950;
}

.awp-smart-result-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.awp-smart-result-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.awp-smart-result-copy > strong {
  overflow: hidden;
  color: #30353a;
  font-size: 10.5px;
  font-weight: 850;
  line-height: 1.75;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.awp-smart-result-copy > p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #8a8f95;
  font-size: 8.5px;
  line-height: 1.8;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.awp-smart-result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 16px;
  color: #999ea4;
  font-size: 8px;
}

.awp-smart-result-category {
  color: #877000;
  font-size: inherit;
}

.awp-smart-result-badge {
  display: inline-flex;
  min-height: 17px;
  align-items: center;
  padding: 0 5px;
  border-radius: 5px;
  background: #fff0f0;
  color: #b73535;
  font-size: 7px;
  font-weight: 900;
}

.awp-smart-result-version {
  color: #858a90;
  font-size: 7.5px;
}

.awp-smart-result-price {
  display: block;
  max-width: 150px;
  color: #191c20;
  font-size: 10px;
  font-weight: 900;
  text-align: left;
  white-space: nowrap;
}

.awp-smart-result-price del {
  display: block;
  color: #aaaeb3;
  font-size: 7.5px;
  font-weight: 600;
}

.awp-smart-result-price ins {
  text-decoration: none;
}

.awp-smart-post-result {
  grid-template-columns: 58px minmax(0,1fr);
}

.awp-smart-search-empty {
  padding: 34px 16px;
  color: #858a90;
  font-size: 10px;
  text-align: center;
}

.awp-smart-search-view-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-top: 1px solid #e9ebed;
  background: #fafafa;
  color: #3b4045;
  font-size: 9.5px;
  font-weight: 900;
  text-decoration: none;
}

.awp-smart-search-view-all:hover {
  background: #f4f5f6;
  color: #111318;
}

.awp-smart-search-view-all svg {
  width: 14px;
  height: 14px;
}

.awp-smart-search-view-all[hidden] { display: none; }

.awp-mobile-search-card .awp-smart-search-panel,
.awp-mobile-drawer-search .awp-smart-search-panel {
  min-width: 0;
}

@media (max-width: 980px) {
  .awp-smart-search-panel {
    min-width: 0;
    max-height: min(560px, calc(100vh - 120px));
  }

  .awp-mobile-search-card .awp-smart-search-panel,
  .awp-mobile-drawer-search .awp-smart-search-panel {
    position: static;
    width: 100%;
    margin-top: 8px;
    border-radius: 12px;
    box-shadow: 0 12px 35px rgba(18,22,30,.12);
    transform: none;
  }

  .awp-mobile-search-card .awp-smart-search-panel:not(.is-open),
  .awp-mobile-drawer-search .awp-smart-search-panel:not(.is-open) {
    display: none;
  }

  .awp-mobile-search-card form.awp-smart-search,
  .awp-mobile-drawer-search form.awp-smart-search {
    flex-wrap: wrap;
  }

  .awp-mobile-search-card .awp-smart-search-panel,
  .awp-mobile-drawer-search .awp-smart-search-panel {
    flex-basis: 100%;
  }
}

@media (max-width: 620px) {
  .awp-smart-search-tabs {
    overflow-x: auto;
  }

  .awp-smart-search-tabs button {
    min-width: 72px;
    flex: 0 0 auto;
  }

  .awp-smart-result {
    grid-template-columns: 50px minmax(0,1fr);
    min-height: 66px;
    padding: 8px 10px;
  }

  .awp-smart-result-thumb {
    width: 50px;
    height: 39px;
  }

  .awp-smart-result-price {
    grid-column: 2;
    max-width: none;
    text-align: right;
  }

  .awp-smart-result-copy > p { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .awp-smart-search-panel { transition: none; }
  .awp-smart-search-loader { animation: none; }
}
