/*
    Toast notifications - see assets/js/wb-toast.js ( wb_show_toast() )

    .wb-toast--compact     one row: icon, title, action link
    .wb-toast--full        icon + title, message, action button, close
    .wb-toast--anchored    under an element, with a caret pointing at it
    .wb-toast--docked      small screens: foot of the screen, dark
    .wb-toast-stack--*     fixed spot holding the non-anchored toasts
*/

.wb-toast {
    --wb-toast-bg: #FFFFFF;
    --wb-toast-border: #E5E5E5;
    --wb-toast-text: #1B1B1B;
    --wb-toast-muted: #555555;
    --wb-toast-link: #2B5BA8;
    --wb-toast-focus: #2B5BA8;

    position: relative;
    box-sizing: border-box;
    width: max-content;
    max-width: min(460px, calc(100vw - 32px));
    padding: 14px 18px;
    background-color: var(--wb-toast-bg);
    border: 1px solid var(--wb-toast-border);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .10), 0 2px 6px rgba(0, 0, 0, .06);
    color: var(--wb-toast-text);
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
    opacity: 0;
    transform: translateY(var(--wb-toast-enter-y, 8px));
    transition: opacity .25s ease, transform .25s ease;
    pointer-events: none;
}
.wb-toast.is-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.wb-toast.is-leaving {
    opacity: 0;
    transform: translateY(var(--wb-toast-enter-y, 8px));
    pointer-events: none;
}

/* Keyboard focus ring on every control (kept even where the theme resets outlines) */
.wb-toast a:focus-visible,
.wb-toast button:focus-visible {
    outline: 2px solid var(--wb-toast-focus) !important;
    outline-offset: 2px;
}

/* Screen reader only: the live regions that announce toasts */
.wb-toast-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------------------
 * Content
 * ------------------------------------------------------------------ */

