/* SprzedamBiznes.pl site header (Bolagsplatsen structure, SB logo and blue).
   The same file is used by the V3 app (wwwroot/site-header/site-header.css): keep both copies identical.
   Desktop from 1200px (below that the menu would not fit on one line), mobile header below. */

.sbh {
    --sbh-blue: #317EFF;
    --sbh-blue-dark: #1F6AE8;
    --sbh-text: #252A34;
    --sbh-muted: #6B7280;
    --sbh-line: #E6EAF0;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid var(--sbh-line);
    box-shadow: 0 2px 10px rgba(16, 24, 40, .06);
    font-family: "Open Sans", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
.sbh *, .sbh *::before, .sbh *::after { box-sizing: border-box; }
.sbh a { text-decoration: none; }
.sbh a:hover, .sbh a:focus { text-decoration: none; }
.sbh button { font-family: inherit; }
.sbh a:focus-visible, .sbh button:focus-visible { outline: 2px solid var(--sbh-blue); outline-offset: 2px; border-radius: 4px; }

.sbh-bar {
    display: flex;
    align-items: center;
    max-width: 1320px; /* as the Bootstrap 5 xxl container; wider screens keep the bar centred */
    height: 72px;
    margin: 0 auto;
    padding: 0 20px;
}
.sbh-logo { display: flex; align-items: center; flex-shrink: 0; margin-right: 20px; }
.sbh-logo img { display: block; width: auto; height: 28px; }

/* ---- Desktop menu ---- */
.sbh-nav { margin-left: auto; height: 100%; }
.sbh-menu { display: flex; align-items: stretch; height: 100%; margin: 0; padding: 0; list-style: none; gap: 14px; }
.sbh-item { position: relative; display: flex; align-items: center; }
.sbh-link, .sbh-login {
    display: inline-flex;
    align-items: center;
    padding: 6px 0;
    color: var(--sbh-text);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .01em;
    text-transform: uppercase;
    white-space: nowrap;
}
.sbh-link:hover, .sbh-link:focus, .sbh-login:hover, .sbh-login:focus,
.sbh-item.is-active > .sbh-link, .sbh-item.is-active > .sbh-caret, .sbh-item.is-open > .sbh-link { color: var(--sbh-blue); }
.sbh-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 28px;
    margin-left: 1px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--sbh-text);
    cursor: pointer;
}
.sbh-caret svg { width: 12px; height: 12px; transition: transform .15s; }
.sbh-item.is-open > .sbh-caret svg { transform: rotate(180deg); }
.sbh-item:hover > .sbh-caret { color: var(--sbh-blue); }

.sbh-badge {
    display: inline-block;
    margin-left: 7px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #DCFCE7;
    color: #166534;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
    letter-spacing: 0;
    text-transform: none;
}

/* "Wycena firmy": the label stays on the same line as the other items, the small badge sits under it
   (out of the flow, so it takes no width or height). */
.sbh-link--stack { position: relative; }
.sbh-link--stack .sbh-badge {
    position: absolute;
    top: calc(100% - 3px);
    left: 50%;
    margin: 0;
    padding: 0 6px;
    font-size: 9px;
    line-height: 1.5;
    transform: translateX(-50%);
}

