/* 2026-11-13 購物站新版：基礎樣式來自官網 site-d.css（.kd-*），這裡只放購物站自己的元件（.sd-*）。 */
.sd-main { padding-bottom: 28px; min-height: 60vh; }
.sd-cart { position: relative; margin-left: auto; flex: none; width: 48px; height: 48px; border-radius: 24px; background: var(--sun); color: var(--brand) !important; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 var(--sun-deep); }
.sd-cart #cart_count { position: absolute; right: -4px; top: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.sd .kd-header .kd-menu-btn { margin-left: 4px; }
@media (min-width: 900px) { .sd .kd-nav { margin-left: auto; } .sd-cart { margin-left: 12px; } }
.sd-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--sun-soft); color: var(--warning); font-weight: 700; font-size: 14px; margin: 10px 6px 0; }
.sd-back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: 10px 4px 0; font-weight: 500; }
.sd-back::before { content: ""; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }

/* 商品卡 */
.sd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.sd-item { position: relative; display: flex; flex-direction: column; padding: 10px 10px 12px; }
.sd-item > a { display: block; color: var(--text) !important; }
.sd-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 20px; }
.sd-item b { display: block; margin-top: 10px; font-family: var(--round); font-weight: 400; font-size: 18px; line-height: 1.4; color: var(--brand); }
.sd-item small { display: block; font-size: 13px; color: var(--text-2); }
.sd-tip { position: absolute; left: 18px; top: 18px; padding: 2px 12px; border-radius: 14px; background: var(--sun); color: var(--brand); font-size: 13px; font-weight: 700; }
.sd-item-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.sd-price { font-weight: 700; font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.sd-add { flex: none; width: 44px; height: 44px; border: 0; border-radius: 22px; background: var(--brand); color: #fff; box-shadow: 0 4px 0 #012a66; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .08s, box-shadow .08s; -webkit-tap-highlight-color: transparent; }
.sd-add:active { transform: translateY(3px); box-shadow: 0 1px 0 #012a66; }
.sd-add::before { content: ""; width: 16px; height: 16px; background: linear-gradient(#fff, #fff) center / 100% 2.5px no-repeat, linear-gradient(#fff, #fff) center / 2.5px 100% no-repeat; }

/* 商品頁 */
.sd-product { display: grid; gap: 18px; margin-top: 8px; }
.sd-gallery { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 28px; }
.sd-gallery::-webkit-scrollbar { display: none; }
.sd-gallery img { flex: none; width: 100%; aspect-ratio: 1; object-fit: cover; scroll-snap-align: center; border-radius: 28px; background: #fff; }
.sd-buy { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.sd-buy h1 { font-family: var(--round); font-weight: 400; font-size: 28px; line-height: 1.3; color: var(--brand); }
.sd-buy .sd-price { font-size: 26px; color: var(--brand); font-family: var(--round); font-weight: 400; }
.sd-qty { display: flex; align-items: center; justify-content: space-between; }
.sd-stepper { display: flex; align-items: center; gap: 6px; }
.sd-stepper > div:not(#qty):not(.qty) { width: 44px; height: 44px; border-radius: 22px; background: var(--sky); display: flex; align-items: center; justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sd-stepper img { width: 44px; height: 44px; }
.sd-stepper #qty, .sd-stepper .qty { min-width: 40px; text-align: center; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sd-info { padding: 20px; }
.sd-info h2 { font-family: var(--round); font-weight: 400; font-size: 20px; color: var(--brand); margin-bottom: 8px; }
.sd-info + .sd-info { margin-top: 12px; }
.sd-info .sd-body { color: var(--text); line-height: 1.9; }
.sd-sec-title { font-family: var(--round); font-weight: 400; font-size: 24px; margin: 32px 6px 0; }
@media (min-width: 900px) {
  .sd-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .sd-product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 28px; margin-top: 16px; }
  .sd-cartbar { display: none !important; }
}

/* 購物車 */
.sd-narrow { max-width: 620px; margin: 0 auto; }
.sd-line { position: relative; display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 12px; margin-top: 12px; }
.sd-line img { width: 88px; height: 88px; object-fit: cover; border-radius: 18px; }
.sd-line .sd-name { font-weight: 700; padding-right: 40px; }
.sd-line .sd-desc { font-size: 14px; color: var(--text-2); }
.sd-line .remove-item { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.sd-line .remove-item img { width: 12px; height: 12px; border-radius: 0; }
.sd-line-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.sd-line .sd-stepper > div:not(.qty) { width: 40px; height: 40px; }
.sd-line .sd-stepper img { width: 40px; height: 40px; border-radius: 0; }
.sd-sum { padding: 18px 20px; margin-top: 16px; display: grid; gap: 8px; }
.sd-sum > div { display: flex; justify-content: space-between; align-items: baseline; font-variant-numeric: tabular-nums; }
.sd-sum .is-total { padding-top: 10px; border-top: 1px solid var(--divider); font-weight: 700; }
.sd-sum .is-total b, .sd-sum .is-total > div:last-child { font-family: var(--round); font-weight: 400; font-size: 26px; color: var(--brand); }
.sd-sum small { color: var(--text-2); font-size: 14px; }
.sd-empty { text-align: center; padding: 36px 20px; margin-top: 16px; display: grid; gap: 16px; justify-items: center; color: var(--text-2); }
.sd-empty .kd-btn { max-width: 260px; }
.sd-pay { position: sticky; bottom: 0; z-index: 10; padding: 14px 0 calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(255,248,236,0), var(--bg) 30%); margin-top: 8px; }
.sd button.kd-btn { cursor: pointer; font-family: var(--round); font-size: 20px; }

/* 結帳表單 */
.sd-form { padding: 20px; margin-top: 16px; display: grid; gap: 16px; }
.sd-form .form-group { margin: 0; }
.sd-form .sd-label { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.sd-form input, .sd-form select, .sd-form textarea { width: 100%; min-height: 52px; padding: 10px 14px; border: 2px solid var(--border); border-radius: 16px; background: #fffdf8; font: inherit; font-size: 16px; color: var(--text); -webkit-appearance: none; appearance: none; }
.sd-form select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' fill='none' stroke='%2302419a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M1 1.500l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.sd-form textarea { min-height: 80px; resize: none; }
.sd-form input:focus, .sd-form select:focus, .sd-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(2,65,154,.15); }
.sd-form .has-error input, .sd-form .has-error select { border-color: #c0392b; background: #fff7f6; }
.sd-form .help-block { font-size: 14px; color: #c0392b; }
.sd-form .help-block ul { margin: 4px 0 0; padding: 0; list-style: none; }
.sd-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sd-method { display: flex; align-items: center; justify-content: space-between; }
.sd-method .radio { width: 22px; height: 22px; border-radius: 11px; border: 7px solid var(--brand); }

/* 條款類文字頁 */
.sd-prose { padding: 22px 20px; margin-top: 16px; line-height: 2; color: var(--text); }
.sd-prose .font-bold { font-weight: 700; color: var(--brand); }
.sd-prose .py-2 { padding: 8px 0; } .sd-prose .text-center { text-align: center; }

/* 加入購物車提示 */
.sd-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 40; transform: translateX(-50%); padding: 10px 20px; border-radius: 22px; background: var(--text); color: #fff; font-weight: 700; font-size: 15px; white-space: nowrap; box-shadow: 0 6px 18px rgba(38,49,61,.25); }
.sd-toast.is-on { animation: sd-pop .25s cubic-bezier(.2,.8,.2,1) both; }
@keyframes sd-pop { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.sd-cartbar[hidden], .sd-toast[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .sd-toast.is-on { animation: none; } }

/* 驗證失敗捲到欄位時，別被固定頁首蓋住 */
html:has(body.sd) { scroll-padding-top: 96px; }
.sd-form input, .sd-form select { scroll-margin-top: 110px; }
/* 2026-11-13 商品介紹（_block/product_detail）：圖文段落、產品資訊、常見問題 */
.sd-detail { display: flex; flex-direction: column; gap: 14px; }
.sd-detail .sd-sec-title { margin-bottom: 2px; }
.sd-lede { margin: 0 6px; font-size: 17px; line-height: 1.8; max-width: 46em; }
.sd-feat { overflow: hidden; display: grid; }
.sd-feat img { width: 100%; height: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.sd-feat > div { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.sd-feat h3 { font-family: var(--round); font-weight: 400; font-size: 20px; line-height: 1.4; color: var(--brand); }
.sd-feat ul, .sd-spec ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sd-feat li, .sd-spec li { position: relative; padding-left: 26px; line-height: 1.7; }
.sd-feat li::before, .sd-spec li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 12px; height: 7px; border-left: 3px solid #2f8a55; border-bottom: 3px solid #2f8a55; transform: rotate(-45deg); }
.sd-spec { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.sd-spec table { width: 100%; max-width: 520px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sd-spec caption { text-align: left; font-weight: 700; padding-bottom: 8px; caption-side: top; color: var(--text); }
.sd-spec th, .sd-spec td { padding: 9px 8px; border-bottom: 1px solid #eee6d6; text-align: right; font-weight: 400; }
.sd-spec th:first-child { text-align: left; font-weight: 500; }
.sd-spec tr:first-child th { font-weight: 700; color: var(--brand); }
.sd-spec small { color: var(--text-2); line-height: 1.6; }
.sd-faq { display: grid; gap: 10px; }
.sd-faq details { padding: 0 18px; }
.sd-faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; font-weight: 700; cursor: pointer; }
.sd-faq summary::-webkit-details-marker { display: none; }
.sd-faq summary::after { content: ""; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(45deg); transition: transform .2s; }
.sd-faq details[open] summary::after { transform: rotate(-135deg); }
.sd-faq p { margin: 0; padding: 0 0 16px; color: var(--text-2); line-height: 1.8; }
@media (min-width: 900px) {
  .sd-detail { gap: 20px; }
  .sd-feat { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sd-feat:nth-of-type(even) img { order: 2; }
  .sd-feat > div { padding: 28px 36px; }
  .sd-feat h3 { font-size: 24px; }
  .sd-faq { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
.sd-detail { margin-top: 28px; }
.sd-detail .sd-sec-title:first-child { margin-top: 0; }
