/* 中興化工 — design tokens come from brand/brand-spec.md */
:root {
  --navy: #1F4A5C;
  --navy-deep: #173a49;
  --ring: #2FA3BC;
  --sky: #6CB9D2;
  --sky-on-dark: #8FCDE0;      /* sky lightened for small text on navy (5.46:1) */
  --sky-soft: #e3f2f7;
  --sky-softer: #f0f8fb;
  --teal-1: #2BB3CB;
  --teal-2: #2386A6;
  --action: #1B6F8A;
  --action-hover: #165c73;
  --line-green: #06C755;       /* LINE buttons only (brand-spec exception) */
  --line-green-hover: #05b44c;
  --line-ink: #04341a;

  --bg: #F4F8F9;
  --surface: #ffffff;
  --ink: #1D2A33;
  --muted: #5B6B75;
  --rule: #DCE6EA;             /* dividers only */
  --control-border: #7d8f98;   /* outlines of buttons / inputs (>=3:1 on white and bg) */
  --on-dark: #e6f2f6;
  --on-dark-muted: #b9d3dd;
  --on-dark-faint: #9fbcc6;

  --font: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Heiti TC", sans-serif;
  --fs-body: 17px;
  --fs-small: 16px;            /* secondary text stays readable for older visitors */
  --fs-h3: 20px;
  --fs-h2: clamp(24px, 2.2vw + 14px, 32px);
  --fs-h1: clamp(34px, 3.6vw + 16px, 52px);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  --radius: 12px;
  --radius-sm: 8px;
  --pill: 999px;
  --shadow-hover: 0 6px 20px rgba(31, 74, 92, .12);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --wrap: 1160px;
  --header-h: 72px;
  --bar-h: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: var(--fs-body); line-height: 1.75;
  text-wrap: pretty;
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }   /* .btn etc. set display, which would otherwise override the hidden attribute */
a { color: var(--action); text-underline-offset: 3px; }
a:hover { color: var(--action-hover); }
:focus-visible { outline: 3px solid var(--action); outline-offset: 2px; border-radius: 4px; }
.hero :focus-visible, .trust :focus-visible, .site-footer :focus-visible { outline-color: #fff; }
h1, h2, h3 { line-height: 1.3; margin: 0; color: var(--navy); letter-spacing: .02em; }
h1 { font-size: var(--fs-h1); font-weight: 900; }
h2 { font-size: var(--fs-h2); font-weight: 800; }
h3 { font-size: var(--fs-h3); font-weight: 700; }
p { margin: 0; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s4); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5); border-radius: var(--pill);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border: 2px solid transparent;
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--action); color: #fff; }
.btn-primary:hover { background: var(--action-hover); color: #fff; }
.btn-line { background: var(--line-green); color: var(--line-ink); }
.btn-line:hover { background: var(--line-green-hover); color: var(--line-ink); }
.btn-ghost { background: var(--surface); color: var(--navy); border-color: var(--control-border); }
.btn-ghost:hover { border-color: var(--action); color: var(--action); }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: var(--s5); min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--navy); flex-shrink: 0; }
.brand img { width: 44px; height: 44px; }
.brand-name { font-size: 22px; font-weight: 900; letter-spacing: .1em; line-height: 1.1; }
.brand-sub { display: block; font-size: 14px; font-weight: 500; letter-spacing: .2em; color: var(--muted); }
.nav { margin-left: auto; display: flex; align-items: center; gap: var(--s1); }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; padding: var(--s2) var(--s3); border-radius: var(--pill); font-size: 16px; }
.nav a:hover, .nav a[aria-current] { background: var(--sky-soft); color: var(--navy); }
.nav .btn { margin-left: var(--s2); min-height: 44px; padding: 0 var(--s4); font-size: 16px; }
.menu-toggle { display: none; }

