/* ──────────────────────────────────────────────────────────────────────────
 * Reis & Irvy's — Standardized Toast System
 * Sitewide notification. Mirrors the reference style (pill, icon + msg + action)
 * with brand blue as the primary background.
 * Only one toast shows at a time; new toasts drop the currently visible one.
 * ──────────────────────────────────────────────────────────────────────── */

/* Pre-hide WC inline notices sitewide so they never flash before JS converts them to toasts.
   The auth form is excluded because it uses inline notices intentionally. */
.woocommerce-message:not(.auth-form-container .woocommerce-message),
.woocommerce-error:not(.auth-form-container .woocommerce-error),
.woocommerce-info:not(.auth-form-container .woocommerce-info) {
    display: none !important;
}

:root {
    --reis-toast-blue: #1e88e5;
    --reis-toast-blue-dark: #1565c0;
    --reis-toast-success: #2e7d32;
    --reis-toast-error: #c62828;
    --reis-toast-warning: #ef6c00;
}

.reis-toast-host {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    pointer-events: none;
    display: flex;
    justify-content: center;
    width: max-content;
    max-width: calc(100vw - 32px);
}

.reis-toast {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--reis-toast-blue);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    padding: 12px 18px;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(17, 17, 17, 0.22);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    max-width: 100%;
}

.reis-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reis-toast__icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.reis-toast__icon svg { width: 12px; height: 12px; display: block; }

.reis-toast__msg {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60ch;
}

.reis-toast__action {
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0 0 0 4px;
    font-size: 14px;
    white-space: nowrap;
}
.reis-toast__action:hover { text-decoration: underline; }

.reis-toast__close {
    position: relative;
    width: 20px;
    height: 20px;
    border: 0;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 2px;
    -webkit-appearance: none;
    appearance: none;
}
.reis-toast__close:hover,
.reis-toast__close:focus,
.reis-toast__close:active {
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    color: rgba(255, 255, 255, 0.85);
}
.reis-toast__close svg { width: 12px; height: 12px; }
/* Tooltip */
.reis-toast__close::after {
    content: 'Close';
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    padding: 3px 7px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}
.reis-toast__close:hover::after { opacity: 1; }

/* ── State variants ─────────────────────────────────────────────────────── */
.reis-toast.is-info    { background: var(--reis-toast-blue); }
.reis-toast.is-success { background: var(--reis-toast-success); }
.reis-toast.is-error   { background: var(--reis-toast-error); }
.reis-toast.is-warning { background: var(--reis-toast-warning); }
.reis-toast.is-neutral { background: #111; }

/* Mobile — allow wrap so long messages don't clip off-screen */
@media (max-width: 480px) {
    .reis-toast {
        border-radius: 16px;
        padding: 12px 16px;
    }
    .reis-toast__msg {
        white-space: normal;
        max-width: none;
    }
}
