/* ═══════════════════════════════════════
   BUSCADOR YAYKUNA — diseño moderno
═══════════════════════════════════════ */

#buscador-yaykuna {
    width: 100%;
    position: relative;
}

/* ── FILA INPUT ── */
#buscador-yaykuna .fila-buscador-yaykuna {
    display: flex;
    align-items: center;
    position: relative;
}

/* ── INPUT ── */
#buscador-yaykuna #input-buscar {
    width: 100%;
    height: 42px;
    padding: 0 50px 0 16px;
    border: 1.5px solid #e2d9f3;
    border-radius: 22px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    background: #f8f5ff;
    color: #1a1a2e;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
#buscador-yaykuna #input-buscar::placeholder { color: #b8aed4; }
#buscador-yaykuna #input-buscar:focus {
    border-color: #7b2be0;
    box-shadow: 0 0 0 3px rgba(123,43,224,0.10);
    background: #fff;
}

/* ── BOTÓN LUPA ── */
#buscador-yaykuna #boton-buscar {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #7b2be0, #5a1fa8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
}
#buscador-yaykuna #boton-buscar .texto-boton { display: none; }
#buscador-yaykuna #boton-buscar svg {
    display: block;
    width: 14px;
    height: 14px;
}
#buscador-yaykuna #boton-buscar svg path {
    stroke: #fff;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#buscador-yaykuna #boton-buscar:hover {
    box-shadow: 0 3px 12px rgba(123,43,224,0.45);
    transform: translateY(-50%) scale(1.08);
}
#buscador-yaykuna #boton-buscar:active {
    transform: translateY(-50%) scale(0.95);
}

/* ── DROPDOWN RESULTADOS ── */
#buscador-yaykuna #resultados-busqueda:empty { display: none; }
#buscador-yaykuna #resultados-busqueda {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ede8f8;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(123,43,224,0.13), 0 2px 8px rgba(0,0,0,0.05);
    z-index: 9500;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 420px;
    scrollbar-width: thin;
    scrollbar-color: #7b2be0 #ede8f8;
}
#buscador-yaykuna #resultados-busqueda::-webkit-scrollbar { width: 6px; }
#buscador-yaykuna #resultados-busqueda::-webkit-scrollbar-track { background: #ede8f8; }
#buscador-yaykuna #resultados-busqueda::-webkit-scrollbar-thumb {
    background: #7b2be0;
    border-radius: 999px;
    min-height: 24px;
}

/* ── CADA RESULTADO ── */
#buscador-yaykuna .tarjeta-resultado {
    border-bottom: 1px solid #f5f2fd;
}
#buscador-yaykuna .tarjeta-resultado:last-child { border-bottom: none; }

#buscador-yaykuna .tarjeta-link {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: #fff;
    text-decoration: none;
    transition: background 0.13s;
}
#buscador-yaykuna .tarjeta-link:hover { background: #faf7ff; }
#buscador-yaykuna .tarjeta-resultado.activo .tarjeta-link { background: #f3ecfd; }

/* Imagen */
#buscador-yaykuna .tarjeta-img img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    background: #f0e8fd;
}

/* Texto */
#buscador-yaykuna .tarjeta-info { min-width: 0; }
#buscador-yaykuna .titulo-resultado {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#buscador-yaykuna .sub-resultado {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
#buscador-yaykuna .res-icon {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
    color: #b8aed4;
    stroke: #b8aed4;
}

/* Lado derecho */
#buscador-yaykuna .tarjeta-lado {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

/* Badges */
#buscador-yaykuna .badge-estado,
.badge-estado {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
#buscador-yaykuna .badge-estado.proximo,
.badge-estado.proximo   { background: #ede8f8; color: #7b2be0; }
#buscador-yaykuna .badge-estado.pasado,
.badge-estado.pasado    { background: #f2f2f2; color: #aaa; }
.badge-estado.hoy       { background: #dcfce7; color: #16a34a; }
.badge-estado.próximo   { background: #ede8f8; color: #7b2be0; }
.badge-estado.finalizado { background: #f2f2f2; color: #aaa; }

/* Flecha derecha */
#buscador-yaykuna .res-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #c4b5fd;
    stroke: #c4b5fd;
    transition: stroke .13s;
}
#buscador-yaykuna .tarjeta-link:hover .res-arrow {
    stroke: #7b2be0;
}

/* Sin resultados */
#buscador-yaykuna .sin-resultados,
.sin-resultados {
    padding: 28px 16px;
    text-align: center;
    font-size: 14px;
    color: #aaa;
    font-weight: 500;
}

/* Highlight */
mark {
    display: inline;
    padding: 0;
    margin: 0;
    line-height: inherit;
    font-size: inherit;
    background: rgba(255,204,0,0.35);
    color: #5a1fa8;
    border-radius: 3px;
    font-weight: inherit;
    font-style: normal;
}

/* ── MÓVIL ── */
@media (max-width: 767px) {
    #buscador-yaykuna #input-buscar {
        height: 44px;
        font-size: 15px;
    }
    #buscador-yaykuna #resultados-busqueda {
        max-height: 210px !important;
        border-radius: 14px;
        overflow-y: scroll !important;
    }
    /* Fade blanco al fondo cuando hay más resultados (estilo Teleticket) */
    #buscador-yaykuna #resultados-busqueda.tiene-mas {
        box-shadow:
            0 12px 40px rgba(123,43,224,0.13),
            0 2px 8px rgba(0,0,0,0.05),
            inset 0 -44px 20px -6px rgba(255,255,255,0.94) !important;
    }
    #buscador-yaykuna .tarjeta-link {
        grid-template-columns: 44px 1fr auto;
        padding: 9px 12px;
        gap: 10px;
    }
    #buscador-yaykuna .tarjeta-img img {
        width: 44px;
        height: 44px;
        border-radius: 9px;
    }
    #buscador-yaykuna .titulo-resultado { font-size: 13px; margin-bottom: 2px; }
    #buscador-yaykuna .sub-resultado    { font-size: 11px; }
    #buscador-yaykuna .res-icon         { width: 10px; height: 10px; }
    #buscador-yaykuna .res-arrow        { width: 13px; height: 13px; }
    #buscador-yaykuna .tarjeta-lado .badge-estado { display: none; }
}
