/* Keep the Elementor shortcode wrapper from clipping the expanding field or dropdown. */
.elementor-widget-shortcode:has(.aier-ms),
.elementor-widget-shortcode:has(.aier-ms) > .elementor-widget-container,
.elementor-shortcode:has(.aier-ms) {
    overflow: visible !important;
}

:root {
    --aier-ms-navy: #063f61;
    --aier-ms-navy-dark: #04344f;
    --aier-ms-teal: #0b8a75;
    --aier-ms-cyan: #29a9c2;
    --aier-ms-border: #d7e1e7;
    --aier-ms-muted: #657788;
    --aier-ms-bg: #ffffff;
    --aier-ms-soft: #f4f8fa;
    --aier-ms-shadow: 0 18px 50px rgba(4, 52, 79, 0.18);
}


/* Isolate sizing from Elementor/theme defaults so result text cannot widen the panel. */
.aier-ms,
.aier-ms *,
.aier-ms *::before,
.aier-ms *::after {
    box-sizing: border-box;
}

.aier-ms {
    --aier-ms-expanded-width: 430px;
    position: relative;
    z-index: 99990;
    display: inline-flex;
    width: 44px;
    height: 44px;
    vertical-align: middle;
    isolation: isolate;
}

.aier-ms--left {
    margin-left: auto;
}

.aier-ms--right {
    margin-right: auto;
}

.aier-ms__form {
    position: absolute;
    top: 0;
    width: 44px;
    margin: 0;
    transition: width 260ms ease;
}

.aier-ms--left .aier-ms__form {
    right: 0;
}

.aier-ms--right .aier-ms__form {
    left: 0;
}

.aier-ms--open .aier-ms__form {
    width: min(var(--aier-ms-expanded-width), 88vw);
}

.aier-ms__bar {
    width: 100%;
}

.aier-ms__bar {
    display: flex;
    align-items: center;
    min-height: 44px;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.aier-ms--right .aier-ms__bar {
    flex-direction: row-reverse;
}

.aier-ms--open .aier-ms__bar,
.aier-ms:focus-within .aier-ms__bar {
    border-color: var(--aier-ms-border);
    background: var(--aier-ms-bg);
    box-shadow: 0 8px 22px rgba(4, 52, 79, 0.12);
}

.aier-ms__toggle {
    flex: 0 0 44px !important;
    width: 44px !important;
    height: 44px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    color: var(--aier-ms-navy);
    background: transparent;
    cursor: pointer !important;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease !important;
}

.aier-ms__toggle:hover,
.aier-ms__toggle:focus-visible {
    color: #ffffff;
    background: var(--aier-ms-navy);
    outline: none;
}

.aier-ms__toggle:active {
    transform: scale(0.95);
}

.aier-ms__toggle svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
}

.aier-ms__input {
    flex: 1 1 auto;
    min-width: 0;
    width: 0;
    height: 42px;
    padding: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    color: var(--aier-ms-navy-dark);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    box-shadow: none !important;
    transition: width 260ms ease, padding 260ms ease, opacity 160ms ease 40ms;
    -webkit-appearance: none;
    appearance: none;
}

.aier-ms--left .aier-ms__input {
    text-align: left;
}

.aier-ms--open .aier-ms__input {
    width: auto;
    padding: 0 4px 0 17px !important;
    opacity: 1;
    pointer-events: auto;
}

.aier-ms--right.aier-ms--open .aier-ms__input {
    padding: 0 17px 0 4px !important;
}

.aier-ms__input::placeholder {
    color: #8796a4;
    opacity: 1;
}

.aier-ms__input::-webkit-search-cancel-button {
    cursor: pointer;
}

.aier-ms__panel {
    position: absolute;
    top: calc(100% + 10px);
    width: min(520px, 92vw);
    max-width: 92vw;
    max-height: min(70vh, 650px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--aier-ms-border);
    border-radius: 14px;
    background: var(--aier-ms-bg);
    box-shadow: var(--aier-ms-shadow);
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.aier-ms--left .aier-ms__panel {
    right: 0;
}

.aier-ms--right .aier-ms__panel {
    left: 0;
}

.aier-ms__panel[hidden] {
    display: none !important;
}

.aier-ms__status {
    padding: 13px 14px;
    color: var(--aier-ms-muted);
    font-size: 13px;
    line-height: 1.45;
}

.aier-ms__status:empty {
    display: none;
}

.aier-ms__status--loading::before {
    content: "";
    display: inline-block;
    width: 13px;
    height: 13px;
    margin-right: 8px;
    border: 2px solid #c8d7df;
    border-top-color: var(--aier-ms-teal);
    border-radius: 50%;
    vertical-align: -2px;
    animation: aier-ms-spin 700ms linear infinite;
}

.aier-ms__status--error {
    color: #a83434;
    background: #fff5f5;
    border-radius: 9px;
}

.aier-ms__status--empty {
    color: var(--aier-ms-navy);
    background: var(--aier-ms-soft);
    border-radius: 9px;
}

.aier-ms__group + .aier-ms__group {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #edf1f4;
}

.aier-ms__group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 11px 12px 7px;
    color: var(--aier-ms-navy);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.aier-ms__group-title::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--aier-ms-cyan);
}

