/* ===== MODAL DE BÚSQUEDA ===== */
.search-modal {
    background: #ffffff;
}

.search-close {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    background: #f3f5fc;
    color: #1F3471;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .3s ease;
    z-index: 10;
}

.search-close:hover {
    background: #1F3471;
    color: #fff;
    transform: rotate(90deg);
}

.search-wrapper {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
    padding: 90px 24px 50px;
}

.search-wrapper h2 {
    font-size: 32px;
    font-weight: 800;
    color: #16213e;
    text-align: center;
    margin-bottom: 8px;
}

.search-wrapper > p {
    text-align: center;
    color: #6b7280;
    margin-bottom: 35px;
}

.search-box {
    position: relative;
    margin-bottom: 30px;
}

.search-box i {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: #1F3471;
    font-size: 20px;
}

.search-box input {
    width: 100%;
    padding: 18px 22px 18px 55px;
    border-radius: 50px;
    border: 2px solid #eef0f5;
    font-size: 16px;
    transition: all .3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #1F3471;
    box-shadow: 0 0 0 4px rgba(31,52,113,.08);
}

.search-results {
    max-height: calc(100vh - 285px);
    overflow-y: auto;
    padding: 24px;
    border: 1px solid #e5eaf2;
    border-radius: 24px;
    background: #f6f8fc;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
    scrollbar-width: thin;
    scrollbar-color: #b9c3d8 transparent;
}

/* ===== ESTADO VACÍO / CARGANDO / SIN RESULTADOS ===== */
.search-empty {
    text-align: center;
    padding: 50px 20px;
    color: #6b7280;
}

.search-empty i {
    font-size: 42px;
    color: #c9d0e3;
    margin-bottom: 16px;
    display: inline-block;
}

.search-empty h5 {
    color: #16213e;
    font-weight: 700;
    margin-bottom: 8px;
}

.search-empty p {
    font-size: 14px;
    margin: 0;
}

.search-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eef0f5;
    border-top-color: #1F3471;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: search-spin .7s linear infinite;
}

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

/* ===============================================
   ESTILOS SOLO PARA LOS RESULTADOS DEL BUSCADOR
   (no toca .search-modal, .search-close, .search-box,
    .search-wrapper ni .search-empty — esos ya están
    definidos en tu app.css y se quedan intactos)
=================================================== */

/* ===== GRUPOS (Productos / Vacantes) ===== */
.search-grupo {
    margin-bottom: 36px;
}

.search-grupo:last-child {
    margin-bottom: 0;
}

.search-grupo-titulo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1F3471;
    margin-bottom: 14px;
}

.search-grupo-icon {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #e8edf8;
    font-size: 13px;
}

.search-grupo-count {
    background: #eef1fa;
    color: #1F3471;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 50px;
    letter-spacing: 0;
}

/* ===== GRID DE PRODUCTOS ===== */
.search-grid-productos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.search-card-producto {
    display: flex;
    align-items: center;
    min-width: 0;
    background: #ffffff;
    border: 1px solid #e3e8f1;
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none;
    transition: all .35s ease;
    box-shadow: 0 8px 24px rgba(31,52,113,.04);
}

.search-card-producto:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 36px rgba(31,52,113,.14);
    border-color: rgba(31,52,113,.2);
}

.search-card-producto:focus-visible,
.search-card-vacante:focus-visible {
    outline: 3px solid rgba(31,52,113,.28);
    outline-offset: 3px;
}

.search-card-img {
    position: relative;
    flex: 0 0 108px;
    width: 108px;
    height: 108px;
    margin: 10px;
    border-radius: 14px;
    background: #f8f9fc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.search-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    transition: transform .4s ease;
}

.search-card-producto:hover .search-card-img img {
    transform: scale(1.08);
}

.search-card-badge {
    align-self: flex-start;
    background: #eef2fa;
    color: #1F3471;
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 50px;
}

.search-card-body {
    min-width: 0;
    padding: 14px 6px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 7px;
    flex: 1;
}

.search-card-body h6 {
    font-size: 14.5px;
    font-weight: 700;
    color: #16213e;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-card-marca {
    font-size: 12.5px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-card-marca span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.search-card-action {
    width: 34px;
    height: 34px;
    margin: 0 14px 0 8px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eef2fa;
    color: #1F3471;
    transition: all .3s ease;
}

.search-card-producto:hover .search-card-action {
    background: #1F3471;
    color: #FFF;
    transform: translate(2px,-2px);
}

/* ===== LISTA DE VACANTES ===== */
.search-lista-vacantes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-card-vacante {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid #e3e8f1;
    background: #ffffff;
    text-decoration: none;
    transition: all .3s ease;
    box-shadow: 0 8px 24px rgba(31,52,113,.04);
}

.search-card-vacante:hover {
    background: #fff;
    border-color: rgba(31,52,113,.2);
    transform: translateX(4px);
    box-shadow: 0 14px 28px rgba(31,52,113,.1);
}

.search-vacante-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 50%;
    background: #eef1fa;
    color: #1F3471;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.search-card-vacante .search-card-body {
    padding: 0;
}

.search-arrow {
    color: #c9d0e3;
    font-size: 16px;
    transition: transform .3s ease;
}

.search-card-vacante:hover .search-arrow {
    transform: translateX(4px);
    color: #1F3471;
}

/* ===== MENSAJE "SIN RESULTADOS" Y "CARGANDO" (dentro de #searchResults) ===== */
/* Nota: NO redefine .search-empty en general, solo ajusta el spinner que es nuevo */
.search-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eef0f5;
    border-top-color: #1F3471;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: search-spin .7s linear infinite;
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 767px) {
    .search-wrapper {
        padding: 80px 14px 30px;
    }

    .search-results {
        max-height: calc(100vh - 260px);
        padding: 16px;
        border-radius: 20px;
    }

    .search-grid-productos {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .search-card-img {
        flex-basis: 92px;
        width: 92px;
        height: 92px;
        margin: 8px;
    }

    .search-card-body { padding: 10px 4px; }
    .search-card-body h6 { font-size: 13.5px; }
    .search-card-marca { font-size: 11.5px; }
    .search-card-action { margin-right: 10px; }

    .search-card-vacante {
        padding: 14px;
        gap: 12px;
    }
}

@media (max-width: 420px) {
    .search-card-img {
        flex-basis: 78px;
        width: 78px;
        height: 78px;
    }

    .search-card-action {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
        margin-left: 4px;
    }
}
