/**
 * Auto Update Cart Frontend Styles
 * 
 * @package Auto_Update_Cart
 * @since 1.0.0
 */

/* Hide the update cart button when auto-update is enabled */
.woocommerce-cart-form__contents.auto-update-enabled button[name="update_cart"],
button[name="update_cart"] {
    display: none !important;
}

/* Loading state for quantity inputs */
.auto-update-cart-qty.auto-update-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Loading indicator */
.auto-update-cart-loading {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #0073aa;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    font-size: 14px;
    font-weight: 500;
    animation: slideInRight 0.3s ease-out;
}

/* Messages */
.auto-update-cart-message {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 4px;
    font-weight: 500;
    animation: slideInDown 0.3s ease-out;
}

.auto-update-cart-message--success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.auto-update-cart-message--error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .auto-update-cart-loading {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
    
    .auto-update-cart-message {
        margin-left: -10px;
        margin-right: -10px;
        border-radius: 0;
    }
}

/* Accessibility improvements */
.auto-update-cart-qty:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .auto-update-cart-loading {
        background: #000;
        color: #fff;
        border: 2px solid #fff;
    }
    
    .auto-update-cart-message--success {
        background-color: #fff;
        color: #000;
        border: 2px solid #008000;
    }
    
    .auto-update-cart-message--error {
        background-color: #fff;
        color: #000;
        border: 2px solid #ff0000;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .auto-update-cart-loading,
    .auto-update-cart-message {
        animation: none;
    }
}