html {
    scroll-padding-top: 124px;
}

body {
    padding-top: 112px;
}

.site-header {
    position: fixed;
    z-index: 1000;
    top: 16px;
    left: 50%;
    width: min(1600px, calc(100% - 36px));
    margin: 0;
    transform: translateX(-50%) scale(1);
    border: 1px solid rgba(29, 61, 91, .12);
    border-radius: 999px;
    background: rgba(250, 252, 255, .9);
    box-shadow: 0 14px 42px rgba(25, 53, 79, .12);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    transition: transform .24s ease, top .24s ease, width .24s ease, box-shadow .24s ease;
}

.nav-wrap--floating {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: clamp(16px, 2vw, 32px);
    width: 100%;
    max-width: none;
    min-height: 84px;
    box-sizing: border-box;
    padding: 12px clamp(18px, 2.6vw, 42px);
    transition: min-height .24s ease, padding .24s ease;
}

.header-links {
    display: flex;
    align-items: center;
    gap: clamp(12px, 1.7vw, 28px);
    min-width: 0;
}

.header-links--left {
    grid-column: 1;
    justify-content: flex-start;
}

.header-links--right {
    grid-column: 3;
    justify-content: flex-end;
}

.site-header .header-links a {
    color: #526b82;
    font-size: clamp(.82rem, .9vw, .96rem);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: color .18s ease, opacity .18s ease;
}

.site-header .header-links a:hover,
.site-header .header-links a[aria-current="page"] {
    color: #173654;
}

.header-brand {
    grid-column: 2;
    justify-self: center;
    margin: 0;
    line-height: 0;
}

.header-brand img {
    display: block;
    width: clamp(122px, 9vw, 158px);
    height: auto;
    transition: width .24s ease;
}

.nav-mobile-only {
    display: none !important;
}

.site-header.is-compact {
    top: 8px;
    transform: translateX(-50%) scale(.97);
    box-shadow: 0 10px 30px rgba(25, 53, 79, .15);
}

.site-header.is-compact .nav-wrap--floating {
    min-height: 64px;
    padding-top: 7px;
    padding-bottom: 7px;
}

.site-header.is-compact .header-brand img {
    width: clamp(108px, 7.5vw, 132px);
}

@media (max-width: 1120px) {
    html {
        scroll-padding-top: 96px;
    }

    body {
        padding-top: 90px;
    }

    .site-header {
        top: 10px;
        width: calc(100% - 24px);
        border-radius: 26px;
    }

    .nav-wrap--floating {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        min-height: 68px;
        gap: 8px;
        padding: 8px 14px;
    }

    .header-links--left {
        display: none;
    }

    .header-brand img {
        width: clamp(116px, 22vw, 142px);
    }

    .site-header .menu-toggle {
        position: static;
        display: flex;
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin: 0;
        padding: 10px;
        border: 0;
        border-radius: 50%;
        background: transparent;
        cursor: pointer;
    }

    .site-header .menu-toggle span {
        background: #173654;
    }

    .site-header .header-links--right {
        position: absolute;
        top: calc(100% + 9px);
        right: 0;
        left: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: auto;
        padding: 10px;
        border: 1px solid rgba(29, 61, 91, .12);
        border-radius: 24px;
        background: rgba(250, 252, 255, .97);
        box-shadow: 0 16px 36px rgba(25, 53, 79, .14);
        -webkit-backdrop-filter: blur(18px);
        backdrop-filter: blur(18px);
    }

    .site-header .header-links--right.is-open {
        display: flex;
    }

    .site-header .header-links--right a {
        display: block;
        padding: 12px 14px;
        font-size: .96rem;
        white-space: normal;
    }

    .site-header .header-links--right .nav-mobile-only {
        display: block !important;
    }

    .site-header.is-compact {
        top: 6px;
        transform: translateX(-50%) scale(.98);
    }

    .site-header.is-compact .nav-wrap--floating {
        min-height: 58px;
        padding-top: 5px;
        padding-bottom: 5px;
    }

    .site-header.is-compact .header-brand img {
        width: clamp(104px, 20vw, 128px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header,
    .nav-wrap--floating,
    .header-brand img {
        transition-duration: .01ms;
    }
}


/* El selector queda en el borde opuesto a WhatsApp. */
.language-float {
    position: fixed;
    z-index: 480;
    left: max(22px, env(safe-area-inset-left));
    bottom: max(22px, env(safe-area-inset-bottom));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid rgba(29, 61, 91, .16);
    border-radius: 999px;
    color: #173654;
    background: rgba(250, 252, 255, .94);
    box-shadow: 0 10px 28px rgba(25, 53, 79, .16);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    font-family: inherit;
    font-size: .84rem;
    font-weight: 750;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.language-float[hidden] {
    display: none;
}

.language-float svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.language-float:hover {
    background: #fff;
    box-shadow: 0 14px 34px rgba(25, 53, 79, .2);
    transform: translateY(-3px);
}

.language-float:focus-visible {
    outline: 3px solid rgba(48, 172, 194, .6);
    outline-offset: 3px;
}

body:has(.language-float:not([hidden])) .kx-consent {
    bottom: calc(max(22px, env(safe-area-inset-bottom)) + 62px);
}

@media (max-width: 640px) {
    .language-float {
        left: max(14px, env(safe-area-inset-left));
        bottom: max(14px, env(safe-area-inset-bottom));
        min-height: 44px;
        gap: 6px;
        padding-inline: 12px;
        font-size: .78rem;
    }

    body:has(.language-float:not([hidden])) .kx-consent {
        bottom: calc(max(14px, env(safe-area-inset-bottom)) + 56px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .language-float {
        transition: none;
    }

    .language-float:hover {
        transform: none;
    }
}
