/* ===== 购物车 / 结账 / 订单 ===== */
.store-page { padding: 28px 0 80px; }

.page-head { margin-bottom: 24px; }
.page-head h1 { margin: 0 0 6px; font-size: 30px; letter-spacing: -0.3px; }
.page-head p { margin: 0; color: var(--text-muted); }

.notice {
    margin: 0 0 20px;
    padding: 12px 16px;
    border-radius: 10px;
    background: #e9f7ef;
    border: 1px solid #c6e9d4;
    color: #1e7a43;
    font-size: 14px;
}

.notice-error {
    background: #fdf0ef;
    border-color: #f3cfcb;
    color: #b03a2e;
}

.notice ul { margin: 8px 0 0; padding-left: 20px; }

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 26px;
    align-items: start;
}

.cart-table-wrap {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.cart-table thead th {
    padding: 13px 16px;
    text-align: left;
    font-size: 12px;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-muted);
    background: #fafcff;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.cart-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.cart-table tbody tr:last-child td { border-bottom: none; }

.cart-thumb img {
    width: 74px;
    height: 74px;
    object-fit: cover;
    border-radius: 10px;
    background: #f4f7fc;
    display: block;
}

.cart-info { min-width: 220px; }
.cart-name {
    display: block;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 4px;
}

.cart-name:hover { color: var(--primary); }

.cart-variant,
.cart-sku {
    display: block;
    font-size: 12.5px;
    color: var(--text-muted);
}

.cart-sku { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.qty-input {
    width: 76px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    background: #fff;
}

.qty-input:focus { outline: 2px solid rgba(47, 107, 255, 0.35); border-color: var(--primary); }

.line-total { font-weight: 700; white-space: nowrap; }

.cart-remove a { color: #b03a2e; font-size: 13px; }
.cart-remove a:hover { text-decoration: underline; }

.cart-table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.cart-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 88px;
}

.cart-summary h2 { margin: 0 0 16px; font-size: 18px; }

.cart-summary dl {
    margin: 0 0 18px;
    font-size: 14px;
}

.cart-summary dl > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
}

.cart-summary dt { color: var(--text-muted); }
.cart-summary dd { margin: 0; font-weight: 600; }

.cart-summary .summary-total {
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 14px;
    font-size: 17px;
}

.cart-summary .summary-total dd {
    color: #c0392b;
    font-size: 21px;
    font-weight: 800;
}

.btn-block { width: 100%; margin-bottom: 10px; }

/* 结账页：可搜索国家下拉与下单按钮 */
.country-combobox {
    position: relative;
}

.country-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
}

.country-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, .12);
}

.country-list {
    position: absolute;
    z-index: 40;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 240px;
    margin: 0;
    padding: 6px;
    overflow-y: auto;
    list-style: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(23, 43, 77, .14);
}

.country-list li {
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 13.5px;
    cursor: pointer;
}

.country-list li:hover,
.country-list li.active {
    background: #eef3fd;
    color: var(--primary);
}

.country-list li[aria-selected="true"] {
    font-weight: 700;
}

.country-list li.country-empty {
    color: var(--text-muted);
    cursor: default;
}

.checkout-submit {
    height: 52px;
    margin-top: 4px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #1f52d0);
    box-shadow: 0 10px 22px rgba(47, 107, 255, .28);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .2px;
    transition: transform .15s, box-shadow .15s;
}

.checkout-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(47, 107, 255, .34);
}

.checkout-submit:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.checkout-secure-note {
    margin: 10px 0 22px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted);
}

.summary-note {
    margin: 4px 0 0;
    font-size: 12px;
    color: #8b97ab;
    line-height: 1.6;
}

/* 折扣码 */
.coupon-box {
    margin: 0 0 16px;
    padding: 13px 14px;
    border: 1px dashed #d5e1f5;
    border-radius: 12px;
    background: #f8faff;
}

.coupon-box-applied {
    border-style: solid;
    border-color: #c6e9d4;
    background: #f2fbf6;
}

.coupon-label {
    display: block;
    margin-bottom: 7px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-muted);
}

.coupon-row { display: flex; gap: 8px; }

.coupon-row input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    text-transform: uppercase;
}

.coupon-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, .15);
}

.coupon-row .btn { white-space: nowrap; }

.coupon-applied {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #1e7a43;
}

