/* Header Astra: base visual NovaPelvis */
:root {
    --afms-brand-primary: #0f172a;
    --afms-brand-secondary: #0f766e;
    --afms-brand-secondary-hover: #115e59;
    --afms-brand-muted: #64748b;
    --afms-brand-surface: #f8fafc;
    --afms-brand-border: #e2e8f0;
}

#masthead,
.site-header,
.ast-primary-header-bar,
.main-header-bar {
    position: sticky;
    top: 0;
    z-index: 9998;
    background: rgba(248, 250, 252, 0.88) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.86);
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px);
}

body.admin-bar #masthead {
    top: 32px;
}

#masthead .ast-container,
#masthead .site-primary-header-wrap {
    min-height: 86px;
}

#masthead .ast-container,
#masthead .site-primary-header-wrap,
#masthead .ast-builder-grid-row {
    align-items: center !important;
}

#masthead .site-title a,
#masthead .ast-site-title-wrap a {
    color: var(--afms-brand-primary) !important;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-decoration: none;
}

#masthead .main-header-menu,
#masthead .ast-builder-menu-1 .main-header-menu {
    align-items: center !important;
    gap: 12px;
}

#masthead .main-header-menu > .menu-item,
#masthead .ast-builder-menu-1 .menu-item {
    display: flex !important;
    align-items: center !important;
}

#masthead .main-header-menu > .menu-item > .menu-link,
#masthead .ast-builder-menu-1 .menu-item > .menu-link {
    min-height: 40px !important;
    padding-inline: 14px !important;
    border-bottom: 1px solid transparent;
    color: var(--afms-brand-primary) !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 40px !important;
    text-decoration: none !important;
    transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease, transform .2s ease;
}

#masthead .main-header-menu > .menu-item > .menu-link:hover,
#masthead .ast-builder-menu-1 .menu-item > .menu-link:hover {
    color: var(--afms-brand-secondary) !important;
    border-bottom-color: var(--afms-brand-secondary);
}

#masthead .main-header-menu > .current-menu-item > .menu-link,
#masthead .main-header-menu > .current_page_item > .menu-link,
#masthead .ast-builder-menu-1 .current-menu-item > .menu-link,
#masthead .ast-builder-menu-1 .current_page_item > .menu-link,
#masthead .menu-link[aria-current="page"] {
    color: var(--afms-brand-secondary) !important;
    border-bottom-color: var(--afms-brand-secondary);
}

#masthead a[href*="/iniciar-sesion"].menu-link,
#masthead a[href*="/mi-cuenta"].menu-link,
#masthead .main-header-menu > .menu-item > a[href*="/iniciar-sesion"],
#masthead .main-header-menu > .menu-item > a[href*="/mi-cuenta"],
#masthead .ast-builder-menu-1 .menu-item > a[href*="/iniciar-sesion"],
#masthead .ast-builder-menu-1 .menu-item > a[href*="/mi-cuenta"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    margin-left: 10px !important;
    padding: 0 22px !important;
    border: 1px solid var(--afms-brand-primary) !important;
    border-radius: 999px !important;
    background: var(--afms-brand-primary) !important;
    color: #fff !important;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14) !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

#masthead a[href*="/iniciar-sesion"].menu-link:hover,
#masthead a[href*="/mi-cuenta"].menu-link:hover,
#masthead .main-header-menu > .menu-item > a[href*="/iniciar-sesion"]:hover,
#masthead .main-header-menu > .menu-item > a[href*="/mi-cuenta"]:hover,
#masthead .ast-builder-menu-1 .menu-item > a[href*="/iniciar-sesion"]:hover,
#masthead .ast-builder-menu-1 .menu-item > a[href*="/mi-cuenta"]:hover {
    background: var(--afms-brand-secondary) !important;
    border-color: var(--afms-brand-secondary) !important;
    color: #fff !important;
    box-shadow: 0 16px 30px rgba(15, 118, 110, 0.22) !important;
    transform: translateY(-1px);
}

.ast-mobile-popup-drawer .menu-item > .menu-link,
.ast-header-break-point .main-header-menu .menu-link {
    color: var(--afms-brand-primary) !important;
    font-weight: 750;
}

.ast-mobile-popup-drawer a[href*="/iniciar-sesion"],
.ast-mobile-popup-drawer a[href*="/mi-cuenta"],
.ast-header-break-point #masthead a[href*="/iniciar-sesion"],
.ast-header-break-point #masthead a[href*="/mi-cuenta"] {
    width: calc(100% - 24px) !important;
    margin: 8px 12px !important;
    border-radius: 999px !important;
    background: var(--afms-brand-primary) !important;
    color: #fff !important;
    text-align: center;
}

