/* =====================================================
   Destination Hub® — Globe-Dropdown Sprachauswahl
   ===================================================== */

/* Wrapper: zentriert im Header */
.langSwitch {
    display: flex;
    justify-content: center;
    padding: 8px 0 4px 0;
}

/* ── Globe-Button (immer sichtbar) ──────────────────── */
.globe-dropdown {
    position: relative;
}

.globe-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px 6px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 22px;
    cursor: pointer;
    color: #ffffff;
    font-family: "Roboto", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.globe-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.globe-btn:focus {
    outline: 2px solid #12abff;
    outline-offset: 2px;
}

.globe-icon {
    opacity: 0.75;
    flex-shrink: 0;
}

.globe-active-flag {
    border-radius: 3px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

.globe-active-name {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.globe-chevron {
    opacity: 0.6;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.globe-btn[aria-expanded="true"] .globe-chevron {
    transform: rotate(180deg);
}

/* ── Dropdown-Menü ──────────────────────────────────── */
.globe-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 9999;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    padding: 6px;
    min-width: 175px;
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.globe-menu.open {
    display: grid;
}

/* ── Einzelne Sprach-Buttons im Menü ────────────────── */
.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    background: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: "Roboto", sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #333333;
    text-align: left;
    transition: background 0.12s ease, color 0.12s ease;
    white-space: nowrap;
}

.lang-btn img {
    border-radius: 3px;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.lang-btn span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lang-btn:hover {
    background: #f0f7ff;
    color: #12abff;
}

.lang-btn.active {
    background: #e8f5ff;
    color: #0088cc;
    font-weight: 500;
}

.lang-btn.active::after {
    content: "✓";
    font-size: 11px;
    color: #12abff;
    margin-left: auto;
    flex-shrink: 0;
}

.lang-btn:focus {
    outline: 2px solid #12abff;
    outline-offset: -2px;
}

/* ── RTL-Support ────────────────────────────────────── */
[dir="rtl"] .langSwitch {
    justify-content: flex-start;
}

[dir="rtl"] .globe-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-btn {
    text-align: right;
    flex-direction: row-reverse;
}

/* ── Smooth Transition beim Sprachwechsel ───────────── */
[data-translate] {
    transition: opacity 0.2s ease;
}

body.lang-switching [data-translate] {
    opacity: 0.6;
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 768px) {
    .globe-active-name {
        display: none;
    }

    .globe-btn {
        padding: 6px 10px;
        gap: 6px;
    }

    .globe-menu {
        grid-template-columns: 1fr 1fr;
        right: 0;
        min-width: 210px;
    }
}

@media (max-width: 480px) {
    .globe-menu {
        grid-template-columns: 1fr;
        min-width: 160px;
    }
}
