/* Búsqueda global del sitio */
#topNav>.container {
    position: relative;
}

#topNav .nav-main-collapse {
    padding-right: 48px;
}

#topMain {
    margin-right: 50px;
}

.site-search {
    position: absolute;
    top: 28px;
    right: 15px;
    z-index: 1002;
}

.site-search-toggle {
    display: grid;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    border: 1px solid #dbcfe0;
    border-radius: 50%;
    background: #fff;
    color: #723890;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.site-search-toggle:hover,
.site-search-toggle:focus,
.site-search-toggle[aria-expanded="true"] {
    border-color: #723890;
    box-shadow: 0 6px 18px rgba(84, 31, 91, .2);
    color: #541f5b;
    outline: none;
    transform: translateY(-1px);
}

.site-search-toggle svg,
.site-search-input-wrap svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.site-search-panel {
    position: absolute;
    top: 52px;
    right: 0;
    width: min(560px, calc(100vw - 30px));
    padding: 20px;
    border: 1px solid #dbcfe0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(52, 20, 58, .24);
    color: #333;
    text-align: left;
}

.site-search-panel[hidden] {
    display: none;
}

.site-search-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 10px;
}

.site-search-label {
    margin: 0;
    color: #541f5b;
    font-size: 16px;
    font-weight: 700;
}

.site-search-close {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid #dbcfe0;
    border-radius: 50%;
    background: #fff;
    color: #541f5b;
    cursor: pointer;
}

.site-search-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.site-search-close:hover,
.site-search-close:focus {
    border-color: #723890;
    background: #f8f3fa;
    outline: 3px solid rgba(114, 56, 144, .12);
}

.site-search-input-wrap {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid #cabbd1;
    border-radius: 10px;
    background: #fff;
    color: #723890;
}

.site-search-input-wrap:focus-within {
    border-color: #723890;
    box-shadow: 0 0 0 3px rgba(114, 56, 144, .12);
}

.site-search-input-wrap input {
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 12px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #333;
    font: inherit;
}

.site-search-input-wrap input::-webkit-search-cancel-button {
    display: none;
    -webkit-appearance: none;
    appearance: none;
}

.site-search-status {
    min-height: 20px;
    margin: 10px 2px 6px;
    color: #6c6170;
    font-size: 13px;
}

.site-search-results {
    display: grid;
    gap: 6px;
    max-height: min(420px, 55vh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.site-search-result {
    display: grid;
    width: 100%;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: #f8f5f9;
    color: #382c3b;
    text-align: left;
    cursor: pointer;
}

.site-search-result:hover,
.site-search-result:focus,
.site-search-result[aria-selected="true"] {
    border-color: #c7b4cf;
    background: #f1e9f4;
    outline: none;
}

.site-search-result strong {
    color: #541f5b;
    font-size: 14px;
}

.site-search-result span {
    color: #756b79 !important;
    font-size: 12px;
}

.site-search-highlight {
    scroll-margin-top: 110px;
    animation: site-search-pulse 1.8s ease;
}

@keyframes site-search-pulse {
    0%, 100% { box-shadow: none; }
    22%, 70% { box-shadow: 0 0 0 5px rgba(114, 56, 144, .24); }
}

@media (prefers-reduced-motion: reduce) {
    .site-search-highlight {
        animation: none;
    }
}

@media only screen and (max-width: 991px) {
    #topNav .nav-main-collapse {
        padding-right: 0;
    }

    #topMain {
        margin-right: 0;
    }

    .site-search {
        right: 62px;
    }

    .site-search-panel {
        position: fixed;
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100vh - 24px);
        transform: none;
    }

    .site-search-results {
        max-height: calc(100vh - 180px);
    }
}
