/* r9 search surface. Every rule is scoped to the search route. */
#app .catalog-browser.catalog-r9-search {
  max-width: 480px;
  min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
  background: #fffdfa;
  color: #26352f;
  font-family: "Noto Sans Thai", Sarabun, Tahoma, "PingFang SC", sans-serif;
}

#app .catalog-r9-search .catalog-editorial {
  padding: 0 17px 18px;
  border-bottom: 1px solid #ece9e3;
  background: #fffdfa;
}

#app .catalog-r9-search .catalog-header--editorial {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  min-height: 58px;
}

#app .catalog-r9-search .catalog-header--editorial > h1 {
  margin: 0;
  color: #26352f;
  font-size: 16px;
  font-weight: 750;
  text-align: center;
}

#app .catalog-r9-search .catalog-header--editorial button {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

#app .catalog-r9-search .catalog-r9-header-spacer { width: 44px; height: 44px; }

#app .catalog-r9-search .catalog-search--editorial {
  min-height: 50px;
  margin-top: 5px;
  border-radius: 9px;
  background: #f7f6f3;
}

#app .catalog-r9-search .catalog-search--editorial input {
  min-height: 48px;
  font-size: 16px;
  line-height: 1.4;
}

#app .catalog-r9-search .catalog-search--editorial .catalog-search-clear {
  width: 40px;
  height: 40px;
  flex: none;
}

#app .catalog-r9-search .catalog-search--editorial .catalog-submit {
  min-width: 68px;
  padding-inline: 13px;
  font-size: 14px;
}

#app .catalog-r9-search .catalog-r9-discover {
  padding: 21px 17px 20px;
  border-bottom: 7px solid #f3f1ec;
}
#app .catalog-r9-search .catalog-r9-discover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#app .catalog-r9-search .catalog-r9-discover-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.4;
}

#app .catalog-r9-search .catalog-r9-discover-head button,
#app .catalog-r9-search .catalog-r9-all-categories {
  min-height: 44px;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  color: #a95436;
  font-size: 13px;
  font-weight: 700;
}

#app .catalog-r9-search .catalog-r9-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

#app .catalog-r9-search .catalog-r9-chip-row button {
  min-height: 44px;
  padding: 7px 13px;
  border: 1px solid #e6e1d9;
  border-radius: 999px;
  background: #fff;
  color: #38564d;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

#app .catalog-r9-search .catalog-r9-all-categories { margin-top: 9px; }

#app .catalog-r9-search .catalog-recent {
  padding: 18px 17px 22px;
  border-bottom: 7px solid #f3f1ec;
}

#app .catalog-r9-search .catalog-recent h2 {
  margin: 0 0 10px;
  color: #66756b;
  font-size: 14px;
  font-weight: 700;
}

#app .catalog-r9-search .catalog-recent > div { gap: 8px; }
#app .catalog-r9-search .catalog-recent button {
  min-height: 44px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
}

#app .catalog-r9-search .catalog-results {
  min-height: 0;
  padding: 19px 17px 28px;
  border-top: 0;
  background: #fffdfa;
}

#app .catalog-r9-search .catalog-results-heading { margin-bottom: 13px; }
#app .catalog-r9-search .catalog-results-heading span {
  color: #826e5d;
  font-size: 12px;
  font-weight: 650;
}

#app .catalog-r9-search .catalog-results-heading h2 {
  margin-top: 4px;
  font-size: 18px;
  line-height: 1.35;
}

#app .catalog-r9-search .catalog-r9-filter-row { margin-bottom: 10px; }
#app .catalog-r9-search .catalog-r9-filter-button {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #e2ded5;
  border-radius: 8px;
  background: #f7f6f3;
  color: #38564d;
  font-size: 13px;
  font-weight: 650;
  text-align: start;
}

#app .catalog-r9-search .catalog-r9-filter-button img {
  width: 21px;
  height: 21px;
  flex: none;
  object-fit: contain;
}

#app .catalog-r9-search .catalog-r9-filter-button span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#app .catalog-r9-search .catalog-r9-filter-button span:last-child { margin-inline-start: auto; }

#app .catalog-r9-search .catalog-r9-empty-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

#app .catalog-r9-search .catalog-r9-empty-actions button {
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid #d9d1c6;
  border-radius: 8px;
  background: #fff;
  color: #38564d;
  font-size: 14px;
  font-weight: 700;
}

#app .catalog-r9-search .catalog-sort {
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e9e5de;
}

#app .catalog-r9-search .catalog-sort-options {
  min-width: 0;
  flex: 1;
  gap: 13px;
  overflow-x: auto;
  scrollbar-width: none;
}

#app .catalog-r9-search .catalog-sort-options::-webkit-scrollbar { display: none; }
#app .catalog-r9-search .catalog-sort-options button {
  min-height: 44px;
  padding: 8px 0;
  font-size: 13px;
}

#app .catalog-r9-search .catalog-view button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 7px;
}

#app .catalog-r9-search .catalog-view button img { width: 20px; height: 20px; }

#app .catalog-r9-search .catalog-cards--list,
#app .catalog-r9-search .catalog-skeletons {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

#app .catalog-r9-search .sf-product-card--list {
  min-height: 108px;
  border-radius: 10px;
  background: #fff;
}

#app .catalog-r9-search .sf-product-card--list .sf-product-card__media {
  width: 108px;
  min-width: 108px;
  background: #faf9f6;
}

#app .catalog-r9-search .sf-product-card--list .sf-product-card__body {
  gap: 7px;
  padding: 12px 13px;
}

#app .catalog-r9-search .sf-product-card--list .sf-product-card__title {
  font-size: 14px;
  line-height: 1.4;
}

#app .catalog-r9-search .sf-product-card--list .sf-product-card__prices strong {
  font-size: 17px;
}

#app .catalog-r9-search .catalog-skeletons > div { height: 108px; }
#app .catalog-r9-search .catalog-empty { padding: 45px 10px; }
#app .catalog-r9-search .catalog-more { min-height: 42px; }

.van-popup.catalog-r9-picker img { display: none; }
.van-popup.catalog-r9-picker button { min-height: 44px; }

#app .catalog-r9-search button:focus-visible,
#app .catalog-r9-search input:focus-visible,
.van-popup.catalog-r9-picker button:focus-visible {
  outline: 2px solid #38564d;
  outline-offset: 2px;
}

#app .catalog-r9-search button { touch-action: manipulation; }

@media (max-width: 350px) {
  #app .catalog-r9-search .catalog-editorial,
  #app .catalog-r9-search .catalog-results,
  #app .catalog-r9-search .catalog-r9-discover,
  #app .catalog-r9-search .catalog-recent { padding-inline: 13px; }
  #app .catalog-r9-search .catalog-sort-options { gap: 9px; }
  #app .catalog-r9-search .catalog-sort-options button { font-size: 12px; }
  #app .catalog-r9-search .sf-product-card--list .sf-product-card__media {
    width: 96px;
    min-width: 96px;
  }
}
