/* ==========================================
Header
========================================== */

.site-header {
    position: relative;
    z-index: 1000;
    width: 100%;
    border-bottom: 0;
    background: transparent;
}

/* Miękkie przejście od góry w główne tło strony */
.site-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(
        to bottom,
        rgba(3, 11, 22, .96) 0%,
        rgba(3, 11, 22, .82) 28%,
        rgba(3, 11, 22, .48) 58%,
        rgba(3, 11, 22, 0) 100%
    );
    pointer-events: none;
    z-index: -1;
}

/* Delikatny glow przy samej górze */
.site-header::after {
    content: "";
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(77, 124, 255, .18),
        rgba(242, 140, 40, .08),
        transparent
    );
    pointer-events: none;
}

/* ==========================================
Header Inner
========================================== */

.header-inner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: var(--header-height);
    gap: 0;
    padding: 0 2rem;
}

/* ==========================================
Logo
========================================== */

.header-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-right: 4rem;
    text-decoration: none;
}

.header-logo img {
    display: block;
    width: 160px;
    height: auto;
}

/* ==========================================
Navigation
========================================== */

.header-navigation {
    display: flex;
    align-items: center;
    margin-left: 0;
}


/* Lista generowana przez wp_nav_menu */

.header-menu {
    display: flex;
    align-items: center;

    gap: 2.3rem;

    margin: 0;
    padding: 0;

    list-style: none;
}

.header-menu > li {
    position: relative;
}

.header-menu a {
    position: relative;
    display: block;

    color: rgba(255, 255, 255, .82);

    font-size: .9rem;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;

    transition: color .25s ease;
}

.header-menu > li > a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -.55rem;
    width: 0;
    height: 1px;
    background: var(--color-primary);
    transition: width .25s ease;
}

.header-menu a:hover {
    color: #fff;
}

.header-menu > li > a:hover::after {
    width: 100%;
}


/* Pozycja aktywna */

.header-menu .current-menu-item > a,
.header-menu .current-menu-parent > a,
.header-menu .current-menu-ancestor > a {
    color: #fff;
}

.header-menu .current-menu-item > a::after,
.header-menu .current-menu-parent > a::after,
.header-menu .current-menu-ancestor > a::after {
    width: 100%;
}


/* ==========================================
Submenu
========================================== */

.header-menu .sub-menu {
    position: absolute;
    top: calc(100% + 1.4rem);
    left: 50%;
    z-index: 200;

    display: flex;
    flex-direction: column;

    gap: .25rem;

    min-width: 220px;

    margin: 0;
    padding: .75rem;

    list-style: none;

    border: 1px solid rgba(77, 124, 255, .28);
    border-radius: 14px;

    background: linear-gradient(
        145deg,
        rgba(16, 35, 72, .97),
        rgba(5, 15, 32, .99)
    );

    box-shadow: 0 20px 45px rgba(0, 0, 0, .35);

    opacity: 0;
    visibility: hidden;

    transform: translateX(-50%) translateY(-8px);

    transition:
        opacity .25s ease,
        visibility .25s ease,
        transform .25s ease;
}


/* mostek, żeby menu nie znikało przy przejściu myszą */

.header-menu > li:has(.sub-menu)::before {
    content: "";

    position: absolute;
    top: 100%;
    left: 0;
    right: 0;

    height: 1.4rem;
}

.header-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;

    transform: translateX(-50%) translateY(0);
}

.header-menu .sub-menu a {
    padding: .65rem .85rem;

    border-radius: 8px;

    font-size: .88rem;
    white-space: normal;

    transition:
        background .25s ease,
        color .25s ease;
}

.header-menu .sub-menu a::after {
    display: none;
}

.header-menu .sub-menu a:hover {
    background: rgba(77, 124, 255, .12);

    color: #fff;
}

/* ==========================================
Right Actions
========================================== */

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-left: auto;
}

/* ==========================================
Socials
========================================== */

.header-socials {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.header-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    opacity: .85;
    transition:
        opacity .25s ease,
        transform .25s ease;
}

.header-socials a:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.header-socials img {
    display: block;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* ==========================================
Consultation CTA
========================================== */

.header-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: .65rem 1.2rem .65rem 1.4rem;

    border: 1px solid var(--color-primary);
    border-radius: 999px;

    color: #fff;
    font-size: .8rem;
    font-weight: 500;
    text-decoration: none;

    box-shadow:
        0 0 18px rgba(77,124,255,.08);

    transition:
        background .25s ease,
        box-shadow .25s ease,
        transform .25s ease;
}

