.cart_table,
.cart_table .cart-productname,
.cart_table td {
    color: var(--gray-800);
}

.cart_table th {
    padding: 20px 16px;
}

.cart_table .qty-input {
    height: 40px;
    font-size: 16px;
    color: var(--gray-800);
    border: 1px solid var(--border-color);
}

.cart-wrapper {
    padding: 60px 0 80px;
    background: #f8f9fa;
}

.cart-table {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.cart-item {
    border-bottom: 1px solid #eee;
    padding: 20px;
}

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

.product-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.qty-controls {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    width: 120px;
}

.qty-btn {
    background: var(--primary-soft);
    border: none;
    width: 35px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.qty-btn:hover {
    background: #e9ecef;
}

.qty-input {
    border: none;
    text-align: center;
    width: 50px;
    height: 40px;
    outline: none;
    font-weight: 600;
}

.cart-summary {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 100px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.summary-row:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 18px;
    color: #28a745;
}

.promotion-section {
    background: #fff;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background: #28a745;
    border-color: #28a745;
    padding: 12px 30px;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s;
}

.btn-primary:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-2px);
}

.btn-outline-secondary {
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: 600;
}

.empty-cart {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-100);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-border {
    color: #28a745;
}

.alert {
    border-radius: 10px;
    margin-bottom: 20px;
}

.remove-item {
    color: #dc3545;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.remove-item:hover {
    color: #c82333;
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .cart-wrapper {
        padding: 30px 0 50px;
    }

    .product-img {
        width: 60px;
        height: 60px;
    }

    .qty-controls {
        width: 100px;
    }

    .qty-btn {
        width: 30px;
        height: 35px;
    }

    .qty-input {
        width: 40px;
        height: 35px;
    }

    .cart-summary {
        position: static;
        margin-top: 30px;
    }
}

/**
 * Cart Page Animations and Visual Feedback
 * Provides smooth transitions and visual feedback for cart interactions
 * 
 * @author VHFresh Development Team
 * @version 1.0
 * @date 2025-09-17
 */

/* Quantity Change Animations */
.quantity-changed {
    background-color: #e3f2fd !important;
    border-color: #2196f3 !important;
    box-shadow: 0 0 0 0.2rem rgba(33, 150, 243, 0.25) !important;
    transition: all 0.3s ease;
}

.quantity-reverted {
    background-color: #ffebee !important;
    border-color: #f44336 !important;
    box-shadow: 0 0 0 0.2rem rgba(244, 67, 54, 0.25) !important;
    transition: all 0.3s ease;
}

/* Price Update Animations */
.price-updated {
    color: #4caf50 !important;
    font-weight: 600 !important;
    transform: scale(1.05);
    transition: all 0.6s ease;
    text-shadow: 0 0 4px rgba(76, 175, 80, 0.3);
}

.item-total-updated {
    background-color: #f3e5f5;
    padding: 4px 8px;
    border-radius: 4px;
    transform: scale(1.02);
    transition: all 0.4s ease;
    border: 1px solid #e1bee7;
}

/* Loading States */
.cart-item.updating {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-item.updating::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: cart-spin 1s linear infinite;
}

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

/* Quantity Input Validation Styles */
.qty-input.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.qty-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: 0;
}

/* Cart Summary Animations */
.cart-summary-updating {
    position: relative;
    overflow: hidden;
}

.cart-summary-updating::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: cart-shimmer 1.5s infinite;
}

@keyframes cart-shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Success/Error Message Animations */
.alert.slide-in {
    animation: slideInFromTop 0.4s ease-out;
}

@keyframes slideInFromTop {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Quantity Button Hover Effects */
.qty-btn {
    transition: all 0.2s ease;
    border-radius: 4px;
}

.qty-btn:hover:not(:disabled) {
    background-color: #f8f9fa;
    border-color: #6c757d;
    transform: scale(1.1);
}

.qty-btn:active:not(:disabled) {
    transform: scale(0.95);
    background-color: #e9ecef;
}

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

/* Free Shipping Progress Indicator */
.free-shipping-progress {
    position: relative;
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 8px 12px;
    margin: 8px 0;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.free-shipping-progress.achieved {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.free-shipping-progress.achieved .fas {
    color: #28a745;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .quantity-changed,
    .quantity-reverted {
        box-shadow: 0 0 0 0.15rem rgba(33, 150, 243, 0.2) !important;
    }

    .price-updated {
        transform: scale(1.02);
        text-shadow: none;
    }

    .item-total-updated {
        transform: scale(1.01);
        padding: 2px 4px;
    }

    .qty-btn:hover:not(:disabled) {
        transform: scale(1.05);
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .quantity-changed {
        background-color: #000080 !important;
        color: white !important;
    }

    .quantity-reverted {
        background-color: #800000 !important;
        color: white !important;
    }

    .price-updated {
        text-shadow: none;
        border: 2px solid #008000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .quantity-changed,
    .quantity-reverted,
    .price-updated,
    .item-total-updated,
    .qty-btn,
    .cart-summary-updating::before {
        transition: none !important;
        animation: none !important;
        transform: none !important;
    }
}

/* Print styles */
@media print {
    .quantity-changed,
    .quantity-reverted,
    .price-updated,
    .item-total-updated {
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
        transform: none !important;
    }
}

.cart_totals td,
.cart_totals th {
    font-size: 16px;
}
