/* 韓式小清新主題:白底、牛油黃主色,配以淡桃、薄荷、淡紫等粉彩點綴;
   細線條、大留白、圓角、輕陰影。品牌一致起見只有一套淺色主題。 */
:root {
  color-scheme: light;
  --bg: #ffffff;            /* 白底 */
  --bg-2: #fff6dc;          /* 淡牛油黃區塊 */
  --surface: #ffffff;
  --text: #4d4136;          /* 柔和的深啡 */
  --muted: #776655;
  --line: #f1e8d2;
  --brand: #fbe08a;         /* 牛油黃:按鈕、選中狀態 */
  --brand-soft: #fff1c4;
  --brand-ink: #4a3a1e;
  --brand-text: #8a5e08;    /* 奶白底上的品牌色文字 */
  --accent: #a84a32;        /* 價錢(柔和磚紅) */
  --peach: #fde9df; --mint: #e4f3ea; --lilac: #eee8f8; --sky: #e5f0fa;   /* 粉彩點綴 */
  --ok: #3d7a4a;
  --warn-bg: #fff6dc;
  --danger: #b3261e;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(150, 120, 60, .06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Noto Sans TC", "Pretendard", "Apple SD Gothic Neo", "Microsoft JhengHei UI", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.65; letter-spacing: .01em; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.eyebrow { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--brand-text); font-weight: 600; }

.banner { background: var(--brand-soft); color: var(--brand-ink); text-align: center; padding: 6px 16px; font-size: 12.5px; letter-spacing: .05em; }
header.top { background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 64px; padding-top: 6px; padding-bottom: 6px; gap: 12px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 20px; text-decoration: none; color: var(--brand-ink); display: inline-flex; align-items: center; gap: 9px; letter-spacing: .04em; }
.logo::before { content: ""; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, #fff 0 26%, #fbe08a 28% 58%, #f5c96a 60% 100%); box-shadow: 0 0 0 3px var(--peach); }
.nav { display: flex; gap: 6px 18px; align-items: center; font-size: 13.5px; flex-wrap: wrap; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--text); }
.cart-btn { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 16px; cursor: pointer; font-size: 13.5px; }
.cart-btn:hover { background: var(--brand-soft); }
.cart-btn b { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; margin-left: 6px; font-size: 11px; font-weight: 600; }

/* 首頁主視覺 */
.hero { position: relative; overflow: hidden; margin: 22px 0 6px; padding: 40px 28px; border-radius: 28px; text-align: center;
  background: linear-gradient(120deg, #fff3c6 0%, #fdeee2 55%, #eaf4ee 100%); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; }
.hero::before { width: 150px; height: 150px; right: -30px; top: -40px; background: radial-gradient(circle, #fff 0 24%, #fbe08a 26% 58%, #f6cf7a 60% 100%); opacity: .8; }
.hero::after { width: 90px; height: 90px; left: -20px; bottom: -28px; background: radial-gradient(circle, #fff 0 24%, #f8d3c4 26% 60%, #f1bba6 62% 100%); opacity: .7; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { margin: 8px 0 8px; font-size: 26px; font-weight: 600; color: var(--brand-ink); letter-spacing: .06em; }
.hero p { margin: 0; color: var(--muted); font-size: 13.5px; }
.hero .pill { display: inline-block; margin-top: 16px; background: rgba(255,255,255,.85); border: 1px solid var(--line); border-radius: 999px; padding: 5px 16px; font-size: 12.5px; color: var(--brand-text); }

.section-title { display: flex; align-items: baseline; gap: 10px; margin: 22px 0 2px; }
.section-title h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: .06em; }

.search { width: 100%; max-width: 420px; margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; font-size: 14px; }
.search:focus { outline: none; border-color: #f0c64e; box-shadow: 0 0 0 3px var(--brand-soft); }
.cats { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 14px; scrollbar-width: thin; }
.chip { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 15px; cursor: pointer; font-size: 13px; color: var(--muted); }
.chip:hover { background: var(--brand-soft); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 600; }

.promo { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; margin-bottom: 18px; font-size: 13px; color: var(--muted); }
.promo b { color: var(--accent); font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px 18px; padding-bottom: 40px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(150, 120, 60, .12); }
.card .img { aspect-ratio: 1 / 1; display: grid; place-items: center; position: relative; margin: 8px 8px 0; border-radius: 14px; overflow: hidden; background-color: var(--bg-2) !important; }
.card:nth-child(4n+2) .img { background-color: var(--peach) !important; }
.card:nth-child(4n+3) .img { background-color: var(--mint) !important; }
.card:nth-child(4n+4) .img { background-color: var(--lilac) !important; }
.card .img i { width: 44%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 7px rgba(255,255,255,.4), 0 0 0 9px rgba(255,255,255,.7); }
.tag { position: absolute; top: 10px; left: 10px; z-index: 1; background: rgba(255,255,255,.9); color: var(--brand-text); border-radius: 999px; font-size: 11px; font-weight: 600; padding: 1px 10px; letter-spacing: .05em; }
.card .body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card h3 { font-size: 14.5px; font-weight: 600; margin: 0; line-height: 1.45; }
.card .spec { font-size: 12px; color: var(--muted); }
.card .offer { font-size: 11.5px; color: var(--accent); background: var(--peach); border-radius: 999px; padding: 1px 9px; align-self: flex-start; margin: 2px 0; }
.price { font-weight: 600; color: var(--accent); font-size: 15px; }
.card .row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; }
.btn { border: 1px solid #f3cf62; background: var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 7px 18px; cursor: pointer; font-weight: 600; font-size: 14px; transition: background .15s; }
.btn:hover { background: #f8d76d; }
.btn.ghost { background: transparent; color: var(--brand-text); border-color: var(--line); font-weight: 500; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { border-color: #e3b0aa; color: var(--danger); background: transparent; font-weight: 500; }
.btn.small { padding: 3px 13px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
select, input[type=number], input[type=text], input[type=date], input[type=password] { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; }
select:focus, input:focus { border-color: #f0c64e; outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }

.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--brand-text); }
a.card { color: inherit; text-decoration: none; }
.line a.sw { display: block; }

/* 商品詳情頁 */
.crumbs { font-size: 12.5px; color: var(--muted); margin: 18px 0 12px; }
.crumbs a { color: var(--brand-text); text-decoration: none; }
.pd-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.gallery { position: sticky; top: 84px; }
.pd-main { aspect-ratio: 1 / 1; border-radius: 24px; overflow: hidden; display: grid; place-items: center; position: relative; border: 1px solid var(--line); }
.pd-main img { width: 100%; height: 100%; object-fit: cover; }
.pd-main .swatch, .card.mini .img i { aspect-ratio: 1; border-radius: 50%; box-shadow: inset 0 0 0 10px rgba(255,255,255,.4), 0 0 0 14px rgba(255,255,255,.7); }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumb { width: 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--bg-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb[aria-pressed="true"] { border-color: #f0c64e; }
.pd-info h1 { font-size: 22px; font-weight: 600; margin: 6px 0 4px; line-height: 1.4; letter-spacing: .02em; }
.pd-spec { color: var(--muted); font-size: 13.5px; }
.pd-price { font-size: 24px; font-weight: 600; color: var(--accent); margin: 14px 0 10px; }
.pd-price .badge { font-size: 12px; vertical-align: middle; color: var(--brand-text); border-color: var(--brand); background: var(--brand-soft); }
.pd-offers { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.pd-offers .offer { font-size: 12px; color: var(--accent); background: var(--peach); border-radius: 999px; padding: 2px 11px; }
.pd-deal { width: 100%; background: var(--peach); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.pd-deal b { font-size: 13.5px; color: var(--accent); }
.pd-deal span { font-size: 12.5px; color: var(--text); }
.pd-info .f select { width: 100%; max-width: 320px; padding: 9px 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: #fff; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 20px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.qty button { width: 38px; height: 36px; border: 0; background: transparent; cursor: pointer; font-size: 16px; }
.qty span { min-width: 34px; text-align: center; }
.pd-add { width: 100%; max-width: 320px; padding: 12px 18px; font-size: 15px; margin-top: 4px; }
.pd-notes { list-style: none; padding: 14px 0 0; margin: 14px 0 0; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pd-notes li { padding: 2px 0; }
.pd-notes li::before { content: "·"; color: var(--brand-text); font-weight: 700; margin-right: 8px; }
.pd-desc { margin: 36px 0 10px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 20px; }
.pd-desc h2 { margin: 0 0 10px; font-size: 16px; font-weight: 600; letter-spacing: .06em; }
#desc { white-space: pre-wrap; font-size: 14px; line-height: 1.85; }
#stockBlock .btn { margin-top: 4px; }
.pd-detail { margin: 36px auto 10px; max-width: 760px; }
.pd-detail h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; letter-spacing: .06em; }
.pd-detail img { display: block; width: 100%; height: auto; }
.grid.related { margin-top: 12px; }
.card.mini .body { gap: 2px; }
@media (max-width: 760px) {
  .pd-grid { grid-template-columns: 1fr; gap: 18px; }
  .gallery { position: static; }
  .pd-main { border-radius: 18px; }
  .pd-info .f select, .pd-add { max-width: none; }
}

/* 首頁導購 */
.hero-cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.hero-cta .btn { text-decoration: none; }
.block { margin: 30px 0 6px; }
.deal-row, .hot-row { display: flex; gap: 14px; overflow-x: auto; padding: 10px 2px 12px; scroll-snap-type: x mandatory; }
.deal { flex: 0 0 300px; scroll-snap-align: start; display: flex; gap: 12px; align-items: stretch; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 18px; padding: 10px; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s; }
.deal:hover { transform: translateY(-2px); }
.deal-img { flex: 0 0 86px; height: 86px; border-radius: 12px; overflow: hidden; background: var(--peach); display: grid; place-items: center; }
.deal-img img { width: 100%; height: 100%; object-fit: cover; }
.deal-img i { width: 46px; height: 46px; border-radius: 50%; background: var(--brand); }
.deal-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.deal-body b { font-size: 14px; line-height: 1.35; }
.deal-body > span { font-size: 12.5px; color: var(--accent); }
.deal-body .deal-meta { color: var(--muted); font-size: 11.5px; }
.deal-body .deal-cta { margin-top: auto; color: var(--brand-text); font-weight: 600; font-size: 12.5px; }
/* 快速篩選面板:每行一類條件,可多選 */
.finder { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 4px 20px 18px; box-shadow: var(--shadow); }
.finder-hint { margin: 2px 0 6px; font-size: 12.5px; color: var(--muted); }
.finder-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.finder-label { font-size: 14px; padding-top: 6px; display: flex; flex-direction: column; }
.finder-label em { font-style: normal; font-weight: 400; font-size: 11px; color: var(--muted); }
.finder-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-size: 13.5px; color: var(--text); }
.fchip:hover:not(:disabled) { background: var(--brand-soft); }
.fchip em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.fchip.on { background: var(--brand); border-color: #f3cf62; color: var(--brand-ink); font-weight: 600; }
.fchip.on em { color: var(--brand-ink); }
.fchip:disabled { opacity: .4; cursor: default; }
.finder-foot { display: flex; align-items: center; gap: 16px; padding-top: 14px; }
@media (max-width: 760px) {
  .finder { padding: 2px 14px 14px; }
  .finder-row { grid-template-columns: 1fr; gap: 6px; }
  .finder-label { flex-direction: row; align-items: baseline; gap: 8px; padding-top: 0; }
  .finder-foot .btn { flex: 1; }
}
.hot-row .card.mini { flex: 0 0 170px; scroll-snap-align: start; }
.rank { position: absolute; top: 8px; left: 8px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 13px; display: grid; place-items: center; }

/* 商品列表:篩選 + 排序 */
.shop-bar { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 10px; }
.shop-bar .search { margin-top: 0; flex: 1 1 260px; }
.shop-tools { display: flex; gap: 10px; align-items: center; }
.sort { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.filter-btn { display: none; }
.filter-btn b { background: var(--accent); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; }
.filter-btn b:empty { display: none; }
.shop-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; margin-top: 16px; align-items: start; }
.filters { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 4px; }
.filters-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.close-filters { display: none; }
.facet { border-bottom: 1px solid var(--line); padding: 8px 0; }
.facet summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; display: flex; justify-content: space-between; }
.facet summary::after { content: "+"; color: var(--muted); }
.facet[open] summary::after { content: "−"; }
.facet-opts { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; }
.opt { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 6px; border-radius: 8px; cursor: pointer; color: var(--text); }
.opt:hover { background: var(--bg-2); }
.opt.on { background: var(--brand-soft); font-weight: 600; }
.opt input { accent-color: #c99a1d; margin: 0; }
.opt span { flex: 1; }
.opt em { font-style: normal; color: var(--muted); font-size: 12px; }
.dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); flex: 0 0 14px; }
.active-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.active-chips:empty { display: none; }
.chip.on { background: var(--brand-soft); border-color: #f0c64e; color: var(--brand-ink); }
.result-count { font-size: 13px; color: var(--muted); margin: 8px 0 10px; }
.more { text-align: center; margin: -10px 0 20px; }
.card .tags { position: absolute; top: 10px; left: 10px; z-index: 1; display: flex; gap: 4px; }
.card .tags .tag { position: static; }
.tag.hot { background: var(--accent); color: #fff; }
.card .meta { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.deal-tag { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; background: var(--peach); border-radius: 10px; padding: 4px 9px; margin: 3px 0; font-size: 11.5px; color: var(--accent); }
.deal-tag b { font-weight: 600; }
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 30px 0 10px; }
.trust div { border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; background: var(--bg-2); display: flex; flex-direction: column; gap: 2px; }
.trust b { font-size: 14px; }
.trust span { font-size: 12.5px; color: var(--muted); }
#filterOverlay { z-index: 12; }
@media (max-width: 900px) {
  .quick { grid-template-columns: 1fr; }
  .shop-layout { grid-template-columns: 1fr; }
  .filter-btn { display: inline-flex; gap: 6px; align-items: center; }
  .filters { position: fixed; top: 0; left: 0; bottom: 0; width: min(330px, 88%); max-height: none; background: #fff; z-index: 13; padding: 16px; transform: translateX(-105%); transition: transform .2s; box-shadow: 4px 0 24px rgba(120, 85, 20, .2); }
  .filters.open { transform: none; }
  .close-filters { display: inline-block; }
}

/* 購物車:免運進度、湊單推薦 */
.ship-progress { background: var(--bg-2); border-radius: 12px; padding: 8px 12px; margin-bottom: 6px; }
.sp-text { font-size: 13px; }
.sp-text b { color: var(--accent); }
.sp-bar { height: 8px; background: #fff; border-radius: 999px; overflow: hidden; margin-top: 6px; border: 1px solid var(--line); }
.sp-bar i { display: block; height: 100%; background: linear-gradient(90deg, #fbe08a, #f3b94d); border-radius: 999px; transition: width .3s; }
.suggest { border: 1px dashed #f0c64e; border-radius: 12px; padding: 8px 10px; margin: 4px 0; background: #fffdf5; }
.sg-title { font-size: 12.5px; font-weight: 600; color: var(--brand-ink); margin-bottom: 4px; }
.sg-row { display: grid; grid-template-columns: 38px 1fr auto; gap: 8px; align-items: center; padding: 4px 0; }
.sg-img { width: 38px; height: 38px; border-radius: 8px; }
.sg-name { font-size: 12px; line-height: 1.35; }
.sg-name em { display: block; font-style: normal; color: var(--accent); }
.sg-row .btn small { font-weight: 400; font-size: 10.5px; }

/* 會員頁 */
.acct { padding-top: 24px; padding-bottom: 40px; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.acct-card { padding: 24px; border-radius: 22px; }
.acct-card h1, .acct-card h2, .acct-head h1 { margin: 6px 0 6px; font-size: 21px; font-weight: 600; letter-spacing: .04em; }
.acct-note { font-size: 13px; color: var(--muted); }
.acct-card .f input { width: 100%; padding: 10px 14px; border-radius: 999px; }
.btn.wide { width: 100%; padding: 11px 18px; }
.linkbtn { border: 0; background: none; color: var(--brand-text); cursor: pointer; padding: 0; font-size: 13px; text-decoration: underline; }
.acct-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.acct-tabs { margin-bottom: 16px; }
.order-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; text-decoration: none; color: inherit; transition: box-shadow .15s; }
.order-card:hover { box-shadow: 0 8px 22px rgba(150, 120, 60, .12); }
.oc-name { font-weight: 600; margin: 2px 0 6px; }
.oc-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.oc-total { text-align: right; font-weight: 600; color: var(--accent); white-space: nowrap; }
.oc-total span { display: block; font-size: 12px; color: var(--brand-text); font-weight: 500; margin-top: 4px; }
.oc-total a { display: block; font-size: 12px; color: var(--brand-text); font-weight: 500; margin: 4px 0; text-decoration: none; }
.oc-total .btn { margin-top: 2px; }

/* 手機:每行兩件商品,字級與留白收細 */
@media (max-width: 560px) {
  .wrap { padding: 0 14px; }
  .hero { padding: 30px 18px; border-radius: 22px; }
  .hero h1 { font-size: 22px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .card { border-radius: 14px; }
  .card .img { margin: 6px 6px 0; border-radius: 10px; }
  .card .body { padding: 8px 10px 12px; }
  .card h3 { font-size: 13px; }
  .card .spec, .card label.spec { font-size: 11px; }
  .card select { max-width: 100%; font-size: 12px; padding: 4px 6px; }
  .card .row { flex-direction: column; align-items: stretch; gap: 6px; }
  .card .row .btn { width: 100%; }
}

.site-footer { border-top: 1px solid var(--line); margin-top: 20px; padding: 26px 0 40px; text-align: center; font-size: 12.5px; color: var(--muted); }
.site-footer a { color: var(--brand-text); text-decoration: none; margin: 0 8px; }

/* 購物車側欄 */
.overlay { position: fixed; inset: 0; background: rgba(74, 56, 38, .35); display: none; z-index: 10; }
.overlay.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100%); background: var(--surface); z-index: 11; transform: translateX(100%); transition: transform .2s; display: flex; flex-direction: column; box-shadow: -4px 0 24px rgba(120, 85, 20, .2); }
.drawer.open { transform: none; }
.drawer header { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-weight: 700; background: var(--bg-2); }
.drawer .items { flex: 1; overflow-y: auto; padding: 8px 16px; }
.line { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line .sw { width: 48px; height: 48px; border-radius: 10px; }
.line .nm { font-size: 14px; }
.line .ctl { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.line .ctl button { width: 26px; height: 26px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; }
.drawer footer { border-top: 1px solid var(--line); padding: 12px 16px; display: grid; gap: 4px; font-size: 14px; }
.drawer footer .tot { font-size: 18px; font-weight: 700; display: flex; justify-content: space-between; }
.sum { display: flex; justify-content: space-between; }
.sum.disc { color: var(--ok); }
.hint { background: var(--warn-bg); border-radius: 10px; padding: 6px 10px; font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* 後台 */
.admin-grid { display: grid; grid-template-columns: 1fr 340px; gap: 20px; padding: 20px 0 60px; align-items: start; }
.admin-grid.orders-grid { grid-template-columns: 360px 1fr; }
@media (max-width: 860px) { .admin-grid, .admin-grid.orders-grid { grid-template-columns: 1fr; } }
.admin-grid > * { min-width: 0; }           /* 避免長內容把版面撐出螢幕 */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.panel h2 { font-size: 16px; margin: 0 0 10px; }
.offer-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.offer-row:last-child { border-bottom: 0; }
.offer-row .n { font-weight: 600; }
.offer-row .d { font-size: 13px; color: var(--muted); }
.badge { font-size: 12px; border-radius: 999px; padding: 1px 8px; border: 1px solid var(--line); color: var(--muted); background: #fff; }
.badge.on { color: var(--ok); border-color: #9cc796; }
.badge.exp { color: var(--danger); border-color: #e3a29d; }
.switch { width: 40px; height: 22px; border-radius: 999px; background: #e7d6a8; position: relative; border: 0; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { left: 20px; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.modal { position: fixed; inset: 0; background: rgba(74, 56, 38, .4); display: none; align-items: flex-start; justify-content: center; overflow-y: auto; z-index: 20; padding: 24px 12px; }
.modal.open { display: flex; }
.modal .box { background: var(--surface); width: min(640px, 100%); border-radius: 18px; padding: 20px; box-shadow: 0 20px 50px rgba(120, 85, 20, .25); }
.modal h2 { margin: 0 0 12px; font-size: 18px; }
.f { display: grid; gap: 4px; margin-bottom: 12px; }
.f > label { font-size: 13px; color: var(--muted); }
.f .inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.f input[type=number] { width: 90px; }
.f input[type=text] { width: 100%; }
.typegrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.typeopt { border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; cursor: pointer; font-size: 14px; background: #fff; text-align: left; }
.typeopt[aria-pressed="true"] { border-color: #e9b52f; background: var(--brand-soft); box-shadow: 0 0 0 2px #e9b52f inset; }
.summary { background: var(--warn-bg); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin-bottom: 12px; }
table.pv { width: 100%; border-collapse: collapse; font-size: 13px; }
table.pv th, table.pv td { text-align: right; padding: 3px 6px; border-bottom: 1px solid var(--line); }
table.pv th:first-child, table.pv td:first-child { text-align: left; }
table.pv tr.hit td { color: var(--ok); font-weight: 600; }
.err { color: var(--danger); font-size: 13px; min-height: 1.2em; }
.sim-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.sim-row input { width: 64px; }

/* ---------- 後台外框(版本 A):左邊選單 + 內容;手機改為底部選單 ---------- */
body.admin { background: #fffdf8; }
body.admin .aside { position: fixed; top: 0; left: 0; bottom: 0; width: 216px; background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; z-index: 20; }
body.admin .aside .logo { padding: 2px 10px 16px; font-size: 18px; }
body.admin .anav { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; text-decoration: none; color: var(--text); font-size: 15.5px; position: relative; }
body.admin .anav:hover { background: var(--bg-2); }
body.admin .anav[aria-current] { background: var(--brand-soft); font-weight: 700; color: var(--brand-ink); }
body.admin .anav .ico { width: 22px; text-align: center; font-size: 17px; }
body.admin .anav .n { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; font-size: 12px; padding: 0 8px; font-weight: 700; line-height: 20px; }
body.admin .aside .foot { margin-top: auto; font-size: 13.5px; color: var(--muted); padding: 8px 12px; display: grid; gap: 6px; }
body.admin .aside .foot a, body.admin .aside .foot button { color: var(--muted); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; font-size: 13.5px; text-decoration: none; }
body.admin .aside .foot a:hover, body.admin .aside .foot button:hover { color: var(--text); }
body.admin main.wrap { margin-left: 216px; max-width: 1160px; padding: 6px 28px 60px; }
body.admin .page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 20px 0 14px; }
body.admin .page-head h1 { font-size: 22px; margin: 0; }
body.admin .page-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
body.admin .subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
body.admin .subtabs a { text-decoration: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 16px; font-size: 14.5px; color: var(--muted); }
body.admin .subtabs a[aria-current] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 700; }
body.admin .admin-grid { padding-top: 0; }
body.admin .btn.big { padding: 12px 24px; font-size: 16px; }
body.admin .btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
body.admin .btn.ok:hover { background: #356b40; }
@media (max-width: 860px) {
  body.admin .aside { top: auto; right: 0; width: auto; height: auto; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); justify-content: space-around; gap: 0; }
  body.admin .aside .logo, body.admin .aside .foot { display: none; }
  body.admin .anav { flex: 1; flex-direction: column; gap: 0; padding: 6px 2px; font-size: 11.5px; text-align: center; }
  body.admin .anav .ico { font-size: 19px; }
  body.admin .anav .n { position: absolute; top: 2px; left: 55%; margin: 0; font-size: 11px; padding: 0 6px; line-height: 17px; }
  body.admin main.wrap { margin-left: 0; padding: 4px 16px 92px; }
  body.admin .mobile-top { display: flex !important; }
}
body.admin .mobile-top { display: none; justify-content: space-between; align-items: center; padding: 12px 0 0; font-size: 13.5px; }
body.admin .mobile-top a, body.admin .mobile-top button { color: var(--muted); background: none; border: 0; font-size: 13.5px; text-decoration: none; cursor: pointer; padding: 0; }

/* 首頁「按品牌選購」 */
.brand-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding-top: 8px; }
.brand { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 8px 8px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; text-align: left; transition: transform .15s, box-shadow .15s; }
.brand:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.brand .bimg { aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--bg-2); margin-bottom: 6px; display: block; }
.brand .bimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand b { font-size: 15.5px; padding: 0 4px; }
.brand em { font-style: normal; font-size: 12.5px; color: var(--muted); padding: 0 4px; }
@media (max-width: 560px) { .brand-row { grid-template-columns: repeat(2, 1fr); } }

/* 結帳:順豐站/智能櫃選擇器 */
.sfp { display: grid; gap: 8px; }
.sfp-type { display: flex; gap: 6px; flex-wrap: wrap; }
.sfp-sel { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sfp select, .sfp input { width: 100%; }
.sfp-p { min-height: 150px; font-size: 14px; }
.sfp-chosen { font-size: 14px; background: var(--brand-soft); border-radius: 10px; padding: 8px 10px; }
.sfp-chosen:empty { display: none; }
.sfp-chosen span { font-size: 12.5px; color: var(--muted); }

/* 付款資料框(結帳頁、訂單頁) */
.paybox { background: var(--warn-bg); border: 1px solid #f3dfa2; border-radius: var(--radius); padding: 12px 14px; margin: 6px 0 12px; display: grid; gap: 8px; }
.pay-head { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 16px; }
.pay-head span { font-weight: 400; font-size: 14px; }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-bottom: 1px dashed #ecd9a0; padding-bottom: 6px; font-size: 14.5px; }
.pay-row .k { color: var(--muted); font-size: 13px; }
.pay-row .v { display: flex; align-items: center; gap: 6px; word-break: break-all; }
.pay-copy { padding: 2px 10px; font-size: 12px; }
.pay-qr { display: grid; justify-items: center; gap: 4px; text-decoration: none; color: var(--muted); font-size: 12px; }
.pay-qr img { width: 220px; max-width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.pay-note, .pay-ddl { font-size: 13.5px; }
.pay-ddl { color: var(--accent); font-weight: 600; }

/* 內容頁(條款、私隱政策、常見問題) */
.doc { max-width: 760px; padding-bottom: 40px; line-height: 1.85; font-size: 15px; }
.doc h1 { font-size: 22px; margin: 18px 0 4px; }
.doc .updated { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.doc .panel { margin-bottom: 14px; }
.doc .panel h2 { font-size: 17px; }
.doc ol, .doc ul { padding-left: 1.3em; margin: 6px 0; }
.doc li + li { margin-top: 4px; }
.doc details { border-bottom: 1px dashed var(--line); padding: 8px 0; }
.doc details:last-child { border-bottom: 0; }
.doc summary { cursor: pointer; font-weight: 600; }
.doc details p { margin: 6px 0 0; color: var(--text); }
.contact-list { display: grid; gap: 8px; }
.contact-list a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); background: var(--bg-2); }
.contact-list a b { min-width: 86px; }

/* 後台:順豐開單視窗 */
.sfm-wrap { position: fixed; inset: 0; background: rgba(74, 56, 38, .4); z-index: 40; display: flex; align-items: center; justify-content: center; padding: 16px; }
.sfm { background: var(--surface); border-radius: var(--radius); width: min(620px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 10px 40px rgba(80, 60, 20, .25); }
.sfm header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.sfm header h2 { margin: 0; font-size: 18px; }
.sfm-x { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.sfm-body { padding: 12px 16px 16px; overflow-y: auto; }
.sfm-body h3 { font-size: 14px; background: var(--bg-2); padding: 6px 10px; border-radius: 8px; margin: 12px 0 8px; }
.sfm-body textarea, .sfm-body input[type=text], .sfm-body input[type=number], .sfm-body select { width: 100%; }
.sfm-sender { font-size: 14px; }
.sfm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 520px) { .sfm-grid { grid-template-columns: 1fr; } }
.sfm-chk { display: flex; gap: 6px; align-items: center; font-size: 14px; margin: 6px 0; }
.sfm-acts { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.sfm-done { text-align: center; padding: 10px 0; }
.sfm-done > div:first-child { color: var(--ok); font-weight: 700; font-size: 18px; }
.sfm-done > b { display: block; font-size: 24px; letter-spacing: .05em; margin: 6px 0; }

/* 商品頁:散光度數及軸度 */
.pd-toric { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.pd-toric select { width: 100%; }
