/* 版型：上方工具列＋置中 Logo＋置中選單，大圖三拼，新品四欄 */
:root {
  --bg: #ffffff;
  --ink: #2b2a28;
  --muted: #8d8984;
  --line: #e7e3df;
  --bar: #e4ddd3;
  --soft: #f4f1ee;
  --sale: #857a72;
  --serif: "Cormorant Garamond", "Noto Serif TC", Georgia, serif;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --mono: "Cutive Mono", "Courier New", monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-weight: 300; font-size: 14px; line-height: 1.7; letter-spacing: .04em; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; width: 100%; height: 100%; object-fit: cover; max-width: 100%; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.muted { color: var(--muted); }

/* 上方工具列 */
.topbar { background: var(--bar); display: flex; justify-content: space-between; align-items: center; padding: 6px 24px; font-size: 12px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; }
.social, .tools { display: flex; gap: 18px; align-items: center; }
.social a { font-family: var(--serif); font-size: 14px; font-weight: 500; }
.tools a, .tools button { display: inline-flex; gap: 5px; align-items: center; }
.tools svg { width: 13px; height: 13px; }

/* Logo＋選單 */
.brand { text-align: center; padding: 26px 16px 18px; }
.logo { display: inline-block; }
.logo img { width: auto; height: 118px; }
.tagline { font-size: 9px; letter-spacing: .32em; color: var(--muted); margin-top: 10px; }
.nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 0; padding: 0 16px 16px; font-size: 13px; border-bottom: 1px solid var(--line); }
.nav a { padding: 2px 14px; position: relative; }
.nav a + a::before { content: "·"; position: absolute; left: -2px; color: var(--muted); }
.nav a.on, .nav a:hover { color: var(--sale); }
.nav .gap { width: 22px; }

/* 首頁輪播 Banner */
.banner { position: relative; aspect-ratio: 16/7; max-height: 78vh; overflow: hidden; background: var(--soft); }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s; }
.slide.on { opacity: 1; z-index: 1; }
.slide img { transform: scale(1.04); transition: transform 6s ease-out; }
.slide.on img { transform: scale(1); }
.cap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; text-align: center; padding: 0 16px; background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,.28)); }
.cap h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(34px, 6vw, 76px); letter-spacing: .18em; line-height: 1.1; text-wrap: balance; }
.cap p { font-family: var(--serif); font-size: clamp(15px, 1.8vw, 22px); letter-spacing: .12em; margin-top: 10px; }
.dots { position: absolute; left: 0; right: 0; bottom: 16px; display: flex; justify-content: center; gap: 10px; z-index: 2; }
.dots button { width: 7px; height: 7px; border-radius: 50%; border: 1px solid #fff; }
.dots button.on { background: #fff; }
.ship { text-align: center; font-family: var(--mono); font-size: 13px; padding: 44px 16px 8px; }
.ship small { display: block; font-family: var(--sans); color: var(--muted); font-size: 11px; margin-top: 4px; }

/* 區塊 */
.section { padding: 56px 24px; max-width: 1280px; margin: 0 auto; }
.title { text-align: center; font-size: 18px; letter-spacing: .12em; font-weight: 400; margin-bottom: 28px; }
.title small { display: block; font-size: 12px; color: var(--muted); letter-spacing: .1em; }

/* 商品卡 */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px 18px; }
.card .pic { aspect-ratio: 3/4; background: var(--soft); overflow: hidden; position: relative; }
.card .pic img { transition: opacity .4s; }
.card .pic .alt { position: absolute; inset: 0; opacity: 0; }
.card:hover .pic .alt { opacity: 1; }
.ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-family: var(--serif); color: rgba(255,255,255,.9); font-size: 18px; letter-spacing: .25em; }
.tag { position: absolute; top: 10px; left: 10px; font-size: 10px; letter-spacing: .12em; background: var(--bg); padding: 1px 7px; }
.card .meta { text-align: center; padding-top: 12px; }
.card .name { font-size: 13px; }
.card .colors { font-size: 11px; color: var(--muted); }
.price { font-size: 13px; }
.price s { color: var(--muted); margin-right: 8px; }
.price b { font-weight: 400; color: var(--sale); }
.pager { display: flex; justify-content: center; gap: 14px; margin-top: 44px; font-size: 13px; }
.pager .on { border-bottom: 1px solid var(--ink); }

