/* Letwork Top Bar – Plugin overrides */

/* Stable height before fonts/widgets paint (CLS). Theme also sets 30px. */
.topbar {
    min-height: 30px;
    box-sizing: border-box;
}

.topbar[style*="--ltb-bg"] {
    background-color: var(--ltb-bg, #f5f5f5);
    color: var(--ltb-color, #333333);
    font-weight: normal !important;
}

.topbar[style*="--ltb-color"] .topbar__item,
.topbar[style*="--ltb-color"] .topbar__item a {
    color: var(--ltb-color, #333333);
    font-weight: normal !important;
}

.topbar[style*="--ltb-color"] .topbar__item.topbar__item--bold,
.topbar[style*="--ltb-color"] .topbar__item.topbar__item--bold a {
    font-weight: 700 !important;
}

.topbar[style*="--ltb-color"] .topbar__text--bold {
    font-weight: 700 !important;
}

/* Even distribution of sectors */
.topbar[data-mobile-max] .usps-box {
    justify-content: space-evenly;
    gap: 0;
}

.topbar[data-mobile-max] .topbar__item {
    flex: 1 1 0%;
    justify-content: center;
    text-align: center;
    margin-right: 0;
    margin-left: 0;
    order: unset;
    padding: 0 8px;
}

.topbar[data-mobile-max] .topbar__item:first-child {
    margin-right: 0;
    margin-left: 0;
}

.topbar__item .topbar__icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex: 0 0 18px;
}

.topbar__item .topbar__img {
    max-height: 22px;
    width: auto;
    object-fit: contain;
}

.topbar__item--script {
    display: flex;
    align-items: center;
}

.topbar--mobile-hidden {
    display: flex;
}

.topbar__link--mobile {
    display: none;
}

/* ── Sprachen-Switcher ── */
.topbar__item--lang-switcher {
    position: relative;
    margin-left: auto;
}

.topbar__lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    color: inherit;
    font: inherit;
    line-height: 1;
    transition: background-color .15s ease, border-color .15s ease;
}

.topbar__lang-trigger:hover,
.topbar__lang-trigger:focus-visible {
    background-color: rgba(0, 0, 0, .06);
    border-color: rgba(0, 0, 0, .12);
    outline: none;
}

.topbar__lang-trigger .topbar__lang-flag {
    display: block;
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

.topbar__lang-code {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: .03em;
}

.topbar__lang-arrow {
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    opacity: .7;
    transition: transform .15s ease;
}

.topbar__item--lang-switcher.is-open .topbar__lang-arrow {
    transform: rotate(180deg);
}

.topbar__lang-list {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 160px;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    background: #ffffff;
    color: #333333;
    border: 1px solid rgba(0, 0, 0, .12);
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .12);
    z-index: 1000;
}

.topbar__lang-list[hidden] {
    display: none;
}

.topbar__lang-list li {
    margin: 0;
    padding: 0;
}

.topbar__lang-list a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    color: inherit !important;
    text-decoration: none;
    font-weight: normal !important;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
}

.topbar__lang-list a:hover,
.topbar__lang-list a:focus-visible {
    background-color: rgba(0, 0, 0, .05);
    outline: none;
}

.topbar__lang-list .topbar__lang-flag {
    display: block;
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
    flex: 0 0 20px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}

@media (max-width: 991.98px) {
    .topbar__link--desktop {
        display: none !important;
    }

    .topbar__link--mobile {
        display: inline-flex !important;
        align-items: center;
        gap: 5px;
    }

    .topbar--mobile-hidden {
        display: none !important;
    }

    .topbar[data-mobile-max] .topbar__item {
        display: none;
    }

    .topbar[data-mobile-max="1"] .topbar__item:nth-child(-n+1),
    .topbar[data-mobile-max="2"] .topbar__item:nth-child(-n+2),
    .topbar[data-mobile-max="3"] .topbar__item:nth-child(-n+3),
    .topbar[data-mobile-max="4"] .topbar__item:nth-child(-n+4),
    .topbar[data-mobile-max="5"] .topbar__item:nth-child(-n+5) {
        display: flex;
    }
}