/* the menu folds into a button below 1060px: seven items plus the LINE button need about that much width */
@media (max-width: 1060px) {
  :root { --header-h: 64px; }
  .menu-toggle { display: inline-flex; margin-left: auto; align-items: center; min-height: 44px; background: none; border: 1px solid var(--control-border); border-radius: var(--pill); padding: 0 16px; font: inherit; font-weight: 700; color: var(--navy); cursor: pointer; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); flex-direction: column; align-items: stretch; padding: var(--s3) var(--s4) var(--s5); border-bottom: 1px solid var(--rule); gap: 2px; max-height: calc(100dvh - var(--header-h)); overflow-y: auto; box-shadow: 0 12px 24px rgba(31,74,92,.12); }
  .nav.open { display: flex; }
  .nav a { padding: var(--s3); font-size: 17px; }
  .nav .btn { margin: var(--s2) 0 0; min-height: 48px; }
}

/* mobile contact bar: calling or LINE is the only conversion on this site */
.contact-bar { display: none; }
@media (max-width: 1060px) {   /* same breakpoint as the folded menu, so LINE / call stay on screen */
  .contact-bar {
    display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: var(--s2) var(--s3) calc(var(--s2) + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97); border-top: 1px solid var(--rule); box-shadow: 0 -6px 18px rgba(31,74,92,.10);
  }
  .contact-bar .btn { min-height: 48px; padding: 0 var(--s3); }
  body { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom)); }
  html { scroll-padding-bottom: calc(var(--bar-h) + 16px + env(safe-area-inset-bottom)); }   /* keyboard focus never hides behind the bar */
}

/* ---------- hero ---------- */
.hero { background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.hero::after { /* the logo's diagonal seam, used once as a quiet signature */
  content: ""; position: absolute; right: -6%; top: -30%; width: 46%; height: 160%;
  background: linear-gradient(90deg, rgba(108,185,210,.10), rgba(108,185,210,.18));
  transform: skewX(-38deg); pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--s7); padding-top: var(--s8); padding-bottom: var(--s8); align-items: center; }
