/* Cart Page Specific Styles */

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.cart-item:hover {
    background-color: #f9fafb;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cart-item-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.cart-item-sku {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.cart-item-points-info {
    font-size: 0.8125rem;
    color: #7c3aed;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.cart-item-discount-info {
    font-size: 0.8125rem;
    color: #16a34a;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.cart-item-cashback-info {
    font-size: 0.8125rem;
    color: #16a34a;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.cart-item-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.cart-item-price {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.current-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #16a34a;
}

.original-price {
    font-size: 1rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.discount-badge {
    background-color: #dcfce7;
    color: #16a34a;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #f3f4f6;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: white;
    border: 1px solid #d1d5db;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background-color: #16a34a;
    color: white;
    border-color: #16a34a;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-btn:disabled:hover {
    background-color: white;
    color: #374151;
    border-color: #d1d5db;
}

.quantity-display {
    font-weight: 600;
    color: #1f2937;
    min-width: 2rem;
    text-align: center;
}

.remove-btn {
    color: #ef4444;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

.remove-btn:hover {
    color: #dc2626;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-item {
        flex-direction: column;
    }

    .cart-item-image {
        width: 100%;
        height: 200px;
    }

    .cart-item-actions {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .quantity-control {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .cart-item {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .cart-item-image {
        height: 160px;
    }
    
    .cart-item-name {
        font-size: 1rem;
    }
    
    .cart-item-description {
        font-size: 0.8125rem;
    }
    
    .current-price {
        font-size: 1.25rem;
    }
    
    .original-price {
        font-size: 0.875rem;
    }
    
    .discount-badge {
        font-size: 0.6875rem;
    }
}

@media (max-width: 320px) {
    .cart-item {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .cart-item-image {
        height: 140px;
    }
    
    .cart-item-name {
        font-size: 0.875rem;
        margin-bottom: 0.375rem;
    }
    
    .cart-item-description {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .cart-item-price {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
        flex-wrap: wrap;
    }
    
    .current-price {
        font-size: 1.125rem;
    }
    
    .original-price {
        font-size: 0.8125rem;
    }
    
    .discount-badge {
        font-size: 0.625rem;
        padding: 0.1875rem 0.375rem;
    }
    
    .cart-item-actions {
        gap: 0.75rem;
    }
    
    .quantity-control {
        padding: 0.375rem 0.75rem;
        gap: 0.5rem;
    }
    
    .quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }
    
    .quantity-display {
        font-size: 0.875rem;
        min-width: 1.5rem;
    }
    
    .remove-btn {
        font-size: 0.875rem;
    }
    
    /* Adjust summary section */
    .sticky {
        position: static;
    }
}

/* Animation for item removal */
@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.removing {
    animation: slideOut 0.3s ease-out forwards;
}

/* Empty cart animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#emptyCart {
    animation: fadeIn 0.5s ease-out;
}

/* Checkout button pulse effect */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(22, 163, 74, 0);
    }
}

#checkoutBtn:hover {
    animation: pulse 1.5s infinite;
}

/* Savings highlight */
#totalSavings {
    font-weight: 600;
}

/* Sticky price summary on scroll */
.sticky {
    position: sticky;
    top: 6rem;
}
