.aw-noty {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;

    padding: 0.75rem 0.75rem;
    border-radius: 0.625rem;
    background: var(--c-notify-bg);
    box-shadow: 0 2px 5px 0 #14171D1A;

    &:hover {
        background: var(--c-on-notify-bg);

        .aw-noty__button {
            color: var(--c-on-notify-close-icon);

            &-circle {
                 stroke: var(--c-on-notify-close-icon);
            }
        }
    }

    &--info {
        .aw-noty__icon {
            color: var(--c-on-blue);
        }
    }

    &--warning {
        .aw-noty__icon {
            color: var(--c-on-yellow);
        }
    }

    &--success {
        .aw-noty__icon {
            color: var(--c-success);
        }
    }

    &--error {
        .aw-noty__icon {
            color: var(--c-error);
        }
    }

    &__content {
        flex-grow: 1;
        align-self: center;

        &.has-text .aw-noty__title {
             @apply font-bold;
        }
    }

    &__title {
        font-size: 1rem;
        line-height: 1;
        color: var(--c-surface);
    }

    &__text {
         font-size: 1rem;
         line-height: 1;
         color: var(--c-surface);
         margin-top: 0.125rem;
    }

    &__icon,
    &__button {
        flex-shrink: 0;
    }

    &__button {
        color: var(--c-notify-close-icon);
        display: flex;
        align-items: center;
        justify-content: center;
        align-self: center;
    }
}

.aw-noty-container {
    @apply flex flex-col;
    position: fixed;
    z-index: 999;
    overflow: visible;
    padding: theme('spacing.2');
    width: theme('maxWidth.xs', 20rem);
    max-height: 100vh;
    max-width: calc(100% - 112px);
    list-style: none;

    /* default */
    right: 0;
    bottom: env(safe-area-inset-bottom, 0px);

    &_top {
        top: auto;
        bottom: env(safe-area-inset-bottom, 0px);
        margin-bottom: 1rem !important;
        margin-top: 0;

        .aw-noty-container__item {
            padding-top: 1rem;

            &:first-of-type {
                 padding-top: 0;
            }

            &:last-of-type {
                padding-bottom: 0;
            }
        }
    }

    &_left {
        right: auto;
        left: 0
    }

    &_right {
        @apply items-end;
    }

    &_center {
        @apply items-center;
        right: 50%;
        transform: translateX(50%);
        width: 100%;
        max-width: 100%;

        .aw-noty-container__item {
            width: 100%;
        }
    }

    &__item {
        overflow: visible;
        max-height: 50vh;
        padding: theme('spacing.2');
        transform-origin: center bottom;
    }

    &_top &__item {
        transform-origin: center top
    }
}

.aw-page-single-noty {
    .aw-noty-container {
        &_top {
             padding-left: 1rem;
             padding-right: 1rem;
         }
    }
}

.aw-page-noty {
    .aw-noty-container_top {
        margin-bottom: max(calc(var(--page-buttons-bottom, 0px) + var(--page-fixed-buttons-height, 0px)), 1rem) !important;
    }
}

.aw-more-noty {
    .aw-noty-container_top {
        margin-bottom: 3.5rem !important;
    }
}

@screen lg {
    .aw-noty {
        padding: 0.5rem 0.75rem;
        border-radius: 0.5rem;

        &__title {
            font-size: 0.875rem;
            line-height: 1;
        }

        &__text {
            font-size: 0.875rem;
            line-height: 1;
        }
    }

    .aw-page-single-noty {
        .aw-noty-container {
            &_top {
                 margin-top: 3.5rem;
                 padding-left: 0.5rem;
                 padding-right: 0.5rem;
             }
        }
    }

    .aw-page-noty, .aw-more-noty {
        .aw-noty-container_top {
            margin-bottom: 0 !important;
        }
    }

    .aw-noty-container {
        width: auto;
        max-width: 23rem;

        &_top {
             top: env(safe-area-inset-top, 0px);
             bottom: auto;
             margin-top: 0.5rem;
             margin-bottom: 0 !important;

             .aw-noty-container__item {
                &:last-of-type {
                     padding-bottom: 0.5rem;
                }
             }
        }
    }
}

/* transition */
.aw-noty {
    &-enter-active {
        transition: 250ms ease-out;
    }

    &-leave-active,
    &-move {
        /* min-width: max-content; */
        transition: 150ms;
        overflow: hidden;
    }

    &-enter-active,
    &-leave-active {
        pointer-events: none;
        backface-visibility: hidden;
        will-change: transform, opacity;
    }

    &-enter,
    &-leave-to {
        opacity: 0;
    }

    &-enter {
        transform: translateY(50%);
    }

    .aw-noty-container_top &-enter {
        transform: translateY(-50%);
    }

    &-leave-to {
        transform: scaleY(0) scaleX(0.6) translateX(100%);
        max-height: 0;
    }

    .aw-noty-container_center &-leave-to {
        transform: scaleY(0) scaleX(0.6);
    }

    .aw-noty-container_left &-leave-to {
        transform: scaleY(0) scaleX(0.6) translateX(-100%);
    }
}
