/**
 * 收银台/结账/订单查询/购物车 - 适配 v2 主题
 */

/* 主内容区 - 与商品详情/分类页一致 */
.content {
    width: 66.66666667%;
    max-width: 66.66666667%;
    padding: 2rem 0 3rem;
    margin: 0 auto;
    position: relative;
}
@media (max-width: 991.98px) {
    .content {
        width: 100%;
        max-width: 100%;
        padding: 1.5rem 1rem 2rem;
    }
}

/* ========== 结账页专属布局 ========== */
.content.checkout-page {
    width: 66.66666667%;
    max-width: 66.66666667%;
    padding: 2rem 1.5rem 3rem;
}
@media (max-width: 991.98px) {
    .content.checkout-page {
        width: 100%;
        max-width: 100%;
    }
    .checkout-page .table-cart thead th {
        color: #000 !important;
    }
}

@media (max-width: 575.98px) {
    .content.checkout-page {
        padding: 1.25rem 1rem 2rem;
    }
}

.checkout-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.checkout-page-title {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 600;
    color: #334155;
}

.checkout-page-title i {
    margin-right: 0.5rem;
    color: #4f46e5;
}

.checkout-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.checkout-close-btn:hover {
    background: #e2e8f0;
    color: #334155;
}

.checkout-close-btn i {
    font-size: 1.25rem;
}

/* Block 区块组件 */
.block {
    margin-bottom: 1.5rem;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.block.block-rounded {
    border-radius: 12px;
    overflow: hidden;
}

.block-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.block-header.block-header-default {
    background: transparent;
}

.block-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
}

.block-title i {
    margin-right: 0.5rem;
    color: #4f46e5;
    font-size: 1.125rem;
}

.block-content {
    padding: 1rem 1.25rem;
}

.block-content.block-content-full {
    padding: 0px;
}

