.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    animation: fadeIn 0.6s ease;
}

.cart-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.cart-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    animation: slideUp 0.8s ease;
}

.cart-empty-icon {
    font-size: 4rem;
    color: var(--gray-color);
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.cart-empty-text {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 30px;
}

.cart-empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color), #b71c1c);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cart-empty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.3);
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.cart-item {
    display: grid;
    grid-template-columns: 100px 1fr auto;
    gap: 20px;
    padding: 25px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    animation: slideIn 0.6s ease;
    position: relative;
}

.cart-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.cart-item-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    transition: transform 0.3s ease;
}

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

.cart-item-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

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

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

.cart-item-meta {
    font-size: 0.9rem;
    color: #666;
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

.cart-item-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-color);
}

.cart-item-remove {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.cart-item-remove:hover {
    color: var(--primary-color);
    background: rgba(211, 47, 47, 0.1);
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--gray-color);
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    font-weight: 600;
}

.quantity-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: scale(1.1);
}

.quantity-input {
    width: 50px;
    text-align: center;
    padding: 8px;
    border: 2px solid var(--gray-color);
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: border-color 0.3s ease;
}

.quantity-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.cart-summary {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    animation: slideUp 0.8s ease;
}

.cart-summary:empty {
    display: none;
    padding: 0;
    box-shadow: none;
    background: transparent;
}

.summary-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 20px;
    text-align: center;
}

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

.summary-row:last-child {
    border-bottom: none;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--primary-color);
}

.summary-label {
    color: #666;
}

.summary-value {
    font-weight: 600;
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-color), #b71c1c);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.3);
}

.checkout-btn:active {
    transform: translateY(0);
}

.continue-shopping {
    text-align: center;
    margin-top: 30px;
    animation: fadeIn 1s ease;
    overflow: visible; 
}

.continue-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
    white-space: nowrap; 
}

.continue-link i {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
}

.continue-link:hover {
    color: #b71c1c;
    gap: 12px;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@media (max-width: 768px) {
    .cart-container {
        padding: 20px 15px;
    }
    
    .cart-title {
        font-size: 2rem;
        margin-bottom: 30px;
    }
    
    .cart-item {
        grid-template-columns: 80px 1fr;
        gap: 15px;
        padding: 20px;
    }
    
    .cart-item-controls {
        grid-column: 1 / -1;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid var(--gray-color);
    }
    
    .cart-item-image {
        width: 80px;
        height: 80px;
    }
    
    .cart-item-title {
        font-size: 1rem;
    }
    
    .cart-item-price {
        font-size: 0.9rem;
    }
    
    .summary-title {
        font-size: 1.3rem;
    }
    
    .checkout-btn {
        padding: 14px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .cart-title {
        font-size: 1.8rem;
    }
    
    .cart-item {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .cart-item-image {
        width: 100%;
        height: 120px;
        margin: 0 auto;
    }
    
    .cart-item-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .quantity-controls {
        justify-content: center;
    }
    
    .cart-summary {
        padding: 20px;
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
