/* Hide legacy WPML language widget */
.site-footer #icl_lang_sel_widget-2 { display: none !important; }

/* =====================
   Language Switcher
   ===================== */
.lang-switcher {
    position: relative;
    padding: 24px 0;
}
/* Pill trigger — footer-2026 design */
.lang-switcher__trigger {
    display: flex;
    min-width: 246px;
    height: 48px;
    padding: 16px;
    align-items: center;
    gap: 8px;
    border-radius: 64px;
    border: 1px solid var(--Shades-Bright-Side-White, #FFF);
    background: var(--Shades-Dark-Side-Antracite, #222);
    box-shadow: 0 0.482px 7.226px 0 rgba(0, 0, 0, 0.10);
    cursor: pointer;
    box-sizing: border-box;
}

/* Business kontekst — pill na jasnym tle: ciemny border, bez tła, ciemny tekst i strzałka. */
.footer-2026-wrap--business .lang-switcher__trigger {
    border: 1px solid var(--Shades-Dark-Side-Antracite, #222);
    background: none;
    box-shadow: 0 0.482px 7.226px 0 rgba(0, 0, 0, 0.10);
}
.footer-2026-wrap--business .lang-switcher__trigger-text {
    color: #222;
}
.footer-2026-wrap--business .lang-switcher__trigger-chevron {
    color: #222;
}

.lang-switcher__trigger-flag {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.lang-switcher__trigger-flag--en {
    display: flex;
    align-items: center;
    justify-content: center;
}
.lang-switcher__trigger-flag--en svg {
    width: 16px;
    height: 16px;
    filter: invert(1);
}

.lang-switcher__trigger-text {
    flex: 1;
    min-width: 0;
    color: var(--Shades-Bright-Side-White, #FFF);
    font-feature-settings: 'liga' off, 'clig' off;
    text-box: trim-both cap alphabetic;
    font-family: "Nunito", sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: 18px;
    white-space: nowrap;
    text-align: left;
}

.lang-switcher__trigger-chevron {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--Shades-Bright-Side-White, #FFF);
    transition: transform 0.2s ease;
}

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

/* Dropdown */
.lang-switcher__dropdown {
    position: absolute;
    top: calc(100% + 12px);
    bottom: auto;
    left: 0;
    z-index: 9999;
    background: #fff;
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.12);
    /* Match z .footer-2026__columns-inner — viewport-relative width z cap 1317px.
       Na wąskich okienkach dropdown sam się skróci, na szerokich = max 1317px (=column-inner). */
    max-width: 1317px;
    width: calc(100vw - 40px);
    box-sizing: border-box;
}
.lang-switcher__dropdown[hidden] { display: none; }

/* Auto-position: opens up when there's not enough space below */
.lang-switcher__dropdown--up {
    top: auto;
    bottom: calc(100% + 12px);
}

/* Grid */
.lang-switcher__grid {
    display: grid;
    gap: 20px;
    row-gap: 20px;
    column-gap: 20px;
    grid-template-columns: repeat(4, 1fr);
}

/* Responsywność dropdownu */
@media (max-width: 1280px) {
    .lang-switcher__dropdown {
        width: calc(100vw - 80px);
        left: 0;
    }
    .lang-switcher__item {
        width: 100%;
        max-width: 100%;
    }
}
@media (max-width: 1023px) {
    .lang-switcher__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .lang-switcher__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@keyframes lang-switcher-slide-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
@keyframes lang-switcher-slide-down {
    from { transform: translateY(0); }
    to   { transform: translateY(100%); }
}

@media (max-width: 767px) {
    .lang-switcher {
        padding-top: 22px;
    }
    .lang-switcher__trigger {
        min-width: 0;
        width: 100%;
        height: 64px;
        padding: 16px 24px;
        justify-content: center;
        gap: 8px;
        align-self: stretch;
    }
    .lang-switcher__dropdown {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        width: 100%;
        min-width: 0;
        max-width: none;
        max-height: 75vh;
        border-radius: 20px 20px 0 0;
        padding: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        box-shadow: 0 -8px 40px rgba(0,0,0,0.2);
        animation: lang-switcher-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    }
    .lang-switcher__dropdown.is-closing {
        animation: lang-switcher-slide-down 0.25s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    }
    .lang-switcher__drag-handle {
        flex-shrink: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 28px;
        cursor: pointer;
    }
    .lang-switcher__drag-handle::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
    }
    .lang-switcher__grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 0 16px 24px;
        padding-right: 16px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .lang-switcher__item {
        width: 100%;
        max-width: 100% !important;
        flex-shrink: 0;
    }
    /* Backdrop */
    .lang-switcher__backdrop-mobile {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
    }
    .lang-switcher__dropdown:not([hidden]) {
        z-index: 9999;
    }
    .lang-switcher__backdrop-mobile.is-visible {
        display: block;
    }
}

/* Language item — shared */
.lang-switcher__item {
    display: flex;
    width: 100%;
    max-width: 304px;
    min-width: 0;
    padding: 16px 24px;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px;
    text-decoration: none;
    box-sizing: border-box;
    transition: background-color 0.15s ease;
}
.lang-switcher__item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}
.lang-switcher__item-label {
    font-family: "Nunito", sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 18px;
    color: #888;
}
.lang-switcher__item-value {
    font-family: "Nunito", sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 26px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lang-switcher__item-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.lang-switcher__item-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    flex-shrink: 0;
}
.lang-switcher__item-flag img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.lang-switcher__item-icon { flex-shrink: 0; }
.lang-switcher__item-icon--check { color: #20BB3B; }

/* Items — light */
.lang-switcher__item { background-color: #F0EEE7; }
@media (hover: hover) and (pointer: fine) {
    .lang-switcher__item:hover { background-color: #e5e3db; }
}
.lang-switcher__item.is-active { background-color: #20BB3B; }
.lang-switcher__item-value { color: #000; }
.lang-switcher__item.is-active .lang-switcher__item-value { color: #000; }
.lang-switcher__item.is-active .lang-switcher__item-label { color: #0a5c1e; }

/* Business kontekst — items na beżowym BG, value #222, flag biały, beżowy hover. */
.footer-2026-wrap--business .lang-switcher--dark .lang-switcher__dropdown { background: #FFF; }
.footer-2026-wrap--business .lang-switcher__item { background-color: #F0EEE7; }
@media (hover: hover) and (pointer: fine) {
    .footer-2026-wrap--business .lang-switcher__item:not(.is-active):hover { background-color: #e5e3db; }
}
.footer-2026-wrap--business .lang-switcher__item-value { color: #222; }
.footer-2026-wrap--business .lang-switcher__item-flag { background-color: #FFF !important; }
.footer-2026-wrap--business .lang-switcher--dark .lang-switcher__item { background-color: #F0EEE7; }
.footer-2026-wrap--business .lang-switcher--dark .lang-switcher__item-value { color: #000; }
@media (hover: hover) and (pointer: fine) {
    .footer-2026-wrap--business .lang-switcher--dark .lang-switcher__item:not(.is-active):hover { background-color: #e5e3db; }
}
.lang-switcher__item-flag { background-color: #fff; }
.lang-switcher__item.is-active .lang-switcher__item-flag { background-color: rgba(255,255,255,0.6); }

/* Items — dark */
.lang-switcher--dark .lang-switcher__dropdown { background: var(--footer-2026-bg, #222); }
.lang-switcher--dark .lang-switcher__item { background-color: #2a2a2a; }
@media (hover: hover) and (pointer: fine) {
    .lang-switcher--dark .lang-switcher__item:hover { background-color: #333; }
}
.lang-switcher--dark .lang-switcher__item-value { color: #fff; }
.lang-switcher--dark .lang-switcher__item-label { color: #888; }
.lang-switcher--dark .lang-switcher__item-flag { background-color: #3a3a3a; }
.lang-switcher--dark .lang-switcher__item.is-active { background-color: #20BB3B; }
.lang-switcher--dark .lang-switcher__item.is-active .lang-switcher__item-value { color: #000; }
.lang-switcher--dark .lang-switcher__item.is-active .lang-switcher__item-label { color: #0a5c1e; }
.lang-switcher--dark .lang-switcher__item.is-active .lang-switcher__item-flag { background-color: rgba(255,255,255,0.3); }
@media (min-width: 1281px) {
    .lang-switcher__item {
        min-width: 304px;
        max-width: 304px;
    }
}
