.popup {
    position: relative;

    display: inline-block;

    text-align: left;
}

.popup__opener {
    list-style: none;
}

.popup__opener::-webkit-details-marker {
    display: none;
}

.popup__opener:focus {
    outline: 0;
}

.popup__opener:focus > * {
    outline: var(--outline-width) solid var(--outline-color);
    outline-offset: var(--outline-offset);
}

.popup__opener[aria-expanded="true"] .button {
    background-color: var(--color-white);
}

.popup__opener[aria-expanded="true"] .button--primary {
    background-color: var(--color-topaz);
}

.popup__container {
    position: fixed;
    z-index: 100;
    right: 0;
    bottom: var(--height-header);
    left: 0;

    padding: var(--space-small) var(--space-smaller);

    background-color: var(--color-pampas);
    box-shadow: 0 -2px 8px 0 rgb(0 70 53 / 15%);
    border-top: 1px solid var(--color-grey-border);
}

@media (min-width: 800px) {
    .popup__container {
        position: absolute;
        bottom: auto;

        min-width: 27rem;

        font-size: var(--size-small);

        box-shadow: 0 2px 8px 0 rgb(0 70 53 / 15%);
        border: 1px solid var(--color-grey-border);
        border-radius: var(--radius);
    }

    .popup__container--large {
        min-width: 31rem;
    }

    .popup__container--bottom {
        right: auto;
        left: 50%;

        margin-top: 0.5rem;
        margin-right: auto;
        margin-left: auto;

        transform: translateX(-50%);
    }

    .popup__container--left {
        right: 0;
        left: auto;

        margin-top: 0.5rem;
    }

    .popup__container--over {
        margin-top: -6.5rem;
        margin-left: -1rem;
    }
}

.popup__title {
    margin-bottom: var(--space-smaller);
    padding-right: var(--space-small);
    padding-left: var(--space-small);

    font-weight: bold;
    overflow-wrap: anywhere;
}

.popup__separator {
    height: 1px;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;

    background-color: var(--color-grey-bg);
    border-radius: var(--radius);
}

.popup__item--link {
    text-decoration: none;
}

.popup__item--link:hover,
.popup__item--link:focus {
    color: initial;
}

.popup__item--button {
    width: 100%;

    font-weight: 400;
    text-align: left;

    background-color: transparent;
    border: none;

    transition: none;
}

.popup__item {
    display: block;
    padding: var(--space-small);

    border-radius: var(--radius);

    transition:
        background-color 0.1s ease-in-out,
        border-color 0.1s ease-in-out;
}

@media (min-width: 800px) {
    .popup__item {
        white-space: nowrap;
    }
}

.popup__item:hover,
.popup__item:focus {
    background-color: var(--color-accent-bg);
}

.popup__item[disabled] {
    background-color: var(--color-accent-bg);
}
