/**
 * WAB Cart Edit Styles
 * 购物车编辑模态框样式
 */

/* 编辑按钮 */
.wab-edit-bundle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 10px;
    padding: 4px 10px;
    font-size: 12px;
    color: #2271b1;
    background: #f0f6fc;
    border: 1px solid #2271b1;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wab-edit-bundle-btn:hover {
    background: #2271b1;
    color: #fff;
}

.wab-edit-icon {
    font-size: 14px;
}

/* 模态框 */
.wab-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wab-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}

.wab-modal-container {
    position: relative;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wab-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.wab-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.wab-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.wab-modal-close:hover {
    color: #333;
}

.wab-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.wab-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
}

/* 加载状态 */
.wab-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    gap: 15px;
}

.wab-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e0e0e0;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: wab-spin 0.8s linear infinite;
}

@keyframes wab-spin {
    to { transform: rotate(360deg); }
}

/* 按钮 */
.wab-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wab-btn-primary {
    background: #2271b1;
    color: #fff;
}

.wab-btn-primary:hover {
    background: #135e96;
}

.wab-btn-primary:disabled {
    background: #a0a0a0;
    cursor: not-allowed;
}

.wab-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.wab-btn-secondary:hover {
    background: #e0e0e0;
}

/* 编辑界面 */
.wab-edit-interface h4 {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* 套餐选择 */
.wab-package-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.wab-edit-package-card {
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wab-edit-package-card:hover {
    border-color: #2271b1;
}

.wab-edit-package-card.selected {
    border-color: #2271b1;
    background: #f0f6fc;
}

.wab-package-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.wab-package-price {
    color: #666;
    font-size: 14px;
}

.wab-package-save {
    margin-top: 5px;
    font-size: 12px;
    color: #2e7d32;
    font-weight: 500;
}

/* 折扣等级 */
.wab-tier-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.wab-tier-badge {
    padding: 4px 10px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 4px;
    font-size: 12px;
}

/* 属性选择 */
.wab-edit-attributes {
    margin-bottom: 20px;
}

.wab-edit-attribute-group {
    margin-bottom: 20px;
}

.wab-attr-name {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.wab-edit-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.wab-edit-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.wab-item-name {
    flex: 1;
    font-size: 14px;
}

.wab-item-sku {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 8px;
    background: #e0e0e0;
    border-radius: 3px;
    font-size: 11px;
    font-family: monospace;
}

/* 数量控制 */
.wab-edit-qty-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.wab-edit-qty-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wab-edit-qty-btn:hover {
    background: #f0f0f0;
}

.wab-edit-qty-input {
    width: 50px;
    height: 30px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

/* 汇总区域 */
.wab-edit-summary {
    padding: 15px;
    background: #f0f6fc;
    border-radius: 8px;
    border: 1px solid #2271b1;
}

.wab-edit-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.wab-summary-label {
    font-weight: 500;
    color: #333;
}

.wab-summary-value {
    font-weight: 600;
    color: #2271b1;
    font-size: 16px;
}

/* 响应式 */
@media (max-width: 600px) {
    .wab-modal-container {
        width: 95%;
        max-height: 95vh;
    }

    .wab-edit-items {
        grid-template-columns: 1fr;
    }

    .wab-package-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

