:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --danger-color: #ef4444;
    --danger-dark: #dc2626;
    --warning-color: #f59e0b;
    --surface-color: #ffffff;
    --surface-alt: #f8fafc;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

/* Container and Layout */
.cart-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    min-height: 60vh;
}

/* Cart Header */
.cart-header {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--surface-alt) 100%);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.cart-header h1 {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cart-header .cart-icon {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
}

.cart-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.cart-stat {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-align: center;
    min-width: 120px;
}

.cart-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.cart-stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Cart Items */
.cart-item {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.cart-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-item:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.cart-item:hover::before {
    opacity: 1;
}

/* Product Image with Zoom */
.cart-item-image-container {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-alt);
    margin-right: 2rem;
    cursor: pointer;
}

.cart-item-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Image Zoom Overlay */
.image-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.image-zoom-container {
    position: relative;
    max-width: 80vw;
    max-height: 80vh;
    background: white;
    border-radius: var(--radius-xl);
    padding: 1rem;
    box-shadow: var(--shadow-xl);
}

.image-zoom-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.image-zoom-close:hover {
    background: var(--danger-dark);
    transform: scale(1.1);
}

.zoomed-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-lg);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Product Details */
.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cart-item-name {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Variant Information */
.variant-info {
    background: linear-gradient(135deg, var(--surface-alt), #f1f5f9);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.variant-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.variant-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.variant-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 160px;
    background: var(--surface-alt);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    border: 2px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.quantity-controls:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.quantity-btn {
    background: var(--surface-color);
    border: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 700;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.quantity-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 72px;
    text-align: center;
    border: none;
    background: transparent;
    height: 44px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
}

.quantity-input:focus {
    background: white;
    border-radius: var(--radius-sm);
}

/* Stock Information */
.stock-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stock-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary-color);
}

/* Item Total and Actions */
.item-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.cart-actions {
    display: flex;
    gap: 0.75rem;
    flex-direction: column;
    align-items: flex-end;
}

.action-btn {
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    justify-content: center;
    min-width: 140px;
    box-shadow: var(--shadow-sm);
}

.save-later-btn {
    background: linear-gradient(135deg, var(--warning-color), #f97316);
    color: white;
}

.save-later-btn:hover {
    background: linear-gradient(135deg, #f97316, #ea580c);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.remove-btn {
    background: linear-gradient(135deg, var(--danger-color), var(--danger-dark));
    color: white;
}

.remove-btn:hover {
    background: linear-gradient(135deg, var(--danger-dark), #b91c1c);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Cart Summary */
.cart-summary {
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--surface-alt) 100%);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    margin-top: 2rem;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 2rem;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-icon {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: var(--shadow-md);
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.summary-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
}

.summary-value {
    font-weight: 600;
    color: var(--text-primary);
}

.summary-total {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    margin: 1.5rem -2.5rem -2.5rem;
    padding: 2rem 2.5rem;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Checkout Button */
.checkout-btn {
    background: linear-gradient(45deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    border: none;
    padding: 1.25rem 2rem;
    border-radius: var(--radius-lg);
    font-size: 1.2rem;
    font-weight: 700;
    width: 100%;
    margin-top: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.checkout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.checkout-btn:hover {
    background: linear-gradient(45deg, var(--secondary-dark), #047857);
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.checkout-btn:hover::before {
    left: 100%;
}

.continue-shopping {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-dark));
    color: white;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    width: 100%;
    text-align: center;
}

.continue-shopping:hover {
    background: linear-gradient(45deg, var(--primary-dark), #1e40af);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    color: white;
}

/* Empty Cart State */
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, var(--surface-color) 0%, var(--surface-alt) 100%);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.empty-cart-icon {
    font-size: 5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    opacity: 0.7;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-cart h3 {
    font-size: 2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 700;
}

.empty-cart p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto 2rem;
}

/* Notification Messages */
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    z-index: 1000;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--danger-color), var(--danger-dark));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    z-index: 1000;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

@keyframes slideIn {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
    .cart-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-container {
        padding: 0 0.75rem;
    }
    
    .cart-header {
        padding: 1.5rem;
    }
    
    .cart-header h1 {
        font-size: 1.75rem;
    }
    
    .cart-header .cart-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }
    
    .cart-stats {
        gap: 1rem;
    }
    
    .cart-stat {
        padding: 0.75rem 1rem;
        min-width: 100px;
    }
    
    .cart-item {
        padding: 1.5rem;
    }
    
    .cart-item-image-container {
        width: 120px;
        height: 120px;
        margin-right: 1.5rem;
    }
    
    .cart-item-name {
        font-size: 1.1rem;
    }
    
    .cart-item-price {
        font-size: 1.3rem;
    }
    
    .quantity-controls {
        max-width: 140px;
    }
    
    .quantity-btn {
        width: 40px;
        height: 40px;
    }
    
    .quantity-input {
        width: 60px;
        height: 40px;
    }
    
    .cart-actions {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .action-btn {
        padding: 0.6rem 1rem;
        font-size: 0.8rem;
        min-width: 120px;
    }
    
    .cart-summary {
        padding: 2rem;
    }
    
    .summary-total {
        margin: 1.5rem -2rem -2rem;
        padding: 1.5rem 2rem;
    }
}

@media (max-width: 480px) {
    .cart-item .row {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .cart-item-image-container {
        margin: 0 auto;
    }
    
    .item-total {
        text-align: center;
    }
    
    .cart-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .image-zoom-container {
        max-width: 95vw;
        max-height: 90vh;
    }
}