.wb-toast__row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.wb-toast__icon {
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
}
.wb-toast__icon svg {
    width: 16px;
    height: 16px;
}
.wb-toast--success .wb-toast__icon { background-color: #E8F3EA; color: #2E6B34; }
.wb-toast--info .wb-toast__icon    { background-color: #E8F0FB; color: #2B5BA8; }
.wb-toast--warning .wb-toast__icon { background-color: #FFF3DC; color: #8A5A00; }
.wb-toast--error .wb-toast__icon   { background-color: #FBE9E9; color: #AB0003; }
.wb-toast--removed .wb-toast__icon { background-color: #EFEFEF; color: #555555; }

.wb-toast__title {
    flex: 1 1 auto;
    margin: 0 !important;
    color: var(--wb-toast-text);
    font-size: 16px;
    font-weight: 500;
}

.wb-toast__message {
    margin: 12px 0 0 !important;
    color: var(--wb-toast-muted);
    font-size: 14px;
    line-height: 1.55;
}

/* Text action (compact) */
.wb-toast__action {
    flex: 0 0 auto;
    margin-left: 18px;
    padding: 0;
    background: none;
    border: 0;
    color: var(--wb-toast-link) !important;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none !important;
    cursor: pointer;
}
.wb-toast__action:hover,
.wb-toast__action:focus-visible {
    text-decoration: underline !important;
}

/* Button action (full) */
.wb-toast__footer {
    margin-top: 14px;
}
.wb-toast__action--button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 0;
    padding: 9px 16px;
    background-color: #262626;
    border-radius: 6px;
    color: #FFFFFF !important;
    font-size: 14px;
    line-height: 1.3;
}
.wb-toast__action--button:hover,
.wb-toast__action--button:focus-visible {
    background-color: #000000;
    text-decoration: none !important;
}
.wb-toast__action--button svg {
    width: 14px;
    height: 14px;
}

.wb-toast__close {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 50%;
    color: #8A8A8A;
    cursor: pointer;
}
.wb-toast__close:hover,
.wb-toast__close:focus-visible {
    background-color: rgba(0, 0, 0, .06);
    color: var(--wb-toast-text);
}
.wb-toast__close svg {
    width: 12px;
    height: 12px;
}

.wb-toast--full {
    width: 380px;
    max-width: calc(100vw - 32px);
    padding: 20px 22px;
}
.wb-toast--full .wb-toast__row {
    padding-right: 24px;
}
.wb-toast--full .wb-toast__title {
    font-size: 18px;
    font-weight: 700;
}
.wb-toast--compact.wb-toast--has-close {
    padding-right: 44px;
}

/* ---------------------------------------------------------------------
 * Anchored: under an element, caret pointing at it
 * ------------------------------------------------------------------ */

.wb-toast--anchored {
    --wb-toast-enter-y: 4px;
    --wb-toast-caret-x: 50%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1055;
}
.wb-toast--anchored::before,
.wb-toast--anchored::after {
    content: "";
    position: absolute;
    left: var(--wb-toast-caret-x);
    width: 0;
    height: 0;
    border-style: solid;
    transform: translateX(-50%);
}
.wb-toast--anchored::before {
    top: -9px;
    border-width: 0 9px 9px 9px;
    border-color: transparent transparent var(--wb-toast-border) transparent;
}
.wb-toast--anchored::after {
    top: -8px;
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent var(--wb-toast-bg) transparent;
}
.wb-toast--anchored.wb-toast--above {
    --wb-toast-enter-y: -4px;
}
.wb-toast--above::before {
    top: auto;
    bottom: -9px;
    border-width: 9px 9px 0 9px;
    border-color: var(--wb-toast-border) transparent transparent transparent;
}
.wb-toast--above::after {
    top: auto;
    bottom: -8px;
    border-width: 8px 8px 0 8px;
    border-color: var(--wb-toast-bg) transparent transparent transparent;
}

/* ---------------------------------------------------------------------
 * Fixed spots (stacks)
 * ------------------------------------------------------------------ */

.wb-toast-stack {
    position: fixed;
    z-index: 1055;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}
.wb-toast-stack:empty {
    display: none;
}

/* Newest toast is closest to the screen edge */
.wb-toast-stack--top {
    --wb-toast-enter-y: -8px;
    top: 16px;
    flex-direction: column-reverse;
}
.admin-bar .wb-toast-stack--top {
    top: 48px;
}
.wb-toast-stack--bottom {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.wb-toast-stack--left {
    left: 16px;
    align-items: flex-start;
}
.wb-toast-stack--right {
    right: 16px;
    align-items: flex-end;
}
.wb-toast-stack--center {
    left: 50%;
    align-items: center;
    transform: translateX(-50%);
}

/* ---------------------------------------------------------------------
 * Docked: part of the screen's footer on small screens (flush, full width, dark)
 * ------------------------------------------------------------------ */

.wb-toast-stack--docked {
    --wb-toast-enter-y: 100%; /* slides up from below the screen */
    right: 0;
    bottom: 0;
    left: 0;
    gap: 0;
    align-items: stretch;
    max-width: none;
}
.wb-toast--docked {
    --wb-toast-bg: #1B1B1B;
    --wb-toast-border: #1B1B1B;
    --wb-toast-text: #FFFFFF;
    --wb-toast-muted: #CFCFCF;
    --wb-toast-link: #9CC3F5;
    --wb-toast-focus: #9CC3F5;

    width: auto;
    max-width: none;
    padding: 18px 20px;
    border: 0;
    border-radius: 0;
    box-shadow: 0 -6px 18px rgba(0, 0, 0, .18);
}
/* Several docked toasts read as one footer, split by a hairline */
.wb-toast--docked + .wb-toast--docked {
    border-top: 1px solid rgba(255, 255, 255, .10);
    box-shadow: none;
}
/* The toast touching the screen edge clears the home indicator on notched phones */
.wb-toast--docked:last-child {
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}
.wb-toast--docked.wb-toast--full {
    padding: 20px 20px 22px;
}
.wb-toast--docked.wb-toast--full:last-child {
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
}
.wb-toast--docked.wb-toast--compact.wb-toast--has-close {
    padding-right: 48px;
}
.wb-toast--docked .wb-toast__close {
    top: 14px;
    right: 12px;
}
.wb-toast--docked.wb-toast--success .wb-toast__icon { background-color: #3E7D3C; color: #FFFFFF; }
.wb-toast--docked.wb-toast--info .wb-toast__icon    { background-color: #2B5BA8; color: #FFFFFF; }
.wb-toast--docked.wb-toast--warning .wb-toast__icon { background-color: #B07A12; color: #FFFFFF; }
.wb-toast--docked.wb-toast--error .wb-toast__icon   { background-color: #AB0003; color: #FFFFFF; }
.wb-toast--docked.wb-toast--removed .wb-toast__icon { background-color: rgba(255, 255, 255, .14); color: #FFFFFF; }
.wb-toast--docked .wb-toast__action--button {
    background-color: #FFFFFF;
    color: #1B1B1B !important;
}
.wb-toast--docked .wb-toast__action--button:hover,
.wb-toast--docked .wb-toast__action--button:focus-visible {
    background-color: #E9E9E9;
}
.wb-toast--docked .wb-toast__close {
    color: #BDBDBD;
}
.wb-toast--docked .wb-toast__close:hover,
.wb-toast--docked .wb-toast__close:focus-visible {
    background-color: rgba(255, 255, 255, .12);
}

@media (prefers-reduced-motion: reduce) {
    .wb-toast,
    .wb-toast.is-leaving {
        transform: none;
        transition: opacity .01s linear;
    }
}
