/* 型錄、產品詳情、詢價視窗（搭配 site.css 使用） */
/* ── 頁面標頭 ── */
.page-head { background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.page-head .wrap { padding-top: 36px; padding-bottom: 28px; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a:hover { color: var(--navy); }
.crumbs span[aria-hidden] { opacity: .5; }
.page-head h1 { font-size: 34px; margin-top: 10px; letter-spacing: .02em; }
.page-head h1 small { display: block; font-size: 14px; font-weight: 500; color: var(--navy-mid); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; }
.page-head p { max-width: 720px; margin: 10px 0 0; }

/* ── 分類切換 ── */
.cat-tabs { border-bottom: 1px solid var(--line); background: var(--white); position: sticky; top: var(--header-h); z-index: 30; }
.cat-tabs .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cat-tabs .wrap::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: none; padding: 14px 16px; border: 0; background: none; cursor: pointer; font-size: 15px; color: var(--text);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.cat-tab:hover { color: var(--navy); }
.cat-tab[aria-pressed="true"] { color: var(--navy); font-weight: 700; border-color: var(--orange); }
.cat-tab .count { font-family: var(--num); font-size: 12px; color: var(--muted); margin-left: 4px; }

.subcats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-bottom: 20px; }
.subcat {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s;
}
.subcat:hover { border-color: var(--navy-soft); }
.subcat[aria-pressed="true"] { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.subcat img { width: 44px; height: 44px; object-fit: contain; background: var(--bg-soft); border-radius: 6px; flex: none; }
.subcat span { font-size: 14px; line-height: 1.35; color: var(--ink); }
.subcat small { display: block; font-size: 12px; color: var(--muted); font-family: var(--num); }

.cat-summary { display: flex; gap: 16px; align-items: center; background: var(--bg-soft); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px; }
.cat-summary img { width: 64px; height: 64px; object-fit: contain; background: var(--white); border-radius: 8px; flex: none; }
.cat-summary h2 { font-size: 18px; }
.cat-summary h2 small { font-size: 12px; color: var(--navy-mid); font-weight: 500; letter-spacing: .08em; margin-left: 8px; }
.cat-summary p { margin: 2px 0 0; font-size: 14px; }

/* ── 型錄主體 ── */
.catalog { display: grid; grid-template-columns: 272px 1fr; gap: 36px; padding-top: 28px; padding-bottom: 80px; align-items: start; }
.catalog > section { min-width: 0; }
.filters { position: sticky; top: calc(var(--header-h) + 68px); max-height: calc(100vh - var(--header-h) - 88px); overflow-y: auto; padding-right: 6px; scrollbar-width: thin; }
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.filters-head h2 { font-size: 16px; }
.link-btn { background: none; border: 0; color: var(--navy-mid); cursor: pointer; font-size: 13px; padding: 4px 0; }
.link-btn:hover { color: var(--orange-deep); text-decoration: underline; }
.fgroup { border-top: 1px solid var(--line); padding: 14px 0; }
.fgroup > h3 { font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.fgroup > h3 small { font-weight: 400; color: var(--muted); font-size: 12px; font-family: var(--num); }
.fopt { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 3px 0; cursor: pointer; }
.fopt input { accent-color: var(--navy); width: 16px; height: 16px; margin: 0; flex: none; }
.fopt .c { margin-left: auto; font-family: var(--num); font-size: 12px; color: var(--muted); }
.fopt.is-empty { opacity: .4; }
.frange { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; }
.frange input {
  width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; font-family: var(--num); font-size: 13px; background: var(--white);
}
.frange input:focus { border-color: var(--navy); outline: none; }
.frange span { color: var(--muted); font-size: 12px; }
.fhint { font-size: 12px; color: var(--muted); margin-top: 6px; font-family: var(--num); }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--white); transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(16px); }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.result-count { font-size: 14px; }
.result-count b { font-family: var(--num); color: var(--ink); font-size: 18px; }
.search { position: relative; flex: 1 1 220px; max-width: 340px; margin-left: auto; }
.search input { width: 100%; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px 8px 36px; font-size: 14px; background: var(--white); }
.search input:focus { border-color: var(--navy); outline: none; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.select { border: 1px solid var(--line); border-radius: 999px; padding: 8px 32px 8px 14px; font-size: 14px; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%234A4E57' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center; appearance: none; cursor: pointer; }
.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.view-toggle button { border: 0; background: none; padding: 6px 10px; border-radius: 999px; cursor: pointer; color: var(--muted); display: flex; }
.view-toggle button[aria-pressed="true"] { background: var(--navy); color: var(--white); }
.filters-open { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--navy); color: var(--white); border: 0; border-radius: 999px; padding: 4px 8px 4px 12px; font-size: 13px; cursor: pointer; }
.chip:hover { background: var(--navy-deep); }
.chip svg { opacity: .7; }

/* 卡片 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 18px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .2s, border-color .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); border-color: var(--navy-soft); transform: translateY(-2px); }
.card-img { aspect-ratio: 4 / 3; background: var(--bg-soft); display: grid; place-items: center; position: relative; }
.card-img img { width: 70%; height: 80%; object-fit: contain; mix-blend-mode: multiply; }
.badge { position: absolute; top: 10px; left: 10px; font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--white); color: var(--text); border: 1px solid var(--line); }
.badge.stock { background: #E6F4EC; color: var(--ok); border-color: #C3E3D0; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card-cat { font-size: 12px; color: var(--navy-mid); }
.card h3 { font-size: 16px; font-family: var(--num); letter-spacing: 0; margin: 2px 0 8px; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: 13px; margin: 0 0 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-family: var(--num); color: var(--ink); }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.card-foot .btn { position: relative; z-index: 1; }

/* 表格 */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; background: var(--white); }
table.specs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.specs th, table.specs td { padding: 10px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.specs th { background: var(--bg-soft); color: var(--ink); font-weight: 500; position: sticky; top: 0; }
table.specs th button { all: unset; cursor: pointer; display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }
table.specs th button:hover { color: var(--orange-deep); }
table.specs th small { font-weight: 400; color: var(--muted); font-size: 11px; font-family: var(--num); }
table.specs th[aria-sort] button::after { content: attr(data-arrow); font-size: 10px; color: var(--orange-deep); }
table.specs td { font-family: var(--num); color: var(--ink); }
table.specs th:first-child, table.specs td:first-child,
table.specs th:nth-child(2), table.specs td:nth-child(2) { text-align: left; }
table.specs tbody tr:hover { background: #F8F9FA; }
table.specs td img { width: 40px; height: 40px; object-fit: contain; background: var(--bg-soft); border-radius: 6px; mix-blend-mode: multiply; }
table.specs td a.sku { color: var(--navy); font-weight: 500; }
table.specs td a.sku:hover { color: var(--orange-deep); text-decoration: underline; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.dot.on { background: var(--ok); }

.empty { text-align: center; padding: 64px 16px; border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h3 { font-size: 18px; margin-bottom: 6px; }
.empty p { margin: 0 0 16px; }

.cta-band { background: var(--navy); color: var(--white); border-radius: var(--radius); padding: 28px 32px; margin-top: 36px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cta-band h2 { color: var(--white); font-size: 20px; }
.cta-band p { margin: 4px 0 0; color: var(--navy-soft); font-size: 14px; }

/* ── 產品詳情 ── */
.product { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) 300px; gap: 36px; padding-top: 32px; padding-bottom: 48px; align-items: start; }
.p-media { background: var(--bg-soft); border-radius: var(--radius); aspect-ratio: 1; display: grid; place-items: center; position: relative; }
.p-media img { width: 72%; height: 72%; object-fit: contain; mix-blend-mode: multiply; }
.p-media figcaption { position: absolute; bottom: 12px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); }
.p-info .card-cat { font-size: 14px; }
.p-info h1 { font-size: 30px; font-family: var(--num); letter-spacing: -.01em; margin: 4px 0 2px; }
.p-info .p-name { font-size: 18px; color: var(--ink); font-weight: 500; }
.p-sub { margin: 10px 0 18px; color: var(--text); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: var(--bg-soft); }
.tag.stock { background: #E6F4EC; color: var(--ok); }
.quote-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.quote-box .price { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 12px; }
.quote-box .price b { font-size: 22px; color: var(--ink); }
.quote-box .kv { font-size: 14px; margin-bottom: 16px; gap: 6px 12px; }
.quote-box .btns { display: flex; gap: 10px; flex-wrap: wrap; }
.quote-box .btns .btn { flex: 1; }
.p-desc { margin-top: 22px; }
.p-desc h2, .p-specs h2, .related h2 { font-size: 18px; margin-bottom: 10px; }
.side-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.side-card h3 { font-size: 15px; margin-bottom: 10px; }
.side-card .kv { font-size: 13px; margin: 0; gap: 6px 12px; }
.side-card .kv dd { font-family: var(--font); }
.channels { display: grid; gap: 8px; }
.channels a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; background: var(--bg-soft); font-size: 14px; }
.channels a:hover { background: var(--line); }
.channels a b { font-weight: 500; color: var(--ink); min-width: 48px; }
.p-specs { padding-bottom: 40px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.spec-table th, .spec-table td { padding: 11px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.spec-table th { width: 40%; background: var(--bg-soft); font-weight: 500; color: var(--ink); }
.spec-table td { color: var(--ink); }
.spec-table td .num { margin-right: 4px; }
.spec-table td small { color: var(--muted); }
.spec-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.related { padding-bottom: 72px; }

/* ── 詢價視窗 ── */
dialog.inquiry { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 24px 64px rgba(16,37,64,.3); color: var(--text); }
dialog.inquiry::backdrop { background: rgba(16, 37, 64, .55); }
.inq-head { padding: 20px 24px 12px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.inq-head h2 { font-size: 20px; }
.inq-head p { margin: 2px 0 0; font-size: 13px; font-family: var(--num); color: var(--navy-mid); }
.inq-close { background: none; border: 0; cursor: pointer; padding: 4px; color: var(--muted); align-self: flex-start; }
.inq-body { padding: 18px 24px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: grid; gap: 4px; font-size: 13px; }
.field.full { grid-column: 1 / -1; }
.field label b { color: var(--orange-deep); font-weight: 400; }
.field input, .field textarea, .field select { border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; font-size: 14px; background: var(--white); width: 100%; }
.field input:focus, .field textarea:focus { border-color: var(--navy); outline: none; }
.field textarea { min-height: 96px; resize: vertical; }
.inq-note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin: 0; }
.inq-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 10px; }
.inq-done { padding: 40px 28px; text-align: center; }
.inq-done h2 { font-size: 20px; margin: 12px 0 6px; }
.inq-done p { margin: 0 0 20px; }


/* 型錄響應式 */
/* ── 響應式 ── */
@media (max-width: 1100px) {
  .product { grid-template-columns: 1fr 1fr; }
  .product aside { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .product aside .side-card { margin: 0; }
}
@media (max-width: 900px) {
  .catalog { grid-template-columns: 1fr; padding-top: 20px; }
  .filters {
    position: fixed; inset: 0 0 0 auto; width: min(340px, 88vw); max-height: none; background: var(--white); z-index: 60;
    padding: 20px; transform: translateX(100%); transition: transform .25s, visibility .25s; visibility: hidden;
  }
  .filters.open { transform: none; visibility: visible; box-shadow: -12px 0 32px rgba(0,0,0,.15); }
  .filters-backdrop { position: fixed; inset: 0; background: rgba(16,37,64,.45); z-index: 55; }
  .filters-open { display: inline-flex; }
  .search { max-width: none; order: 3; flex-basis: 100%; }
  .cat-tabs { top: var(--header-h); }
  .spec-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page-head h1 { font-size: 26px; }
  .product { grid-template-columns: 1fr; gap: 24px; }
  .product aside { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .subcats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .subcat { padding: 6px 8px 6px 6px; gap: 8px; }
  .subcat img { width: 32px; height: 32px; }
  .subcat span { font-size: 13px; }
  .cat-summary { padding: 12px 14px; }
  .cat-summary img { width: 48px; height: 48px; }
  .card-body { padding: 10px 12px 12px; }
  .card h3 { font-size: 13px; }
  .kv { font-size: 12px; }
  .card-foot .btn { display: none; }
  .inq-body { grid-template-columns: 1fr; }
  .cta-band { padding: 22px 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
