/* Modern Cart Styles - 重新设计布局 */
.modern-cart {
    min-height: 100vh;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.cart-wrapper {
    max-width: 95vw; /* 改为视口宽度的95%，尽可能大 */
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header Section */
.cart-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cart-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.cart-title {
    font-size: 3rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.cart-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    margin: 0 0 2rem 0;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.cart-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.item-count,
.total-preview {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Main Cart Grid */
.cart-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0;
    min-height: 600px;
}

/* Cart Items Section */
.cart-items-section {
    padding: 2rem;
    background: #fafbfc;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.update-cart-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.update-cart-btn:hover:not(:disabled) {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.update-cart-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
}

/* Items Grid - 新的布局结构 */
.items-grid {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.cart-item {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto auto auto auto; /* 改为1fr，让第一列自适应 */
    gap: 2rem;
    align-items: center;
    border: 2px solid #f1f5f9;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cart-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.cart-item:hover {
    border-color: #667eea;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
}

.cart-item:hover::before {
    transform: scaleX(1);
}

/* 图片和信息区域 - 新设计 */
.item-image-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.item-image {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.cart-item:hover .item-image img {
    transform: scale(1.05);
}

.item-info {
    text-align: center;
    min-width: 0;
}

.item-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    word-wrap: break-word;
    hyphens: auto;
}

.item-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
}

.item-name a:hover {
    color: #667eea;
}

.item-meta {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

/* Quantity Controls */
.item-quantity {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.quantity-label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border-radius: 12px;
    padding: 0.25rem;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.quantity-controls:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.qty-btn {
    background: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s ease;
    font-weight: 600;
}

.qty-btn:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.qty-btn:active {
    transform: scale(0.95);
}

/* 修复WooCommerce数量输入框 */
.quantity .input-text {
    width: 60px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-weight: 700;
    color: #1a202c;
    padding: 0.5rem 0.25rem;
    outline: none;
}

/* Price and Subtotal */
.item-price,
.item-subtotal {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.price-label,
.subtotal-label {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-value,
.subtotal-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a202c;
}

/* Remove Button */
.item-remove {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn {
    background: #fee2e2;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #dc2626;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #dc2626;
    color: white;
    transform: scale(1.1);
}

.remove-btn:active {
    transform: scale(0.95);
}

/* Continue Shopping */
.continue-shopping {
    text-align: center;
    padding-top: 1rem;
    border-top: 2px solid #e2e8f0;
}

.continue-btn {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.continue-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Order Summary */
.order-summary {
    background: white;
    padding: 2rem;
    border-left: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    height: fit-content;
}

.summary-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.summary-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a202c;
    margin: 0;
}

.summary-content {
    margin-bottom: 2rem;
}

.cart_totals h2 {
    display: none;
}

.cart_totals table {
    width: 100%;
    border-collapse: collapse;
}

.cart_totals th,
.cart_totals td {
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
}

.cart_totals th {
    font-weight: 600;
    color: #64748b;
    font-size: 1rem;
}

.cart_totals td {
    font-weight: 700;
    color: #1a202c;
    text-align: right;
    font-size: 1rem;
}

.cart_totals .order-total th,
.cart_totals .order-total td {
    border-bottom: none;
    padding-top: 1.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: #667eea;
}

/* Checkout Actions */
.checkout-actions {
    text-align: center;
}

/* 修改结账按钮字体颜色为白色 */
.checkout-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important; /* 强制白色字体 */
    border: none;
    padding: 1.25rem 2rem;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.checkout-btn:hover {
    color: white !important; /* 悬停时也保持白色 */
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
}

.checkout-btn svg {
    color: white !important; /* SVG图标也设为白色 */
}

.security-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.security-badge svg {
    color: #10b981;
    flex-shrink: 0;
}

/* 隐藏WooCommerce默认的结账按钮 */
.wc-proceed-to-checkout {
    display: none !important;
}

.checkout-button.button.alt.wc-forward {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cart-grid {
        grid-template-columns: 1fr;
    }
    
    .order-summary {
        border-left: none;
        border-top: 1px solid #e2e8f0;
    }
}

@media (max-width: 768px) {
    .modern-cart {
        padding: 1rem 0.5rem;
    }
    
    .cart-header {
        padding: 2rem 1rem;
    }
    
    .cart-title {
        font-size: 2rem;
    }
    
    .cart-subtitle {
        font-size: 1rem;
    }
    
    .cart-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cart-items-section,
    .order-summary {
        padding: 1.5rem;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
        text-align: center;
    }
    
    .item-image-section {
        flex-direction: row;
        justify-content: center;
        gap: 1rem;
    }
    
    .item-image {
        width: 80px;
        height: 80px;
    }
    
    .item-info {
        text-align: left;
    }
    
    .item-quantity,
    .item-price,
    .item-subtotal,
    .item-remove {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border-top: 1px solid #e2e8f0;
    }
    
    .quantity-controls {
        order: 2;
    }
    
    .quantity-label {
        order: 1;
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .cart-title {
        font-size: 1.75rem;
    }
    
    .section-title,
    .summary-title {
        font-size: 1.5rem;
    }
    
    .item-image-section {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .item-image {
        width: 60px;
        height: 60px;
    }
}