/* Cart Page Specific Styles */

/* Quantity Controls */
.quantity-btn {
    width: 2rem;
    height: 2rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    cursor: pointer;
}
.quantity-btn:hover {
    background-color: #f9fafb;
}

.quantity-input {
    width: 4rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    outline: none;
}
.quantity-input:focus {
    box-shadow: 0 0 0 2px #3b82f6;
    border-color: #3b82f6;
}

/* Action Buttons */
.action-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #4b5563;
    transition: color 0.2s;
    cursor: pointer;
}
.action-btn:hover {
    color: #1f2937;
}

/* Checkout Button */
.checkout-btn {
    width: 100%;
    background-color: #2563eb;
    color: #fff;
    padding: 0.75rem 0;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
}
.checkout-btn:hover {
    background-color: #1d4ed8;
}

/* Recently Viewed Items */
.recently-viewed-item {
    cursor: pointer;
    border-radius: 0.5rem;
    padding: 0.5rem;
    transition: box-shadow 0.2s, transform 0.2s;
}
.recently-viewed-item:hover {
    box-shadow: 0 2px 8px #0001;
    transform: scale(1.05);
}

/* Cart Item Animations */
.cart-item {
    transition: all 0.3s;
}
.cart-item:hover {
    background-color: #f9fafb;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .quantity-input {
        width: 3.5rem;
    }
    .action-btn span {
        display: none;
    }
    .recently-viewed-item h4 {
        font-size: 0.75rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Success/Error Messages */
.message {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    color: #fff;
    font-weight: 500;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s;
}
.message.show {
    transform: translateX(0);
}
.message.success {
    background-color: #22c55e;
}
.message.error {
    background-color: #ef4444;
}

/* Empty Cart State */
.empty-cart {
    text-align: center;
    padding: 3rem 0;
}
.empty-cart-icon {
    width: 6rem;
    height: 6rem;
    margin: 0 auto 1rem auto;
    color: #d1d5db;
}

/* Promo Code Success */
.promo-success {
    color: #16a34a;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}
.promo-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Sticky Summary */
@media (min-width: 1024px) {
    .sticky {
        position: sticky;
        top: 6rem;
    }
}

/* Cart Badge Animation */
@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0,0,0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}
.cart-updated {
    animation: bounce 0.6s ease-in-out;
}

/* Price Update Animation */
@keyframes priceUpdate {
    0% { background-color: transparent; }
    50% { background-color: rgba(59, 130, 246, 0.1); }
    100% { background-color: transparent; }
}
.price-updated {
    animation: priceUpdate 0.6s ease-in-out;
}

/* Remove Item Animation */
@keyframes slideOut {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(100%);
        opacity: 0;
    }
}
.removing {
    animation: slideOut 0.3s ease-in-out forwards;
}

/* Bulk Discount Badge */
.bulk-discount-badge {
    background-color: #bbf7d0;
    color: #166534;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Trust Indicators */
.trust-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: #16a34a;
}

/* Responsive Grid Adjustments
@media (max-width: 640px) {
    .grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 641px) and (max-width: 768px) {
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (min-width: 769px) and (max-width: 1024px) {
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (min-width: 1280px) {
    .xl\:grid-cols-6 {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
} */

/* Focus States for Accessibility */
.quantity-btn:focus,
.quantity-input:focus,
.checkout-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #3b82f6;
    border-color: #3b82f6;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .cart-item {
        border: 1px solid #9ca3af;
    }
    .quantity-btn,
    .quantity-input {
        border-width: 2px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .cart-item,
    .recently-viewed-item,
    .message {
        transition: none;
    }
    .cart-updated,
    .price-updated,
    .removing {
        animation: none;
    }
}