/* Header compartido: conserva su espacio para evitar saltos al cambiar de estilo. */
:root {
    --sticky-header-height: 116px;
    scroll-padding-top: calc(var(--sticky-header-height) + 18px);
}

body>header {
    display: flow-root;
    position: sticky;
    top: 0;
    z-index: 1030;
    height: var(--sticky-header-height);
    background: #fff;
    pointer-events: none;
    transition: background-color 240ms ease;
}

body>header>.navbar {
    min-height: var(--sticky-header-height);
    padding-top: 14px;
    padding-bottom: 14px;
    pointer-events: auto;
    transition: margin 240ms ease, padding 240ms ease, min-height 240ms ease,
        border-radius 240ms ease, background-color 240ms ease, box-shadow 240ms ease;
}

body>header .brand img:first-child {
    width: 250px;
    max-width: 100%;
    height: auto;
    transition: width 240ms ease, height 240ms ease;
}

body>header.is-scrolled {
    background: transparent;
}

body>header.is-scrolled>.navbar {
    min-height: 72px;
    margin: 14px clamp(16px, 3.8vw, 74px) 0;
    padding: 6px 24px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 36px;
    background: rgba(255, 255, 255, 0.68);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    box-shadow: 0 8px 32px rgba(18, 22, 70, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body>header.is-scrolled .brand img:first-child {
    width: 210px;
    height: auto;
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body>header.is-scrolled>.navbar {
        background: rgba(255, 255, 255, 0.97);
    }
}

@media (max-width: 1599px) {
    :root {
        --sticky-header-height: 90px;
    }

    body>header .brand img:first-child {
        width: 210px;
        height: auto;
    }

    body>header.is-scrolled .brand img:first-child {
        width: 185px;
        height: auto;
    }

    body>header.is-scrolled>.navbar {
        min-height: 64px;
        padding: 5px 18px;
    }
}

@media (max-width: 767px) {
    :root {
        --sticky-header-height: 70px;
    }

    body>header>.navbar {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    body>header.is-scrolled>.navbar {
        margin: 10px 12px 0;
        min-height: 56px;
        padding: 4px 14px;
        border-radius: 25px;
        gap: 10px;
    }

    body>header .brand img:first-child {
        width: 170px;
        height: auto;
    }

    body>header.is-scrolled .brand img:first-child {
        width: 155px;
        height: auto;
    }

    body>header.is-scrolled .nav-links {
        top: calc(100% + 8px);
        border: 1px solid rgba(255, 255, 255, 0.8);
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.88);
        -webkit-backdrop-filter: blur(22px) saturate(160%);
        backdrop-filter: blur(22px) saturate(160%);
        box-shadow: 0 12px 32px rgba(18, 22, 70, 0.15);
        max-height: calc(100dvh - 110px);
        overflow-y: auto;
    }
}

@media (prefers-reduced-motion: reduce) {

    body>header,
    body>header>.navbar,
    body>header .brand img {
        transition: none;
    }
}
