/* checkout.css - 结算清单专用样式 v1.1.1 */

/* ========== 生成购物清单按钮 ========== */
.generate-btn-container {
    margin: 20px 0 80px 0;
    text-align: center;
    padding: 0 10px;
}

.btn-generate {
    background: linear-gradient(135deg, #e36318 0%, #e332b5 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 6px 20px rgba(73, 160, 120, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 91;
    min-height: 56px;
}

.btn-generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(73, 160, 120, 0.5);
}

.btn-generate:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(73, 160, 120, 0.4);
}

.btn-generate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 4px 12px rgba(73, 160, 120, 0.2) !important;
}

/* ========== 结算清单区域 ========== */
.checkout-section {
    display: none; /* 初始隐藏 */
    margin: 20px 0 30px;
    animation: slideUp 0.4s ease;
}
.checkout-section.show {
    display: block !important; /* JS控制显示 */
}
.checkout-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    border: 2px solid #e8f5e9;
}

.checkout-content {
    margin-top: 15px;
}

/* 清单头部 */
.checkout-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f2ff;
}

.checkout-section .section-header h3 {
    color: var(--secondary-color);
    margin: 0;
    display: flex;
    align-items: center;
    font-size: 1.2rem;
}

.checkout-section .section-header h3 i {
    margin-right: 10px;
    font-size: 1.1rem;
}

/* 商品清单容器 */
.list-items-container {
    max-height: 350px;
    overflow-y: auto;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.list-item {
    padding: 15px 0;
    border-bottom: 1px dashed #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.list-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.item-main {
    flex: 2;
    min-width: 0;
}

.item-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 6px;
    font-size: 1rem;
    line-height: 1.4;
    word-break: break-word;
}

.item-subname {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.item-series {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.item-group {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.item-code {
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    color: #28a745;
    background: #e8f5e9;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 6px;
    font-weight: 600;
    letter-spacing: 1px;
}

.item-details {
    flex: 1;
    text-align: right;
    min-width: 120px;
    padding-left: 15px;
}

.item-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 5px;
}

.item-quantity {
    color: var(--gray-color);
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: block;
}

.item-subtotal {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
    background: #fff3cd;
    padding: 6px 12px;
    border-radius: 6px;
    display: inline-block;
}

/* 清单汇总 */
.list-summary {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 10px;
    margin-top: 25px;
    border: 1px solid #c8e6c9;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 1rem;
    padding: 8px 0;
    border-bottom: 1px solid #d4edda;
}

.summary-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.summary-row.total {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #c8e6c9;
}



/* 订单信息 */
.order-info {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 20px;
    margin-top: 25px;
    border: 1px solid #e6e9ff;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row.highlight {
    background: #e8f5e9;
    margin: 15px -20px -20px;
    padding: 15px 20px;
    border-radius: 0 0 10px 10px;
    font-weight: 700;
    font-size: 1.2rem;
    border-top: 2px solid #c8e6c9;
}

/* 动画效果 */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 576px) {
    .btn-generate {
        padding: 14px 24px;
        font-size: 1rem;
        min-height: 52px;
    }
    
    .checkout-card {
        padding: 15px;
    }
    
    .list-items-container {
        padding: 15px;
        max-height: 300px;
    }
    
    .list-item {
        flex-direction: column;
        gap: 12px;
    }
    
    .item-details {
        text-align: left;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-left: 0;
        padding-top: 10px;
        border-top: 1px dashed #eee;
    }
    
    .qrcode-wrapper {
        width: 220px;
        height: 220px;
    }
}

@media (min-width: 768px) {
    .checkout-content {
        display: grid;
        grid-template-columns: 1.5fr 1fr;
        gap: 30px;
        align-items: start;
    }
    
    .list-items-container {
        grid-column: 1;
        max-height: 400px;
        margin-bottom: 0;
    }
    
    .qrcode-container {
        grid-column: 2;
        grid-row: 1;
        margin: 0;
        align-self: start;
        position: sticky;
        top: 20px;
    }
    
    .order-info {
        grid-column: 1 / span 2;
        grid-row: 2;
    }
}
/* 确保二维码容器可见 */
#qrcodeWrapper {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 二维码图片样式 */
#qrcodeWrapper canvas,
#qrcodeWrapper img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

/* 加载状态 */
.qrcode-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.qrcode-loading i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #49A078;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功状态 */
.qrcode-success {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (max-width: 576px) {
    .qrcode-wrapper {
        width: 220px;
        height: 220px;
    }
}
/* 购物清单弹窗样式 */
.checkout-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.checkout-modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, #49A078 0%, #73B38D 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-actions {
    display: flex;
    gap: 10px;
}
#closeModalBtn2, #saveImageBtn {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
}
/* 确保按钮在打印时隐藏 */
@media print {
    .modal-actions {
        display: none !important;
    }
}
.btn-modal {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}
/* checkout.css - 更新弹窗样式 */

