/* Header: overlays the hero by default, becomes a solid bar (.plain) when the page does not start with a hero. */

.site-header {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    z-index: 20;
    color: var(--header-text);
}

.site-header.plain {
    position: static;
    background: var(--header-background);
}

.bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 32px;
    padding-top: 22px;
    padding-bottom: 22px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--header-text);
    text-decoration: none;
    font: 800 20px/1 var(--font-h2, var(--font-main));
    font-stretch: 118%;
    letter-spacing: -0.01em;
}

.brand:hover {
    color: var(--color-white);
}

.brand-mark {
    width: 26px;
    height: 26px;
    background: var(--color-accent);
    clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%);
}

.brand-logo {
    width: auto;
    height: 36px;
    max-width: 220px;
    object-fit: contain;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 28px;
    font-size: 15px;
    font-weight: 500;
}

.nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav a {
    color: var(--header-text);
    text-decoration: none;
    padding: 6px 0;
}

.nav a:hover {
    color: var(--header-text-hover);
}

/* Sub menu: opens on hover and on keyboard focus */
.has-sub {
    position: relative;
}

.sub {
    position: absolute;
    top: 100%;
    left: -16px;
    z-index: 30;
    min-width: max-content;
    margin: 0;
    padding: 8px 16px;
    list-style: none;
    background: var(--header-background);
    border: 1px solid var(--header-divider);
    border-radius: var(--radius);
    visibility: hidden;
    opacity: 0;
    transition: opacity var(--transition), visibility var(--transition);
}

.has-sub:hover > .sub,
.has-sub:focus-within > .sub {
    visibility: visible;
    opacity: 1;
}

.sub a {
    display: block;
    padding: 8px 0;
}

/* Language switcher: native <details>, no script needed */
.language-switcher {
    position: relative;
    font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace);
    font-size: 14px;
}

.language-switcher summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--header-border);
    border-radius: var(--radius-sm);
    color: var(--header-text);
    cursor: pointer;
    list-style: none;
}

.language-switcher summary::-webkit-details-marker {
    display: none;
}

.language-switcher summary::after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.language-switcher__list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 30;
    min-width: 100%;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: var(--header-background);
    border: 1px solid var(--header-divider);
    border-radius: var(--radius);
}

.language-switcher__list a {
    display: block;
    padding: 8px 14px;
    white-space: nowrap;
}

.bar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tel {
    font-family: var(--font-mono, ui-monospace, Menlo, Consolas, monospace);
    font-size: 14px;
    color: var(--header-phone);
    text-decoration: none;
}

.tel:hover {
    color: var(--color-white);
}

.nav-toggle {
    display: none;
    min-height: 44px;
    padding: 0 16px;
    background: transparent;
    color: var(--header-text);
    border: 1px solid var(--header-border);
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 15px;
    cursor: pointer;
}

@media (max-width: 860px) {
    .nav-toggle {
        display: inline-flex;
        align-items: center;
    }

    .js .nav {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: var(--header-background);
        border-radius: var(--radius);
        padding: 8px 16px;
        order: 5;
    }

    .js .nav.open {
        display: flex;
    }

    .js .nav-list {
        flex-direction: column;
        gap: 0;
    }

    .js .nav a {
        display: block;
        padding: 14px 0;
        border-bottom: 1px solid var(--header-divider);
    }

    .sub {
        position: static;
        visibility: visible;
        opacity: 1;
        padding: 0 0 0 16px;
        border: 0;
        min-width: 0;
    }

    .language-switcher {
        padding: 12px 0;
    }

    .language-switcher__list {
        position: static;
        margin-top: 6px;
    }

    .bar-actions {
        display: none;
    }

    .plain .bar-actions {
        display: flex;
    }
}
