.language-parent {
    flex: 0 0 auto;
    position: absolute;
    top: 3.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    margin: 0 auto;
    margin-left: 2px;
    right: 1.7rem; 
    transition: background-color 0.3s ease;
    z-index: 8950;
}
.language-parent:expanded {
    background-color: white;
}
.language-parent.hide {
    visibility: hidden;
}
.language-parent.top-stack {
    z-index: 11000;
}

.flag-expander {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    margin-right: 0.5rem;
}

.top-language {
    display: flex;
    justify-content: center;
}

.flag {
    width: 48px;
    height: 48px;
    display: block;
}

.bottom-language {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;

    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease-out;
    margin-top: 1.5rem;
    gap: 1.25rem;
}
.bottom-language:not([hidden]) {
    max-height: 10rem;
}

.lang-switch-but {
    display: inline-block;
    border-radius: 4px;
}
.lang-switch-but:hover,
.lang-switch-but:focus {
    outline: 2px solid #0066ff;
    background-color: rgba(0, 102, 255, 0.1);
}

@media (max-width: 1300px) {
    .language-parent {
        right: 13rem;
    }
}
@media (max-width: 450px) {
    .language-parent {
        right: 7rem;
    }
}