.checkout-modal .modal-content {
    max-width: 480px;
}
.btn-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
/* 基本信息卡片 */
.modal-basic-info {
    background: #f8f9ff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e6e9ff;
}
.basic-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}
.basic-info-item {
    display: flex;
    flex-direction: column;
}

.basic-info-label {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.basic-info-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
}
/* 统计卡片 */
.modal-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 15px 0;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 15px 10px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid #e6e9ff;
}

.stat-card.highlight {
    background: linear-gradient(135deg, #49A078, #73B38D);
    color: white;
    border: none;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: #49A078;
}

.stat-card.highlight .stat-value {
    color: white;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
}

.stat-card.highlight .stat-label {
    color: rgba(255,255,255,0.9);
}

.modal-order-info {
    background: #f8f9ff;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 0px;
    border: 1px solid #e6e9ff;
}

.modal-list-container {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.modal-qrcode {
    text-align: center;
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f7ff 100%);
    border-radius: 12px;
    border: 2px solid #e6e9ff;
}

.modal-qrcode .qrcode-wrapper {
    width: 200px;
    height: 200px;
    margin: 15px auto;
}

.modal-summary {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e8f5e9;
}

.modal-summary .total {
    font-size: 1.3rem;
    color: #49A078;
    font-weight: 700;
}

/* 保存图片按钮的加载状态 */
.btn-modal.saving {
    background: #6c757d;
}

.btn-modal.saving i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 576px) {
    .modal-content {
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-qrcode .qrcode-wrapper {
        width: 180px;
        height: 180px;
    }
}
/* checkout.css - 更新弹窗样式 */
/* 二维码区域 - 放在顶部 */
.modal-qrcode-area {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f7ff 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid #e6e9ff;
    margin: 0px 0;
}

.qrcode-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #49A078;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.qrcode-wrapper {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    border: 2px solid #e6e9ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qrcode-hint {
    font-size: 0.9rem;
    color: #666;
    margin-top: 10px;
}

/* 订单信息卡片 */
.modal-order-summary {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.summary-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e6e9ff;
}

.summary-item {
    margin-bottom: 0px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item:last-child {
    margin-bottom: 0px;
}

.summary-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 0.95rem;
}

.summary-value {
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
}

/* 统计信息行 */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #49A078;
}

/* 总金额 */
.total-amount {
    background: linear-gradient(135deg, #49A078, #73B38D);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-label {
    font-size: 1rem;
}

.total-value {
    font-size: 1.5rem;
    font-weight: 800;
}

/* 商品明细 */
.modal-items-detail {
    padding: 20px;
}
.modal-items-section {
    background: white;
    border-radius: 12px;
    padding: 0;
    border: 1px solid #e6e9ff;
    overflow: hidden;
}
.items-section-header {
    background: #f8f9ff;
    padding: 15px 20px;
    border-bottom: 2px solid #e6e9ff;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #49A078;
}
/* 响应式调整 */
@media (max-width: 768px) {
    .basic-info-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}


.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #49A078;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f2ff;
}

.gift-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ff9800;
    margin: 20px 0 15px;
    padding-top: 15px;
    border-top: 2px dashed #ffcc80;
    display: flex;
    align-items: center;
    gap: 8px;
}

.items-list {
    max-height: 300px;
    overflow-y: auto;
}

.item-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed #eee;
    align-items: flex-start;
}

.item-row:last-child {
    border-bottom: none;
}

.gift-row {
    background: #fff3e0;
    margin: 0 -20px;
    padding: 12px 20px;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.item-sub {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 6px;
}

.item-code {
    font-size: 0.85rem;
    color: #28a745;
    background: #e8f5e9;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    font-family: monospace;
}

.item-numbers {
    text-align: right;
    min-width: 100px;
    margin-left: 10px;
}

.item-price {
    color: #49A078;
    font-weight: 600;
    margin-bottom: 4px;
}

.item-quantity {
    color: #666;
    margin-bottom: 6px;
}

.item-subtotal {
    font-weight: 600;
    color: #333;
    background: #fff3cd;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

/* 修复保存图片和关闭按钮 */
.btn-modal {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-modal:hover {
    background: rgba(255, 255, 255, 0.3);
}

#saveImageBtn {
    background: rgba(255, 255, 255, 0.2);
}

#closeModalBtn2 {
    background: rgba(255, 255, 255, 0.1);
}

/* 响应式调整 */
@media (max-width: 576px) {
    .checkout-modal .modal-content {
        max-height: 95vh;
        margin: 10px;
    }
    
    .qrcode-wrapper {
        width: 180px;
        height: 180px;
    }
    
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .total-value {
        font-size: 1.3rem;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        max-height: calc(95vh - 70px);
    }
    
    .items-list {
        max-height: 250px;
    }
    
    .gift-row {
        margin: 0 -15px;
        padding: 12px 15px;
    }
}

@media (max-width: 400px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .qrcode-wrapper {
        width: 160px;
        height: 160px;
    }
    
    .item-numbers {
        min-width: 80px;
    }
}