/**
 * 结账系统样式文件
 */

/* 结账页面基础样式 */
.checkout-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

.checkout-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 订单摘要 */
.checkout-summary {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.checkout-summary h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 20px;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

.cart-items-summary {
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
    transition: background 0.3s ease;
}

.summary-item:hover {
    background: rgba(0, 124, 186, 0.05);
    margin: 0 -15px;
    padding-left: 15px;
    padding-right: 15px;
    border-radius: 6px;
}

.summary-item:last-child {
    border-bottom: none;
}

.item-info {
    display: flex;
    align-items: center;
    flex: 1;
}

.item-info img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 15px;
    border: 1px solid #e9ecef;
}

.item-details h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    line-height: 1.3;
    color: #333;
}

.item-details p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.item-quantity {
    margin: 0 15px;
    font-weight: bold;
    color: #495057;
    background: #e9ecef;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.item-price {
    font-weight: bold;
    color: #007cba;
    font-size: 16px;
}

.order-total {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    font-size: 20px;
    color: #28a745;
    border: 2px solid #28a745;
    font-weight: bold;
}

/* 结账表单 */
.checkout-form-container {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.checkout-form-container h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #333;
    font-size: 20px;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

.form-section {
    margin-bottom: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.form-section h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #495057;
    font-size: 16px;
    font-weight: bold;
}

.form-section h4 small {
    font-weight: normal;
    color: #6c757d;
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row.three-columns {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-group {
    margin-bottom: 20px;
    position: relative;
}

.form-group.focused label {
    color: #007cba;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #495057;
    transition: color 0.3s ease;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
    transform: translateY(-1px);
}

.form-group input.error,
.form-group textarea.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    color: #6c757d;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* 表单操作按钮 */
.form-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid #e9ecef;
}

.btn-submit-checkout {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 15px;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-submit-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.btn-submit-checkout:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-back-cart {
    color: #6c757d;
    text-decoration: none;
    padding: 15px 25px;
    border: 2px solid #6c757d;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-back-cart:hover {
    background: #6c757d;
    color: white;
    transform: translateY(-1px);
}

/* 购物车为空 */
.checkout-empty {
    text-align: center;
    padding: 80px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.checkout-empty p {
    font-size: 18px;
    color: #6c757d;
    margin-bottom: 20px;
}

.checkout-empty a {
    color: #007cba;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 20px;
    border: 2px solid #007cba;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.checkout-empty a:hover {
    background: #007cba;
    color: white;
}

/* 消息提示 */
.checkout-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 6px;
    color: white;
    font-weight: bold;
    z-index: 9999;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    max-width: 400px;
    animation: slideInRight 0.3s ease;
}

.checkout-message-success {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.checkout-message-error {
    background: linear-gradient(135deg, #dc3545, #e74c3c);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 个人资料页面样式 */
.profile-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.profile-container h2 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 28px;
    text-align: center;
}

.profile-description {
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 16px;
    text-align: center;
    font-style: italic;
}

.profile-form {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.profile-form .form-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.profile-form .form-section h3 {
    color: #495057;
    font-size: 18px;
    border-left: 4px solid #007cba;
    padding-left: 15px;
    margin-bottom: 25px;
}

.profile-preview {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.profile-preview h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #495057;
    text-align: center;
}

.preview-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.preview-item {
    padding: 15px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.preview-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.preview-item strong {
    color: #495057;
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
}

.preview-item span {
    color: #333;
    font-size: 14px;
    word-break: break-word;
}

.preview-item span:empty::after {
    content: "未填写";
    color: #6c757d;
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    
    .checkout-summary {
        position: static;
        order: 2;
    }
    
    .checkout-form-container {
        order: 1;
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-row.three-columns {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-submit-checkout {
        margin-right: 0;
    }
    
    .profile-form {
        padding: 25px;
    }
    
    .preview-content {
        grid-template-columns: 1fr;
    }
    
    .checkout-message {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .checkout-page,
    .profile-page {
        padding: 10px;
    }
    
    .checkout-summary,
    .checkout-form-container,
    .profile-form {
        padding: 15px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .btn-submit-checkout,
    .btn-back-cart {
        padding: 12px 20px;
        font-size: 14px;
    }
}
