:host .popup__background {
    z-index: 1;
    opacity: 1;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}
:host([state="open"]) .popup__background {
    transition: width 0ms 0ms, height 0ms 0ms, opacity 0.15s ease;
}
:host([state="hidden"]) .popup__background {
    width: 0;
    height: 0;
    opacity: 0;
}
:host .popup {
    z-index: 9;
    overflow: hidden;
    margin: 0;
    padding: 32px 0 0 0;
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    opacity: 1;
    box-sizing: border-box;
}
:host button:not([disabled]):not(:disabled) {
    cursor: pointer;
}
:host([state="hidden"]) .popup {
    left: 0;
    top: -100%;
    opacity: 0;
}
:host .popup__inner {
    z-index: 2;
    overflow: auto;
    box-sizing: border-box;
    padding: 24px 16px 12px 16px;
    position: relative;
    max-width: 100%;
    max-height: 100%;
    border-radius: 16px 16px 0 0;
    background-color: var(--white);
    overflow: hidden;
}
:host([loading]) .popup__inner {
    position: relative;
    overflow: hidden;
}
:host([loading]) .popup__inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    z-index: 5;
    pointer-events: none;
}
:host([loading]) .popup__inner::after {
    z-index: 6;
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: skewX(-20deg);
    animation: glare-shine 2.5s infinite ease-in-out;
}
:host .popup__headline {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
:host .component--title,
:host ::slotted(.component--title) {
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
    color: var(--black-900);
}
:host .popup__headline button {
    z-index: 7;
    align-self: flex-start;
    outline: none;
    border: none;
    background-color: transparent;
}
:host .popup__headline button span {
    display: none;
}
:host .popup__handle {
    display: none;
}

/** Стили для еще не загруженного попапа */
/*@container style(--is-blank: 1) {*/
/*    .popup__inner {*/
/*        position: relative;*/
/*        overflow: hidden;*/
/*    }*/
/*    .popup__inner::before {*/
/*        content: '';*/
/*        position: absolute;*/
/*        top: 0; left: 0; right: 0; bottom: 0;*/
/*        background: rgba(0, 0, 0, 0.35);*/
/*        backdrop-filter: blur(4px);*/
/*        z-index: 5;*/
/*        pointer-events: none;*/
/*    }*/
/*    .popup__inner::after {*/
/*        z-index: 6;*/
/*        content: '';*/
/*        position: absolute;*/
/*        top: 0;*/
/*        left: -150%;*/
/*        width: 60%;*/
/*        height: 100%;*/
/*        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);*/
/*        transform: skewX(-20deg);*/
/*        animation: glare-shine 2.5s infinite ease-in-out;*/
/*    }*/
/*}*/
@keyframes glare-shine {
    0% {
        left: -150%;
    }
    100% {
        left: 150%;
    }
}

@media (min-width: 768px) {
    :host .popup {
        padding: 56px 16px 24px 16px;
        align-items: center;
    }
    :host .popup__inner {
        border-radius: 16px;
        padding-top: 8px;
    }
}

@media (max-width: 767px) {
    :host .popup__inner {
        padding-top: 8px;
    }
    :host .popup__handle {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 20px;
        flex-shrink: 0;
        cursor: grab;
        touch-action: none;
        margin: 0 0 4px 0;
    }
    :host .popup__handle:active {
        cursor: grabbing;
    }
    :host .popup__handle::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background-color: var(--black-200);
        border-radius: 2px;
        pointer-events: none;
    }
}
