/* 商品列表（分類頁、商店總覽、商品分類、搜尋）2026-11-19 新設計
   卡片、選單、標題共用 front.css；這裡只放列表自己的版面 */

.th-catpage { padding-bottom: clamp(56px, 7vw, 104px); }
.th-crumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0 20px; font-size: .8125rem; color: var(--soft); }
.th-crumb a { margin: 0 !important; padding: 0 !important; }
.th-crumb a:hover { color: var(--blue); }
.th-crumb [aria-current] { color: var(--ink); }

/* 標題＋說明 */
.th-cat__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 34em); gap: 20px 48px; align-items: end; padding-bottom: clamp(24px, 3vw, 36px); }
.th-cat__head .th-h2 { margin: 0; }
.th-cat__head .th-soft { color: var(--soft); font-size: .5em; margin-top: 10px; letter-spacing: .02em; }
.th-cat__intro p { margin: 0; color: var(--ink-2); line-height: 1.9; font-size: .9375rem; }
.th-cat__intro p.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.th .th-cat__more { margin-top: 8px; padding: 6px 0; border: 0; cursor: pointer; font-size: .875rem; font-weight: 500; text-decoration: underline; text-underline-offset: 4px; background-color: transparent !important; color: var(--blue) !important; }

/* 分類膠囊＋工具列 */
.th-cat__bar { display: grid; gap: 14px; padding: 16px 0 24px; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--th-navh, 76px) + 16px); }
.th-cat__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.th-cat__chips a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-size: .875rem; white-space: nowrap; transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease); }
.th-cat__chips a:hover { border-color: rgba(46, 100, 164, .45); color: var(--ink); }
.th-cat__chips a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.th-cat__tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.th-cat__select select, .th-cat__search input {
  min-height: 44px; border-radius: 999px; border: 1px solid rgba(15, 35, 64, .14); background-color: #fff; font: inherit; font-size: .9375rem; color: var(--ink); box-sizing: border-box;
}
.th-cat__select select { padding: 0 40px 0 18px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2340536d' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px; }
.th-cat__search { position: relative; display: block; flex: 0 1 280px; }
.th-cat__search input { width: 100%; padding: 0 48px 0 18px; }
.th-cat__search input::-webkit-search-cancel-button { display: none; }
.th .th-cat__search button { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background-color: var(--ink) !important; color: #fff !important; }
.th-cat__search svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.th-cat__select select:focus-visible, .th-cat__search input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

/* 商品格 */
.th-cat__grid { gap: 16px; }
.th-cat__grid .th-card { position: relative; }
.th-card__add { position: absolute; right: 14px; bottom: 16px; margin: 0; }
.th .th-card__add button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid rgba(46, 100, 164, .3); border-radius: 50%; cursor: pointer; background-color: #fff !important; color: var(--blue) !important; transition: background-color .3s var(--ease), color .3s var(--ease); }
.th .th-card__add button:hover { background-color: var(--ink) !important; border-color: var(--ink); color: #fff !important; }
.th-card__add svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.th-cat__grid .th-card:has(.th-card__add) .th-card__price { padding-right: 48px; }

/* 分頁 */
.th-cat__pages { margin-top: clamp(28px, 4vw, 48px); }
.th-cat__pages ul.page-numbers { display: flex !important; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.th-cat__pages li { margin: 0; padding: 0; }
.th-cat__pages li > .page-numbers { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-family: 'Sora', 'Noto Sans TC', sans-serif; font-size: .9375rem; }
.th-cat__pages a.page-numbers:hover { border-color: rgba(46, 100, 164, .45); color: var(--ink); }
.th-cat__pages li > .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.th-cat__pages li > .page-numbers.dots { border: 0; background: none; min-width: 24px; padding: 0; }

.th-cat__empty { display: grid; justify-items: center; gap: 16px; padding: clamp(48px, 7vw, 88px) 20px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); text-align: center; color: var(--ink-2); }
.th-cat__empty p { margin: 0; }

.th-cat__read { padding-bottom: 0; }
/* 文章圖是 1.91:1 的橫幅，照首頁 16:10 裁會切掉字 */
.th-catpage .th-news__pic, .th-srch__posts .th-news__pic { aspect-ratio: 1.91 / 1; }

/* 搜尋頁：文章結果 */
.th-catpage:has(~ .th-srch__posts) { padding-bottom: 0; }
.th-srch__posts .th-sec { padding-top: clamp(48px, 6vw, 80px); }

@media (max-width: 1100px) {
  .th-cat__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .th-cat__head { grid-template-columns: 1fr; align-items: start; }
  .th-cat__tools { justify-content: stretch; }
  .th-cat__search { flex: 1 1 100%; order: -1; }
  .th-cat__select { flex: 1 1 0; }
  .th-cat__select select { width: 100%; }
}
@media (max-width: 640px) {
  /* 手機：首頁的卡片是橫滑，列表頁改回兩欄格子 */
  .th-cat__grid { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-columns: auto; overflow: visible; margin: 0; padding: 0; gap: 10px; }
  .th-cat__grid .th-card a { padding: 10px 10px 16px; border-radius: 18px; }
  .th-cat__grid .th-card__pic { border-radius: 12px; }
  .th-cat__grid .th-card__name { font-size: .9375rem; }
  .th-card__add { right: 10px; bottom: 12px; }
  .th .th-card__add button { width: 38px; height: 38px; position: relative; }
  .th .th-card__add button::after { content: ""; position: absolute; inset: -4px; } /* 看起來 38，實際可按 46 */
  .th-cat__grid .th-card:has(.th-card__add) .th-card__price { padding-right: 40px; flex-wrap: wrap; gap: 0 8px; }
  .th-cat__chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .th-cat__chips::-webkit-scrollbar { display: none; }
}

