/* =====================================================
   HEADER
===================================================== */

.site-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background .3s ease, border-color .3s ease;
}

.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 45px 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    width: 25%;
}

.header-center {
    width: 50%;
}

.header-right {
    width: 25%;
}

.header-logo img {
    height: 70px;
    width: auto;
    max-width: 320px;
    display: block;
}

.header-nav {
    display: flex;
    justify-content: center;
    gap: 50px;
}

.header-actions {
    display: flex;
    justify-content: flex-end;
    gap: 30px;
}

.header-cart-link {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.header-cart-count {
    white-space: nowrap;
}

.header-menu-toggle {
    display: none;
}

.header-mobile-nav {
    display: none;
}

.header-nav a,
.header-actions a {
    text-decoration: none;
    color: #f5f0e8;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color .25s ease;
}

.header-nav a:hover,
.header-actions a:hover {
    color: #e4cfa9;
}


/* =====================================================
   HEADER — jasne podstrony
   Na stronie głównej zostaje biały/transparentny.
   Na podstronach robimy ciemne menu na jasnym tle.
===================================================== */

body:not(.home) .site-header {
    background: rgba(244, 238, 231, .96) !important;
    border-bottom: 1px solid rgba(45, 41, 38, .08) !important;
    backdrop-filter: blur(18px);
}

body:not(.home) .header-nav a,
body:not(.home) .header-actions a {
    color: #2d2926 !important;
}

body:not(.home) .header-nav a:hover,
body:not(.home) .header-actions a:hover {
    color: #8f745c !important;
}

/* Tymczasowe przyciemnienie jasnego logo na podstronach */
body:not(.home) .header-logo img {
    filter: invert(1) brightness(.35) sepia(.18) saturate(.7) !important;
    opacity: .88 !important;
}


/* =====================================================
   HEADER — WooCommerce / konto / koszyk / dokumenty
   Dodatkowe zabezpieczenie, gdy WordPress nie doda klasy .home
===================================================== */

body.woocommerce-cart .site-header,
body.woocommerce-checkout .site-header,
body.woocommerce-account .site-header,
body.page-template-default .site-header,
body.page .site-header {
    background: rgba(244, 238, 231, .96) !important;
    border-bottom: 1px solid rgba(45, 41, 38, .08) !important;
    backdrop-filter: blur(18px);
}

body.woocommerce-cart .header-nav a,
body.woocommerce-cart .header-actions a,
body.woocommerce-checkout .header-nav a,
body.woocommerce-checkout .header-actions a,
body.woocommerce-account .header-nav a,
body.woocommerce-account .header-actions a,
body.page-template-default .header-nav a,
body.page-template-default .header-actions a,
body.page .header-nav a,
body.page .header-actions a {
    color: #2d2926 !important;
}

body.woocommerce-cart .header-logo img,
body.woocommerce-checkout .header-logo img,
body.woocommerce-account .header-logo img,
body.page-template-default .header-logo img,
body.page .header-logo img {
    filter: invert(1) brightness(.35) sepia(.18) saturate(.7) !important;
    opacity: .88 !important;
}

/* HEADER — finalna korekta podstron */

body:not(.home) .site-header,
body.page .site-header,
body.woocommerce-cart .site-header,
body.woocommerce-checkout .site-header,
body.woocommerce-account .site-header {
    background: rgba(244, 238, 231, .97) !important;
    border-bottom: 1px solid rgba(45, 41, 38, .07) !important;
    backdrop-filter: blur(16px) !important;
}

body:not(.home) .header-inner,
body.page .header-inner,
body.woocommerce-cart .header-inner,
body.woocommerce-checkout .header-inner,
body.woocommerce-account .header-inner {
    max-width: 1480px !important;
    padding: 24px 52px !important;
}

body:not(.home) .header-logo img,
body.page .header-logo img,
body.woocommerce-cart .header-logo img,
body.woocommerce-checkout .header-logo img,
body.woocommerce-account .header-logo img {
    height: 48px !important;
    max-width: 260px !important;
}

body:not(.home) .header-nav,
body.page .header-nav,
body.woocommerce-cart .header-nav,
body.woocommerce-checkout .header-nav,
body.woocommerce-account .header-nav {
    gap: 38px !important;
}

body:not(.home) .header-actions,
body.page .header-actions,
body.woocommerce-cart .header-actions,
body.woocommerce-checkout .header-actions,
body.woocommerce-account .header-actions {
    gap: 24px !important;
}

body:not(.home) .header-nav a,
body:not(.home) .header-actions a,
body.page .header-nav a,
body.page .header-actions a,
body.woocommerce-cart .header-nav a,
body.woocommerce-cart .header-actions a,
body.woocommerce-checkout .header-nav a,
body.woocommerce-checkout .header-actions a,
body.woocommerce-account .header-nav a,
body.woocommerce-account .header-actions a {
    font-size: 11px !important;
    letter-spacing: 2.2px !important;
    color: #2d2926 !important;
}


/* ODDECH POD HEADEREM — kategorie i podstrony z obrazem */

body:not(.home) .category-page {
    padding-top: 118px !important;
}

body:not(.home) .category-hero {
    margin-top: 34px !important;
}

/* =========================================
   HEADER MOBILE/TABLET NAV — FINAL PREMIUM
   real class: .header-mobile-nav
========================================= */

@media (max-width: 1180px) {

    /* Nie pozwalamy desktopowej nawigacji robić panelu */
    .header-center .header-nav,
    body.menu-open .header-nav,
    body.mobile-menu-open .header-nav,
    body.nav-open .header-nav,
    body.header-menu-open .header-nav {
        display: none !important;
    }

    body.menu-open,
    body.mobile-menu-open,
    body.nav-open,
    body.header-menu-open {
        overflow: hidden !important;
    }

    /* Delikatne przyciemnienie tła po otwarciu menu */
    body.menu-open .site-header::before,
    body.mobile-menu-open .site-header::before,
    body.nav-open .site-header::before,
    body.header-menu-open .site-header::before {
        content: "" !important;
        position: fixed !important;
        inset: 0 !important;
        background: rgba(26, 22, 19, .34) !important;
        backdrop-filter: blur(8px) !important;
        -webkit-backdrop-filter: blur(8px) !important;
        z-index: 99980 !important;
    }

    /* Właściwy panel menu */
    .header-mobile-nav {
        position: fixed !important;
        top: 98px !important;
        left: 50% !important;

        width: min(720px, calc(100vw - 52px)) !important;
        max-width: calc(100vw - 52px) !important;

        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 0 !important;

        padding: 24px 30px !important;
        margin: 0 !important;

        background: rgba(245, 242, 238, .97) !important;
        border: 1px solid rgba(45, 41, 38, .10) !important;
        border-radius: 24px !important;
        box-shadow: 0 24px 80px rgba(28, 24, 21, .22) !important;

        transform: translateX(-50%) translateY(-14px) !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;

        z-index: 99999 !important;
        overflow: hidden !important;

        transition:
            opacity .28s ease,
            visibility .28s ease,
            transform .28s ease !important;
    }

    body.menu-open .header-mobile-nav,
    body.mobile-menu-open .header-mobile-nav,
    body.nav-open .header-mobile-nav,
    body.header-menu-open .header-mobile-nav,
    .header-mobile-nav.is-open,
    .header-mobile-nav.active,
    .header-mobile-nav.open {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: translateX(-50%) translateY(0) !important;
    }

    .header-mobile-nav a {
        width: 100% !important;

        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;

        padding: 20px 0 !important;
        margin: 0 !important;

        border-bottom: 1px solid rgba(45, 41, 38, .09) !important;

        color: #2d2926 !important;
        text-decoration: none !important;
        text-transform: uppercase !important;

        font-size: 22px !important;
        line-height: 1.15 !important;
        letter-spacing: .18em !important;
        font-weight: 400 !important;
    }

    .header-mobile-nav a:last-child {
        border-bottom: 0 !important;
    }

    .header-mobile-nav a::after {
        content: "→" !important;
        font-size: 18px !important;
        letter-spacing: 0 !important;
        opacity: .45 !important;
        transform: translateX(0) !important;
        transition: transform .22s ease, opacity .22s ease !important;
    }

    .header-mobile-nav a:hover::after {
        opacity: .9 !important;
        transform: translateX(5px) !important;
    }

    /* Hamburger / X */
    .header-menu-toggle {
        width: 42px !important;
        height: 42px !important;

        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;

        border: 1px solid rgba(255, 255, 255, .18) !important;
        border-radius: 999px !important;
        background: rgba(255, 255, 255, .08) !important;

        color: inherit !important;
        cursor: pointer !important;

        position: relative !important;
        z-index: 100000 !important;
    }

    body:not(.home) .header-menu-toggle {
        border-color: rgba(45, 41, 38, .12) !important;
        background: rgba(255, 255, 255, .28) !important;
        color: #2d2926 !important;
    }

    body.home .header-menu-toggle {
        color: #f5f0e8 !important;
    }

    .header-actions {
        position: relative !important;
        z-index: 100000 !important;
    }
}


/* Mobile ciaśniej */

@media (max-width: 768px) {

    .header-mobile-nav {
        top: 82px !important;
        width: calc(100vw - 28px) !important;
        max-width: calc(100vw - 28px) !important;
        padding: 18px 22px !important;
        border-radius: 18px !important;
    }

    .header-mobile-nav a {
        font-size: 18px !important;
        letter-spacing: .15em !important;
        padding: 16px 0 !important;
    }

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

/* =========================================
   HEADER MOBILE/TABLET NAV — mniejszy panel premium
========================================= */

@media (min-width: 769px) and (max-width: 1180px) {

    .header-mobile-nav {
        top: 94px !important;
        left: auto !important;
        right: 42px !important;

        width: 390px !important;
        max-width: calc(100vw - 84px) !important;

        padding: 18px 24px !important;

        border-radius: 16px !important;
        background: rgba(245, 242, 238, .96) !important;
        box-shadow: 0 18px 46px rgba(28, 24, 21, .16) !important;

        transform: translateY(-10px) !important;
    }

    body.menu-open .header-mobile-nav,
    body.mobile-menu-open .header-mobile-nav,
    body.nav-open .header-mobile-nav,
    body.header-menu-open .header-mobile-nav,
    .header-mobile-nav.is-open,
    .header-mobile-nav.active,
    .header-mobile-nav.open {
        transform: translateY(0) !important;
    }

    .header-mobile-nav a {
        padding: 15px 0 !important;
        font-size: 15px !important;
        line-height: 1.2 !important;
        letter-spacing: .22em !important;
    }

    .header-mobile-nav a::after {
        font-size: 15px !important;
        opacity: .35 !important;
    }

    body.menu-open .site-header::before,
    body.mobile-menu-open .site-header::before,
    body.nav-open .site-header::before,
    body.header-menu-open .site-header::before {
        background: rgba(26, 22, 19, .18) !important;
        backdrop-filter: blur(3px) !important;
        -webkit-backdrop-filter: blur(3px) !important;
    }
}


/* Telefon — nadal kompaktowo, ale na całą wygodną szerokość */

@media (max-width: 768px) {

    .header-mobile-nav {
        top: 78px !important;
        left: 50% !important;
        right: auto !important;

        width: calc(100vw - 32px) !important;
        max-width: 360px !important;

        padding: 16px 20px !important;
        border-radius: 15px !important;

        transform: translateX(-50%) translateY(-10px) !important;
    }

    body.menu-open .header-mobile-nav,
    body.mobile-menu-open .header-mobile-nav,
    body.nav-open .header-mobile-nav,
    body.header-menu-open .header-mobile-nav,
    .header-mobile-nav.is-open,
    .header-mobile-nav.active,
    .header-mobile-nav.open {
        transform: translateX(-50%) translateY(0) !important;
    }

    .header-mobile-nav a {
        padding: 14px 0 !important;
        font-size: 15px !important;
        letter-spacing: .18em !important;
    }

    .header-mobile-nav a::after {
        font-size: 14px !important;
    }
}

/* =========================================================
   HEADER — logo final size fix
========================================================= */

.swiat-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 220px;
    max-width: 220px;
    flex-shrink: 0;
    line-height: 0;
}

.swiat-logo-img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}


