header {
    z-index: 1002;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 60px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, transparent 100%);
    transition: background 0.4s ease, backdrop-filter 0.4s ease, box-shadow 0.4s ease;
}

header.white {
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
}

/* ── Logo ── */
.nav-logo         { display: none; }
.nav-logo--white  { display: block; }
header.white .nav-logo--color { display: block; }
header.white .nav-logo--white { display: none; }

header .brand {
    text-decoration: none;
    line-height: 0;
    flex-shrink: 0;
}

header .brand img {
    height: 38px;
}

/* ── Desktop nav ── */
header .navigation {
    display: flex;
    align-items: center;
}

header .navigation .navigation-items {
    display: flex;
    align-items: center;
    gap: 2px;
}

header .navigation .navigation-items a {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.025em;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: color 0.2s ease, background-color 0.2s ease;
}

header .navigation .navigation-items a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.13);
}

header.white .navigation .navigation-items a {
    color: var(--dark-color);
}

header.white .navigation .navigation-items a:hover {
    color: var(--blue-color);
    background-color: rgba(0, 159, 218, 0.07);
}

/* CTA – przywrócenie wartości .btn nadpisanych przez ogólny selektor linków */
header .navigation .navigation-items a.nav-cta {
    margin-left: 8px;
    padding: 9px 20px;
    font-size: 0.875rem;
    border-radius: 50px;
    color: #fff;
    background-color: var(--blue-color);
}

header.white .navigation .navigation-items a.nav-cta,
header.white .navigation .navigation-items a.nav-cta:hover {
    color: #fff;
    background-color: var(--blue-color);
}

/* ── Hamburger ── */
.bar {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 26px;
    cursor: pointer;
    z-index: 1001;
    flex-shrink: 0;
}

.bar .top,
.bar .middle,
.bar .bottom {
    height: 2px;
    border-radius: 2px;
    background: #fff;
    transition: transform 0.3s ease, opacity 0.3s ease, width 0.3s ease;
    transform-origin: center;
}

.bar .top    { width: 100%; }
.bar .middle { width: 100%; }
.bar .bottom { width: 60%; margin-left: auto; }

header.white .bar .top,
header.white .bar .middle,
header.white .bar .bottom { background: var(--blue-color); }

/* Hamburger → X */
.bar.open .top    { transform: translateY(7px) rotate(45deg); }
.bar.open .middle { opacity: 0; transform: scaleX(0); }
.bar.open .bottom { width: 100%; transform: translateY(-7px) rotate(-45deg); }

.bar.open .top,
.bar.open .middle,
.bar.open .bottom,
header.white .bar.open .top,
header.white .bar.open .middle,
header.white .bar.open .bottom { background: #fff; }

/* ── Elementy tylko mobilne – ukryte na desktopie ── */
.nav-mobile-head,
.nav-mobile-footer { display: none; }

/* ── Breakpointy ── */
@media (min-width: 1041px) {
    .bar               { display: none !important; }
    header .navigation { display: flex !important; }
}

@media (max-width: 1040px) {
    header, header.white { padding: 10px 24px; }

    /* Header transparentny gdy menu otwarte */
    header.menu-open {
        background: transparent !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: none !important;
    }

    .bar { display: flex; }

    /* ── Pełnoekranowe menu ── */
    header .navigation {
        display: none;
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100dvh;
        background: linear-gradient(165deg, #0c1d2c 0%, #0f2234 100%);
        z-index: 1000;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }

    header .navigation.active {
        display: flex;
        animation: menuFadeIn 0.3s ease;
    }

    /* Linki nawigacyjne */
    header .navigation .navigation-items {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0;
        gap: 0;
        width: 100%;
    }

    header .navigation .navigation-items a {
        color: rgba(255, 255, 255, 0.88);
        font-size: 1.2rem;
        font-weight: 400;
        padding: 11px 28px;
        width: 100%;
        border-radius: 12px;
        letter-spacing: 0.02em;
    }

    header .navigation .navigation-items a:hover,
    header .navigation .navigation-items a:active {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.07);
    }

    header .navigation .navigation-items a.nav-cta {
        margin-left: 0;
        margin-top: 20px;
        color: #fff;
        background-color: var(--blue-color);
        border-radius: 50px;
        font-size: 0.875rem;
        padding: 10px 28px;
        width: auto;
    }

    /* Staggered fade-in dla linków */
    header .navigation.active .navigation-items a:nth-child(1) { animation: navItemIn 0.35s ease 0.12s both; }
    header .navigation.active .navigation-items a:nth-child(2) { animation: navItemIn 0.35s ease 0.18s both; }
    header .navigation.active .navigation-items a:nth-child(3) { animation: navItemIn 0.35s ease 0.24s both; }
    header .navigation.active .navigation-items a:nth-child(4) { animation: navItemIn 0.35s ease 0.30s both; }
    header .navigation.active .navigation-items a:nth-child(5) { animation: navItemIn 0.35s ease 0.36s both; }
    header .navigation.active .navigation-items a:nth-child(6) { animation: navItemIn 0.35s ease 0.42s both; }

    /* Logo na górze */
    .nav-mobile-head {
        display: flex;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        padding: 14px 24px;
        align-items: center;
    }

    .nav-mobile-head img { height: 34px; }

    header .navigation.active .nav-mobile-head {
        animation: navItemIn 0.35s ease 0.05s both;
    }

    /* Ikony social na dole */
    .nav-mobile-footer {
        display: flex;
        position: absolute;
        bottom: 44px;
        gap: 28px;
    }

    .nav-mobile-footer a {
        color: rgba(255, 255, 255, 0.65);
        font-size: 1.3rem;
        transition: color 0.2s ease;
        text-decoration: none;
    }

    .nav-mobile-footer a:hover {
        color: rgba(255, 255, 255, 0.75);
    }

    header .navigation.active .nav-mobile-footer {
        animation: navItemIn 0.35s ease 0.48s both;
    }

    /* Nadpisanie kolorów z header.white – menu zawsze białe */
    header.white .navigation .navigation-items a {
        color: rgba(255, 255, 255, 0.88);
    }
    header.white .navigation .navigation-items a:hover,
    header.white .navigation .navigation-items a:active {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.07);
    }

    /* Overlay – tylko dla JS, bez efektów wizualnych */
    #nav-overlay { display: none !important; }
}

@keyframes menuFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes navItemIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}
