
/* ================================================
   购物车页面 - 现代化金色主题设计
   与商品详情页保持一致的视觉风格
   ================================================ */

:root {
    /* 金色主题色系 */
    --gold-primary: #d4af37;
    --gold-light: #f4e4a6;
    --gold-dark: #b8941f;
    
    /* 中性色系 */
    --black: #000000;
    --white: #FFFFFF;
    --gray-50: #fafafa;
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    /* 功能色 */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* 背景色 */
    --bg-light: #f9f9f9;
    --bg-section: #f5f5f5;
    
    /* 边框和阴影 */
    --border: #e5e5e5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.15);
    
    /* 过渡动画 */
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;
}

/* 主容器 */
.cart-container {
    max-width: 1300px;
    margin: 30px auto;
    padding: 20px;
    width: 100%;
}

/* 页面标题 */
.cart-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.cart-title {
    font-size: 36px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 10px;
    display: inline-block;
}

.cart-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-primary), var(--gold-light));
    border-radius: 2px;
}

.cart-subtitle {
    color: var(--gray-500);
    font-size: 16px;
    margin-top: 15px;
}

/* 空购物车状态 */
.empty-cart-container {
    background: var(--bg-section);
    border-radius: 16px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-top: 40px;
}

.empty-cart-icon {
    font-size: 80px;
    color: var(--gray-300);
    margin-bottom: 25px;
}

.empty-cart-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 15px;
}

.empty-cart-message {
    color: var(--gray-500);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 35px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.continue-shopping-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: var(--white);
    padding: 14px 28px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-gold);
    border: none;
    cursor: pointer;
}

.continue-shopping-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.3);
}

.continue-shopping-btn::before {
    content: '←';
    font-size: 18px;
}

/* 购物车内容区域 */
.cart-content-wrapper {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

/* 购物车头部 */
.cart-content-header {
    background: var(--bg-section);
    padding: 25px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.cart-item-count {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 18px;
}

.cart-item-count span {
    color: var(--gold-primary);
    font-size: 20px;
}

.cart-summary-total {
    font-size: 20px;
    font-weight: 700;
    color: var(--gold-primary);
}

/* 购物车表格 */
.cart-items-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-items-table thead {
    background: var(--gray-50);
}

.cart-items-table th {
    padding: 20px;
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

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

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

.cart-items-table tr:hover {
    background: var(--gray-50);
}

/* 商品信息列 */
.cart-item-info {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    min-width: 320px;
}

.cart-item-image {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--white);
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.cart-item-image:hover img {
    transform: scale(1.05);
}

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

.cart-item-title {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 16px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.cart-item-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

.cart-item-title a:hover {
    color: var(--gold-primary);
}

.cart-item-variant {
    color: var(--gray-600);
    font-size: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cart-item-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray-500);
    font-size: 13px;
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: 12px;
}

/* 价格列 */
.cart-item-price {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 16px;
    min-width: 120px;
}

/* 数量控制列 */
.cart-item-quantity {
    min-width: 160px;
}

.quantity-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border-radius: 10px;
    padding: 4px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.quantity-btn {
    width: 40px;
    height: 40px;
    background: var(--white);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 300;
    color: var(--gray-700);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-normal);
}

.quantity-btn:hover {
    background: var(--gold-primary);
    border-color: var(--gold-primary);
    color: var(--white);
}

.quantity-input {
    width: 60px;
    height: 40px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    -moz-appearance: textfield;
    outline: none;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
}

/* 小计列 */
.cart-item-subtotal {
    font-weight: 700;
    color: var(--gold-primary);
    font-size: 18px;
    min-width: 120px;
}

/* 操作列 */
.cart-item-actions {
    min-width: 100px;
}

.remove-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--danger);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-normal);
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.1);
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    transform: translateY(-1px);
}

/* 购物车底部操作区 */
.cart-actions-container {
    padding: 30px;
    background: var(--bg-section);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.cart-update-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    color: var(--gray-800);
    border: 2px solid var(--border);
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.cart-update-btn:hover {
    background: var(--gray-100);
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.cart-update-btn::before {
    content: '🔄';
    font-size: 18px;
}

.cart-checkout-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    color: var(--white);
    padding: 16px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-gold);
    border: none;
    cursor: pointer;
}

.cart-checkout-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(212, 175, 55, 0.3);
}

.cart-checkout-btn::before {
    content: '→';
    font-size: 18px;
    font-weight: 300;
}

/* 购物车汇总信息 */
.cart-summary-container {
    background: var(--bg-section);
    border-radius: 16px;
    padding: 30px;
    margin-top: 40px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.cart-summary-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gold-light);
}

.cart-summary-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.summary-label {
    color: var(--gray-600);
    font-size: 15px;
}

.summary-value {
    font-weight: 600;
    color: var(--gray-800);
    font-size: 16px;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-top: 2px solid var(--border);
    margin-top: 10px;
}

.total-label {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.total-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--gold-primary);
}

