/* 購物流程補充樣式（商品頁 / 購物車 / 結帳 / 付款 / 結果）；基礎元件沿用 site.css */

.shop-page { background: #f4fbfd; }
.shop-section { padding: 56px 0 96px; }
.shop-flash { margin: 0 0 24px; }

/* 錯誤訊息 */
.form-errors {
    border: 1px solid #f2c0c0;
    border-left: 4px solid #d64545;
    background: #fff5f5;
    color: #8a2a2a;
    border-radius: 0 16px 16px 0;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.form-errors p { margin: 4px 0; font-size: .9rem; }
/* scrollIntoView 時避開 sticky header（76px） */
.form-errors { scroll-margin-top: 92px; }

/* 商品頁 */
.product-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}
.product-media img,
.product-media__placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: linear-gradient(145deg, #f1fbff, #ddf4fd);
    border-radius: 28px;
    display: grid;
    place-items: center;
    color: #9bbccb;
    font-weight: 800;
}
.product-description { color: #4f6f80; margin: 0 0 22px; white-space: pre-line; }
.product-price {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 22px;
    color: #617d8c;
    font-size: .9rem;
}
.product-price b { color: var(--ink); font-size: 2rem; letter-spacing: -.02em; }
.product-unavailable { color: #8a2a2a; font-weight: 700; }
.add-to-cart { display: grid; gap: 16px; }
.quantity-field { display: grid; gap: 7px; max-width: 200px; }
.quantity-field > span { color: #476b7e; font-size: .82rem; font-weight: 700; }
.add-to-cart .full-button { margin-top: 4px; }

/* select / textarea 與 site.css 的 input 一致 */
.field-grid select,
.quantity-field select,
.cart-quantity select {
    width: 100%;
    min-height: 48px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #bcd7e2;
    border-radius: 12px;
    padding: 11px 13px;
    font: inherit;
}
.field-grid select:focus,
.quantity-field select:focus,
.cart-quantity select:focus { border-color: var(--blue); outline: 3px solid #0788c526; }
.field-grid + .field-grid { margin-top: 18px; }
.field-grid .field-full { grid-column: 1 / -1; }
.field-grid--address { grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr); }

/* 購物車 */
.cart-empty { text-align: center; padding: 48px 24px; }
.cart-empty h2 { margin: 0 0 8px; font-size: 1.6rem; }
.cart-empty p { color: #617d8c; margin: 0; }
.cart-empty p a { color: #076f9e; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.cart-empty .primary-button { margin-top: 20px; }
/* 空車時直接列出可購買商品 */
.cart-suggestions { display: grid; gap: 18px; margin-top: 22px; }
.cart-suggestion .cart-quantity .primary-button { margin-top: 0; min-height: 42px; }
.cart-suggestion__link {
    color: #076f9e;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
    padding: 8px 0;
}
.cart-product h2 a { color: inherit; text-decoration: none; }
.cart-product h2 a:hover,
.cart-product h2 a:focus-visible { text-decoration: underline; text-underline-offset: 4px; }
.cart-layout { padding-top: 0; }
.cart-product > img,
.cart-product__placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: linear-gradient(145deg, #f1fbff, #ddf4fd);
    border-radius: 18px;
}
.cart-product h2 { margin-top: 0; }
.cart-actions { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; margin-top: 14px; }
.cart-quantity { display: flex; align-items: end; gap: 10px; }
.cart-quantity label { display: grid; gap: 6px; }
.cart-quantity label > span { color: #476b7e; font-size: .78rem; font-weight: 700; }
.cart-quantity select { min-height: 42px; width: 84px; }
.cart-quantity .secondary-button { margin-top: 0; }
.link-button {
    background: none;
    border: 0;
    color: #8a2a2a;
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
    padding: 8px 0;
}
.cart-line-total { text-align: right; display: grid; gap: 4px; }
.cart-line-total span { color: #718997; font-size: .78rem; }
.cart-line-total b { font-size: 1.15rem; }

/* 結帳 */
.check-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: #31586d;
    font-weight: 700;
    cursor: pointer;
}
.check-field input { width: 20px; height: 20px; }
.option-group { display: grid; gap: 0; }
.option-group .plan-option { margin-top: 0; }
.option-group .plan-option + .plan-option { margin-top: 12px; }
.option-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #bfdce6;
    display: block;
    position: relative;
}
.plan-option.is-selected .option-dot { border-color: var(--blue); }
.plan-option.is-selected .option-dot::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--blue);
}
.plan-option:focus-within { outline: 3px solid #0788c526; }
.invoice-fields { margin-top: 18px; }
.order-card .primary-button.full-button { margin-top: 24px; }
.order-card .primary-button.full-button:disabled {
    background: #b8c9d2;
    box-shadow: none;
    cursor: not-allowed;
}
/* 綠界單筆金額上限：超限的付款方式停用 */
.plan-option.is-disabled { background: #f3f7f9; color: #8fa5b1; cursor: not-allowed; }
.plan-option.is-disabled .option-dot { border-color: #d5e3ea; }
.plan-option > span .payment-limit-hint { color: #b03a3a; }
.payment-limit-notice { margin: 0 0 18px; }

/* 付款跳轉頁 */
.pay-card .brand-logo { width: 52px; height: 52px; margin: 0 auto 18px; display: block; }
.pay-card p { color: #607d8c; margin: 0 0 8px; }
.pay-card form { margin-top: 26px; }

/* 結果頁 */
.success-mark--muted { background: linear-gradient(145deg, #9fb8c4, #6f8b98); }
.success-details span { color: #718997; font-size: .88rem; }
.atm-panel { text-align: left; }
.atm-panel p { display: flex; justify-content: space-between; gap: 16px; }
.atm-panel p > span { color: #476b7e; font-size: .88rem; }
.atm-panel p > b { color: var(--ink); font-size: 1.15rem; letter-spacing: .02em; }
.atm-panel__note { display: block !important; color: #8a2a2a; font-weight: 700; font-size: .88rem; margin-top: 12px !important; }
.success-card .secondary-button { margin-top: 28px; }

@media (width <= 980px) {
    .product-layout { grid-template-columns: 1fr; gap: 26px; }
    /* site.css 在此寬度把摘要卡（含送出鈕）排到表單前面，錯誤訊息會落在首屏外；改回表單在前 */
    .checkout-summary { order: 0; }
}

@media (width <= 760px) {
    .shop-section { padding: 36px 0 72px; }
    .field-grid--address { grid-template-columns: 1fr; }
    .cart-line-total { grid-column: 1 / -1; text-align: left; display: flex; justify-content: space-between; align-items: baseline; }
    .atm-panel p { flex-direction: column; gap: 2px; }
}

/* info-panel 內的按鈕：site.css 的 .info-panel a 會把連結染成深藍＋底線，按鈕要維持白字 */
.info-panel a.primary-button,
.info-panel a.secondary-button {
    color: #fff;
    text-decoration: none;
    margin-top: 10px;
}