/* tablet */

@media (max-width: 1024px) {
    .swiat-logo-link {
        width: 200px;
        max-width: 200px;
    }
}


/* mobile */

@media (max-width: 767px) {
    .swiat-logo-link {
        width: 170px;
        max-width: 170px;
    }
}

/* =========================================================
   HEADER — logo final hard reset
========================================================= */

.site-header-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 250px !important;
    max-width: 250px !important;
    min-width: 0 !important;
    height: auto !important;
    line-height: 0 !important;
    flex: 0 0 250px !important;
    overflow: visible !important;
}

.site-header-logo__img {
    display: block !important;
    width: 250px !important;
    max-width: 250px !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
}


/* Home — logo jasne, ale ten sam rozmiar */

.home .site-header-logo,
.front-page .site-header-logo {
    width: 250px !important;
    max-width: 250px !important;
    flex-basis: 250px !important;
}

.home .site-header-logo__img,
.front-page .site-header-logo__img {
    width: 250px !important;
    max-width: 250px !important;
    height: auto !important;
}


/* Tablet */

@media (max-width: 1024px) {
    .site-header-logo {
        width: 210px !important;
        max-width: 210px !important;
        flex-basis: 210px !important;
    }

    .site-header-logo__img {
        width: 210px !important;
        max-width: 210px !important;
    }
}


/* Mobile */

@media (max-width: 767px) {
    .site-header-logo {
        width: 170px !important;
        max-width: 170px !important;
        flex-basis: 170px !important;
    }

    .site-header-logo__img {
        width: 170px !important;
        max-width: 170px !important;
    }
}

/* =========================================================
   HEADER — logo final reset
========================================================= */

.site-header .site-header-logo {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 260px !important;
    max-width: 260px !important;
    flex: 0 0 260px !important;
    line-height: 0 !important;
    overflow: visible !important;
}

.site-header .site-header-logo__img {
    display: block !important;
    width: 260px !important;
    max-width: 260px !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
}


/* Tablet */

@media (max-width: 1024px) {
    .site-header .site-header-logo {
        width: 210px !important;
        max-width: 210px !important;
        flex-basis: 210px !important;
    }

    .site-header .site-header-logo__img {
        width: 210px !important;
        max-width: 210px !important;
    }
}


/* Mobile */

@media (max-width: 767px) {
    .site-header .site-header-logo {
        width: 170px !important;
        max-width: 170px !important;
        flex-basis: 170px !important;
    }

    .site-header .site-header-logo__img {
        width: 170px !important;
        max-width: 170px !important;
    }
}