/* ========== 结账页 Block 增强 ========== */
.checkout-block {
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.checkout-block .block-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

/* 商品列表块购物车图标 */
.checkout-block--cart .block-title .mcy-icon.checkout-cart-icon {
    width: 60px;
    height: 60px;
    vertical-align: middle;
    margin-right: 0.5rem;
}

/* 结账页表头文字黑色 */
.checkout-page .table-cart thead th {
    color: #000 !important;
}

/* 商品列表行 */
.checkout-item-thumb {
    width: 60px;
    min-width: 60px;
}

.checkout-item-thumb img {
    border-radius: 10px;
    max-width: 56px;
    height: auto;
}

.checkout-item-name {
    font-weight: 600;
    color: #334155;
    font-size: 0.9375rem;
}

.checkout-item-sku {
    font-size: 0.8125rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.checkout-item-qty {
    font-weight: 500;
    color: #475569;
}

.checkout-item-price {
    font-weight: 600;
    color: #4f46e5;
    font-size: 0.9375rem;
}

.checkout-fee-title {
    font-weight: 600;
    color: #334155;
}

.checkout-fee-desc {
    font-size: 0.8125rem;
    color: #64748b;
    margin-top: 0.2rem;
}

.checkout-total-row td {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    padding: 1rem 1.25rem !important;
    border-top: 2px solid #e2e8f0;
}

.checkout-total-label {
    font-size: 0.9375rem;
    color: #64748b;
    margin-right: 0.5rem;
}

.checkout-total-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: #4f46e5 !important;
}

.checkout-repay-btn {
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    background: #000;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.checkout-repay-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.checkout-repay-btn i {
    margin-right: 0.35rem;
}

/* 钱包余额 */
.checkout-wallet-balance {
    color: #10b981 !important;
    font-weight: 600;
}

/* 支付方式 - 结账页 */
.checkout-pay-container .checkout-pay-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.checkout-pay-container .pay-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkout-pay-container .pay-item:hover {
    border-color: #c7d2fe;
    background: #eef2ff;
}

.checkout-pay-container .pay-item.pay-current {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.checkout-pay-container .pay-item .pay-icon img,
.checkout-pay-container .pay-item.wallet-balance-click img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.checkout-pay-container .pay-item .pay-name {
    font-weight: 500;
    color: #334155;
}

/* 支付按钮区 */
.checkout-pay-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.checkout-btn-pay {
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.checkout-btn-pay:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

.checkout-btn-pay:disabled {
    background: linear-gradient(135deg, #a5b4fc 0%, #c4b5fd 100%);
    cursor: not-allowed;
    opacity: 0.85;
}

.checkout-btn-cancel {
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.checkout-btn-cancel:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.checkout-btn-cancel i {
    margin-right: 0.35rem;
}

/* 订单已取消 */
.checkout-cancelled {
    text-align: center;
    padding: 2.5rem 1.5rem !important;
}

.checkout-cancelled-icon {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.checkout-cancelled-text {
    font-size: 1.125rem;
    color: #64748b;
    margin: 0 0 1.25rem;
}

.checkout-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #4f46e5;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.checkout-btn-back:hover {
    color: #4338ca;
}

/* 支付二维码区域 - render-pay */
.checkout-page .render-pay .loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #64748b;
}

.checkout-page .render-pay .loading .las {
    font-size: 1.25rem;
}

.checkout-page .render-pay .loading .la-spin {
    animation: checkout-spin 0.8s linear infinite;
}

@keyframes checkout-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.checkout-page .render-qrcode {
    margin: 1.5rem auto;
    padding: 1rem;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.checkout-page .render-pay .pay-title {
    color: #4f46e5;
}

.checkout-page .pay-icon-alipay { color: #1677ff; }
.checkout-page .pay-icon-wxpay { color: #07c160; }
.checkout-page .pay-icon-qqpay { color: #12b7f5; }

/* 结账页移动端适配 */
@media (max-width: 767.98px) {
    .checkout-page .checkout-block--cart .block-content {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .checkout-page .table-cart thead th {
        color: #000 !important;
    }
    .checkout-page .table-cart {
        font-size: 0.875rem;
        min-width: 320px;
    }
    .checkout-page .table-cart .checkout-item-thumb {
        width: 48px;
        min-width: 48px;
    }
    .checkout-page .table-cart .checkout-item-thumb img {
        max-width: 44px;
    }
    .checkout-page .checkout-pay-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    .checkout-page .checkout-btn-pay,
    .checkout-page .checkout-btn-cancel {
        width: 100%;
    }
}

/* 商品列表表格 */
.table-vcenter td,
.table-vcenter th {
    vertical-align: middle;
}

.table-cart {
    margin-bottom: 0;
}

.table-cart thead th {
    font-weight: 600;
    color: #000 !important;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.table-cart tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table-cart tbody tr:last-child td {
    border-bottom: none;
}

.table-cart .img-fluid {
    max-width: 60px;
    border-radius: 8px;
}

.table-cart .table-active td {
    background: #f8fafc;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* 支付方式 - 收银台 pay-item 结构 */
.pay-container .pay-list .pay-item .pay-icon {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}

.pay-container .pay-list .pay-item .pay-icon img,
.pay-container .pay-list .pay-item.wallet-balance-click img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.pay-container .pay-list .pay-item .pay-name {
    font-size: 0.9375rem;
}

/* ========== 订单查询页 ========== */
.content .input-group {
    margin-bottom: 1.5rem;
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.content .input-group:focus-within {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.content .input-group .form-control.search-order-keyword {
    padding: 0.875rem 1.25rem;
    border: none;
    background: transparent;
    font-size: 0.9375rem;
}

.content .input-group .search-order-btn {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
}

.content .input-group .search-order-btn:hover {
    opacity: 0.9;
}

/* 订单卡片 */
.order-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.order-header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    padding: 1rem 1.25rem;
}

.order-header h2,
.order-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.order-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-info span {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

.order-pay-type img {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}

.order-pay-type pay {
    color: #4f46e5;
    font-weight: 500;
}

/* 订单表格 - 与 block 协调 */
.content .block .table-striped thead th {
    font-weight: 600;
    color: #475569;
    font-size: 0.8125rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.content .block .table-striped tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.content .block .table-striped tbody tr:hover {
    background: #fafafa;
}

.item-info.flex-container {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.item-info .item-logo {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.item-info .item-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-info .item-content .item-name {
    font-weight: 500;
    color: #334155;
    font-size: 0.9375rem;
}

.item-info .item-content .item-sku-name {
    font-size: 0.8125rem;
    color: #64748b;
}

/* ========== 购物车页 ========== */
.bg-gradient-blue {
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.content .block.bg-gradient-blue .block-header {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
}

.table-cart thead th {
    background: #f8fafc !important;
    color: #000 !important;
    font-size: 0.8125rem;
}

.table-cart tbody tr {
    transition: background 0.15s;
}

.table-cart tbody tr:hover {
    background: #fafafa;
}

.table-cart tbody tr:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
}

.table-cart .h6,
.table-cart .fs-sm {
    color: #334155 !important;
    font-weight: 500;
}

.table-cart .cart-item-del {
    color: #94a3b8 !important;
    transition: color 0.15s;
}

.table-cart .cart-item-del:hover {
    color: #ef4444 !important;
}

.quantity-change {
    display: flex;
    align-items: stretch;
    border: 1px solid #e5e7eb;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.quantity-change button,
.quantity-change input[type="text"] {
    display: block;
    flex: 0 0 auto;
    text-align: center;
    line-height: 32px;
    font-size: 0.875rem;
}

.quantity-change .change-left {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.quantity-change .change-right {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.quantity-change button {
    background: #f8fafc;
    border: none;
    cursor: pointer;
    color: #64748b;
    width: 28px;
    transition: background 0.15s, color 0.15s;
}

.quantity-change button:hover {
    background: #e2e8f0;
    color: #334155;
}

.quantity-change input[type="text"] {
    border: none;
    outline: none;
    margin: 0;
    width: 36px;
    color: #334155;
    font-weight: 600;
}

.quantity-change button:first-child,
.quantity-change input[type="text"] {
    border-right: 1px solid #e5e7eb;
}

.quantity-change button:last-child {
    border-left: 1px solid #e5e7eb;
}

.block-cart-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 1.25rem;
    padding: 0.5rem 0;
    gap: 1rem;
}

.btn-cart-clear,
.btn-cart-bill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cart-clear {
    background: #f1f5f9;
    color: #64748b;
}

.btn-cart-clear:hover {
    background: #e2e8f0;
    color: #dc2626;
}

.btn-cart-bill {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: #fff;
    margin-left: auto;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-cart-bill:hover {
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}

.cart-total-amount {
    color: #4f46e5 !important;
    font-size: 1.25rem !important;
}

[class^="cart-price-"],
[class*=" cart-price-"],
[class^="cart-amount-"],
[class*=" cart-amount-"] {
    color: #4f46e5 !important;
    font-weight: 600 !important;
}

.cart-widgets {
    padding: 0.5rem 0;
    border: 2px dashed transparent;
    border-radius: 8px;
    position: relative;
}

.cart-widget-edit {
    position: absolute;
    top: -6px;
    right: -6px;
    padding: 4px 10px;
    background: #4f46e5;
    border-radius: 6px;
    font-size: 0.75rem;
    color: #fff;
    visibility: hidden;
    cursor: pointer;
    transition: background 0.2s;
}

.cart-widgets:hover {
    border-color: #e5e7eb;
}

.cart-widgets:hover .cart-widget-edit {
    visibility: visible;
}

.cart-widgets:hover .cart-widget-edit:hover {
    background: #4338ca;
}

/* 购物车空状态 */
.content .block .text-center {
    padding: 2.5rem 1.5rem !important;
    color: #64748b;
    font-size: 0.9375rem;
}

