:root {
    --fichas-chrome-blue: #123f5a;
    --fichas-chrome-blue-2: #1f6f98;
    --fichas-chrome-green: #2ab27b;
    --fichas-chrome-yellow: #f7c948;
    --fichas-chrome-orange: #f9703e;
    --fichas-header-height: 77px;
}

body .site-header {
    position: sticky;
    top: var(--fichas-adminbar-height, 0px);
    z-index: 100000;
    overflow: visible;
    margin-bottom: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    background:
        radial-gradient(circle at 12% 0%, rgba(247, 201, 72, 0.2) 0%, rgba(247, 201, 72, 0) 32%),
        linear-gradient(135deg, var(--fichas-chrome-blue) 0%, var(--fichas-chrome-blue-2) 72%, #236f78 100%) !important;
    box-shadow: 0 14px 34px rgba(8, 38, 58, 0.18);
}

body .site-header::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--fichas-chrome-green), var(--fichas-chrome-yellow), var(--fichas-chrome-orange));
    opacity: 0.95;
    pointer-events: none;
}

body .site-header-content {
    display: flex;
    align-items: center;
    width: min(1180px, calc(100% - 40px));
    min-height: 74px;
    margin: 0 auto;
    padding: 8px 0;
    gap: 22px;
}

body .site-logo {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    line-height: 1;
}

body .site-logo .custom-logo-link {
    display: inline-flex;
    align-items: center;
    min-height: 52px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

body .site-logo .custom-logo-link:hover,
body .site-logo .custom-logo-link:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(247, 201, 72, 0.48);
    background: rgba(255, 255, 255, 0.14);
    outline: none;
}

body .site-logo img.custom-logo {
    display: block;
    width: auto;
    max-width: 180px;
    max-height: 42px;
}

body .asap-menu-container-flex {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

body #menu {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
}

body .mega-menu {
    gap: 8px;
    margin-left: auto;
}

body .mega-menu > .menu-item > a {
    position: relative;
    min-height: 42px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

body .mega-menu > .menu-item > a:hover,
body .mega-menu > .menu-item > a:focus-visible,
body .mega-menu > .menu-item.has-mega:focus-within > a,
body .mega-menu > .menu-item.has-mega:hover > a {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    outline: none;
}

body .mega-menu > .menu-item.has-mega > a::after {
    border-color: currentColor;
    opacity: 0.9;
}

body .mega-menu > .menu-item:last-child > a {
    margin-left: 4px;
    border-color: rgba(247, 201, 72, 0.72);
    background: var(--fichas-chrome-yellow);
    color: var(--fichas-chrome-blue);
    box-shadow: 0 10px 22px rgba(247, 201, 72, 0.2);
}

body .mega-menu > .menu-item:last-child > a:hover,
body .mega-menu > .menu-item:last-child > a:focus-visible {
    background: #ffe175;
    color: var(--fichas-chrome-blue);
}

body .mega-panel {
    top: calc(100% + 12px);
    width: min(980px, 92vw);
    border: 1px solid #dbe7f1;
    border-top: 5px solid var(--fichas-chrome-yellow);
    border-radius: 18px;
    box-shadow: 0 24px 54px rgba(8, 38, 58, 0.22);
}

body .mega-panel::after {
    content: "";
    position: absolute;
    top: -10px;
    left: 50%;
    width: 18px;
    height: 18px;
    border-left: 1px solid #dbe7f1;
    border-top: 1px solid #dbe7f1;
    background: #ffffff;
    transform: translateX(-50%) rotate(45deg);
}

.ficha-sticky-next {
    position: fixed;
    right: 18px;
    bottom: max(18px, env(safe-area-inset-bottom));
    left: 18px;
    z-index: 99980;
    display: flex;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transform: translateY(120%);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.ficha-sticky-next.is-visible {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
}

.ficha-sticky-next-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    width: min(820px, 100%);
    padding: 12px 12px 12px 18px;
    border: 1px solid rgba(247, 201, 72, 0.75);
    border-radius: 18px;
    background:
        radial-gradient(circle at 0% 50%, rgba(247, 201, 72, 0.24) 0%, rgba(247, 201, 72, 0) 36%),
        linear-gradient(135deg, #123f5a 0%, #1f6f98 100%);
    color: #ffffff;
    box-shadow: 0 24px 54px rgba(8, 38, 58, 0.32);
}

.ficha-sticky-next-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.13);
    color: var(--fichas-chrome-yellow);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.ficha-sticky-next-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    min-width: 0;
    min-height: 54px;
    padding: 9px 12px 9px 16px;
    border-radius: 14px;
    background: #ffffff;
    color: var(--fichas-chrome-blue);
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(8, 38, 58, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ficha-sticky-next-link:hover,
.ficha-sticky-next-link:focus-visible {
    transform: translateY(-2px);
    color: var(--fichas-chrome-blue);
    outline: 3px solid rgba(247, 201, 72, 0.42);
    outline-offset: 3px;
    box-shadow: 0 16px 30px rgba(8, 38, 58, 0.24);
}

.ficha-sticky-next-text > span {
    display: block;
    color: #13795b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1.15;
    text-transform: uppercase;
}

.ficha-sticky-next-text {
    min-width: 0;
}

.ficha-sticky-next-link strong {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    color: var(--fichas-chrome-blue);
    font-size: 16px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ficha-sticky-next-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--fichas-chrome-yellow);
    color: var(--fichas-chrome-blue);
    font-size: 24px;
    font-style: normal;
    font-weight: 900;
}

.ficha-sticky-next-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font: inherit;
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
}

