/* Cart Page Styles */

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    margin-top: 80px; /* Account for fixed header */
    min-height: calc(100vh - 200px);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.cart-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin: 0;
}

.continue-shopping {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid #3498db;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.continue-shopping:hover {
    background: #3498db;
    color: white;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

/* Empty Cart State */
.empty-cart {
    text-align: center;
    padding: 4rem 2rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-cart-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-cart h2 {
    color: #7f8c8d;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.empty-cart p {
    color: #95a5a6;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Cart Content */
.cart-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Cart Items */
.cart-items {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.cart-items-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
}

.cart-items-list {
    max-height: 600px;
    overflow-y: auto;
}

/* Cart Item */
.cart-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
    align-items: center;
    transition: background-color 0.3s ease;
}

.cart-item:hover {
    background: #f8f9fa;
}

.cart-item:last-child {
    border-bottom: none;
}

/* Product Info */
.item-product {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8f9fa;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.item-details p {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: 0;
}

/* Price */
.item-price {
    font-weight: 600;
    color: #e74c3c;
    font-size: 1.1rem;
}

/* Quantity Controls */
.item-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.qty-btn {
    background: #f8f9fa;
    border: none;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    color: #555;
    transition: background-color 0.3s;
    min-width: 35px;
}

.qty-btn:hover:not(:disabled) {
    background: #e9ecef;
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-input {
    border: none;
    padding: 0.5rem;
    width: 50px;
    text-align: center;
    font-size: 1rem;
    background: white;
}

/* Total */
.item-total {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* Actions */
.item-actions {
    display: flex;
    justify-content: center;
}

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.remove-btn:hover {
    background: #c0392b;
}

.remove-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* Cart Summary */
.cart-summary {
    height: fit-content;
}

.summary-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 2rem;
    position: sticky;
    top: 100px;
}

.summary-card h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: #555;
}

.summary-row span:last-child {
    font-weight: 600;
    color: #2c3e50;
}

.summary-divider {
    height: 1px;
    background: #eee;
    margin: 1.5rem 0;
}

.total-row {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
    padding-top: 1rem;
    border-top: 2px solid #eee;
}

.total-row span:last-child {
    color: #e74c3c;
    font-size: 1.4rem;
}

.summary-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

/* Logo Link */
.logo a {
    color: white;
    text-decoration: none;
}

.logo a:hover {
    color: #3498db;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .cart-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .summary-card {
        position: static;
    }
}

@media (max-width: 768px) {
    .cart-container {
        padding: 1rem;
        margin-top: 100px;
    }
    
    .cart-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .cart-header h1 {
        font-size: 2rem;
    }
    
    .cart-items-header {
        display: none; /* Hide header on mobile */
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
        text-align: center;
    }
    
    .item-product {
        flex-direction: column;
        text-align: center;
    }
    
    .item-image {
        width: 100px;
        height: 100px;
    }
    
    .quantity-controls {
        justify-content: center;
    }
    
    .summary-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .cart-container {
        padding: 0.5rem;
    }
    
    .cart-header h1 {
        font-size: 1.5rem;
    }
    
    .item-image {
        width: 80px;
        height: 80px;
    }
    
    .summary-card {
        padding: 1rem;
    }
    
    .btn-primary, .btn-secondary {
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
}

/* Animation for cart updates */
.cart-item.updating {
    opacity: 0.7;
    pointer-events: none;
}

.cart-item.removing {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideOut {
    to {
        transform: translateX(-100%);
        opacity: 0;
        height: 0;
        padding: 0;
        margin: 0;
    }
}

/* Success/Error Messages */
.cart-message {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1001;
    animation: slideIn 0.3s ease-out;
}

.cart-message.success {
    background: #27ae60;
}

.cart-message.error {
    background: #e74c3c;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}