/* ==========================================================================
   AIWEB refactor module: checkout
   Generated from the former post-legacy section of style.css, then reviewed as
   a migration layer. New code should be edited semantically in the appropriate
   module instead of adding patches to style.css.
   ========================================================================== */

.checkout_wrapper .option_outer { background: #fff; border: 1px solid #e7eded; border-radius: 8px; padding: 15px; margin-bottom: 20px; }
.checkout_wrapper .option_title h2 { font-size: 18px; border-bottom: 2px solid #eaf3f4; padding-bottom: 10px; margin-bottom: 15px; color: #333; font-weight: bold; }

/* 配送/支付大按鈕選項 */
.checkout_wrapper .option_item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
    width: 100%; float: none; border: 1px solid #dbe3e3; background-color: #fff; border-radius: 8px; padding: 20px 10px; min-height: 80px; margin-bottom: 15px; box-sizing: border-box; overflow: hidden; transition: all 0.2s ease;
}
.checkout_wrapper .option_item:hover { border-color: #bbb; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.checkout_wrapper .option_item input[type="radio"] { position: absolute; opacity: 0; width: 100%; height: 100%; top: 0; left: 0; margin: 0; padding: 0; z-index: 10; cursor: pointer; appearance: none; }
.checkout_wrapper .option_item label { border: none; background: none; width: 100%; height: auto; margin: 0; box-shadow: none; display: block; text-align: center; }
.checkout_wrapper .option_item label img, .checkout_wrapper .option_item img, .checkout_wrapper .option_item label .status { display: none; }

.checkout_wrapper .option_item:has(input[type="radio"]:checked), .checkout_wrapper .option_item.selected { border: 2px solid #147486; background-color: #fff5f5; }
.checkout_wrapper .option_item input:checked + label:after, .checkout_wrapper .option_item input:checked:after {
    content: "✓"; position: absolute; bottom: 0; right: 0; width: 24px; height: 24px; background-color: #147486; color: #fff; font-size: 14px; line-height: 24px; text-align: center; border-top-left-radius: 6px; z-index: 11; display: block;
}

.checkout_wrapper .option_item .name { font-size: 20px; font-weight: 700; color: #333; margin-bottom: 8px; width: 100%; text-align: center; overflow: visible; }
.checkout_wrapper .option_item .intro, .checkout_wrapper .option_item .info { font-size: 14px; color: #666; line-height: 1.4; text-align: center; width: 100%; }
.checkout_wrapper .option_item .info .price { font-size: 16px; color: #147486; font-weight: bold; display: inline-block; margin-top: 5px; }

/* 右側單欄商品清單 */
.checkout_wrapper .cart_list li {
    width: 100%; float: none; display: flex; align-items: flex-start; justify-content: flex-start; flex-wrap: nowrap;
    padding: 15px; border: 2px solid #f0f0f0; border-radius: 8px; margin-bottom: 12px; background-color: #fff; box-sizing: border-box; transition: all 0.2s ease;
}
.checkout_wrapper .cart_list li:hover { border-color: #b3d7ff; background-color: #f8fbff; box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
.checkout_wrapper .cart_list input[type="checkbox"] { width: 20px; height: 20px; margin-right: 15px; cursor: pointer; accent-color: #147486; transform: scale(1.2); }

.checkout_wrapper .cart_list .photo { flex-shrink: 0; float: none; margin-right: 12px; border: 1px solid #e7eded; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; }
.checkout_wrapper .cart_list .co-item-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.checkout_wrapper .cart_list .co-item-main-full { width: 100%; }
.checkout_wrapper .cart_list .co-item-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: nowrap; margin-top: 4px; }
.checkout_wrapper .cart_list .name { flex-grow: 0; text-align: left; margin: 0; font-size: 15px; font-weight: bold; white-space: normal; line-height: 1.4; display: block; width: auto; }
/* pre-line：屬性字串本來就一項一行（lib_order.php 的 get_goods_attr_info），
   不還原換行的話，選三項急件處理會黏成一長串看不出哪一項是哪一項 */
.checkout_wrapper .cart_list .extra_info { display: block; font-size: 13px; color: #888; line-height: 1.55; white-space: pre-line; word-break: break-word; }
.checkout_wrapper .cart_list .price { flex-shrink: 0; font-weight: bold; margin: 0; color: #333; white-space: nowrap; }
.checkout_wrapper .cart_list .co-price { margin: 0; white-space: nowrap; }
.checkout_wrapper .cart_list .co-qty-wrap { margin-left: 0; flex-shrink: 0; }

.checkout_wrapper .cart_list .drop { visibility: visible; opacity: 1; display: block; position: static; flex-shrink: 0; align-self: flex-start; margin-left: 8px; color: #6b7676; font-size: 20px; cursor: pointer; padding: 5px; background: none; border: none; float: none; }
.checkout_wrapper .cart_list .drop:hover { color: #147486; }

.checkout_wrapper textarea { width: 100%; margin: 0; padding: 10px; box-sizing: border-box; border: 1px solid #c6d0d0; border-radius: 4px; font-size: 14px; min-height: 80px; }

.checkout_wrapper .flow_action {
    width: 100%; box-sizing: border-box; margin: 20px 0 0 0; padding: 20px; background-color: #f9f9f9; border-radius: 8px; border: 1px solid #e7eded; float: none; clear: both; overflow: hidden;
}
.checkout_wrapper .flow_action .next { width: 100%; padding: 15px; background-color: #147486; color: #fff; font-size: 18px; font-weight: bold; border: none; border-radius: 50px; cursor: pointer; box-shadow: 0 4px 10px rgba(231, 76, 60, 0.3); }
.checkout_wrapper .flow_action .back { display: block; text-align: center; margin-top: 15px; color: #666; text-decoration: underline; }

/* ======================================================
   6. 訂單完成頁、登入頁
   ====================================================== */
.box .bd .message_wrapper.flow_done { background-color: #fff; border: 1px solid #dbe3e3; border-radius: 12px; padding: 40px 20px; margin: 20px auto; max-width: 600px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.05); position: relative; overflow: hidden; }
.message_wrapper.flow_done dt.title { font-size: 24px; font-weight: bold; color: #333; margin-bottom: 20px; display: flex; flex-direction: column; align-items: center; border: none; background: none; }
.message_wrapper.flow_done dt.title::before { content: "✓"; display: flex; align-items: center; justify-content: center; width: 80px; height: 80px; background-color: #2ecc71; color: #fff; font-size: 40px; border-radius: 50%; margin-bottom: 15px; box-shadow: 0 4px 10px rgba(46, 204, 113, 0.3); }
.message_wrapper.flow_done .price { display: block; font-size: 32px; color: #147486; font-weight: 800; margin-top: 10px; }

.login-wrapper { display: flex; justify-content: center; padding: 50px 0; background-color: #f4f6f8; }
.login-container { display: flex; width: 900px; max-width: 95%; background: #fff; box-shadow: 0 10px 25px rgba(0,0,0,0.08); border-radius: 12px; overflow: hidden; }
.login-box { padding: 40px; }
.login-form-side { flex: 1.5; background: #fff; }
/* 手機長文排版已合併至 style-responsive.css 的單一規則。 */
/* 結帳頁數量加減 */
.co-qty-wrap { display:inline-flex; align-items:center; border:1px solid #d8e0e0; border-radius:6px; overflow:hidden; flex-shrink:0; margin-left:0; }
.co-qty-btn { width:30px; height:30px; border:none; background:#eaf3f4; color:#333; font-size:16px; line-height:30px; cursor:pointer; padding:0; }
.co-qty-btn:hover { background:#dbe3e3; }
.co-qty-input { width:40px; height:30px; border:none; border-left:1px solid #d8e0e0; border-right:1px solid #d8e0e0; text-align:center; font-size:14px; background:#fff; padding:0; }
.co-price { font-weight:bold; color:#333; flex-shrink:0; }

/* 結帳頁「繼續選購」按鈕（桌機+手機都顯示）*/
.co-continue-wrap { margin:14px 0 5px; }
.co-continue-btn {
    display:block; padding:13px; text-align:center;
    background:#fff; color:#147486;
    border:2px solid #147486; border-radius:25px;
    font-size:15px; font-weight:bold; text-decoration:none;
    transition:all .2s ease;
}
.co-continue-btn:hover { background:#147486; color:#fff; }
/* ======================================================
   結帳登入頁 flow.php?step=login —— 完整版（取代之前所有相關 CSS）
   ====================================================== */

/* 1. 登入框：取消雙欄、置中、合理寬度 */
.login-wrapper {
    padding: 20px 15px;
}
.login-container {
    display: block;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    box-sizing: border-box;
    background: none;
    box-shadow: none;
}
.login-box.login-form-side {
    width: 100%;
    float: none;
    box-sizing: border-box;
    background: #fff;
    padding: 30px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* 2. 分隔線「或使用以下方式登入」：乾淨文字，無亂跑橫線 */
.login-form-side .flow-social-divider {
    display: block;
    text-align: center;
    color: #bbb;
    font-size: 13px;
    margin: 18px 0 12px;
    border: none;
    width: 100%;
    box-sizing: border-box;
}
.login-form-side .flow-social-divider:before,
.login-form-side .flow-social-divider:after {
    display: none;
}

/* 3. LINE / Google 按鈕：鎖在登入框內、上下排、撐滿寬度 */
.login-form-side .flow-social-buttons {
    display: block;
    width: 100%;
    float: none;
    position: static;
    margin: 0;
    box-sizing: border-box;
}
.login-form-side .btn-social {
    display: block;
    width: 100%;
    height: 48px;
    line-height: 48px;
    margin: 0 0 10px 0;
    float: none;
    position: static;
    text-align: center;
    color: #fff;
    border-radius: 6px;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    box-sizing: border-box;
}
.login-form-side .btn-line { background-color: #06C755; }
.login-form-side .btn-google { background-color: #4285F4; }
.login-form-side .btn-social:hover { opacity: 0.9; }
/* 「不打算登入，直接購買」加框 */
.login-form-side .submit-area .btn-text {
    display: block;
    margin-top: 12px;
    padding: 12px;
    text-align: center;
    background: #f4f8f8;
    color: #666;
    border: 1px solid #d8e0e0;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}
.login-form-side .submit-area .btn-text:hover {
    background: #e7eded;
    border-color: #c6d0d0;
    color: #333;
}
/* 忘記密碼連結：移到密碼框下方靠右，不再歪斜 */
.login-form-side .password-wrapper {
    display: block;
    position: static;
}
.login-form-side .password-wrapper .input-field {
    width: 100%;
    box-sizing: border-box;
}
.login-form-side .password-wrapper .forgot-link {
    display: block;
    margin-top: 6px;
    text-align: right;
    color: #6b7676;
    font-size: 13px;
    text-decoration: none;
    float: none;
    position: static;
}
.login-form-side .password-wrapper .forgot-link:hover {
    color: #147486;
}
/* 使用者名稱、密碼欄位統一撐滿整行，視覺一致 */
.login-form-side .input-group {
    display: block;
    margin-bottom: 16px;
}
.login-form-side .input-group .input-field,
.login-form-side .password-wrapper .input-field {
    width: 100%;
    box-sizing: border-box;
    display: block;
}
.login-form-side .input-group label {
    display: block;
    margin-bottom: 6px;
}
/* 登入鈕 + 直接購買鈕：統一成整行框按鈕，只差顏色 */
.login-form-side .submit-area .btn-main,
.login-form-side .submit-area .btn-text {
    display: block;
    width: 100%;
    margin: 0 0 10px 0;
    padding: 13px;
    text-align: center;
    font-size: 15px;
    font-weight: bold;
    border-radius: 6px;
    box-sizing: border-box;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-appearance: none;
}

/* 登入鈕：紅底白字（主要動作）*/
.login-form-side .submit-area .btn-main {
    background: #147486;
    color: #fff;
    border: 1px solid #147486;
}
.login-form-side .submit-area .btn-main:hover {
    background: #103f49;
    border-color: #103f49;
}

/* 直接購買鈕：灰框深字（次要動作）*/
.login-form-side .submit-area .btn-text {
    background: #f4f8f8;
    color: #666;
    border: 1px solid #d8e0e0;
    font-weight: normal;
}
.login-form-side .submit-area .btn-text:hover {
    background: #e7eded;
    border-color: #c6d0d0;
    color: #333;
}

/* 結帳頁：16px 起，老花眼友善 */
body#page_flow .checkout_wrapper {
    font-size: 16px;
    line-height: 1.65;
}

body#page_flow .checkout_wrapper .option_title h2 {
    font-size: 20px;
    line-height: 1.4;
}

body#page_flow .checkout_wrapper .option_item .name {
    font-size: 18px;
}

body#page_flow .checkout_wrapper .option_item .intro,
body#page_flow .checkout_wrapper .option_item .info {
    font-size: 15px;
}

body#page_flow .checkout_wrapper .cart_list .name {
    font-size: 17px;
}

body#page_flow .checkout_wrapper .cart_list .price {
    font-size: 17px;
}

body#page_flow .checkout_wrapper .consignee_info {
    font-size: 16px;
    line-height: 1.7;
}

body#page_flow .checkout_wrapper .consignee_info strong {
    font-size: 15px;
}

body#page_flow .checkout_wrapper .extra_options h3,
body#page_flow .checkout_wrapper .other_info,
body#page_flow .checkout_wrapper .other_info p,
body#page_flow .checkout_wrapper .other_info span {
    font-size: 16px;
}

body#page_flow .checkout_wrapper textarea {
    font-size: 16px;
    line-height: 1.6;
}

body#page_flow .checkout_wrapper .flow_action .next {
    font-size: 18px;
}

body#page_flow .progress_bar {
    font-size: 15px;
}

/* ========= 2. 結帳商品列：圖左、文字靠左、刪除右上 ========= */
#checkout_form .cart_list ul { margin: 0; padding: 0; list-style: none; }
#checkout_form .cart_list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 14px;
    margin: 0 0 12px 0;
    border: 1px solid #e7eded;
    border-radius: 10px;
    background: #fff;
    box-sizing: border-box;
    float: none;
}
#checkout_form .cart_list .photo {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    margin: 0;
    border: 1px solid #e7eded;
    border-radius: 6px;
    overflow: hidden;
    display: block;
}
#checkout_form .cart_list .photo img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
}
#checkout_form .cart_list .co-item-main,
#checkout_form .cart_list .co-item-main-full {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}
#checkout_form .cart_list .name {
    display: block;
    width: auto;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
    word-break: break-word;
}
#checkout_form .cart_list .extra_info { display: block; font-size: 13px; color: #888; line-height: 1.55; white-space: pre-line; word-break: break-word; }
#checkout_form .cart_list .co-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin: 0;
}
#checkout_form .cart_list .co-price,
#checkout_form .cart_list .price {
    font-weight: 700; color: #333; white-space: nowrap; margin: 0;
}
#checkout_form .co-qty-wrap {
    display: inline-flex; align-items: center;
    border: 1px solid #d8e0e0; border-radius: 6px; overflow: hidden;
    flex-shrink: 0; margin: 0;
}
#checkout_form .co-qty-btn {
    width: 32px; height: 32px; padding: 0;
    border: none; background: #eaf3f4; color: #333;
    font-size: 16px; line-height: 32px; cursor: pointer;
}
#checkout_form .co-qty-btn:hover { background: #e6e6e6; }
#checkout_form .co-qty-input {
    width: 44px; height: 32px; padding: 0;
    border: none; border-left: 1px solid #d8e0e0; border-right: 1px solid #d8e0e0;
    text-align: center; font-size: 14px; background: #fff;
    -moz-appearance: textfield;
}
#checkout_form .co-qty-input::-webkit-outer-spin-button,
#checkout_form .co-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#checkout_form .cart_list .drop {
    flex: 0 0 auto;
    align-self: flex-start;
    margin: 0 0 0 4px;
    padding: 6px 10px;
    font-size: 13px;
    color: #888;
    background: #eaf3f4;
    background-image: none;
    border: none;
    border-radius: 6px;
    box-shadow: none;
    text-shadow: none;
    white-space: nowrap;
    float: none;
}
#checkout_form .cart_list .drop:hover { color: #147486; background: #f0e3e3; }

/* ===== 結帳頁改版：固定結帳列 + 付款方式大卡片（2026-07-30）===== */
/* 註：刻意不用 display:contents（LINE 內建瀏覽器會跑版），只用 fixed/flex */

.co-sticky-bar {
  display: none;
}

/* 付款方式／配送方式：大卡片、整塊可點（手機不容易按錯） */
.flow_wrapper .option_item {
  border: 1px solid #e0e4e8;
  border-radius: 12px;
  margin-bottom: 10px;
  padding: 12px 14px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.flow_wrapper .option_item:hover { border-color: #b9c6d2; }
.flow_wrapper .option_item label {
  display: block;
  cursor: pointer;
  margin: 0;
}
.flow_wrapper .option_item .name {
  font-size: 16px;
  font-weight: 600;
}
.flow_wrapper .option_item .intro {
  display: block;
  font-size: 13px;
  color: #8b959e;
  margin-top: 4px;
  line-height: 1.6;
}

/* 結帳休假公告：只影響獨立提示視窗。 */
body .checkout-holiday-backdrop{position:fixed;inset:0;z-index:100000;background:rgba(16,63,73,.56);display:flex;align-items:center;justify-content:center;padding:20px;}
body .checkout-holiday-dialog{box-sizing:border-box;width:100%;max-width:520px;max-height:85vh;overflow:auto;background:#ffffff;border-radius:20px;padding:28px;color:#283d42;box-shadow:0 20px 70px #0003;font:18px/1.7 "Microsoft JhengHei",sans-serif;}
body .checkout-holiday-dialog h2{font-size:25px;line-height:1.5;margin:0 0 16px;color:#147486;}
body .checkout-holiday-dialog p{font-size:18px;white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 24px;}
body .checkout-holiday-dialog button{display:block;width:100%;min-height:48px;border:0;border-radius:12px;padding:12px;background:#147486;color:#fff;font:inherit;cursor:pointer;}
body .checkout-holiday-dialog button:focus-visible{outline:3px solid #b78a46;outline-offset:4px;}


/* --------------------------------------------------------------------------
   Checkout mobile polish — make shipping/payment option cards balanced and centered.
   -------------------------------------------------------------------------- */
@media screen and (max-width: 800px) {
    body#page_flow .checkout_wrapper .option_outer {
        margin-bottom: 14px;
        background: #fff;
        border: 1px solid #dbe6e7;
        border-radius: 14px;
        overflow: hidden;
    }

    body#page_flow .checkout_wrapper .option_title {
        margin-top: 0;
        padding: 12px 14px;
        background: #f7fbfb;
        border: 0;
        border-bottom: 1px solid #e3eded;
    }

    body#page_flow .checkout_wrapper .option_title h2 {
        font-size: 18px;
        line-height: 1.4;
    }

    body#page_flow .checkout_wrapper .option_inner {
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    body#page_flow .checkout_wrapper .option_item {
        float: none;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    body#page_flow .checkout_wrapper .option_item label {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        min-height: 0;
        height: auto;
        margin: 0;
        padding: 14px 44px 14px 40px;
        box-sizing: border-box;
        border: 1px solid #d7e1e3;
        border-radius: 12px;
        background: #fff;
        line-height: 1.45;
        text-align: center;
        box-shadow: none;
    }

    body#page_flow .checkout_wrapper .option_item label .name {
        display: block;
        width: 100%;
        height: auto;
        overflow: visible;
        font-size: 16px;
        font-weight: 700;
        color: #143c46;
    }

    body#page_flow .checkout_wrapper .option_item label .status,
    body#page_flow .checkout_wrapper .option_item img {
        display: none;
    }

    body#page_flow .checkout_wrapper .option_item input[type="radio"] {
        position: absolute;
        top: 50%;
        right: 14px;
        bottom: auto;
        transform: translateY(-50%);
        margin: 0;
        accent-color: #147486;
    }

    body#page_flow .checkout_wrapper .option_item label.checked {
        border-color: #147486;
        background: #eef8f8;
        box-shadow: 0 0 0 2px rgba(20, 116, 134, 0.08);
    }

    body#page_flow .checkout_wrapper .option_item label.checked::after {
        content: '✓';
        position: absolute;
        top: 50%;
        left: 14px;
        transform: translateY(-50%);
        font-size: 16px;
        font-weight: 700;
        color: #147486;
    }

    body#page_flow .checkout_wrapper .option_item .intro {
        display: block;
        margin: 6px 4px 0;
        color: #64797d;
        font-size: 13px;
        line-height: 1.65;
        text-align: center;
    }

    body#page_flow .checkout_wrapper .option_item .info {
        display: block;
        margin: 3px 4px 0;
        color: #147486;
        font-size: 13px;
        line-height: 1.5;
        text-align: center;
    }

    body#page_flow .checkout_wrapper .option_inner .current_intro {
        margin: 0 0 10px;
        padding: 12px 14px;
        border-radius: 12px;
        background: #f7fbfb;
        border: 1px solid #e4efef;
        color: #4d6469;
        font-size: 14px;
        line-height: 1.8;
    }

    body#page_flow .checkout_wrapper .insure_wrapper {
        padding: 4px 2px 0;
        text-align: left;
    }
}
