/*** ---------- Toasts (public/js/components/toast.js) ---------- ***/
/* Mobile: bottom of the screen; desktop: top right, floating over the page */
.wpb-toasts { position: fixed; z-index: 1100; left: 1.2rem; right: 1.2rem; bottom: 1.2rem; display: flex; flex-direction: column; gap: .8rem; pointer-events: none;
    @media (min-width: 768px) { left: auto; bottom: auto; top: 1.6rem; right: 1.6rem; width: 36rem; }
}

.wpb-toast { --accent: var(--clr-green); --offset: .8rem; pointer-events: auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 1.2rem; padding: 1.2rem 1.2rem 1.2rem 1.4rem; background-color: #fff; border: 1px solid var(--clr-border); border-radius: .8rem; box-shadow: 0 .6rem 2rem rgba(var(--clr-dark-rgb), .12); font-size: 1.3rem; line-height: 1.4; color: var(--clr-text); opacity: 0; transform: translateY(var(--offset)); transition: opacity var(--ts-20) ease, transform var(--ts-20) ease;
    @media (min-width: 768px) { --offset: -.8rem; }

    &.is-visible { opacity: 1; transform: none; }
    &.is-leaving { opacity: 0; transform: translateX(1.6rem); }

    &.wpb-toast--notice { --accent: var(--clr-blue); }
    &.wpb-toast--error { --accent: var(--clr-red); }

    /* Round badge, as the check on the added-to-cart modal */
    .wpb-toast__icon { display: inline-grid; place-items: center; align-self: start; width: 2.8rem; height: 2.8rem; border-radius: 50%; background-color: var(--accent); color: #fff; font-size: 1.2rem;
        .icon { color: inherit; }
    }
    &.wpb-toast--notice .wpb-toast__icon { background-color: rgba(var(--clr-blue-rgb), .1); color: var(--accent); font-size: 1.8rem; }
    .wpb-toast__body { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; }
    .wpb-toast__title { font-size: 1.4rem; font-weight: 600; line-height: 1.3; color: var(--clr-headings); }
    .wpb-toast__message { overflow-wrap: anywhere;
        * { font-size: inherit; }
        a { color: inherit; text-decoration: underline; }
        /* WooCommerce adds links styled as buttons (e.g. "View cart", "Undo"): show them as text links */
        :is(.button, .btn) { --padding: 0; --button-mh: auto; --color: var(--clr-blue); --bg-color: transparent; --border: none; --hover-color: var(--clr-dark); --hover-bg-color: transparent; --hover-border: none; --font-size: inherit; display: inline; min-height: 0; margin-right: .4rem; font-weight: 600; text-decoration: underline; }
    }
    .wpb-toast__list { padding-left: 1.6rem;
        li + li { margin-top: .2rem; }
    }
    .wpb-toast__action { display: inline-flex; align-items: center; gap: .4rem; margin-top: .2rem; font-size: 1.3rem; font-weight: 600; color: var(--clr-blue);
        .icon { font-size: .9rem; transition: transform var(--ts-15) ease; }
        &:hover { color: var(--clr-dark);
            .icon { transform: translateX(.2rem); }
        }
    }
    .wpb-toast__close { align-self: start; display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; margin: -.3rem -.3rem 0 0; padding: 0; border: none; border-radius: .4rem; background-color: transparent; color: var(--clr-text); font-size: 1.2rem; cursor: pointer; transition: background-color var(--ts-15) ease;
        &:hover { background-color: var(--clr-light); }
    }
}

/* Success and info notices are only shown as toasts; hidden until the script moves them */
[data-wux-notices="success"], [data-wux-notices="notice"] { display: none; }
