/* ========================================
   Cart Toast & Modal Animations
   ======================================== */

/* Pulse animation for cart counter */
@keyframes pulse-animation {
    0%, 100% {
        transform: translateY(-50%) scale(1);
    }
    50% {
        transform: translateY(-50%) scale(1.2);
    }
}

.pulse-animation {
    animation: pulse-animation 0.6s ease-in-out;
}

/* Sidebar badge enhancements */
#cart-counter {
    transition: all 0.3s ease;
}

#cart-counter.pulse-animation {
    animation: pulse-animation 0.6s ease-in-out;
}

/* Toast custom styles */
#cartToast {
    min-width: 300px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#cartToast .toast-body {
    font-size: 0.95rem;
    padding: 1rem;
}

/* Cart success modal animation */
.cart-success-animation {
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Modal enhancements */
#cartSuccessModal .modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175);
}

#cartSuccessModal .btn {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

#cartSuccessModal .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Loading button state */
.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Product card hover effect enhancement */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15) !important;
}

/* Add to cart button animation */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:active::after {
    width: 300px;
    height: 300px;
}

/* ========================================
   Product Card Quantity Selector
   ======================================== */

.quantity-selector {
    transition: all 0.3s ease;
}

.quantity-selector .input-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.quantity-selector .quantity-input {
    font-weight: 600;
    font-size: 0.95rem;
    border-left: none;
    border-right: none;
    background-color: #f8f9fa;
    max-width: 60px;
    cursor: text;
}

.quantity-selector .quantity-input:focus {
    background-color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    border-color: #86b7fe;
}

/* Hide spinner arrows in number inputs for cleaner look */
.quantity-selector .quantity-input::-webkit-outer-spin-button,
.quantity-selector .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-selector .quantity-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.quantity-selector .btn-decrease,
.quantity-selector .btn-increase {
    border-color: #dee2e6;
    background-color: white;
    transition: all 0.2s ease;
}

.quantity-selector .btn-decrease:hover,
.quantity-selector .btn-increase:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    transform: scale(1.05);
}

.quantity-selector .btn-decrease:active,
.quantity-selector .btn-increase:active {
    transform: scale(0.95);
}

.quantity-selector .btn-decrease i,
.quantity-selector .btn-increase i {
    font-size: 0.75rem;
}

/* Product card improvements */
.product-card .card-body {
    padding: 1rem;
}

.product-card .product-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    min-height: 2.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-description {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    min-height: 3.6rem;
}

.product-card .price-section {
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

.product-card .btn-sm {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    font-weight: 500;
}

.product-card .alert {
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

/* Quantity badge on add to cart button */
.quantity-badge {
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    animation: badgePop 0.3s ease-out;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.quantity-badge i {
    font-size: 0.6rem;
    margin-right: 0.1rem;
}

/* Product detail page quantity input */
#quantity {
    font-weight: 600;
    font-size: 1.1rem;
    cursor: text;
}

#quantity:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Hide spinner arrows in number inputs */
#quantity::-webkit-outer-spin-button,
#quantity::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#quantity[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}
