/*
 * Toast notifications — shared by the storefront and the admin panel.
 * @see assets/js/toast.js
 *
 * Its own colours rather than either stylesheet's tokens, because the two
 * sides name their tokens differently and a toast has to read the same on
 * both: a dark card, a green or red mark, white text.
 */

.toast-stack {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2000;
    display: grid;
    gap: .6rem;
    width: min(380px, calc(100vw - 2rem));
    pointer-events: none;
}

.toast-note {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .8rem .75rem .8rem 1rem;
    border-radius: 12px;
    background: #0f1b33;
    color: #fff;
    font-size: .92rem;
    line-height: 1.45;
    box-shadow: 0 10px 30px rgba(10, 22, 51, .28);
    border-left: 4px solid #22c55e;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .22s ease, transform .22s ease;
}

.toast-note.is-in {
    opacity: 1;
    transform: none;
}

.toast-note.is-out {
    opacity: 0;
    transform: translateY(-8px);
}

.toast-note--error {
    border-left-color: #ef4444;
}

.toast-note > .bi {
    font-size: 1.1rem;
    line-height: 1.3;
    color: #22c55e;
    flex: none;
}

.toast-note--error > .bi {
    color: #f87171;
}

.toast-note__text {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.toast-note__x {
    flex: none;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, .6);
    padding: .1rem .3rem;
    cursor: pointer;
    border-radius: 6px;
    line-height: 1;
}

.toast-note__x:hover,
.toast-note__x:focus-visible {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

/* On a phone the stack runs the width of the screen, clear of the edges. */
@media (max-width: 575.98px) {
    .toast-stack {
        top: .75rem;
        right: .75rem;
        left: .75rem;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast-note,
    .toast-note.is-in,
    .toast-note.is-out {
        transform: none;
        transition: opacity .16s ease;
    }
}
