/**
 * TOAST CONTAINER
 */
#as-toast-container {
    position: fixed;
    top: 1em;
    right: 1em;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5em;
    pointer-events: none;
    padding: 1em;
}

/**
 * TOAST
 */
.as-toast {
    pointer-events: all;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.65em;
    min-height: 40px;
    min-width: 200px;
    max-width: 220px;
    background-color: var(--color-toast-bg);
    border: 2px solid var(--color-toast-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-toast);
    padding: 0.75em 1em;
    position: relative;
    overflow: hidden;
    animation: as-toast-in 0.25s ease forwards;
}

.as-toast.as-toast-hiding {
    animation: as-toast-out 0.3s ease forwards;
}

@keyframes as-toast-in {
    from { 
        opacity: 0; 
        transform: translateX(110%); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes as-toast-out {
    from { 
        opacity: 1; 
        transform: translateX(0); 
        max-height: 120px; 
        margin-bottom: 0; 
    }
    to { 
        opacity: 0; 
        transform: translateX(110%); 
        max-height: 0; 
        margin-bottom: -0.5em; 
    }
}

/**
 * WP TOAST STYLES
 */
.as-toast-success { 
    --toast-color: var(--color-toast-success);
}

.as-toast-error { 
    --toast-color: var(--color-toast-error);
}

.as-toast-warning { 
    --toast-color: var(--color-toast-warning);
}

.as-toast-info { 
    --toast-color: var(--color-toast-info);
}

.as-toast-progress {
    background-color: var(--toast-color); 
}

.as-toast {
    border-color: var(--toast-color); 
}

/**
 * TOAST ICON
 */
.as-toast-ico {
    color: var(--toast-color);
    font-size: 2em;
    flex-shrink: 0;
    margin-top: 1px;
}

/**
 * TOAST BODY
 */
.as-toast-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.15em;
}

.as-toast-title {
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size);
    color: inherit;
}

.as-toast-message {
    font-size: var(--font-size);
    color: var(--color-toast-txt);
    word-break: break-word;
}

/**
 * CLOSE BTN
 */
.as-toast-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.4em;
    color: var(--color-toast-close-btn);
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    align-self: flex-start;
    transition: color 0.15s;
}

.as-toast-close:hover {
    color: var(--color-black); 
}

/**
 * TOAST PROGRESS BAR
 */
.as-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    animation: as-toast-progress linear forwards;
}

@keyframes as-toast-progress {
    from { 
        transform: scaleX(1);
    }
    to { 
        transform: scaleX(0);
    }
}