/* ========== TOAST NOTIFICATION FIX ========== */
/* This file specifically fixes the oversized toast/popup issue */

/* Force all toast notifications to be small and positioned correctly */
#toast,
.toast,
.shop-toast,
.cart-toast,
.wishlist-toast,
div[class*="toast"] {
    /* Position at bottom-right corner */
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    top: auto !important;
    left: auto !important;
    
    /* Size constraints - much smaller */
    max-width: 260px !important;
    min-width: 160px !important;
    width: auto !important;
    height: auto !important;
    max-height: 100px !important;
    
    /* Padding and spacing */
    padding: 10px 16px !important;
    margin: 0 !important;
    
    /* Typography */
    font-size: 14px !important;
    line-height: 1.4 !important;
    font-weight: 500 !important;
    text-align: left !important;
    
    /* Visual styling */
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    
    /* Animation */
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease !important;
    
    /* Ensure it's on top */
    z-index: 99999 !important;
    
    /* Prevent overflow */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* When toast is shown */
#toast.show,
.toast.show,
.shop-toast.show,
.cart-toast.show,
.wishlist-toast.show,
div[class*="toast"].show {
    transform: translateY(0) !important;
    opacity: 1 !important;
}

/* Success toast */
.toast.success,
#toast.success {
    background: #10b981 !important;
    color: white !important;
    border-left: 4px solid #059669 !important;
}

/* Error toast */
.toast.error,
#toast.error {
    background: #ef4444 !important;
    color: white !important;
    border-left: 4px solid #dc2626 !important;
}

/* Info toast */
.toast.info,
#toast.info {
    background: #3b82f6 !important;
    color: white !important;
    border-left: 4px solid #2563eb !important;
}

/* Warning toast */
.toast.warning,
#toast.warning {
    background: #f59e0b !important;
    color: white !important;
    border-left: 4px solid #d97706 !important;
}

/* Desktop screens - still keep it small */
@media (min-width: 1200px) {
    #toast,
    .toast,
    .shop-toast,
    .cart-toast,
    .wishlist-toast,
    div[class*="toast"] {
        max-width: 280px !important;
        bottom: 24px !important;
        right: 24px !important;
        padding: 12px 18px !important;
        font-size: 14px !important;
    }
}

/* Tablet screens */
@media (max-width: 768px) {
    #toast,
    .toast,
    .shop-toast,
    .cart-toast,
    .wishlist-toast,
    div[class*="toast"] {
        left: 12px !important;
        right: 12px !important;
        bottom: 12px !important;
        max-width: calc(100vw - 24px) !important;
        font-size: 13px !important;
        padding: 10px 14px !important;
    }
}

/* Mobile screens */
@media (max-width: 480px) {
    #toast,
    .toast,
    .shop-toast,
    .cart-toast,
    .wishlist-toast,
    div[class*="toast"] {
        left: 10px !important;
        right: 10px !important;
        bottom: 10px !important;
        max-width: calc(100vw - 20px) !important;
        font-size: 12px !important;
        padding: 8px 12px !important;
    }
}

/* Remove any inline styles that might be set by JavaScript */
#toast[style],
.toast[style] {
    /* Use !important to override inline styles */
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    top: auto !important;
    left: auto !important;
    max-width: 260px !important;
    width: auto !important;
    height: auto !important;
}

/* Ensure text doesn't wrap and create large toasts */
#toast *,
.toast * {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
}

/* If there's a toast container, constrain it too */
.toast-container,
#toast-container {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    top: auto !important;
    left: auto !important;
    max-width: 280px !important;
    z-index: 99999 !important;
}

/* Multiple toasts stacking */
.toast:nth-child(n+2) {
    bottom: calc(20px + (n - 1) * 60px) !important;
}

/* Prevent any parent containers from making toast large */
body > .toast,
body > #toast {
    max-width: 260px !important;
    width: auto !important;
}