.hero .wrap > * { min-width: 0; }
.eyebrow { display: inline-block; font-size: var(--fs-small); font-weight: 700; letter-spacing: .12em; color: var(--sky-on-dark); margin-bottom: var(--s4); }
.hero-name { font-size: clamp(20px, 1vw + 14px, 26px); font-weight: 800; color: #fff; margin-bottom: var(--s2); }
.hero-title { font-size: var(--fs-h1); font-weight: 900; line-height: 1.3; letter-spacing: .02em; margin: 0; color: #fff; }
.hero-title .accent { color: var(--sky-on-dark); }
.hero-lead { margin-top: var(--s4); font-size: 18px; color: var(--on-dark); max-width: 34em; }
.search { margin-top: var(--s6); display: flex; background: #fff; border-radius: var(--pill); padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.18); max-width: 560px; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 18px; padding: 0 var(--s4); color: var(--ink); }
.search input:focus { outline: none; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.js [data-search-form] input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }   /* catalog pages use their own 清除 button instead of the tiny browser × */
.copy-buf { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
.search-clear { flex-shrink: 0; min-width: 48px; min-height: 48px; margin-right: 4px; padding: 0 12px; border: 0; border-radius: var(--pill); background: var(--sky-soft); color: var(--navy); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.search-clear:hover { background: var(--rule); }
.search:focus-within { outline: 3px solid var(--action); outline-offset: 2px; }
.hero .search:focus-within { outline-color: #fff; }
.search .btn { min-height: 48px; }
.search-hints { margin-top: var(--s4); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: var(--fs-small); color: var(--on-dark-muted); }
.search-hints a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid rgba(255,255,255,.55); border-radius: var(--pill); color: #fff; text-decoration: none; font-weight: 600; }
.search-hints a:hover { background: rgba(255,255,255,.12); color: #fff; }

.visit-card { background: #fff; color: var(--ink); border-radius: var(--radius); padding: var(--s5) var(--s5) var(--s4); }
.status { display: inline-flex; align-items: center; justify-self: start; gap: var(--s2); font-weight: 800; font-size: 16px; padding: 4px 12px; border-radius: var(--pill); background: var(--sky-soft); color: var(--navy); }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.status.open::before { background: var(--teal-2); }
.status.closed { background: var(--rule); color: var(--ink); }
.visit-card h2 { font-size: 20px; margin: var(--s3) 0 var(--s2); }
.hours { width: 100%; border-collapse: collapse; font-size: 16px; }
.hours th, .hours td { text-align: left; padding: 6px 0; border-bottom: 1px solid var(--rule); font-weight: 500; }
.hours td { text-align: right; font-variant-numeric: tabular-nums; }
.hours tr.today th, .hours tr.today td { color: var(--navy); font-weight: 800; }
.visit-card .addr { margin-top: var(--s3); font-size: 16px; color: var(--muted); }
.visit-card .addr a { font-weight: 700; }

@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: var(--s6); padding-top: var(--s7); padding-bottom: var(--s7); }
  .hero::after { width: 70%; right: -30%; }
}

/* ---------- sections ---------- */
section { padding: var(--s8) 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); margin-bottom: var(--s5); flex-wrap: wrap; }
.section-head p { color: var(--muted); margin-top: var(--s2); }
.more { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.band { background: var(--surface); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.scroller + .section-head { margin-top: var(--s7); }
.sub-head { margin-top: var(--s2); }

/* category grid */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--s3); }
@media (min-width: 1100px) { .cat-grid { grid-template-columns: repeat(7, 1fr); } } /* same card size in every group */
.cat-group-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s4); margin: var(--s6) 0 var(--s3); }
.section-head + .cat-group-head { margin-top: 0; }
.cat-group { font-size: 18px; color: var(--navy); padding-left: var(--s3); border-left: 4px solid var(--sky); line-height: 1.4; }
.group-link { font-weight: 700; font-size: var(--fs-small); white-space: nowrap; }
.cat {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.cat:hover { border-color: var(--sky); box-shadow: var(--shadow-hover); transform: translateY(-2px); color: var(--ink); }
.cat-thumb { aspect-ratio: 4 / 3; background: #fff; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: var(--s4); border-bottom: 1px solid var(--rule); overflow: hidden; }
.cat-thumb img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.cat-body { padding: var(--s3) var(--s3) var(--s4); }
.cat-name { font-weight: 800; color: var(--navy); line-height: 1.4; }
.cat-count { font-size: var(--fs-small); color: var(--muted); }

/* product cards */
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s4); }
.p-card {
  display: flex; flex-direction: column; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease);
}
.p-card[hidden] { display: none; }
.p-card:hover { border-color: var(--sky); box-shadow: var(--shadow-hover); transform: translateY(-2px); color: var(--ink); }
.p-thumb { aspect-ratio: 1; background: #fff; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: var(--s4); overflow: hidden; }
.p-thumb img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.p-body { padding: var(--s3) var(--s4) var(--s4); border-top: 1px solid var(--rule); display: flex; flex-direction: column; gap: 2px; flex: 1; }
.p-brand { font-size: 14px; font-weight: 700; letter-spacing: .04em; color: var(--action); }
.p-name { font-weight: 800; line-height: 1.45; color: var(--navy); }
.p-meta { font-size: var(--fs-small); color: var(--muted); margin-top: auto; padding-top: var(--s2); }

.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: var(--s4); overflow-x: auto; padding-bottom: var(--s2); scroll-snap-type: x mandatory; }
.scroller > * { scroll-snap-align: start; }
@media (min-width: 1000px) { .scroller { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; } .scroller > :nth-child(n+6) { display: none; } }

/* trust */
.trust { background: var(--navy); color: #fff; }
.trust h2 { color: #fff; }
.trust .section-head p { color: var(--on-dark-muted); }
.lic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); }
.lic { border: 1px solid rgba(108,185,210,.35); border-radius: var(--radius); padding: var(--s5); background: rgba(255,255,255,.04); }
.lic-name { font-weight: 800; font-size: 18px; }
.lic-no { margin-top: var(--s2); font-variant-numeric: tabular-nums; color: var(--sky-on-dark); font-weight: 700; letter-spacing: .02em; }
.lic-detail { margin-top: var(--s1); color: var(--on-dark-muted); font-size: var(--fs-small); }
.brands { margin-top: var(--s6); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); color: var(--on-dark-muted); font-size: var(--fs-small); }
.brands strong { color: #fff; margin-right: var(--s2); }
.brands span { display: inline-block; padding: 2px 12px; border: 1px solid rgba(143,205,224,.5); border-radius: var(--pill); color: var(--on-dark); font-weight: 600; }
@media (max-width: 900px) { .lic-grid { grid-template-columns: 1fr; } }

/* services */
.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
.svc { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: var(--s6); display: flex; flex-direction: column; gap: var(--s3); }
.svc p { color: var(--muted); }
.svc .btn { align-self: flex-start; margin-top: auto; }
@media (max-width: 800px) { .svc-grid { grid-template-columns: 1fr; } }

/* placeholders: honest gaps, not fake content */
.ph { border: 2px dashed var(--sky); background: var(--sky-softer); color: var(--action); border-radius: var(--radius-sm); padding: var(--s3) var(--s4); font-size: var(--fs-small); font-weight: 700; }
.ph-media { aspect-ratio: 16 / 9; display: grid; place-items: center; text-align: center; }

/* visit section */
.visit-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s6); align-items: start; }
.visit-grid.no-photo { grid-template-columns: minmax(0, 760px); }
.info-list { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s5); margin: var(--s4) 0 0; align-items: center; }
.info-list dt { color: var(--muted); font-weight: 600; }
.info-list dd { margin: 0; font-weight: 600; }
.info-list dd a { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 800px) { .visit-grid { grid-template-columns: 1fr; } }

