/* 宗教品牌商城（信眾）：溫潤、安靜，商品圖 1:1 完整顯示 */
body[data-site="shop"] { --brand: #8C5A3C; --brand-dark: #6E4329; --brand-soft: #F1E4D6; --gold: #B8893B; padding-bottom: env(safe-area-inset-bottom); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 99; background: #fff; padding: .4em .8em; border-radius: 8px; }
#view { outline: none; min-height: 60vh; }
.icon-link { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.icon-link svg, .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.cart-link b, .tb-count { position: absolute; top: -6px; right: -10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.shop-nav a[aria-current="page"] { color: var(--brand-dark); font-weight: 700; }

/* 手機底部導覽 */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px);
    border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); text-decoration: none; position: relative; }
  .tabbar a[aria-current="page"] { color: var(--brand-dark); }
  .tb-count { top: -4px; right: calc(50% - 22px); }
  body[data-site="shop"] .foot { padding-bottom: 96px; }
  .shop-nav .cart-link { display: none; }
}

/* 輪播 BN：1600×700（16:7） */
.bn { position: relative; margin: 20px 0 8px; border-radius: var(--radius); overflow: hidden; background: var(--brand-soft); aspect-ratio: 16/7; }
.bn-track { display: flex; height: 100%; transition: transform .45s ease; }
.bn-slide { flex: 0 0 100%; position: relative; display: block; color: #fff; text-decoration: none; }
.bn-slide img { width: 100%; height: 100%; object-fit: cover; }
.bn-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 24px 20px; background: linear-gradient(transparent, rgba(30, 18, 8, .55)); }
.bn-cap h2 { margin: 0; font-size: clamp(1.1rem, 3vw, 1.8rem); color: #fff; }
.bn-cap p { margin: 2px 0 0; opacity: .92; font-size: .95em; }
.bn-dots { position: absolute; right: 14px; bottom: 12px; display: flex; gap: 6px; }
.bn-dots button { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: rgba(255, 255, 255, .55); cursor: pointer; }
.bn-dots button[aria-current="true"] { background: #fff; width: 20px; border-radius: 4px; }
.shop-hero { padding: 48px 0 24px; text-align: center; }
.shop-hero h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }

.cats { display: flex; gap: 8px; overflow-x: auto; padding: 16px 0 6px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .4em 1em; font: inherit; cursor: pointer; color: var(--ink); }
.cats button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 商品卡：1000×1000（1:1）完整顯示 */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; margin: 16px 0 40px; }
@media (max-width: 520px) { .pgrid { grid-template-columns: 1fr 1fr; gap: 12px; } }
.pcard { display: flex; flex-direction: column; text-decoration: none; color: inherit; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(60, 40, 20, .12); }
.pcard .ph { aspect-ratio: 1; background: #fff; display: grid; place-items: center; border-bottom: 1px solid var(--line); position: relative; }
.pcard .ph img { width: 100%; height: 100%; object-fit: contain; }
.ph-empty { color: var(--brand); font-size: 2.2em; font-family: var(--serif); opacity: .5; }
.pcard .pb { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pcard h3 { font-size: 1em; margin: 0; font-family: var(--font); font-weight: 600; }
.pcard .sum { color: var(--muted); font-size: .85em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { font-weight: 700; color: var(--brand-dark); }
.price s { color: var(--muted); font-weight: 400; font-size: .85em; margin-left: .4em; }
.pcard .price { margin-top: auto; padding-top: 6px; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff; font-size: .78em; padding: .15em .7em; border-radius: 999px; }
.badge.sale { background: var(--bad); }

.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 28px; }
.sec-head h2 { margin: 0; font-size: 1.4em; }

/* 商品頁 */
.crumbs { font-size: .85em; color: var(--muted); padding: 18px 0 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.pdp { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: start; margin-bottom: 40px; }
@media (max-width: 800px) { .pdp { grid-template-columns: 1fr; gap: 20px; } }
.gallery .main { aspect-ratio: 1; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); display: grid; place-items: center; overflow: hidden; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs button { flex: none; width: 68px; height: 68px; padding: 0; border: 2px solid transparent; border-radius: 10px; background: #fff; cursor: pointer; overflow: hidden; }
.thumbs button[aria-current="true"] { border-color: var(--brand); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; }
.pinfo h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-top: 6px; }
.pinfo .price { font-size: 1.5em; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; overflow: hidden; }
.qty button { width: 38px; height: 38px; border: 0; background: none; font-size: 1.2em; cursor: pointer; color: var(--ink); }
.qty input { width: 48px; border: 0; text-align: center; padding: 0; outline: none; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.buy { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 18px 0; }
.buy .btn { flex: 1; min-width: 140px; }
.note-line { font-size: .88em; color: var(--muted); }
.prose { line-height: 1.9; }
.prose p { margin: 0 0 1em; }
.stock-low { color: var(--warn); font-weight: 600; font-size: .9em; }

/* 文章 */
.alist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; margin: 16px 0 40px; }
.acard { text-decoration: none; color: inherit; overflow: hidden; display: flex; flex-direction: column; }
.acard .cv { aspect-ratio: 16/9; background: var(--brand-soft); display: grid; place-items: center; }
.acard .cv img { width: 100%; height: 100%; object-fit: cover; }
.acard .ab { padding: 14px 16px 18px; }
.acard h3 { font-size: 1.05em; margin: 6px 0 4px; }
.article { max-width: 760px; margin: 0 auto 40px; }
.article .cover { aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; margin: 12px 0 20px; }
.article .cover img { width: 100%; height: 100%; object-fit: cover; }
.article figcaption { font-size: .85em; color: var(--muted); margin-top: -12px; margin-bottom: 18px; }

/* 購物車、結帳 */
.page-title { padding: 28px 0 8px; }
.cart-grid { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; margin-bottom: 40px; }
@media (max-width: 860px) { .cart-grid { grid-template-columns: 1fr; } }
.line-item { display: grid; grid-template-columns: 76px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.line-item:last-child { border-bottom: 0; }
.line-item .ph { width: 76px; height: 76px; border-radius: 10px; background: #fff; border: 1px solid var(--line); overflow: hidden; display: grid; place-items: center; }
.line-item .ph img { width: 100%; height: 100%; object-fit: contain; }
.line-item a { color: inherit; text-decoration: none; font-weight: 600; }
.line-item .rm { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: .85em; padding: 4px 0; text-decoration: underline; }
@media (max-width: 480px) { .line-item { grid-template-columns: 60px 1fr; } .line-item .ph { width: 60px; height: 60px; } .line-item .end { grid-column: 2; display: flex; justify-content: space-between; align-items: center; } }
.summary { padding: 20px; position: sticky; top: 80px; }
.summary dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0 0 14px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; }
.summary .total { font-size: 1.25em; font-weight: 700; color: var(--brand-dark); }
.hint { background: var(--brand-soft); color: var(--brand-dark); border-radius: 10px; padding: .6em .9em; font-size: .88em; margin: 0 0 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.seg label { margin: 0; padding: .45em 1.1em; font-weight: 400; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; }
.seg label:has(input:checked) { background: var(--brand); color: #fff; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--brand); }

/* 訂單、會員 */
.status { display: inline-block; padding: .15em .8em; border-radius: 999px; font-size: .85em; font-weight: 600; background: var(--brand-soft); color: var(--brand-dark); }
.status.paid, .status.shipped, .status.done { background: #EAF4EE; color: var(--ok); }
.status.failed, .status.expired, .status.cancelled, .status.refunded { background: #F6E6E6; color: var(--bad); }
.order-box { padding: 22px; margin-bottom: 16px; }
.payinfo { border: 1px dashed var(--brand); border-radius: 12px; padding: 14px 16px; margin: 14px 0; background: #FFFBF6; }
.payinfo b { font-family: ui-monospace, monospace; font-size: 1.15em; letter-spacing: .05em; }
.olist a { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.olist a:last-child { border-bottom: 0; }
.olist a:hover { background: #FFFBF6; }
.acct { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; margin-bottom: 40px; }
@media (max-width: 800px) { .acct { grid-template-columns: 1fr; } }
.test-banner { background: #FFF5E0; color: #8A5A00; border: 1px solid #F0D9A8; border-radius: 10px; padding: .6em .9em; font-size: .88em; margin: 10px 0; }
