/* Header compartido: conserva su espacio para evitar saltos al cambiar de estilo. */
:root {
    --sticky-header-height: 147px;
    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 {
    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 {
    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: 78px;
    height: 52px;
}

@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: 110px;
    }

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

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

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

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

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

    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;
    }
}
