:root {
  --gold: #a97f34;
  --gold-deep: #8a6a2c;
  --ink: #2b2420;
  --mut: #8a7f6f;
  --paper: #f7f2e8;
  --card: #ffffff;
  --line: #e7dcc0;
  --ok: #17623f;
  --ok-bg: #ddf3e7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--ink);
  color: #f6efe0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .3px; }
.logo {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 6px;
  background: linear-gradient(160deg, var(--gold), var(--gold-deep));
  color: #fff; font-weight: 800;
}
.env { font-size: 12.5px; color: #d8c9a6; white-space: nowrap; }

.wrap {
  max-width: 1000px;
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

.sec-title { margin: 0 0 4px; font-size: 18px; }
.sec-note { margin: 0 0 14px; color: var(--mut); font-size: 13px; }

/* 商品 */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.product {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.p-thumb {
  height: 88px; border-radius: 8px;
  background: linear-gradient(150deg, #fbf6ea, #efe3c6);
  display: grid; place-items: center;
  font-size: 30px; font-weight: 800; color: var(--gold-deep);
}
.p-name { font-size: 14px; font-weight: 600; min-height: 40px; }
.p-price { color: var(--gold-deep); font-weight: 800; }
.p-add {
  margin-top: auto;
  border: 1px solid var(--gold); background: #fff; color: var(--gold-deep);
  border-radius: 8px; padding: 8px 10px; font-weight: 700; cursor: pointer;
  font-size: 13.5px;
}
.p-add:hover { background: #fdf8ec; }

/* 購物車 */
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.cart, .checkout {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px;
}
.cart-items { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.cart-empty { color: var(--mut); font-size: 13px; margin: 6px 0; }
.cart-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; font-size: 13.5px; }
.cart-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.qty button { width: 26px; height: 26px; border: 0; background: #faf5ea; color: var(--ink); cursor: pointer; font-size: 15px; }
.qty span { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-row .lp { font-weight: 700; min-width: 60px; text-align: right; font-variant-numeric: tabular-nums; }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; border-top: 1px dashed var(--line); padding-top: 12px; }
.cart-total strong { font-size: 22px; color: var(--gold-deep); font-variant-numeric: tabular-nums; }

/* 付款 */
.pay-option {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--gold); border-radius: 10px; padding: 12px;
  background: #fdf8ec; cursor: default;
}
.pay-option input { accent-color: var(--gold-deep); }
.pay-main { display: flex; flex-direction: column; }
.pay-name { font-weight: 700; }
.pay-sub { font-size: 12px; color: var(--mut); }
.pay-badge { margin-left: auto; background: var(--gold-deep); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.only-note { font-size: 12px; color: var(--mut); margin: 10px 0 14px; }

.pay-btn {
  width: 100%; border: 0; border-radius: 10px; padding: 13px;
  background: linear-gradient(160deg, var(--gold), var(--gold-deep));
  color: #fff; font-weight: 800; font-size: 15px; cursor: pointer;
  box-shadow: 0 2px 0 rgba(138,106,44,.4);
}
.pay-btn:disabled { background: #d8ccb0; box-shadow: none; cursor: not-allowed; }
.pay-btn:not(:disabled):active { transform: translateY(2px); box-shadow: none; }

.status { min-height: 18px; margin: 10px 0 0; font-size: 13px; color: var(--gold-deep); }
.status.error { color: #9b3129; }

.fineprint { margin-top: 12px; font-size: 12px; color: var(--mut); }
.fineprint summary { cursor: pointer; }
.fineprint ul { margin: 8px 0 0; padding-left: 18px; }

@media (max-width: 760px) {
  .wrap { grid-template-columns: 1fr; }
  .side { position: static; }
}