/* 消息提示 */
.cart-message {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
    animation: slideIn 0.3s ease;
}

.cart-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    border-left: 4px solid var(--success);
}

.cart-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    border-left: 4px solid var(--danger);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== 响应式设计 ==================== */

/* 平板电脑 (1024px以下) */
@media (max-width: 1024px) {
    .cart-container {
        padding: 15px;
    }
    
    .cart-title {
        font-size: 32px;
    }
    
    .cart-item-info {
        min-width: 280px;
    }
    
    .cart-item-image {
        width: 80px;
        height: 80px;
    }
    
    .cart-content-header {
        padding: 20px;
    }
    
    .cart-actions-container {
        padding: 25px;
    }
}

/* 平板 (768px以下) */
@media (max-width: 768px) {
    .cart-title {
        font-size: 28px;
    }
    
    .cart-content-wrapper {
        border-radius: 12px;
    }
    
    .cart-items-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .cart-items-table thead {
        display: none;
    }
    
    .cart-items-table tbody {
        display: block;
    }
    
    .cart-items-table tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        padding: 20px;
        border-bottom: 2px solid var(--border);
    }
    
    .cart-items-table tr:last-child {
        border-bottom: none;
    }
    
    .cart-items-table td {
        padding: 0;
        border: none;
    }
    
    /* 商品信息占据整行 */
    .cart-item-info {
        grid-column: 1 / -1;
        min-width: 100%;
    }
    
    /* 其他信息展示 */
    .cart-item-price,
    .cart-item-quantity,
    .cart-item-subtotal,
    .cart-item-actions {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .cart-item-price::before {
        content: '价格：';
        color: var(--gray-500);
        font-size: 14px;
        font-weight: normal;
    }
    
    .cart-item-quantity::before {
        content: '数量：';
        color: var(--gray-500);
        font-size: 14px;
        font-weight: normal;
    }
    
    .cart-item-subtotal::before {
        content: '小计：';
        color: var(--gray-500);
        font-size: 14px;
        font-weight: normal;
    }
    
    .cart-item-actions::before {
        content: '操作：';
        color: var(--gray-500);
        font-size: 14px;
        font-weight: normal;
    }
    
    /* 操作按钮调整 */
    .cart-actions-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cart-update-btn,
    .cart-checkout-btn {
        justify-content: center;
    }
    
    /* 汇总信息调整 */
    .cart-summary-details {
        grid-template-columns: 1fr;
    }
}

/* 手机 (480px以下) */
@media (max-width: 480px) {
    .cart-container {
        padding: 12px;
        margin: 20px auto;
    }
    
    .cart-title {
        font-size: 24px;
    }
    
    .empty-cart-container {
        padding: 40px 20px;
    }
    
    .empty-cart-title {
        font-size: 20px;
    }
    
    .cart-item-info {
        gap: 15px;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
    }
    
    .cart-item-title {
        font-size: 15px;
    }
    
    .cart-items-table tr {
        grid-template-columns: 1fr;
        padding: 15px;
        gap: 12px;
    }
    
    .quantity-controls {
        width: 100%;
        justify-content: center;
    }
    
    .quantity-btn {
        width: 38px;
        height: 38px;
    }
    
    .quantity-input {
        width: 50px;
        height: 38px;
    }
    
    .cart-checkout-btn,
    .cart-update-btn,
    .continue-shopping-btn {
        padding: 12px 20px;
        font-size: 15px;
        width: 100%;
        justify-content: center;
    }
    
    .cart-summary-container {
        padding: 20px;
    }
    
    .cart-summary-title {
        font-size: 20px;
    }
    
    .total-label {
        font-size: 18px;
    }
    
    .total-value {
        font-size: 20px;
    }
}

/* 小手机 (360px以下) */
@media (max-width: 360px) {
    .cart-title {
        font-size: 22px;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
    }
    
    .cart-item-title {
        font-size: 14px;
    }
    
    .cart-item-variant,
    .cart-item-stock {
        font-size: 12px;
    }
    
    .quantity-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .quantity-input {
        width: 45px;
        height: 36px;
        font-size: 14px;
    }
    
    .cart-summary-container {
        padding: 16px;
    }
}

/* 面包屑导航 */
.breadcrumb-nav {
    font-size: 14px;
    color: var(--gray-500);
    margin-bottom: 25px;
    padding: 10px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.breadcrumb-link {
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition-fast);
}

.breadcrumb-link:hover {
    color: var(--gold-primary);
}

.breadcrumb-separator {
    color: var(--gray-400);
}

.breadcrumb-current {
    color: var(--gold-primary);
    font-weight: 500;
}

/* 加载状态 */
.cart-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 移动端触摸优化 */
@media (max-width: 768px) {
    .quantity-btn,
    .remove-btn,
    .cart-update-btn,
    .cart-checkout-btn,
    .continue-shopping-btn {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    input[type="number"] {
        font-size: 16px !important;
    }
    
    .cart-content-wrapper {
        -webkit-tap-highlight-color: transparent;
    }
}