.ficha-sticky-next-close:hover,
.ficha-sticky-next-close:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    outline: 3px solid rgba(247, 201, 72, 0.42);
    outline-offset: 3px;
}

body.single-ficha.ficha-sticky-next-visible .ficha-wrapper {
    padding-bottom: 110px;
}

body.single-ficha.ficha-sticky-next-visible .ficha-navegacion-cards .nav-card-next {
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 1050px) {
    :root {
        --fichas-header-height: 64px;
    }

    body .site-header #menu,
    body .site-header .mega-menu {
        display: none !important;
    }

    body .asap-menu-container-flex {
        justify-content: flex-end;
    }

    body .site-header-content {
        width: min(100% - 24px, 1180px);
        min-height: 64px;
        padding: 7px 0;
    }

    body .site-logo .custom-logo-link {
        min-height: 48px;
        padding: 7px 10px;
        border-radius: 16px;
    }

    body .site-logo img.custom-logo {
        max-width: 158px;
        max-height: 38px;
    }

    body #nav-icon {
        top: 50% !important;
        right: 12px !important;
        width: 50px;
        height: 50px;
        padding: 0 !important;
        transform: translateY(-50%);
    }

    body #nav-icon .circle.nav-icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 50px;
        height: 50px;
        border: 1px solid rgba(247, 201, 72, 0.75);
        border-radius: 16px;
        background: var(--fichas-chrome-yellow);
        box-shadow: 0 12px 24px rgba(8, 38, 58, 0.18);
    }

    body #nav-icon .line {
        left: 50% !important;
        width: 24px !important;
        height: 3px !important;
        margin-left: -12px;
        border-radius: 999px;
        background: var(--fichas-chrome-blue) !important;
    }

    body #nav-icon .line.top {
        top: 16px !important;
    }

    body #nav-icon .line.middle {
        top: 24px !important;
    }

    body #nav-icon .line.bottom {
        top: 32px !important;
    }

    body.menu-open #nav-icon .circle.nav-icon {
        background: #ffffff;
    }
}

@media (max-width: 768px) {
    .ficha-sticky-next {
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 12px;
    }

    .ficha-sticky-next-inner {
        grid-template-columns: 1fr auto;
        gap: 10px;
        padding: 10px;
        border-radius: 16px;
    }

    .ficha-sticky-next-kicker {
        display: none;
    }

    .ficha-sticky-next-link {
        min-height: 58px;
        padding: 10px 10px 10px 14px;
    }

    .ficha-sticky-next-link strong {
        font-size: 14px;
    }

    .ficha-sticky-next-icon,
    .ficha-sticky-next-close {
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    body.single-ficha.ficha-sticky-next-visible .ficha-wrapper {
        padding-bottom: 128px !important;
    }

    body.single-ficha.ficha-sticky-next-visible .ficha-progress-panel {
        bottom: calc(max(12px, env(safe-area-inset-bottom)) + 86px);
    }
}

@media (max-width: 420px) {
    body .site-logo img.custom-logo {
        max-width: 142px;
    }

    .ficha-sticky-next-link {
        grid-template-columns: minmax(0, 1fr) 36px;
        gap: 8px;
    }

    .ficha-sticky-next-icon,
    .ficha-sticky-next-close {
        width: 36px;
        height: 36px;
    }
}
