/* Desktop menu buttons */
.main-header-menu .menu-item.portal-button > .menu-link,
.main-header-menu .menu-item.demo-button > .menu-link {
    display: inline-flex;
    align-self: center;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    margin: 6px 8px;
    padding: 6px 12px;
    border: 1px solid #176447;
    border-radius: 6px;
    font-weight: 600;
    line-height: 1.4;
}

.main-header-menu .menu-item.portal-button > .menu-link {
    background-color: transparent;
    color: #176447;
}

.main-header-menu .menu-item.demo-button > .menu-link {
    background-color: #176447;
    color: #ffffff;
}

.main-header-menu .menu-item.portal-button > .menu-link:hover,
.main-header-menu .menu-item.portal-button > .menu-link:focus-visible,
.main-header-menu .menu-item.demo-button > .menu-link:hover,
.main-header-menu .menu-item.demo-button > .menu-link:focus-visible {
    background-color: #124F38;
    border-color: #124F38;
    color: #ffffff;
}

/* Underline the current page on desktop */
body:not(.ast-header-break-point)
.main-header-menu
.menu-item:not(.demo-button):not(.portal-button) > .menu-link {
    position: relative;
}

body:not(.ast-header-break-point)
.main-header-menu
.menu-item.current-menu-item:not(.demo-button):not(.portal-button) > .menu-link {
    color: #176447;
    font-weight: 600;
}

body:not(.ast-header-break-point)
.main-header-menu
.menu-item.current-menu-item:not(.demo-button):not(.portal-button) > .menu-link::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 2px;
    background-color: #176447;
    border-radius: 2px;
}

/* Mobile menu border, divider and shadow */
.ast-header-break-point .ast-mobile-header-content {
    background-color: #ffffff;
    border: 1px solid #dce8e1;
    border-bottom: 2px solid #dce8e1;
    box-shadow: 0 8px 18px rgba(17, 43, 57, 0.09);
    padding-bottom: 12px;
}

/* Highlight the current page in the mobile menu */
.ast-header-break-point
.menu-item.current-menu-item:not(.demo-button):not(.portal-button) > .menu-link {
    background-color: #e5f1e8 !important;
    color: #176447 !important;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #176447;
}

/* Compact, left-aligned mobile menu buttons */
.ast-header-break-point .menu-item.demo-button,
.ast-header-break-point .menu-item.portal-button {
    text-align: left !important;
}

.ast-header-break-point .menu-item.demo-button > .menu-link,
.ast-header-break-point .menu-item.portal-button > .menu-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    align-self: flex-start !important;
    width: fit-content !important;
    min-width: 0 !important;
    max-width: calc(100% - 40px);
    height: auto !important;
    flex: none !important;
    margin: 6px auto 6px 20px !important;
    padding: 6px 12px !important;
    border: 1px solid #176447 !important;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4 !important;
}

.ast-header-break-point .menu-item.demo-button > .menu-link {
    background: #176447 !important;
    color: #ffffff !important;
}

.ast-header-break-point .menu-item.portal-button > .menu-link {
    background: transparent !important;
    color: #176447 !important;
}

.ast-header-break-point .menu-item.demo-button > .menu-link:hover,
.ast-header-break-point .menu-item.demo-button > .menu-link:focus-visible,
.ast-header-break-point .menu-item.portal-button > .menu-link:hover,
.ast-header-break-point .menu-item.portal-button > .menu-link:focus-visible {
    background: #124F38 !important;
    border-color: #124F38 !important;
    color: #ffffff !important;
}

/* Soft green background behind the open-menu close button */
.ast-header-break-point
.menu-toggle[aria-expanded="true"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 8px;
    background-color: #e5f1e8 !important;
    color: #176447 !important;
    border: 1px solid #d3e5d8 !important;
    border-radius: 8px;
}

.ast-header-break-point
.menu-toggle[aria-expanded="true"] svg {
    fill: currentColor;
}

/* Visible keyboard focus */
#masthead .menu-link:focus-visible,
#masthead .menu-toggle:focus-visible {
    outline: 2px solid #176447;
    outline-offset: 3px;
}

/* Keep the header visible while scrolling */
#masthead {
    position: sticky;
    top: 0;
    z-index: 999;
}

#masthead .ast-primary-header-bar {
    background-color: #ffffff;
}

/* Allow space for the WordPress admin toolbar */
body.admin-bar #masthead {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar #masthead {
        top: 46px;
    }
}

@media (max-width: 600px) {
    body.admin-bar #masthead {
        top: 0;
    }
}

/* Soft edges while preserving the full image */
.pharmatill-soft-image img {
    -webkit-mask-image:
        linear-gradient(to right,
            transparent 0%, #000 8%, #000 92%, transparent 100%),
        linear-gradient(to bottom,
            transparent 0%, #000 10%, #000 88%, transparent 100%);
    -webkit-mask-composite: source-in;

    mask-image:
        linear-gradient(to right,
            transparent 0%, #000 8%, #000 92%, transparent 100%),
        linear-gradient(to bottom,
            transparent 0%, #000 10%, #000 88%, transparent 100%);
    mask-composite: intersect;
}

/* Clear divider below the mobile menu */
.ast-header-break-point .ast-mobile-header-content {
    border-bottom: 1px solid #cdded3 !important;
    padding-bottom: 18px;
}
/* Inset divider beneath Portal in the mobile menu */
.ast-header-break-point .menu-item.portal-button::after {
    content: "";
    display: block;
    height: 1px;
    margin: 14px 20px 0;
    background-color: #c5d6cb;
}
#ast-scroll-top {
    border-radius: 4px;
}