/* footer */
.site-footer { background: var(--navy-deep); color: var(--on-dark-muted); padding: var(--s7) 0 var(--s6); font-size: var(--fs-small); }
.site-footer a { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: var(--s6); }
.foot-title { color: #fff; font-weight: 800; margin: 0 0 var(--s2); font-size: 16px; letter-spacing: 0; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.foot-grid li a { display: inline-flex; align-items: center; min-height: 44px; }
.foot-grid p a { display: inline-flex; align-items: center; min-height: 44px; }
.foot-legal { margin-top: var(--s6); padding-top: var(--s4); border-top: 1px solid rgba(255,255,255,.12); color: var(--on-dark-faint); }
.foot-md { color: #fff; font-weight: 700; }
.foot-md + .foot-legal { margin-top: var(--s2); padding-top: 0; border-top: 0; }
@media (max-width: 800px) { .foot-grid { grid-template-columns: 1fr; } }

/* ---------- catalog page ---------- */
.page-head { background: var(--surface); border-bottom: 1px solid var(--rule); padding: var(--s6) 0 var(--s5); }
.page-head.slim { padding-bottom: var(--s3); }
.crumbs ol { list-style: none; margin: 0 0 var(--s3); padding: 0; display: flex; flex-wrap: wrap; align-items: center; font-size: var(--fs-small); color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; min-height: 40px; }
.page-head.slim .crumbs ol { margin: 0; }
.crumbs li + li::before { content: "›"; margin: 0 var(--s2); }
.crumbs a { color: var(--muted); display: inline-block; padding: 8px 0; }
.page-head p { color: var(--muted); margin-top: var(--s2); }
.page-head.compact { padding: var(--s4) 0; }
.page-head.compact .crumbs ol { margin-bottom: var(--s1); }
.page-head.compact h1 { font-size: var(--fs-h2); }
.page-head.compact p { margin-top: var(--s1); }
.catalog { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); padding-top: var(--s5); padding-bottom: var(--s8); }
.catalog > * { min-width: 0; }
.cat-pick summary { display: none; }
/* every category visible at once as wrapping buttons, one row per group; the layout stays put when the next page loads */
.chip-nav { display: grid; gap: var(--s2); }
.chip-group { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: var(--s3); align-items: start; }
.chip-head { font-size: var(--fs-small); font-weight: 700; color: var(--muted); line-height: 1.4; padding-top: 10px; }
.chip-head .group-link { display: inline-block; padding: 6px 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; text-decoration: none; color: var(--ink); padding: 0 14px; border: 1px solid var(--rule); background: var(--surface); border-radius: var(--pill); font-weight: 600; font-size: 16px; }
.chip span { color: var(--muted); font-weight: 500; font-size: 14px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--action); background: var(--sky-soft); color: var(--navy); }
.chip[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip[aria-current="page"] span { color: var(--on-dark-muted); }
.result-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.result-bar .search { margin: 0; box-shadow: none; border: 1px solid var(--control-border); flex: 1; min-width: 260px; max-width: none; }
.result-count { color: var(--muted); font-size: var(--fs-small); }
.empty { padding: var(--s7) var(--s5); text-align: center; background: var(--surface); border: 1px dashed var(--control-border); border-radius: var(--radius); color: var(--muted); }
.empty strong { display: block; color: var(--navy); font-size: 18px; margin-bottom: var(--s2); }
.empty .actions { justify-content: center; }
.to-top { margin-top: var(--s5); text-align: center; }
.to-top a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--s4); font-weight: 700; }
@media (max-width: 900px) {
  .catalog { gap: var(--s4); }
  .js .cat-pick summary {
    display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 var(--s4);
    border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: var(--surface);
    font-weight: 700; color: var(--navy); cursor: pointer; list-style: none;
  }
  .js .cat-pick summary::-webkit-details-marker { display: none; }
  .js .cat-pick summary::after { content: "▾"; color: var(--muted); }
  .js .cat-pick[open] summary::after { content: "▴"; }
  .chip-nav { gap: 0; }
  .chip-group { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .chip-head { padding-top: var(--s3); display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s3); }
  .chip-head .group-link { padding: 0; }
  .chip-head:empty { display: none; }
  .chips { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s2); }
  .chip { justify-content: space-between; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); font-size: 15px; }
  .result-bar .search { flex-basis: 100%; min-width: 0; }
}