.coupon-applied a { color: #b03a2e; font-size: 12.5px; }
.coupon-applied a:hover { text-decoration: underline; }

.coupon-msg { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; }
.coupon-msg.error { color: #b03a2e; }
.coupon-msg.ok { color: #1e7a43; }

.cart-summary dd.discount { color: #1e7a43; }

.empty-cart {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 70px 24px;
    text-align: center;
}

.empty-cart h1 { margin: 0 0 8px; font-size: 24px; }
.empty-cart p { margin: 0 0 22px; color: var(--text-muted); }

/* 结账 */
.checkout-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 26px;
    align-items: start;
}

.checkout-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
}

.checkout-form h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.checkout-form h2 + .field-row,
.checkout-form h2 + .field { margin-top: 0; }

.checkout-form h2:not(:first-child) { margin-top: 28px; }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.field-row.three { grid-template-columns: 1fr 1fr 1fr; }

.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.field .req { color: #c0392b; }

.field input,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.15);
}

.field-error {
    display: block;
    margin-top: 5px;
    font-size: 12.5px;
    color: #b03a2e;
}

.payment-box {
    border: 1px solid var(--border);
    background: #fafcff;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 22px;
}

.payment-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 14px;
    cursor: pointer;
}

.payment-option em { color: var(--text-muted); font-style: normal; font-size: 12.5px; }
.payment-option + .payment-option { margin-top: 10px; }

#wintopay-card-fields {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.wintopay-card-element {
    min-height: 44px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 10px;
}

/* 蜜罐字段：视觉隐藏，正常用户不会填写 */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.checkout-form { position: relative; }

.checkout-summary .summary-items {
    list-style: none;
    margin: 0 0 18px;
    padding: 0 0 16px;
    border-bottom: 1px solid var(--border);
}

.checkout-summary .summary-items li {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
}

.checkout-summary .summary-items img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    background: #f4f7fc;
    flex-shrink: 0;
}

.checkout-summary .summary-items li > div { flex: 1; }

.summary-item-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.summary-item-variant { font-size: 12px; color: var(--text-muted); }
.summary-item-total { font-size: 13px; font-weight: 700; white-space: nowrap; }

/* 订单成功 */
.order-success {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.success-mark {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #e9f7ef;
    color: #1e8e46;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 16px;
}

.order-success h1 { margin: 0 0 8px; font-size: 28px; }
.order-success > p { margin: 0 0 26px; color: var(--text-muted); max-width: 60em; }

.order-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 24px;
}

.order-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    background: #fafcff;
}

.order-card h2 { margin: 0 0 12px; font-size: 16px; }
.order-date { margin: 0 0 14px; font-size: 13px; color: var(--text-muted); }

.order-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.order-table th {
    text-align: left;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.order-table td { padding: 12px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.order-table tr:last-child td { border-bottom: none; }
.order-item-name { display: block; font-weight: 600; margin-bottom: 3px; }

.order-totals { margin: 14px 0 0; font-size: 13.5px; }
.order-totals > div { display: flex; justify-content: space-between; padding: 5px 0; }
.order-totals dt { color: var(--text-muted); }
.order-totals dd { margin: 0; font-weight: 600; }
.order-totals .summary-total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; font-size: 16px; }
.order-totals .summary-total dd { color: #c0392b; font-size: 19px; font-weight: 800; }

.order-card address {
    font-style: normal;
    font-size: 14px;
    line-height: 1.9;
    color: #40506a;
}

.order-notes { margin: 14px 0 0; font-size: 13px; color: #40506a; }

.success-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* 响应式 */
@media (max-width: 960px) {
    .cart-layout,
    .checkout-layout { grid-template-columns: 1fr; }
    .cart-summary { position: static; }
    .order-grid { grid-template-columns: 1fr; }
    .order-success { padding: 26px 20px; }
}

@media (max-width: 640px) {
    .cart-table thead { display: none; }
    .cart-table,
    .cart-table tbody,
    .cart-table tr,
    .cart-table td { display: block; width: 100%; }
    .cart-table tr {
        padding: 16px;
        border-bottom: 1px solid var(--border);
    }
    .cart-table td { border: none; padding: 4px 0; }
    .cart-thumb { display: none; }
    .cart-table td[data-label]::before {
        content: attr(data-label) ": ";
        color: var(--text-muted);
        font-size: 12.5px;
        margin-right: 6px;
    }
    .cart-table-actions { padding: 14px 16px; }
    .field-row,
    .field-row.three { grid-template-columns: 1fr; gap: 0; }
    .checkout-form { padding: 20px; }
}
