:root {
    --mzst-accent: #f73030;
    --mzst-success: #0f9f8f;
    --mzst-warning: #b7791f;
    --mzst-error: #d92d20;
    --mzst-info: #2563eb;
    --mzst-text: #1f2937;
    --mzst-muted: #667085;
    --mzst-surface: #ffffff;
    --mzst-border: #dde5ef;
    --mzst-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

.mzst-toaster {
    position: fixed;
    z-index: 100050;
    top: max(16px, calc(var(--mzsn-header-offset, 0px) + 14px));
    right: 22px;
    display: grid;
    width: min(390px, calc(100vw - 32px));
    gap: 10px;
    pointer-events: none;
}

.mzst-toaster.is-cart-drawer-open {
    z-index: 390;
}

.admin-bar .mzst-toaster {
    top: max(48px, calc(var(--mzsn-header-offset, 0px) + 46px));
}

.mzst-toast {
    position: relative;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 34px;
    gap: 12px;
    align-items: start;
    min-height: 76px;
    overflow: hidden;
    padding: 14px 12px 13px 14px;
    color: var(--mzst-text);
    background: var(--mzst-surface);
    border: 1px solid var(--mzst-border);
    border-left: 4px solid var(--mzst-info);
    border-radius: 8px;
    box-shadow: var(--mzst-shadow);
    opacity: 0;
    pointer-events: auto;
    transform: translate3d(18px, -4px, 0);
    transition: opacity 180ms ease, transform 220ms ease;
}

.mzst-toast.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.mzst-toast.is-leaving {
    opacity: 0;
    transform: translate3d(12px, -3px, 0);
}

.mzst-toast--success,
.mzst-toast--cart {
    border-left-color: var(--mzst-success);
}

.mzst-toast--warning {
    border-left-color: var(--mzst-warning);
}

.mzst-toast--error {
    border-left-color: var(--mzst-error);
}

.mzst-toast--info {
    border-left-color: var(--mzst-info);
}

.mzst-toast__visual {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    overflow: hidden;
    background: #ecfdf7;
    border-radius: 8px;
}

.mzst-toast--info .mzst-toast__visual {
    background: #eef4ff;
}

.mzst-toast--warning .mzst-toast__visual {
    background: #fff7ed;
}

.mzst-toast--error .mzst-toast__visual {
    background: #fef3f2;
}

.mzst-toast__visual span {
    position: relative;
    width: 19px;
    height: 19px;
    border: 2px solid var(--mzst-success);
    border-radius: 999px;
}

.mzst-toast__visual span::after {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 5px;
    content: "";
    border-bottom: 2px solid var(--mzst-success);
    border-left: 2px solid var(--mzst-success);
    transform: rotate(-45deg);
}

.mzst-toast--info .mzst-toast__visual span {
    border-color: var(--mzst-info);
}

.mzst-toast--info .mzst-toast__visual span::after {
    top: 4px;
    left: 7px;
    width: 2px;
    height: 8px;
    border-right: 2px solid var(--mzst-info);
    border-bottom: 0;
    border-left: 0;
    transform: none;
}

.mzst-toast--warning .mzst-toast__visual span {
    border-color: var(--mzst-warning);
}

.mzst-toast--warning .mzst-toast__visual span::after {
    top: 4px;
    left: 7px;
    width: 2px;
    height: 9px;
    border-right: 2px solid var(--mzst-warning);
    border-bottom: 0;
    border-left: 0;
    transform: none;
}

.mzst-toast--error .mzst-toast__visual span {
    border-color: var(--mzst-error);
}

.mzst-toast--error .mzst-toast__visual span::before,
.mzst-toast--error .mzst-toast__visual span::after {
    position: absolute;
    top: 8px;
    left: 4px;
    width: 8px;
    height: 2px;
    content: "";
    background: var(--mzst-error);
    border: 0;
}

.mzst-toast--error .mzst-toast__visual span::before {
    transform: rotate(45deg);
}

.mzst-toast--error .mzst-toast__visual span::after {
    transform: rotate(-45deg);
}

.mzst-toast__visual--image {
    background: #f8fafc;
    border: 1px solid #edf1f6;
}

.mzst-toast__visual--image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mzst-toast__body {
    min-width: 0;
    padding-top: 1px;
}

.mzst-toast__title {
    margin: 0 0 3px;
    overflow: hidden;
    color: #111827;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mzst-toast__message {
    display: -webkit-box;
    overflow: hidden;
    color: var(--mzst-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mzst-toast__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.mzst-toast__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #e5eaf1;
    border-radius: 6px;
}

.mzst-toast__action:hover,
.mzst-toast__action:focus {
    color: #111827;
    text-decoration: none;
    background: #f1f5f9;
}

.mzst-toast__action--primary {
    color: #ffffff;
    background: var(--mzst-accent);
    border-color: var(--mzst-accent);
}

.mzst-toast__action--primary:hover,
.mzst-toast__action--primary:focus {
    color: #ffffff;
    background: #d92525;
    border-color: #d92525;
}

.mzst-toast__close {
    position: relative;
    width: 30px;
    height: 30px;
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 6px;
}

.mzst-toast__close::before,
.mzst-toast__close::after {
    position: absolute;
    top: 14px;
    left: 8px;
    width: 14px;
    height: 2px;
    content: "";
    background: #98a2b3;
    border-radius: 999px;
}

.mzst-toast__close::before {
    transform: rotate(45deg);
}

.mzst-toast__close::after {
    transform: rotate(-45deg);
}

.mzst-toast__close:hover,
.mzst-toast__close:focus-visible {
    background: #f2f4f7;
    outline: none;
}

.mzst-toast__progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--mzst-success), var(--mzst-accent));
    transform-origin: left center;
    animation: mzst-progress var(--mzst-duration) linear forwards;
}

.mzst-toast--info .mzst-toast__progress {
    background: linear-gradient(90deg, var(--mzst-info), var(--mzst-accent));
}

.mzst-toast--warning .mzst-toast__progress {
    background: linear-gradient(90deg, var(--mzst-warning), var(--mzst-accent));
}

.mzst-toast--error .mzst-toast__progress {
    background: linear-gradient(90deg, var(--mzst-error), var(--mzst-accent));
}

.mzst-toast.is-paused .mzst-toast__progress {
    animation-play-state: paused;
}

@keyframes mzst-progress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 782px) {
    .admin-bar .mzst-toaster {
        top: max(62px, calc(var(--mzsn-header-offset, 0px) + 60px));
    }
}

@media (max-width: 640px) {
    .mzst-toaster {
        top: max(12px, calc(var(--mzsn-header-offset, 0px) + 10px));
        right: 12px;
        left: 12px;
        width: auto;
    }

    .mzst-toast {
        grid-template-columns: 38px minmax(0, 1fr) 32px;
        min-height: 70px;
        padding: 12px 10px 12px 12px;
    }

    .mzst-toast__visual {
        width: 38px;
        height: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mzst-toast {
        transition: none;
    }

    .mzst-toast__progress {
        animation: none;
        transform: scaleX(0);
    }
}