.header-cta:hover {
    background: rgba(77,124,255,.08);

    box-shadow:
        0 0 25px rgba(77,124,255,.18);

    transform: translateY(-1px);
}

.header-cta-arrow {
    color: var(--color-primary);
    font-size: 1.25rem;
    line-height: 1;
    transition: transform .25s ease;
}

.header-cta:hover .header-cta-arrow {
    transform: translateX(4px);
}

/* ==========================================
Mobile Menu Button
========================================== */

.header-menu-toggle {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;

    width: 46px;
    height: 46px;
    padding: 0;

    border: 1px solid rgba(255,255,255,.1);
    border-radius: 10px;
    background: rgba(255,255,255,.02);

    cursor: pointer;

    transition:
        border-color .25s ease,
        background .25s ease;
}

.header-menu-toggle:hover {
    border-color: rgba(77,124,255,.5);
    background: rgba(77,124,255,.05);
}

.header-menu-toggle span {
    display: block;
    width: 20px;
    height: 1px;
    background: rgba(255,255,255,.85);
    transition:
        transform .3s ease,
        opacity .3s ease;
}

/* ==========================================
   Responsive
========================================== */

@media (max-width: 1100px) {

    .header-inner {
        padding: 0 1.5rem;
    }

    .header-logo {
        margin-right: 2rem;
    }

    .header-menu {
        gap: 1.5rem;
    }

     .header-socials {
        gap: .5rem;
    }

    .header-cta {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}


/* ==========================================
   Tablet
========================================== */

@media (max-width: 900px) {

    .header-navigation {
        display: none;
    }

    .header-actions {
        gap: .75rem;
    }

    .header-socials {
        display: none;
    }

    .header-cta {
        display: none;
    }
}


/* ==========================================
   Mobile
========================================== */

@media (max-width: 600px) {

    .header-inner {
        min-height: 68px;
        padding: 0 1rem;
    }

    .header-logo {
        margin-right: 0;
    }

    .header-logo img {
        width: 125px;
        height: auto;
    }

    .header-actions {
        display: flex;
        align-items: center;
        gap: 0;
    }

    .header-socials,
    .header-cta {
        display: none;
    }

    .header-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 40px;
        height: 40px;
    }
}


/* ==========================================
   Small mobile
========================================== */

@media (max-width: 400px) {

    .header-inner {
        min-height: 64px;
        padding: 0 .85rem;
    }

    .header-logo img {
        width: 115px;
    }

    .header-menu-toggle {
        width: 38px;
        height: 38px;
    }
}

/* ==========================================
   Mobile Menu — Open
========================================== */

@media (max-width: 900px) {

    .site-header.menu-open .header-navigation {
        position: absolute;

        top: 100%;
        left: 0;
        right: 0;

        display: block;

        margin: 0;
        padding: .75rem 1.25rem 1.25rem;

        border-top: 1px solid rgba(255,255,255,.06);

        background: rgba(3,11,22,.98);

        box-shadow:
            0 20px 40px rgba(0,0,0,.3);

        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;

        z-index: 999;
    }

    .site-header.menu-open .header-menu {
        flex-direction: column;
        align-items: stretch;

        gap: 0;

        width: 100%;
    }

    .site-header.menu-open .header-menu > li {
        border-bottom: 1px solid rgba(255,255,255,.06);
    }

    .site-header.menu-open .header-menu > li:last-child {
        border-bottom: 0;
    }

    .site-header.menu-open .header-menu a {
        display: flex;
        align-items: center;

        min-height: 52px;

        padding: .8rem .25rem;

        color: rgba(255,255,255,.82);

        font-size: .95rem;
    }

    .site-header.menu-open .header-menu a::after {
        display: none;
    }


    /* Podmenu rozwinięte na stałe */

    .site-header.menu-open .header-menu .sub-menu {
        position: static;

        min-width: 0;

        margin: 0 0 .75rem 1rem;
        padding: 0 0 0 1rem;

        border: 0;
        border-left: 1px solid rgba(77, 124, 255, .3);
        border-radius: 0;

        background: transparent;
        box-shadow: none;

        opacity: 1;
        visibility: visible;

        transform: none;
    }

    .site-header.menu-open .header-menu .sub-menu a {
        min-height: 44px;

        padding: .55rem .25rem;

        font-size: .9rem;
    }


    /* Hamburger → X */

    .site-header.menu-open .header-menu-toggle span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .site-header.menu-open .header-menu-toggle span:nth-child(2) {
        opacity: 0;
    }

    .site-header.menu-open .header-menu-toggle span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

}