/* 列表頁工具 */
.shop-head { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 32px; }
.search { border: 0; border-bottom: 1px solid var(--ink); background: transparent; padding: 6px 2px; font: inherit; width: 220px; max-width: 100%; outline: none; color: var(--ink); }
.empty { color: var(--muted); text-align: center; padding: 60px 0; grid-column: 1 / -1; }

/* 商品頁 */
.crumb { font-size: 12px; color: var(--muted); max-width: 1180px; margin: 0 auto; padding: 24px 24px 0; }
.pdp { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; max-width: 1180px; margin: 0 auto; padding: 24px 24px 64px; }
.gallery .main { aspect-ratio: 3/4; background: var(--soft); }
.gallery .main img { object-fit: contain; }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 8px; }
.thumbs button { aspect-ratio: 3/4; opacity: .55; transition: opacity .2s; }
.thumbs button.on, .thumbs button:hover { opacity: 1; }
.pdp h1 { font-weight: 400; font-size: 20px; letter-spacing: .08em; }
.pdp .price { font-size: 16px; margin: 6px 0 26px; }
.opt { margin-bottom: 20px; }
.opt h4 { font-weight: 400; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); padding: 5px 14px; font-size: 12px; min-width: 50px; text-align: center; }
.chip.on { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.qty { display: inline-flex; border: 1px solid var(--line); }
.qty button { width: 36px; height: 36px; }
.qty span { width: 40px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.btn { display: block; width: 100%; text-align: center; padding: 13px; font-size: 13px; letter-spacing: .2em; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); }
.btn:hover { opacity: .85; }
.btn-out { background: transparent; color: var(--ink); }
.btn-line { background: #06c755; border-color: #06c755; color: #fff; }
.info { margin-top: 30px; border-top: 1px solid var(--line); }
.info details { border-bottom: 1px solid var(--line); padding: 13px 0; }
.info summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; font-size: 13px; }
.info summary::-webkit-details-marker { display: none; }
.info summary::after { content: "+"; }
.info details[open] summary::after { content: "−"; }
.info p { color: #5d5a56; font-size: 13px; margin-top: 8px; }

/* 文字頁 */
.page { max-width: 720px; margin: 0 auto; padding: 56px 24px; }
.page h1 { font-size: 18px; font-weight: 400; text-align: center; letter-spacing: .15em; margin-bottom: 32px; }
.page h1 small { display: block; font-size: 12px; color: var(--muted); }
.page h3 { font-weight: 500; font-size: 14px; margin: 26px 0 6px; }
.page p, .page li { color: #5d5a56; line-height: 2; }
.page ul { padding-left: 20px; }

/* 頁尾 */
.footer { border-top: 1px solid var(--line); padding: 40px 24px 28px; text-align: center; margin-top: 24px; }
.flinks { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 36px; font-size: 13px; }
.flinks small { display: block; font-size: 10px; color: var(--muted); letter-spacing: .1em; }
.copy { color: var(--muted); font-size: 11px; margin-top: 32px; }
.totop { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--muted); background: var(--bg); font-size: 14px; z-index: 20; }

/* 購物車抽屜 */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.3); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 40; }
.overlay.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(400px, 92vw); background: var(--bg); color: var(--ink); z-index: 50; transform: translateX(100%); transition: transform .35s; padding: calc(24px + env(safe-area-inset-top, 0px)) 22px calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; }
.drawer.on { transform: none; }
.drawer .close { position: absolute; top: calc(16px + env(safe-area-inset-top, 0px)); right: 16px; width: 32px; height: 32px; }
.drawer h3 { font-weight: 400; letter-spacing: .15em; margin-bottom: 16px; font-size: 15px; }
#cartItems { flex: 1; overflow-y: auto; }
.ci { display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.ci .pic { aspect-ratio: 3/4; background: var(--soft); }
.ci .sub { color: var(--muted); font-size: 12px; }
.ci .rm { color: var(--muted); font-size: 12px; text-decoration: underline; }
.ci .qty button, .ci .qty span { width: 26px; height: 26px; }
.cart-sum { border-top: 1px solid var(--ink); padding-top: 14px; display: grid; gap: 8px; }
.row { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; }
.row.total { font-size: 15px; font-weight: 500; margin: 4px 0 6px; }
.toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px); background: var(--ink); color: var(--bg); padding: 10px 20px; font-size: 13px; opacity: 0; transition: .3s; z-index: 60; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 手機 */
@media (max-width: 860px) {
  .topbar { padding: 6px 16px; }
  .tools .hide-m { display: none; }
  .brand { padding: 26px 16px 16px; }
  .logo img { height: 84px; }
  .tagline { font-size: 8px; letter-spacing: .2em; }
  .nav { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 0 8px 12px; scrollbar-width: none; }
  .nav a { white-space: nowrap; }
  .nav .gap { display: none; }
  .banner { aspect-ratio: 4/5; max-height: none; }
  .section { padding: 44px 16px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 10px; }
  .crumb { padding: 16px 16px 0; }
  .pdp { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 16px 16px 48px; }
  .page { padding: 40px 16px; }
  .footer { padding: 32px 16px 24px; }
  .flinks { gap: 14px 24px; }
}