@media (max-width: 921px) {
    #masthead {
        overflow: visible;
    }

    #masthead .ast-container,
    #masthead .site-primary-header-wrap {
        min-height: 72px;
    }

    .ast-header-break-point .ast-mobile-header-content,
    .ast-header-break-point .main-header-bar-navigation,
    .ast-mobile-popup-drawer .ast-mobile-popup-content {
        background: #ffffff !important;
    }

    .ast-header-break-point .main-header-bar-navigation,
    .ast-header-break-point .ast-mobile-header-content {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        z-index: 9999;
        overflow-y: auto;
        max-height: calc(100vh - 72px);
        border-top: 1px solid var(--afms-brand-border);
        box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
    }

    .ast-header-break-point .main-header-menu {
        background: #ffffff !important;
    }

    .ast-header-break-point .ast-mobile-header-content .main-header-bar-navigation {
        position: static !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        width: 100% !important;
        max-height: none !important;
        overflow: visible !important;
        border-top: 0;
        box-shadow: none;
    }

    .ast-header-break-point .ast-mobile-header-content {
        position: static !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
        width: 100% !important;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
        border-top: 1px solid var(--afms-brand-border);
        box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
    }

    .ast-header-break-point .main-header-menu .menu-item {
        border-bottom: 1px solid #eef2f7;
    }

    .ast-header-break-point .main-header-menu .menu-link {
        min-height: 48px !important;
        line-height: 48px !important;
    }

    .ast-header-break-point #masthead a[href*="/iniciar-sesion"],
    .ast-header-break-point #masthead a[href*="/mi-cuenta"] {
        display: flex !important;
        margin: 12px !important;
    }
}

/* Unified app header for every NovaPelvis page. */
#masthead,
.site-header,
.ast-primary-header-bar,
.main-header-bar {
    background: #ffffff !important;
    border-bottom: 1px solid #d9dee6 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
}

#masthead .ast-container,
#masthead .site-primary-header-wrap {
    width: min(100% - 48px, 1368px) !important;
    max-width: 1368px !important;
    min-height: 80px !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
}

#masthead .site-title a,
#masthead .ast-site-title-wrap a {
    color: #294f4b !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    letter-spacing: 0 !important;
}

#masthead .main-header-menu,
#masthead .ast-builder-menu-1 .main-header-menu {
    gap: 28px !important;
}

#masthead .main-header-menu > .menu-item > .menu-link,
#masthead .ast-builder-menu-1 .menu-item > .menu-link {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 80px !important;
    padding: 0 2px !important;
    border: 0 !important;
    border-bottom: 3px solid transparent !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: #000000 !important;
    box-shadow: none !important;
    font-size: 16px !important;
    font-weight: 650 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
}

#masthead .main-header-menu > .current-menu-item > .menu-link,
#masthead .main-header-menu > .current_page_item > .menu-link,
#masthead .ast-builder-menu-1 .current-menu-item > .menu-link,
#masthead .ast-builder-menu-1 .current_page_item > .menu-link,
#masthead .menu-link[aria-current="page"] {
    border-bottom-color: #56c8c7 !important;
    color: #56c8c7 !important;
}

#masthead .main-header-menu > .menu-item > .menu-link:hover,
#masthead .ast-builder-menu-1 .menu-item > .menu-link:hover {
    border-bottom-color: #56c8c7 !important;
    color: #178b8a !important;
}

#masthead a[href*="/ver-planes"].menu-link,
#masthead .main-header-menu > .menu-item > a[href*="/ver-planes"],
#masthead .ast-builder-menu-1 .menu-item > a[href*="/ver-planes"] {
    min-height: 48px !important;
    height: 48px !important;
    padding: 0 25px !important;
    border: 0 !important;
    border-radius: 4px !important;
    background: #56c8c7 !important;
    color: #ffffff !important;
    font-size: 18px !important;
    font-weight: 750 !important;
}

#masthead a[href*="/iniciar-sesion"].menu-link,
#masthead a[href*="/mi-cuenta"].menu-link,
#masthead .main-header-menu > .menu-item > a[href*="/iniciar-sesion"],
#masthead .main-header-menu > .menu-item > a[href*="/mi-cuenta"],
#masthead .ast-builder-menu-1 .menu-item > a[href*="/iniciar-sesion"],
#masthead .ast-builder-menu-1 .menu-item > a[href*="/mi-cuenta"] {
    min-height: 48px !important;
    height: 48px !important;
    padding: 0 25px !important;
    border: 0 !important;
    border-radius: 4px !important;
    background: #f2f4f7 !important;
    color: #000000 !important;
    box-shadow: none !important;
    font-size: 18px !important;
    font-weight: 750 !important;
}

#masthead a[href*="/ver-planes"].menu-link *,
#masthead .main-header-menu > .menu-item > a[href*="/ver-planes"] * {
    color: #ffffff !important;
}

#masthead a[href*="/iniciar-sesion"].menu-link *,
#masthead a[href*="/mi-cuenta"].menu-link *,
#masthead .main-header-menu > .menu-item > a[href*="/iniciar-sesion"] *,
#masthead .main-header-menu > .menu-item > a[href*="/mi-cuenta"] * {
    color: #000000 !important;
}

@media (max-width: 921px) {
    #masthead .ast-container,
    #masthead .site-primary-header-wrap {
        width: min(100% - 28px, 1368px) !important;
        min-height: 68px !important;
    }

    .ast-header-break-point .main-header-menu .menu-link,
    #masthead .main-header-menu > .menu-item > .menu-link,
    #masthead .ast-builder-menu-1 .menu-item > .menu-link {
        min-height: 48px !important;
        padding: 0 16px !important;
        border-bottom: 1px solid #eef2f7 !important;
    }
}