/* ---------- product page ---------- */
.product { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--s7); padding-top: var(--s6); padding-bottom: var(--s7); align-items: start; }
.product > * { min-width: 0; }
.gallery-main { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); aspect-ratio: 1; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: var(--s6); overflow: hidden; }
.gallery-main img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-note { margin-top: var(--s2); font-size: var(--fs-small); color: var(--muted); }
.product h1 { font-size: clamp(28px, 2.4vw + 14px, 40px); }
.product .p-brand { font-size: 15px; margin-bottom: var(--s2); display: block; }
.p-cat { color: var(--muted); margin-top: var(--s2); }
.p-id { margin-left: var(--s4); font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn-line.nudge { box-shadow: 0 0 0 4px var(--navy); }
.variants { margin-top: var(--s5); }
.variants h2 { font-size: 16px; color: var(--muted); letter-spacing: .1em; margin-bottom: var(--s3); }
.v-list { display: flex; flex-wrap: wrap; gap: var(--s2); }
.v-btn {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: 56px; padding: 4px 16px 4px 4px;
  border: 1px solid var(--control-border); background: #fff; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); text-align: left;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.v-btn img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: #fff; flex-shrink: 0; }
.v-btn:hover { border-color: var(--action); }
.v-btn[aria-pressed="true"] { border-color: var(--navy); background: var(--sky-soft); color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.ask { margin-top: var(--s6); background: var(--sky-softer); border: 1px solid var(--sky-soft); border-radius: var(--radius); padding: var(--s5); }
.ask h2 { font-size: var(--fs-h3); }
.ask p { color: var(--muted); font-size: 16px; margin-top: var(--s2); }
.ask .actions { margin-top: var(--s4); }
.ask .line-id { font-size: var(--fs-small); margin-top: var(--s3); }
.copy-msg { display: block; min-height: 1.5em; font-size: var(--fs-small); color: var(--action); font-weight: 700; margin-top: var(--s2); }
@media (max-width: 900px) { .product { grid-template-columns: 1fr; gap: var(--s5); } }
.spec-sec { padding-bottom: var(--s7); }
.spec-sec h2 { font-size: var(--fs-h3); margin-bottom: var(--s3); }
.specs { display: grid; grid-template-columns: max-content minmax(0, 1fr); max-width: 820px; margin: 0; border-top: 1px solid var(--rule); }
.specs dt, .specs dd { padding-top: var(--s3); padding-bottom: var(--s3); border-bottom: 1px solid var(--rule); }
.specs dt { color: var(--muted); font-weight: 600; padding-right: var(--s5); }
.specs dd { margin: 0; }
.md-for { font-size: 17px; margin: var(--s4) 0 var(--s2); }
.md-shop { margin-top: var(--s4); }
.md-warn { font-weight: 700; color: var(--ink); }
.specs ul { margin: 0; padding-left: 1.2em; }
.spec-note { margin-top: var(--s3); font-size: var(--fs-small); color: var(--muted); }
@media (max-width: 600px) {
  .specs { grid-template-columns: minmax(0, 1fr); }
  .specs dt { border-bottom: 0; padding-bottom: 0; }
}

@media (max-width: 600px) {
  .p-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
  .p-thumb { padding: var(--s2); }
  .p-body { padding: var(--s2) var(--s3) var(--s3); }
  .p-name { font-size: 16px; }
  .gallery-main { padding: var(--s3); }
  section { padding: var(--s7) 0; }
  /* categories as compact rows so the licences and shop info are not pushed 3 screens down */
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); }
  .cat { flex-direction: row; align-items: center; min-height: 72px; }
  .cat-thumb { width: 64px; flex-shrink: 0; aspect-ratio: 1; padding: 6px; border-bottom: 0; }
  .cat-body { padding: var(--s2) var(--s2) var(--s2) 0; }
  .cat-name { font-size: 16px; line-height: 1.35; }
  .actions .btn, .ask .actions .btn { flex: 1 1 100%; }
}

/* ---------- simple pages ---------- */
.prose { max-width: 760px; padding-top: var(--s6); padding-bottom: var(--s8); display: grid; gap: var(--s4); }
.prose h2 { margin-top: var(--s4); }
.prose .actions { margin-top: 0; }
.prose .steps { margin: 0; padding-left: 1.4em; display: grid; gap: var(--s2); }
.prose .steps .btn { margin-top: var(--s2); }
.sub-chips { margin: 0; }
/* the one thing to read first on a page (輔具補助: buy only after approval) */
.notice { background: var(--sky-softer); border: 1px solid var(--sky-soft); border-left: 6px solid var(--navy); border-radius: var(--radius-sm); padding: var(--s4) var(--s5); display: grid; gap: var(--s2); }
.notice strong { color: var(--navy); }
/* 輔具補助提醒（分類頁標題下、商品頁詢問區） */
.subsidy-note, .ask p.subsidy-note, .page-head p.subsidy-note { margin-top: var(--s3); padding: var(--s2) var(--s3); background: var(--surface); border: 1px solid var(--sky-soft); border-left: 4px solid var(--sky); border-radius: var(--radius-sm); font-size: var(--fs-small); color: var(--ink); max-width: 760px; }
.subsidy-note a { font-weight: 700; margin-left: .3em; white-space: nowrap; }
/* 限門市購買（store_only：電子血壓計、血糖機與試紙、霧化器） */
.p-tag { align-self: flex-start; margin-top: var(--s1); padding: 1px 8px; border: 1px solid var(--navy); border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--navy); background: var(--surface); }
.store-note, .page-head p.store-note { margin-top: var(--s3); padding: var(--s2) var(--s3); background: var(--surface); border: 1px solid var(--sky-soft); border-left: 4px solid var(--navy); border-radius: var(--radius-sm); font-size: var(--fs-small); color: var(--ink); max-width: 760px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
