/**
 * 全站商品搜尋（2026-10-06）— 搜尋結果頁的搜尋框、類型／平台切換、空結果提示。
 * 版面沿用分類頁 catalog-theme-page.css；顏色全部走主題變數（--button-color／--pos-text-color），不另外選色。
 */
.wx-search-page .catalog-theme-head {
  flex-wrap: wrap;
}

.wx-search-form {
  flex: 0 1 460px;
  width: min(460px, 100%);
  margin: 0;
  padding: 0;
}

/* 電腦／平板（≥768）頁首已有放大鏡（結果頁會把目前的搜尋字帶進去），不再放第二個搜尋框（老闆 2026-10-06：同一個功能別出現兩次）。
   手機（≤767）頂欄沒有放大鏡、抽屜換頁後會關起來，所以手機保留頁內搜尋框。 */
@media (min-width: 768px) {
  .wx-search-page .wx-search-form {
    display: none;
  }
}

.wx-search-form__label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wx-search-form__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 4px 0 14px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wx-search-form__row:focus-within {
  border-color: var(--button-color, #587493);
  box-shadow: 0 0 0 3px rgba(88, 116, 147, 0.18);
}

.wx-search-form__icon {
  flex: 0 0 auto;
  color: #94a3b8;
}

.wx-search-form .wx-search-form__input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  font-size: 16px; /* iPhone 字小於 16px 點下去會整頁放大跳動 */
  font-weight: 600;
  color: #0f172a;
}

.wx-search-form__btn {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--button-color, #587493);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.wx-search-form__btn:focus-visible {
  outline: 2px solid var(--button-color, #587493);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .wx-search-form__btn:hover {
    filter: brightness(1.07);
  }
}

.wx-search-summary {
  margin: 6px 0 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--pos-text-color, #334155);
}

.wx-search-summary strong {
  color: var(--button-color, #587493);
}

.wx-search-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
}

.wx-search-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wx-search-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: var(--pos-text-color, #334155);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wx-search-chip.is-active {
  border-color: var(--button-color, #587493);
  background: var(--button-color, #587493);
  color: #fff;
}

.wx-search-chip__n {
  font-size: 12px;
  font-weight: 700;
  opacity: 0.7;
}

.wx-search-chip:focus-visible {
  outline: 2px solid var(--button-color, #587493);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .wx-search-chip:not(.is-active):hover {
    border-color: var(--button-color, #587493);
    color: var(--button-color, #587493);
  }
}

.wx-search-hint {
  margin-top: 8px;
}

.wx-search-empty {
  padding: 28px 12px 12px;
  text-align: center;
}

.wx-search-empty__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
}

.wx-search-empty__sub {
  margin: 0 auto 8px;
  max-width: 34em;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  color: #64748b;
}

.wx-search-empty__sub a {
  color: var(--button-color, #587493);
  font-weight: 700;
}

.wx-search-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.wx-search-links a {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 14px;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: var(--pos-text-color, #334155);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .wx-search-links a:hover {
    border-color: var(--button-color, #587493);
    color: var(--button-color, #587493);
  }
}

@media (max-width: 768px) {
  .wx-search-page .catalog-theme-head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .wx-search-form {
    flex: 1 1 100%;
    width: 100%;
  }

  /* 手機：類型／平台切換只在工具列自己橫向捲動，不撐破整頁 */
  .wx-search-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .wx-search-chips::-webkit-scrollbar {
    display: none;
  }
}