.aier-ms__group--courses .aier-ms__group-title::before {
    background: var(--aier-ms-navy);
}

.aier-ms__group--shop .aier-ms__group-title::before {
    background: var(--aier-ms-teal);
}

.aier-ms__group--membership .aier-ms__group-title::before {
    background: #b99b47;
}

.aier-ms__groups,
.aier-ms__group,
.aier-ms__result-list {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.aier-ms__result-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
}

/*
 * Elementor/header navigation CSS can force links and nested spans into a
 * single no-wrap flex row. These higher-specificity rules isolate the result
 * layout so the description always starts below the title and stays inside
 * the dropdown.
 */
.aier-ms .aier-ms__result {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: start !important;
    row-gap: 0;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 11px 12px;
    overflow: hidden;
    border-radius: 9px;
    box-sizing: border-box;
    color: inherit;
    text-align: left !important;
    white-space: normal !important;
    text-decoration: none !important;
    transition: background 150ms ease, transform 150ms ease;
}

.aier-ms__result:hover,
.aier-ms__result:focus-visible {
    background: var(--aier-ms-soft);
    outline: none;
    transform: translateX(2px);
}

/* New markup wrapper; it also protects the two text rows from flex rules. */
.aier-ms .aier-ms__result > .aier-ms__result-content {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    align-items: start !important;
    row-gap: 4px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    white-space: normal !important;
}

/*
 * The broad selectors support both the current wrapped markup and an older
 * cached JavaScript file that may still output the two spans directly.
 */
.aier-ms .aier-ms__result .aier-ms__result-title,
.aier-ms .aier-ms__result .aier-ms__result-description {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
}

.aier-ms .aier-ms__result .aier-ms__result-title {
    display: block !important;
    margin-top: 0;
    margin-bottom: 0;
    color: var(--aier-ms-navy-dark);
    font-size: 14px !important;
    font-weight: 750;
    line-height: 1.35 !important;
}

.aier-ms .aier-ms__result .aier-ms__result-description {
    display: -webkit-box !important;
    margin-top: 4px;
    margin-bottom: 0;
    overflow: hidden;
    color: var(--aier-ms-muted);
    font-size: 12px !important;
    font-weight: 400;
    line-height: 1.45 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

/* The wrapper already supplies the row gap, so avoid double spacing. */
.aier-ms .aier-ms__result-content > .aier-ms__result-description {
    margin-top: 0;
}

.aier-ms .aier-ms__result .aier-ms__result-description:empty {
    display: none !important;
}

.aier-ms-page-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 14px 0 18px;
    padding: 12px 14px;
    border: 1px solid #b9dfe6;
    border-left: 4px solid var(--aier-ms-cyan);
    border-radius: 9px;
    color: var(--aier-ms-navy-dark);
    background: #eefbfc;
    font-size: 14px;
    line-height: 1.4;
}

.aier-ms-page-filter__message {
    font-weight: 650;
}

.aier-ms-page-filter__clear {
    flex: none;
    padding: 7px 12px;
    border: 1px solid var(--aier-ms-navy);
    border-radius: 999px;
    color: var(--aier-ms-navy);
    background: #ffffff;
    font-family: inherit;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.aier-ms-page-filter__clear:hover,
.aier-ms-page-filter__clear:focus-visible {
    color: #ffffff;
    background: var(--aier-ms-navy);
    outline: none;
}

.aier-ms-filtered-out {
    display: none !important;
}

.aier-ms-target {
    position: relative;
    outline: 3px solid rgba(41, 169, 194, 0.46);
    outline-offset: 3px;
    scroll-margin-top: 150px;
    animation: aier-ms-highlight 1.6s ease 1;
}

@keyframes aier-ms-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes aier-ms-highlight {
    0%, 100% {
        box-shadow: inherit;
    }
    35% {
        box-shadow: 0 0 0 8px rgba(41, 169, 194, 0.16);
    }
}

@media (max-width: 767px) {
    .aier-ms--open .aier-ms__form {
        width: min(var(--aier-ms-expanded-width), 86vw);
    }

    .aier-ms__panel {
        width: min(92vw, 460px);
        max-height: 66vh;
    }

    .aier-ms-page-filter {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aier-ms,
    .aier-ms__bar,
    .aier-ms__input,
    .aier-ms__toggle,
    .aier-ms__result,
    .aier-ms-target {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}

/*  */
/* Push search to the right end */
.aier-search-menu-item {
    margin-left: auto !important;
}
/*  */