.sbh-drop {
    display: none;
    position: absolute;
    top: 100%;
    left: -14px;
    z-index: 1;
    min-width: 320px;
    padding: 8px;
    border: 1px solid var(--sbh-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(16, 24, 40, .14);
}
.sbh-item.is-open > .sbh-drop { display: block; }
.sbh-drop-link { display: block; padding: 10px 12px; border-radius: 8px; color: var(--sbh-text); }
.sbh-drop-link:hover, .sbh-drop-link:focus { background: #F1F6FF; color: var(--sbh-text); }
.sbh-drop-title { display: block; font-size: 14px; font-weight: 700; }
.sbh-drop-desc { display: block; margin-top: 2px; color: var(--sbh-muted); font-size: 12.5px; }
.sbh-drop-link:hover .sbh-drop-title { color: var(--sbh-blue); }

.sbh-right { display: flex; align-items: center; flex-shrink: 0; gap: 14px; margin-left: 18px; }
.sbh-login.is-disabled { pointer-events: none; opacity: .5; }
.sbh-account { display: flex; align-items: center; gap: 10px; }
.sbh-logout { display: inline-flex; align-items: center; padding: 4px; color: var(--sbh-muted); }
.sbh-logout svg { display: block; width: 17px; height: 17px; }
.sbh-logout:hover, .sbh-logout:focus { color: var(--sbh-blue); }
.sbh-cta {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 7px;
    background: var(--sbh-blue);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .01em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color .15s;
}
.sbh-cta:hover, .sbh-cta:focus { background: var(--sbh-blue-dark); color: #fff; }

/* Sizes step up with the width so the menu always stays on one line (checked at 1200, 1280, 1366, 1440 and 1920px). */
@media (min-width: 1280px) {
    .sbh-logo img { height: 30px; }
    .sbh-menu { gap: 17px; }
    .sbh-link, .sbh-login, .sbh-cta { font-size: 13px; }
    .sbh-right { gap: 16px; margin-left: 22px; }
    .sbh-cta { padding: 10px 16px; }
}
@media (min-width: 1440px) {
    .sbh-bar { padding: 0 24px; }
    .sbh-logo img { height: 32px; }
    .sbh-menu { gap: 19px; }
    .sbh-link, .sbh-login, .sbh-cta { font-size: 14px; letter-spacing: .01em; }
    .sbh-right { gap: 20px; margin-left: 24px; }
    .sbh-cta { padding: 10px 18px; }
}

/* Logged in: "Moje konto" and the logout icon are wider than "Zaloguj", so everything is set a little tighter. */
.sbh--auth .sbh-logo img { height: 26px; }
.sbh--auth .sbh-menu { gap: 11px; }
.sbh--auth .sbh-link, .sbh--auth .sbh-login, .sbh--auth .sbh-cta { font-size: 11.5px; letter-spacing: 0; }
.sbh--auth .sbh-right { gap: 10px; margin-left: 14px; }
@media (min-width: 1280px) {
    .sbh--auth .sbh-logo img { height: 28px; }
    .sbh--auth .sbh-menu { gap: 13px; }
    .sbh--auth .sbh-link, .sbh--auth .sbh-login, .sbh--auth .sbh-cta { font-size: 12.5px; }
    .sbh--auth .sbh-right { gap: 12px; margin-left: 18px; }
}
@media (min-width: 1440px) {
    .sbh--auth .sbh-logo img { height: 30px; }
    .sbh--auth .sbh-menu { gap: 14px; }
    .sbh--auth .sbh-link, .sbh--auth .sbh-login, .sbh--auth .sbh-cta { font-size: 14px; }
    .sbh--auth .sbh-right { gap: 12px; margin-left: 16px; }
}

/* ---- Mobile header and menu panel ---- */
.sbh-burger, .sbh-panel { display: none; }

@media (max-width: 1199.98px) {
    .sbh-bar { height: 64px; padding: 0 16px; }
    .sbh-nav, .sbh-login, .sbh-account { display: none; }
    .sbh-logo img { height: 28px; }
    .sbh-right { margin-left: auto; gap: 0; }
    .sbh-cta { padding: 9px 14px; font-size: 12px; }

    .sbh-burger {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        margin: 0 10px 0 -8px;
        padding: 0 8px;
        border: 0;
        background: none;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
        align-items: stretch;
    }
    /* Explicit width: iOS Safari does not stretch the lines inside a <button> (they were 0 px wide there). */
    .sbh-burger span { display: block; width: 24px; height: 2px; flex: 0 0 2px; border-radius: 2px; background: var(--sbh-text); transition: transform .2s, opacity .2s; }
    .sbh-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .sbh-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
    .sbh-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .sbh-panel {
        display: block;
        position: fixed;
        top: 64px;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 1029;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 4px 16px 32px;
        border-top: 1px solid var(--sbh-line);
        background: #fff;
    }
    .sbh-panel[hidden] { display: none; }
    .sbh-plist, .sbh-psub { margin: 0; padding: 0; list-style: none; }
    .sbh-pitem { border-bottom: 1px solid #EEF1F5; }
    .sbh-plink, .sbh-acc {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 15px 2px;
        border: 0;
        background: none;
        color: var(--sbh-text);
        font-size: 15px;
        font-weight: 700;
        text-align: left;
        cursor: pointer;
    }
    .sbh-plink:hover, .sbh-plink:focus, .sbh-acc:hover { color: var(--sbh-blue); }
    .sbh-pitem.is-active > .sbh-plink, .sbh-pitem.is-active > .sbh-acc { color: var(--sbh-blue); }
    .sbh-plink .sbh-badge { margin-left: auto; margin-right: 10px; }
    .sbh-arrow { margin-left: auto; color: #9CA3AF; font-size: 20px; font-weight: 400; line-height: 1; }
    .sbh-plink .sbh-badge + .sbh-arrow { margin-left: 0; }
    .sbh-acc svg { width: 14px; height: 14px; margin-left: auto; color: var(--sbh-muted); transition: transform .15s; }
    .sbh-acc[aria-expanded="true"] svg { transform: rotate(180deg); }
    .sbh-psub { padding: 0 0 10px 12px; }
    .sbh-psub[hidden] { display: none; }
    .sbh-psub a { display: block; padding: 9px 2px; color: #4B5563; font-size: 14px; }
    .sbh-psub a:hover, .sbh-psub a:focus { color: var(--sbh-blue); }
    .sbh-pfoot { padding-top: 18px; color: #4B5563; font-size: 14px; }
    .sbh-pfoot p { margin: 0 0 10px; }
    .sbh-pfoot a { color: #4B5563; }
    .sbh-pfoot a:hover, .sbh-pfoot a:focus { color: var(--sbh-blue); }
    .sbh-pfoot .sbh-sep { margin: 0 6px; color: #9CA3AF; }
}

@media (max-width: 420px) {
    .sbh-logo img { height: 24px; }
    .sbh-cta { padding: 8px 11px; font-size: 11.5px; }
}

/* Anchor jumps (e.g. /cennik#nieruchomosci-komercyjne) stop below the sticky header. */
html:has([data-sbh]) { scroll-padding-top: 88px; }
@media (max-width: 1199.98px) { html:has([data-sbh]) { scroll-padding-top: 76px; } }

/* Page scroll locked while the mobile menu is open. */
/* Lock only <html>: overflow on body too makes body its own scroll container and the sticky header jumps to the page top. */
html.sbh-locked { overflow: hidden; }
