/* ============================================================
   星時電子 — 商城（結帳頁），沿用站台暖色系
   ============================================================ */

:root {
    --bg-cream:        #faf9f5;
    --bg-warm:         #f4f3ee;
    --bg-card:         #ffffff;
    --border-soft:     #e8e6dc;
    --border-hover:    #d4d1c5;
    --text-primary:    #1a1915;
    --text-secondary:  #5a5750;
    --text-muted:      #8a877f;
    --accent:          #cc785c;
    --accent-hover:    #b8694e;
    --accent-soft:     #f3e7e0;
    --danger:          #b5533f;
    --danger-bg:       #fbeee9;
    --max-width:       1080px;
    --radius-sm:       8px;
    --radius-md:       14px;
    --radius-lg:       20px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-cream);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: color .2s ease, opacity .2s ease; }

h1, h2, h3, h4 {
    font-family: "Noto Serif TC", "Songti TC", "PingFang TC", Georgia, serif;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

/* ============ Navigation ============ */
.nav {
    position: sticky; top: 0; z-index: 100;
    background-color: rgba(250, 249, 245, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-soft);
}
.nav-inner {
    max-width: var(--max-width); margin: 0 auto;
    padding: 16px 28px;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo img { height: 34px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { font-size: 15px; color: var(--text-secondary); font-weight: 500; }
.nav-links a:hover { color: var(--text-primary); }
.nav-cta {
    background-color: var(--text-primary); color: var(--bg-cream) !important;
    padding: 9px 18px; border-radius: 999px; font-size: 14px !important; font-weight: 500;
    transition: background-color .2s ease;
}
.nav-cta:hover { background-color: #000; }

/* ============ Layout ============ */
.shop-wrap {
    flex: 1;
    max-width: var(--max-width); width: 100%;
    margin: 0 auto; padding: 48px 28px 72px;
}
.shop-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: start;
}

/* ============ Product side ============ */
.product-media {
    position: sticky; top: 96px;
}
.product-figure {
    background-color: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: 0 20px 50px -34px rgba(26, 25, 21, 0.28);
}
.product-figure img {
    width: 100%; height: auto; border-radius: var(--radius-md); display: block;
}
.product-eyebrow {
    display: inline-block; font-size: 12px; font-weight: 500; color: var(--accent);
    letter-spacing: 0.12em; text-transform: uppercase; margin: 28px 0 0;
    padding: 5px 13px; border: 1px solid var(--accent); border-radius: 999px;
    background-color: var(--accent-soft);
}
.product-title { font-size: 34px; font-weight: 600; margin: 16px 0 0; }
.product-desc { font-size: 15px; color: var(--text-secondary); margin: 16px 0 0; line-height: 1.85; }

/* ============ Checkout card ============ */
.checkout-card {
    max-width: 640px;
    margin: 0 auto;
    background-color: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 40px 40px;
    box-shadow: 0 20px 50px -34px rgba(26, 25, 21, 0.28);
}
.checkout-card h2 { font-size: 22px; font-weight: 600; }
.checkout-title { font-size: 30px; margin-bottom: 4px; }

.field-group { margin-top: 28px; }
.field-label {
    font-size: 13px; color: var(--text-muted); letter-spacing: 0.03em;
    margin-bottom: 10px; display: block;
}

/* 版本 / 運送方式 選項卡 */
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option-list.row { flex-direction: row; flex-wrap: wrap; }
.option {
    position: relative; flex: 1 1 0; min-width: 130px;
    border: 1px solid var(--border-soft); border-radius: var(--radius-md);
    padding: 14px 16px; cursor: pointer; transition: all .16s ease;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.option:hover { border-color: var(--border-hover); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .opt-name { font-size: 15px; font-weight: 500; color: var(--text-primary); }
.option .opt-price { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.option.selected {
    border-color: var(--accent);
    background-color: var(--accent-soft);
    box-shadow: 0 0 0 3px rgba(204, 120, 92, 0.12);
}

/* 數量 stepper */
.qty {
    display: inline-flex; align-items: center;
    border: 1px solid var(--border-soft); border-radius: 999px; overflow: hidden;
}
.qty button {
    width: 42px; height: 42px; border: none; background: var(--bg-warm);
    font-size: 20px; color: var(--text-secondary); cursor: pointer; font-family: inherit;
    transition: background-color .15s ease;
}
.qty button:hover { background-color: var(--accent-soft); color: var(--accent-hover); }
.qty input {
    width: 56px; height: 42px; border: none; text-align: center;
    font-size: 16px; font-family: inherit; color: var(--text-primary); background: var(--bg-card);
}
.qty input:focus { outline: none; }
.stock-note { font-size: 13px; color: var(--text-muted); margin-left: 14px; }

/* 小尺寸步進器（加購用，較不佔高度） */
.qty-sm button { width: 34px; height: 32px; font-size: 17px; }
.qty-sm input { width: 44px; height: 32px; font-size: 15px; }

/* 加購 */
.addon {
    display: flex; align-items: center; gap: 13px;
    border: 1px solid var(--border-soft); border-radius: var(--radius-md);
    padding: 13px 17px;
}
.addon .addon-name { font-size: 15px; font-weight: 500; }
.addon .addon-price { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* 一般輸入 */
.fld {
    width: 100%; border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
    padding: 11px 13px; font-size: 15px; font-family: inherit; color: var(--text-primary);
    background-color: var(--bg-card); transition: border-color .2s ease, box-shadow .2s ease;
}
.fld:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fld-row { display: flex; gap: 12px; }
.fld-row > div { flex: 1; }
.sub-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; display: block; }

/* 訂單摘要 */
.summary {
    margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border-soft);
}
.summary-row {
    display: flex; justify-content: space-between; font-size: 14px;
    color: var(--text-secondary); padding: 6px 0;
}
.summary-total {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--border-soft);
}
.summary-total .label { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.summary-total .amount {
    font-size: 28px; font-weight: 600; color: var(--accent);
    font-family: "Noto Serif TC", Georgia, serif;
}

/* ============ Buttons / notes ============ */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 24px; border-radius: 999px; font-size: 15px; font-weight: 500;
    font-family: inherit; border: 1px solid transparent; cursor: pointer; transition: all .18s ease;
}
.btn-primary { background-color: var(--accent); color: #fff; }
.btn-primary:hover { background-color: var(--accent-hover); transform: translateY(-1px); }
.btn-block { width: 100%; margin-top: 24px; }
.btn[disabled] { background-color: var(--border-hover); cursor: not-allowed; transform: none; }

.hint { font-size: 13px; color: var(--text-muted); text-align: center; margin: 12px 0 0; }
.hint a { color: var(--accent-hover); font-weight: 500; }
.hint a:hover { text-decoration: underline; }

.shop-error {
    margin: 0 0 24px; padding: 12px 15px; border-radius: var(--radius-sm);
    background-color: var(--danger-bg); border: 1px solid #efd3c9;
    color: var(--danger); font-size: 14px;
}

.sold-out {
    margin-top: 24px; padding: 14px 16px; border-radius: var(--radius-md);
    background-color: var(--bg-warm); border: 1px solid var(--border-soft);
    color: var(--text-secondary); font-size: 14.5px; text-align: center;
}

/* ============ Complete page ============ */
.result-wrap {
    flex: 1; display: flex; align-items: center; justify-content: center;
    padding: 64px 20px;
    background: linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-warm) 100%);
}
.result-card {
    width: 100%; max-width: 520px;
    background-color: var(--bg-card); border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg); padding: 44px 40px;
    box-shadow: 0 20px 50px -30px rgba(26, 25, 21, 0.28);
}
.result-card h1 { font-size: 28px; font-weight: 600; margin: 16px 0 0; }
.result-card .lead { font-size: 15px; color: var(--text-secondary); margin: 16px 0 0; line-height: 1.85; }
.order-no { font-size: 20px; font-weight: 600; color: var(--accent-hover); font-family: "Noto Serif TC", Georgia, serif; }
.result-table { width: 100%; border-collapse: collapse; margin-top: 22px; }
.result-table td { padding: 9px 0; font-size: 14px; }
.result-table td:first-child { color: var(--text-muted); }
.result-table td:last-child { text-align: right; color: var(--text-secondary); font-weight: 500; }
.result-divider { border-top: 1px solid var(--border-soft); margin: 8px 0; }

/* ============ Footer ============ */
.footer { background-color: var(--text-primary); color: #cdcabe; padding: 48px 28px 28px; }
.footer-inner {
    max-width: var(--max-width); margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-inner h3 { color: #fff; font-size: 22px; margin: 0; font-weight: 500; }
.footer-inner span { color: #6b6862; font-size: 12.5px; }

@media (max-width: 860px) {
    .shop-grid { grid-template-columns: 1fr; gap: 32px; }
    .product-media { position: static; }
    .nav-links a:not(.nav-cta) { display: none; }
}
