/* Shopping Cart Button Styles */
.cart-button {
    border-width: 2px;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
}

.cart-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cart-button i {
    transition: transform 0.3s ease;
}

.cart-button:hover i {
    transform: scale(1.1);
}

/* Cart Badge Styles */
.cart-badge {
    font-size: 0.65rem;
    padding: 0.35rem 0.5rem;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease;
}

/* Badge Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.15);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.cart-badge.updated {
    animation: pulse 0.5s ease;
}

/* Toast Container */
#toastContainer {
    z-index: 9999;
}

#toastContainer .toast {
    min-width: 300px;
    backdrop-filter: blur(10px);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .cart-button {
        padding: 0.4rem 0.8rem;
    }

    .cart-badge {
        font-size: 0.6rem;
        padding: 0.3rem 0.45rem;
        min-width: 18px;
        height: 18px;
    }
}

/* Cart Page Styles */
.cart-page {
    min-height: 60vh;
}

.cart-item-row {
    transition: all 0.3s ease;
}

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

.quantity-input {
    max-width: 140px;
}

.quantity-input .btn {
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: #9E8A78;
    color: #9E8A78;
}

.quantity-input .btn:hover {
    background-color: #9E8A78;
    color: white;
    border-color: #9E8A78;
}

.quantity-input .form-control {
    border-color: #9E8A78;
    font-weight: 600;
    color: #9E8A78;
    /* Ẩn spinner của input number */
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Ẩn spinner cho Chrome, Safari, Edge, Opera */
.quantity-input .form-control::-webkit-outer-spin-button,
.quantity-input .form-control::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Ẩn scrollbar */
.quantity-input .form-control {
    overflow: hidden;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

.quantity-input .form-control::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

.cart-summary {
    position: sticky;
    top: 100px;
}

/* Product Card Enhancement for Add to Cart */
.add-to-cart-form {
    transition: all 0.3s ease;
}

.add-to-cart-form .card {
    border: 2px solid #0d6efd;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

.add-to-cart-form .card-body {
    padding: 1.5rem;
}

.add-to-cart-form .input-group-lg .btn {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.add-to-cart-form .input-group-lg .form-control {
    font-size: 1.25rem;
    font-weight: 600;
    height: 45px;
}

.add-to-cart-form button[type="submit"] {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.add-to-cart-form button[type="submit"]:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.3);
}

.add-to-cart-form button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}