/* Hleba Language Switcher — replaces GTranslate */
.hleba-lang-switcher {
    position: fixed;
    bottom: 76px;
    right: 108px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.hleba-lang-switcher-target {
    display: flex;
    align-items: center;
}

.hleba-lang-switcher--inline {
    position: static;
    bottom: auto;
    right: auto;
    z-index: 5;
}

.hleba-lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 24px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    font-size: 14px;
    color: #333;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.hleba-lang-switcher--inline .hleba-lang-btn {
    min-height: 42px;
}

.hleba-lang-btn:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}

.hleba-lang-btn img {
    border-radius: 2px;
}

.hleba-lang-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 6px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    overflow: hidden;
    min-width: 160px;
}

.hleba-lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    transition: background 0.15s;
}

.hleba-lang-option:hover {
    background: #f5f5f5;
}

.hleba-lang-option img {
    border-radius: 2px;
}

.hleba-location-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hleba-header-mini-lang-item {
    margin-left: 8px;
}

.header-mini .hleba-lang-switcher-target-desktop {
    display: flex;
    align-items: center;
    height: 100%;
}

.header-mini .hleba-lang-switcher-target-desktop .hleba-lang-btn {
    min-height: 32px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    box-shadow: none;
}

.header-mini .hleba-lang-switcher-target-desktop .hleba-lang-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.header-mini .hleba-lang-switcher-target-desktop .hleba-lang-btn span {
    color: #fff;
}

.header-mini .hleba-lang-switcher-target-desktop .hleba-lang-btn img {
    border-radius: 2px;
}

.dropdown-cats-market {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.dropdown-cats-market .search-input {
    flex: 1 1 auto;
    min-width: 0;
}

.hleba-location-button-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
}

.hleba-location-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 16px;
    white-space: nowrap;
}

@media only screen and (min-width: 981px) {
    .dropdown-cats-market {
        display: grid !important;
        align-items: center;
        grid-template-columns: max-content minmax(320px, 680px) max-content;
        justify-content: start;
        column-gap: 12px;
    }

    .dropdown-cats-market > .dropdown {
        flex: 0 0 auto;
    }

    .dropdown-cats-market > .line-search-market,
    .dropdown-cats-market > .search-input {
        flex: 0 1 auto;
        width: 100% !important;
        max-width: 680px;
        min-width: 0;
    }

    .dropdown-cats-market > .hleba-location-button-wrap {
        flex: 0 0 auto;
        margin-left: 0;
        justify-self: start;
    }

    .hleba-location-trigger {
        height: 42px;
    }
}

.hleba-mobile-location-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    line-height: normal !important;
}

.header-mobile.modal-mobile .index-page.mobile-header {
    position: relative;
}

.header-mobile.modal-mobile .index-page.mobile-header > a:first-child {
    flex: 0 0 auto;
}

.hleba-lang-switcher-target-mobile-modal {
    margin-left: auto;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 40;
}

.hleba-lang-switcher-target-mobile-modal .hleba-lang-switcher,
.hleba-lang-switcher-target-mobile-modal .hleba-lang-btn {
    position: relative;
    z-index: 41;
}

/* Mobile adjustments */
@media only screen and (max-device-width: 970px) {
    .hleba-header-mini-lang-item {
        display: none;
    }

    .hleba-lang-switcher {
        bottom: calc(96px + env(safe-area-inset-bottom));
        right: 84px;
    }

    .hleba-lang-btn {
        gap: 6px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .hleba-mobile-location-wrap .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 40px;
    }

    .hleba-lang-switcher--inline-mobile .hleba-lang-btn {
        min-width: 72px;
        min-height: 40px;
        height: 40px;
        justify-content: center;
        padding: 8px 12px;
        border-radius: 14px;
        box-shadow: none;
    }

    .hleba-lang-switcher--inline-mobile .hleba-lang-btn span {
        display: none;
    }

    .hleba-lang-switcher--inline-mobile .hleba-lang-btn img {
        width: 24px;
        height: 16px;
        max-width: 24px;
        flex: 0 0 24px;
    }

    .hleba-lang-switcher-target-mobile-modal .hleba-lang-btn {
        min-width: 72px;
        min-height: 40px;
        height: 40px;
        padding: 8px 12px;
        border-radius: 14px;
        box-shadow: none;
    }
}

/* Translation loading indicator */
[data-original-text] {
    transition: opacity 0.2s;
}