/* 商品介紹（內文） */
.detail { max-width: 760px; margin: 0 auto; padding: 48px 24px 72px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 28px; }
.detail .title { margin-bottom: 8px; }
.d-title { font-family: var(--serif); font-weight: 400; font-size: 24px; letter-spacing: .12em; text-align: center; margin-top: 24px; }
.d-title small { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); letter-spacing: .05em; margin-top: 4px; }
.d-text { text-align: center; color: #5d5a56; line-height: 2.2; font-size: 14px; }
.d-img { width: 100%; height: auto; }
.tbl { width: 100%; overflow-x: auto; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 10px 8px; font-weight: 300; }
.tbl tr:first-child th { background: var(--soft); font-weight: 400; }
.tbl .spec { text-align: left; }
.tbl .spec th { width: 90px; background: var(--soft); font-weight: 400; }
.tbl .spec tr:first-child th { background: var(--soft); }
.d-notice { width: 100%; color: #5d5a56; font-size: 13px; line-height: 2; padding-left: 20px; }
@media (max-width: 860px) { .detail { padding: 40px 16px 56px; gap: 22px; } .d-text { font-size: 13px; } }

/* ===== APP 模式（手機）===== */
.tabbar, .buybar { display: none; }
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cat { position: relative; display: block; }
.cat .pic { aspect-ratio: 3/4; background: var(--soft); overflow: hidden; }
.cat span { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 10px 10px; color: #fff; font-size: 13px; letter-spacing: .12em; text-align: center; background: linear-gradient(to top, rgba(0,0,0,.45), rgba(0,0,0,0)); }
@media (max-width: 860px) {
  body { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); -webkit-tap-highlight-color: transparent; }
  .topbar .tools, .totop { display: none; }
  .topbar { justify-content: center; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; background: rgba(255,255,255,.97); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--muted); position: relative; }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .on { color: var(--ink); }
  .badge { position: absolute; top: -3px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 10px; font-weight: 400; line-height: 16px; text-align: center; }
  .buybar { display: flex; align-items: center; gap: 14px; position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom, 0px)); z-index: 34; background: var(--bg); border-top: 1px solid var(--line); padding: 8px 16px; }
  .buybar .price { margin: 0; white-space: nowrap; font-size: 14px; }
  .buybar .btn { flex: 1; padding: 11px; }
  .pdp ~ .section { padding-bottom: 96px; }
  .footer { padding-bottom: 80px; }
  .drawer { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
