/* =========================================================
   BUSCADOR EN TIEMPO REAL
   Mantiene el estilo negro original del encabezado
========================================================= */

/* Contenedor principal del buscador */
#site-search-block {
    width: 300px;
    padding: 10px;

    overflow: visible;
    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.65);
}

/* Formulario */
#site-search-form {
    position: relative;

    width: 100%;
    margin: 0;

    box-sizing: border-box;
}

/* Input */
#site-search-input {
    display: block;

    width: 100%;
    height: 40px;
    padding: 0 44px 0 12px;

    box-sizing: border-box;

    color: #ffffff;
    font-size: 14px;

    background: rgba(34, 34, 34, 0.92);
    border: 0;
    border-radius: 0;
    box-shadow: none;
    outline: none;
}

#site-search-input::placeholder {
    color: rgba(255, 255, 255, 0.65);
    opacity: 1;
}

#site-search-input:focus {
    color: #ffffff;

    background: rgba(34, 34, 34, 0.96);
    border: 0;

    box-shadow: inset 0 -2px 0 #ba007c;
    outline: none;
}

/* =========================================================
   BOTÓN DE BÚSQUEDA DENTRO DEL INPUT
========================================================= */

.site-search-submit {
    position: absolute;
    top: 50%;
    right: 4px;

    width: 36px;
    height: 34px;
    padding: 0;
    margin: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: rgba(255, 255, 255, 0.82);

    background: transparent;
    border: 0;
    border-radius: 0;

    cursor: pointer;

    transform: translateY(-50%);

    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.site-search-submit:hover,
.site-search-submit:focus {
    color: #ffb600;

    background: rgba(255, 255, 255, 0.06);

    outline: none;
    box-shadow: none;
}

/* =========================================================
   RESULTADOS
   Recupera los 10px de padding del contenedor para ocupar
   exactamente los mismos 300px del bloque negro.
========================================================= */

.site-search-results {
    position: absolute;

    /*
     * El formulario mide 280px porque el contenedor tiene
     * 10px de padding a cada lado.
     *
     * Con -10px recuperamos esos 20px y los resultados
     * vuelven a medir exactamente 300px.
     */
    top: calc(100% + 10px);
    left: -10px;
    right: -10px;

    width: auto;
    max-height: min(410px, 65vh);

    z-index: 1200;

    box-sizing: border-box;

    overflow-x: hidden;
    overflow-y: auto;

    background: rgba(20, 20, 20, 0.96);

    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0;

    box-shadow: 0 9px 20px rgba(0, 0, 0, 0.24);

    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);

    overscroll-behavior: contain;
}

.site-search-results[hidden] {
    display: none !important;
}

/* =========================================================
   CADA RESULTADO
========================================================= */

.site-search-result {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;

    box-sizing: border-box;

    display: flex;
    align-items: flex-start;
    gap: 10px;

    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    white-space: normal;

    background: transparent;

    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);

    transition:
        background-color 0.18s ease,
        color 0.18s ease;
}

.site-search-result:last-child {
    border-bottom: 0;
}

.site-search-result:hover,
.site-search-result:focus,
.site-search-result.is-active {
    color: #ffffff;
    text-decoration: none;

    background: rgba(186, 0, 124, 0.35);

    outline: none;
}

/* Icono */
.site-search-result__icon {
    flex: 0 0 34px;

    width: 34px;
    height: 34px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: #ffffff;

    background: rgba(25, 53, 82, 0.88);
    border-radius: 4px;

    font-size: 14px;
}

/* Contenido */
.site-search-result__content {
    flex: 1 1 auto;
    min-width: 0;
}

/* Tipo de resultado */
.site-search-result__meta {
    display: block;
    margin-bottom: 1px;

    color: #ffb600;

    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.04em;

    text-transform: uppercase;
}

/* Título */
.site-search-result__title {
    display: block;

    color: inherit;

    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;

    overflow-wrap: anywhere;
}

/* Descripción */
.site-search-result__summary {
    display: -webkit-box;
    margin-top: 2px;

    overflow: hidden;

    color: rgba(255, 255, 255, 0.65);

    font-size: 11px;
    line-height: 1.4;

    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* =========================================================
   MENSAJES
   Buscando, sin resultados o error
========================================================= */

.site-search-message {
    width: 100%;
    padding: 15px 12px;

    box-sizing: border-box;

    color: rgba(255, 255, 255, 0.76);

    font-size: 12px;
    line-height: 1.5;
    text-align: center;

    background: transparent;
}

.site-search-message .fa-spinner {
    margin-right: 6px;
    color: #ffb600;
}

/* =========================================================
   SCROLL
========================================================= */

.site-search-results {
    scrollbar-width: thin;

    scrollbar-color:
        rgba(186, 0, 124, 0.75)
        rgba(255, 255, 255, 0.04);
}

.site-search-results::-webkit-scrollbar {
    width: 7px;
}

.site-search-results::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

.site-search-results::-webkit-scrollbar-thumb {
    background: rgba(186, 0, 124, 0.75);
    border-radius: 8px;
}

/* =========================================================
   TABLET Y MÓVIL
========================================================= */

@media (max-width: 991px) {
    #site-search-block {
        right: 10px;
        left: 10px;

        width: auto;
        max-width: none;

        padding: 10px;
    }

    #site-search-form {
        width: 100%;
    }

    .site-search-results {
        top: calc(100% + 10px);

        left: -10px;
        right: -10px;

        width: auto;
        max-height: 55vh;
    }
}

@media (max-width: 575.98px) {
    #site-search-block {
        right: 8px;
        left: 8px;

        padding: 8px;
    }

    /*
     * En móvil el padding cambia de 10px a 8px,
     * por eso también cambia la compensación.
     */
    .site-search-results {
        top: calc(100% + 8px);

        left: -8px;
        right: -8px;

        width: auto;
    }

    .site-search-result {
        padding: 10px;
    }

    .site-search-result__summary {
        -webkit-line-clamp: 1;
    }
}