/* Cart Styles */

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

.cart-item:hover {
    background-color: rgba(249, 250, 251, 0.5);
}

.quantity-input {
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input:focus {
    outline: none;
    box-shadow: none;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    overflow: hidden;
}

.quantity-btn {
    padding: 0.5rem;
    background-color: white;
    border: none;
    color: #6b7280;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-btn:hover {
    background-color: #f9fafb;
    color: #374151;
}

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

/* Cart Summary Animations */
.cart-total,
.cart-subtotal,
.item-total {
    transition: all 0.3s ease;
}

.cart-updating .cart-total,
.cart-updating .cart-subtotal,
.cart-updating .item-total {
    opacity: 0.5;
    transform: scale(0.95);
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

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

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Success/Error Messages */
.toast {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1000;
    max-width: 300px;
    padding: 1rem;
    border-radius: 0.5rem;
    color: white;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background-color: #10b981;
}

.toast-error {
    background-color: #ef4444;
}

.toast-warning {
    background-color: #f59e0b;
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background-color: #ef4444;
    color: white;
    border-radius: 50%;
    width: 1.25rem;
    height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .cart-item {
        padding: 1rem;
    }
    

    
    .cart-item .flex-shrink-0 {
        margin-bottom: 1rem;
    }
    
    .quantity-controls {
        margin: 1rem 0;
    }
    
    .toast {
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
}

/* WhatsApp Button Special Styling */
.whatsapp-btn {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    position: relative;
    overflow: hidden;
}

.whatsapp-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s;
}

.whatsapp-btn:hover::before {
    left: 100%;
}

/* Checkout Form Styling */
.checkout-form {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input.error,
.form-textarea.error {
    border-color: #ef4444;
}

.form-error {
    color: #ef4444;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Stock Warning */
.stock-warning {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* Empty Cart Styling */
.empty-cart {
    text-align: center;
    padding: 3rem;
}

.empty-cart-icon {
    width: 4rem;
    height: 4rem;
    color: #d1d5db;
    margin: 0 auto 1rem;
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.fade-out {
    animation: fadeOut 0.3s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.slide-out-right {
    animation: slideOutRight 0.3s ease-in;
}

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

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

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes slideOutRight {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

/* Pulse animation for cart icon */
.cart-pulse {
    animation: pulse 0.5s ease-in-out;
}

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

/* Loading Modal */
#loadingModal:not(.hidden) {
    display: flex !important;
}
