/* =============================================================================
   ULFUR TOAST NOTIFICATIONS
   ============================================================================= */

.ulfur-toast-container {
    position: fixed;
    top: 80px; /* below site header */
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: 100%;
    pointer-events: none;
}

/* Hide standard WC notices to prevent flashing before JS intercepts them */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
    display: none !important;
}

.ulfur-toast {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 40px 14px 16px;
    border-radius: 10px;
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ulfur-toast--visible {
    opacity: 1;
    transform: translateX(0);
}

.ulfur-toast--leaving {
    animation: ulfur-toast-leave 0.3s ease forwards;
}

@keyframes ulfur-toast-leave {
    to { opacity: 0; transform: translateX(100%); }
}

/* --- Types - SOLID backgrounds --- */
.ulfur-toast--success {
    background: #14532d;
    border: 1px solid #22c55e;
    color: #bbf7d0;
}
.ulfur-toast--error {
    background: #450a0a;
    border: 1px solid #ef4444;
    color: #fecaca;
}
.ulfur-toast--info,
.ulfur-toast--notice {
    background: #422006;
    border: 1px solid #eab308;
    color: #fef3c7;
}

/* --- Icon --- */
.ulfur-toast__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ulfur-toast__icon svg { width: 20px; height: 20px; display: block; }
.ulfur-toast--success .ulfur-toast__icon { color: #22c55e; }
.ulfur-toast--error .ulfur-toast__icon { color: #ef4444; }
.ulfur-toast--info .ulfur-toast__icon,
.ulfur-toast--notice .ulfur-toast__icon { color: #eab308; }

/* --- Text --- */
.ulfur-toast__text {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    min-width: 0;
}
/* Links inside toasts - clearly visible and clickable */
.ulfur-toast__text a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}
.ulfur-toast__text a:hover {
    opacity: 0.8;
}

/* --- Close --- */
.ulfur-toast__close {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
}
.ulfur-toast__close:hover { opacity: 1; }

/* --- Progress bar --- */
.ulfur-toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    animation: ulfur-toast-progress linear forwards;
    transform-origin: left;
}
.ulfur-toast--success .ulfur-toast__progress { background: #22c55e; }
.ulfur-toast--error .ulfur-toast__progress { background: #ef4444; }
.ulfur-toast--info .ulfur-toast__progress,
.ulfur-toast--notice .ulfur-toast__progress { background: #eab308; }

@keyframes ulfur-toast-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* --- Persistent toast (no auto-dismiss) --- */
.ulfur-toast--persistent { border-width: 2px; }

/* --- Responsive --- */
@media (max-width: 480px) {
    .ulfur-toast-container {
        top: 70px;
        right: 12px;
        left: 12px;
        max-width: none;
    }
}
