#bdm-toast-region {
    position: fixed;
    z-index: 100000;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(430px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    overflow: auto;
    pointer-events: none;
}

body.admin-bar #bdm-toast-region {
    top: 52px;
    max-height: calc(100vh - 72px);
}

.bdm-toast {
    --bdm-toast-color: #195080;
    --bdm-toast-soft: #eaf2f8;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 30px;
    gap: 10px;
    align-items: start;
    position: relative;
    padding: 14px 12px 14px 14px;
    border: 1px solid #dbe4eb;
    border-left: 5px solid var(--bdm-toast-color);
    border-radius: 12px;
    background: #fff;
    color: #2e4151;
    box-shadow: 0 14px 36px rgba(19, 47, 70, .24);
    opacity: 0;
    transform: translateY(-10px) scale(.98);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: auto;
}

.bdm-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.bdm-toast.is-leaving {
    opacity: 0;
    transform: translateX(18px) scale(.98);
}

.bdm-toast.is-error {
    --bdm-toast-color: #c9362b;
    --bdm-toast-soft: #fbe7e5;
}

.bdm-toast.is-warning {
    --bdm-toast-color: #d27a00;
    --bdm-toast-soft: #fff1d8;
}

.bdm-toast.is-success {
    --bdm-toast-color: #198754;
    --bdm-toast-soft: #e2f4e9;
}

.bdm-toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bdm-toast-soft);
    color: var(--bdm-toast-color);
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

.bdm-toast-title {
    display: block;
    margin: 0 0 4px;
    color: #173d5f;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.25;
}

.bdm-toast-message {
    min-width: 0;
}

.bdm-toast-content {
    min-width: 0;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.bdm-toast-actions {
    display: flex;
    gap: 7px;
    margin-top: 9px;
}

.bdm-toast-action {
    min-height: 32px;
    padding: 5px 11px;
    border: 1px solid var(--bdm-toast-color);
    border-radius: 7px;
    background: var(--bdm-toast-color);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    cursor: pointer;
}

.bdm-toast-action:hover,
.bdm-toast-action:focus {
    filter: brightness(.92);
    outline: 2px solid var(--bdm-toast-color);
    outline-offset: 2px;
}

.bdm-toast-content > .bdm-account-notice,
.bdm-toast-content > .bdmom-notice,
.bdm-toast-content > .bdm-stock-notice,
.bdm-toast-content > .bdm-agent-notice,
.bdm-toast-content > .woocommerce-error,
.bdm-toast-content > .woocommerce-message,
.bdm-toast-content > .woocommerce-info {
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
}

.bdm-toast-content > ul.woocommerce-error,
.bdm-toast-content > ul.woocommerce-message,
.bdm-toast-content > ul.woocommerce-info {
    list-style: none !important;
}

.bdm-toast-content li {
    margin: 0 !important;
}

.bdm-toast-content > .woocommerce-error::before,
.bdm-toast-content > .woocommerce-message::before,
.bdm-toast-content > .woocommerce-info::before {
    display: none !important;
}

.bdm-toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: -3px -3px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #eef2f5;
    color: #506272;
    font: 900 20px/1 Arial, sans-serif;
    cursor: pointer;
}

.bdm-toast-close:hover,
.bdm-toast-close:focus {
    background: #dde5eb;
    color: #173d5f;
    outline: 2px solid var(--bdm-toast-color);
    outline-offset: 1px;
}

.bdm-action-inline-feedback {
    --bdm-feedback-color: #c9362b;
    --bdm-feedback-soft: #fbe7e5;
    display: grid;
    grid-template-columns: 23px minmax(0, 1fr) 25px;
    gap: 7px;
    align-items: center;
    width: 100%;
    margin: 8px 0 4px;
    padding: 8px 9px;
    border: 1px solid #e8b5b1;
    border-color: color-mix(in srgb, var(--bdm-feedback-color) 36%, #fff);
    border-left: 4px solid var(--bdm-feedback-color);
    border-radius: 8px;
    background: var(--bdm-feedback-soft);
    color: #5d2420;
    box-sizing: border-box;
    font-size: 11px;
    line-height: 1.35;
    scroll-margin: 110px;
}

.bdm-action-inline-feedback.is-warning {
    --bdm-feedback-color: #d27a00;
    --bdm-feedback-soft: #fff3dc;
    color: #6d4406;
}

.bdm-action-inline-feedback.is-success {
    --bdm-feedback-color: #198754;
    --bdm-feedback-soft: #e4f5ea;
    color: #145d35;
}

.bdm-action-inline-feedback > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 23px;
    height: 23px;
    border-radius: 50%;
    background: #fff;
    color: var(--bdm-feedback-color);
    font-weight: 900;
}

.bdm-action-inline-feedback > strong {
    min-width: 0;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.bdm-action-inline-feedback > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .75);
    color: inherit;
    font: 900 17px/1 Arial, sans-serif;
    cursor: pointer;
}

.bdm-field-invalid,
.woocommerce-MyAccount-content .bdm-field-invalid {
    border-color: #c9362b !important;
    box-shadow: 0 0 0 3px rgba(201, 54, 43, .14) !important;
    outline: 0 !important;
}

.bdm-field-feedback {
    display: block;
    width: 100%;
    margin: 5px 0 2px;
    color: #b52f27;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.3;
}

form .bdm-action-inline-feedback {
    flex-basis: 100%;
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    #bdm-toast-region,
    body.admin-bar #bdm-toast-region {
        top: auto;
        right: 10px;
        bottom: 84px;
        left: 10px;
        width: auto;
        max-height: calc(100vh - 105px);
    }

    .bdm-toast {
        grid-template-columns: 32px minmax(0, 1fr) 30px;
        gap: 9px;
        padding: 13px 10px 13px 12px;
        border-radius: 11px;
    }

    .bdm-toast-icon {
        width: 32px;
        height: 32px;
    }

    .bdm-toast-action {
        min-height: 35px;
    }

    .bdm-action-inline-feedback {
        font-size: 10px;
    }
}

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

@media print {
    #bdm-toast-region {
        display: none !important;
    }
}
